/* ==========================================================
   All Keyboards – global home page (site root)
   Idea: one keyboard, every script. The hero is a real QWERTY board whose legends change
   script in a wave; the rest of the page stays quiet so that keyboard is the memorable thing.
   Header, footer and FAQ items come from style.css.
   ========================================================== */
.gh {
  /* palette */
  --ink: #0e2a31;
  --lagoon: #135e6e;
  --sky: #3fa7bf;
  --paper: #f3f7f8;
  --marigold: #f2b33d;
  --line: #d3e1e4;
  --muted: #4f6469;               /* 5.9:1 on paper */
  --key: #ffffff;
  --key-edge: #b8cfd4;

  /* one professional family for headings and text: IBM Plex Sans */
  --display: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --text: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(.2, .8, .2, 1);

  font-family: var(--text);
  color: var(--ink);
  background: var(--paper);
}
.gh a { color: var(--lagoon); }
.gh h2, .gh h3 { color: var(--ink); }
.gh :focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; }

/* ---------- Hero ---------- */
.gh-hero { padding: 48px 0 64px; }
.gh-hero-copy { max-width: 640px; }
.gh-title {
  margin: 0 0 18px;
  font-family: var(--display);
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.06;
  color: var(--ink);
}
.gh-lead {
  max-width: 58ch;
  margin: 0 0 28px;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--muted);
}

/* search */
.gh-search { position: relative; max-width: 560px; }
.gh-search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  height: 60px;
  padding: 0 12px 0 20px;
  border-radius: 14px;
  background: var(--key);
  border: 1.5px solid var(--key-edge);
  border-bottom-width: 2px;
  cursor: text;
  transition: border-color .15s;
}
.gh-search-box:focus-within { border-color: var(--lagoon); }
.gh-search-box > i { color: var(--lagoon); }
.gh-search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 500 1.05rem var(--text); color: var(--ink); }
.gh-search-box input::placeholder { color: #7b8e93; }
.gh-search .gh-search-box input:focus-visible { outline: none; }
.gh-search-kbd {
  padding: 2px 9px;
  border-radius: 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  background: var(--paper);
  color: var(--muted);
  font: 600 .8rem var(--text);
  box-shadow: none;
}
.gh-suggest {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 14px;
  background: var(--key);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(14, 42, 49, .14);
  max-height: 340px;
  overflow-y: auto;
}
.gh-suggest a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.gh-suggest li[aria-selected="true"] a, .gh-suggest a:hover { background: var(--paper); }
.gh-suggest .gh-glyph { width: 34px; height: 34px; font-size: 1.05rem; }
.gh-suggest-name { font-weight: 700; }
.gh-suggest-native { color: var(--muted); }
.gh-suggest-native[dir="rtl"] { text-align: left; }
.gh-suggest-go { margin-left: auto; font-size: .8rem; color: var(--muted); }
.gh-suggest-empty { padding: 12px 14px; color: var(--muted); }

/* quick links under the search */
.gh-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 18px; }
.gh-popular { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0; font-size: .92rem; }
.gh-popular span { color: var(--muted); }
.gh-popular a { font-weight: 700; text-decoration: none; border-bottom: 2px solid transparent; }
.gh-popular a:hover { border-bottom-color: var(--marigold); }
.gh-continue {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--lagoon);
  color: #fff !important;
  font-weight: 700;
  font-size: .9rem;
  text-decoration: none;
}
.gh-continue:hover { background: var(--ink); }
.gh-continue [lang] { font-weight: 500; opacity: .85; }
.gh-continue--suggest { background: var(--key); color: var(--lagoon) !important; border: 1px solid var(--key-edge); }
.gh-continue--suggest:hover { background: var(--paper); }
.gh-install { margin-top: 18px; padding: 8px 14px; border-radius: 10px; border: 1px dashed var(--key-edge); background: transparent; color: var(--lagoon); font: 700 .88rem var(--text); cursor: pointer; }
.gh-install[hidden] { display: none; }

/* ---------- The keyboard ---------- */
.gh-kb {
  --gap: clamp(4px, .8vw, 9px);
  --unit: calc((100% - 9 * var(--gap)) / 10);  /* one key = a tenth of the top row */
  max-width: 980px;
  margin: 40px 0 0;
  padding: clamp(10px, 1.6vw, 18px);
  border-radius: clamp(14px, 2vw, 26px);
  background: var(--lagoon);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .14);
}
.gh-kb-rows { display: grid; gap: var(--gap); }
.gh-kb-row { display: flex; gap: var(--gap); }
.gh-kb-row--1 { padding-left: calc(var(--unit) * .35); padding-right: calc(var(--unit) * .65); }
.gh-kb-row--2 { padding-left: calc(var(--unit) * .85); padding-right: calc(var(--unit) * 2.15 + var(--gap) * 2); }
.gh-kc {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 1 / .74;
  display: grid;
  place-items: center;
  border-radius: clamp(6px, 1vw, 12px);
  background: var(--key);
  border-bottom: clamp(2px, .35vw, 4px) solid var(--key-edge);
  color: var(--ink);
  transform: translateY(0);
  transition: transform .12s var(--ease-out), border-bottom-width .12s var(--ease-out), background-color .2s;
}
.gh-kc-legend {
  font-family: var(--legend-font, var(--display));
  font-size: clamp(.95rem, 2.3vw, 1.75rem);
  font-weight: 600;
  line-height: 1;
}
/* the English letter of the key, small in the corner – which key types which letter */
.gh-kc-latin {
  position: absolute;
  top: clamp(3px, .5vw, 7px);
  left: clamp(5px, .7vw, 9px);
  font: 700 clamp(.5rem, .9vw, .72rem) var(--text);
  color: #7b8e93;
}
.gh-kb[data-script="english"] .gh-kc-latin { visibility: hidden; }

/* a key being pressed – by the wave or by typing in the search box */
.gh-kc.is-down { transform: translateY(3px); border-bottom-width: 1px; }
.gh-kc.is-hit { background: #fff3d6; border-bottom-color: var(--marigold); }

.gh-kc--space {
  margin-top: var(--gap);
  margin-inline: auto;
  width: calc(var(--unit) * 6 + var(--gap) * 5);
  aspect-ratio: auto;
  padding: clamp(8px, 1.2vw, 14px) 12px;
  grid-auto-flow: row;
  gap: 2px;
  text-decoration: none;
  text-align: center;
}
.gh-kc--space:hover { background: #fff3d6; border-bottom-color: var(--marigold); }
.gh-space-native { font-size: clamp(1.05rem, 2.2vw, 1.5rem); font-weight: 700; line-height: 1.25; color: var(--ink); }
.gh-space-name { font-size: clamp(.72rem, 1.2vw, .85rem); font-weight: 600; color: var(--lagoon); }
.gh-kb-caption { margin: 14px 2px 0; font-size: .9rem; color: #d9eef3; text-align: center; }

/* legend change: the key dips while its letter swaps (transform + opacity only) */
@keyframes gh-swap {
  0%   { transform: translateY(0); }
  45%  { transform: translateY(3px); }
  100% { transform: translateY(0); }
}
@keyframes gh-legend {
  0%   { opacity: 1; transform: scale(1); }
  45%  { opacity: 0; transform: scale(.7); }
  55%  { opacity: 0; transform: scale(.7); }
  100% { opacity: 1; transform: scale(1); }
}
.gh-kc.is-swap { animation: gh-swap .42s var(--ease-out); }
.gh-kc.is-swap .gh-kc-legend { animation: gh-legend .42s var(--ease-out); }

/* ---------- Sections ---------- */
.gh-section { padding: 80px 0; border-top: 1px solid var(--line); }
.gh-section h2 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(1.6rem, 2.8vw, 2.15rem);
  font-weight: 600;
  letter-spacing: -.018em;
  line-height: 1.15;
}
.gh-section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 22px; }
.gh-section-head h2 { margin: 0; }

/* two columns: heading on the left, content on the right */
.gh-split { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 40px; align-items: start; }
.gh-split-head p { margin: 0; color: var(--muted); line-height: 1.6; max-width: 34ch; }

/* ---------- Language index ---------- */
.gh-index { background: var(--key); }
.gh-filter { position: relative; margin: 0; flex: 0 1 300px; }
.gh-filter i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; }
.gh-filter input { width: 100%; padding: 11px 14px 11px 38px; border: 1px solid var(--line); border-radius: 10px; font: 500 .95rem var(--text); background: var(--paper); color: var(--ink); }
.gh-filter input:focus { outline: none; border-color: var(--lagoon); background: var(--key); }

/* region switches drawn as small keycaps */
.gh-tabs { display: flex; gap: 8px; margin-bottom: 34px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.gh-tabs::-webkit-scrollbar { display: none; }
.gh-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  background: var(--key);
  color: var(--ink);
  font: 500 .9rem var(--text);
  cursor: pointer;
  transition: transform .1s, border-bottom-width .1s;
}
.gh-tab span { color: var(--muted); font-weight: 500; }
.gh-tab:hover { border-color: var(--key-edge); }
.gh-tab:active { transform: translateY(2px); border-bottom-width: 1px; }
.gh-tab.is-active { background: var(--lagoon); border-color: var(--lagoon); border-bottom-color: var(--ink); color: #fff; }
.gh-tab.is-active span { color: #cfe8ee; }

.gh-region + .gh-region { margin-top: 40px; }
.gh-region[hidden] { display: none; }
.gh-region-title { margin: 0 0 6px; font-size: 1rem; font-weight: 700; color: var(--muted) !important; }
.gh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  column-gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gh-grid li { border-bottom: 1px solid var(--line); }
.gh-grid li[hidden] { display: none; }
.gh-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 8px;
  margin: 0 -8px;
  border-radius: 10px;
  color: var(--ink) !important;
  text-decoration: none;
  transition: background-color .15s;
}
.gh-card:hover { background: var(--paper); }
.gh-card:hover .gh-glyph, .gh-card:focus-visible .gh-glyph { border-bottom-color: var(--marigold); }
.gh-glyph {
  display: grid;
  place-items: center;
  width: 42px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  border-bottom: 2px solid var(--key-edge);
  background: var(--key);
  color: var(--lagoon);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
}
.gh-card-body { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; min-width: 0; }
.gh-name { font-weight: 600; font-size: 1rem; }
.gh-native { font-size: 1.05rem; color: var(--muted); }
.gh-native[dir="rtl"] { text-align: left; }
.gh-script { font-size: .8rem; color: #7b8e93; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.gh-empty { padding: 32px 0; color: var(--muted); }
.gh-empty p { margin: 4px 0; }

/* ---------- Features ---------- */
.gh-features { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; margin: 0; }
.gh-feature { padding: 18px 0; border-top: 1px solid var(--line); }
.gh-feature dt { margin-bottom: 6px; font-size: 1.05rem; font-weight: 600; }
.gh-feature dt i { width: 22px; color: var(--lagoon); }
.gh-feature dd { margin: 0; color: var(--muted); line-height: 1.6; }

/* ---------- Steps ---------- */
.gh-steps-wrap { background: var(--lagoon); color: #fff; border-top: 0; }
.gh-steps-wrap h2 { color: #fff; max-width: 22ch; }
.gh-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin: 36px 0 0; padding: 0; list-style: none; counter-reset: gh-step; }
.gh-steps li { counter-increment: gh-step; }
.gh-steps li::before {
  content: counter(gh-step);
  display: block;
  margin-bottom: 10px;
  font-family: var(--display);
  font-size: 2.6rem;
  font-weight: 600;
  line-height: 1;
  color: var(--marigold);
}
.gh-steps h3 { margin: 0 0 6px; font-size: 1.15rem; font-weight: 600; color: #fff !important; }
.gh-steps p { margin: 0; color: #d5ebf0; line-height: 1.6; }

/* ---------- Tools + guides ---------- */
.gh-more-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.gh-tools { margin: 0; padding: 0; list-style: none; }
.gh-tools li + li { border-top: 1px solid var(--line); }
.gh-tools a { display: flex; gap: 16px; align-items: center; padding: 16px 0; text-decoration: none; color: var(--ink) !important; }
.gh-tools a:hover strong { color: var(--lagoon); text-decoration: underline; text-decoration-color: var(--marigold); text-underline-offset: 4px; }
.gh-tools strong { display: block; font-size: 1.02rem; }
.gh-tools span:last-child { color: var(--muted); font-size: .93rem; line-height: 1.5; }
.gh-tool-mark {
  flex: 0 0 64px;
  display: grid;
  place-items: center;
  height: 52px;
  border-radius: 10px;
  border: 1px solid var(--line);
  border-bottom: 2px solid var(--key-edge);
  background: var(--key);
  color: var(--lagoon);
  font: 600 1.05rem system-ui, "Segoe UI Symbol", sans-serif;
}
.gh-guides-title { margin: 0 0 8px; font-size: 1rem; font-weight: 700; color: var(--muted) !important; }
.gh-guides { margin: 0 0 14px; padding: 0; list-style: none; }
.gh-guides li { border-top: 1px solid var(--line); }
.gh-guides a { display: block; padding: 12px 0; font-weight: 600; text-decoration: none; color: var(--ink) !important; line-height: 1.45; }
.gh-guides a:hover { color: var(--lagoon) !important; }
.gh-guides-more { font-weight: 700; }

/* ---------- About + FAQ ---------- */
.gh-about-wrap, .gh-faq-wrap { background: var(--key); }
.gh-faq-wrap { border-top: 1px solid var(--line); }
.gh-about p { max-width: 68ch; margin: 0 0 14px; font-size: 1.05rem; line-height: 1.75; color: #2c4248; }
.gh-faq .faq-item { border-color: var(--line); }
.gh-faq .faq-item summary { color: var(--ink); }
.gh-faq .faq-item p { color: #2c4248; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .gh-split { grid-template-columns: 1fr; gap: 20px; }
  .gh-split-head p { max-width: 60ch; }
  .gh-more-cols { grid-template-columns: 1fr; }
}
@media (max-width: 767.98px) {
  .gh-hero { padding: 36px 0 48px; }
  .gh-section { padding: 56px 0; }
  .gh-features { grid-template-columns: 1fr; }
  .gh-steps { grid-template-columns: 1fr; gap: 24px; }
  .gh-filter { flex-basis: 100%; }
  .gh-kc-latin { display: none; }
}
@media (max-width: 575.98px) {
  .gh-search-box { height: 54px; padding: 0 10px 0 16px; }
  .gh-search-kbd { display: none; }
  .gh-script { display: none; }
  .gh-kb { --gap: 3px; margin-top: 32px; }
  .gh-kc:not(.gh-kc--space) { aspect-ratio: 1 / 1.3; border-radius: 6px; }
  .gh-kc-legend { font-size: 1.05rem; }
  .gh-kb-row--1 { padding-left: calc(var(--unit) * .5); padding-right: calc(var(--unit) * .5); }
  .gh-kb-row--2 { padding-left: calc(var(--unit) * 1.5); padding-right: calc(var(--unit) * 1.5); }
}

/* motion only where it helps: no wave, no key dips */
@media (prefers-reduced-motion: reduce) {
  .gh-kc, .gh-tab { transition: none; }
  .gh-kc.is-swap, .gh-kc.is-swap .gh-kc-legend { animation: none; }
}

/* ---------- Footer: full width on the home page only (other pages keep the boxed footer) ---------- */
.page-global .site-footer {
  max-width: none;
  margin-top: 0;
  /* the background spans the window; the content stays in line with the 1100px page column */
  padding-inline: max(26px, calc((100% - 1100px) / 2 + 26px));
}
