/* özbekça.uz — the companion app's world (DESIGN.md "The Keyboard Is the Lesson") on the web. Light only. */

:root {
  color-scheme: light;
  --canvas: #F2F3F6;
  --card: #FFFFFF;
  --text: #1D1D1F;
  --secondary: #636368;
  --tertiary: #8A8A90;
  --accent: #0070B0;
  --accent-soft: rgba(0, 112, 176, 0.12);
  --icon-blue: #0A84C6;
  --key-a: #0676B4;
  --key-b: #12823C;
  --btn-a: #0470AC;
  --btn-b: #127A3A;
  --quiet-fill: rgba(118, 118, 128, 0.12);
  --hairline: rgba(60, 60, 67, 0.12);
  --tray: #DFDFE5;
  --key: #FFFFFF;
  --key-pressed: #CCCFD6;
  --done-text: #0E703E;
  --done-fill: #E7F7EC;
  --badge: #000000;

  --r-card: 26px;
  --r-control: 18px;
  --r-field: 14px;
  --r-key: 8px;

  --shadow-card: 0 1px 1px rgba(0, 0, 0, 0.04), 0 18px 40px -28px rgba(20, 30, 50, 0.22);
  --shadow-key: 0 1px 0 rgba(0, 0, 0, 0.28);
  --glow-key: 0 5px 8px rgba(10, 132, 198, 0.45);
  --glow-btn: 0 8px 24px -6px rgba(10, 132, 198, 0.5);

  --rounded: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif;
  --text-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  /* typed text: SF Pro Rounded where the browser has it, else the system face (Nunito lacks ʻ and ʼ) */
  --field-font: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --key-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-soft: cubic-bezier(0.25, 0.1, 0.25, 1);

  --gutter: 32px;
  --max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font: 400 17px/1.5 var(--text-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1.5px; }
button { font: inherit; color: inherit; }
::selection { background: rgba(0, 112, 176, 0.2); }
:focus-visible { outline: 3px solid rgba(0, 112, 176, 0.45); outline-offset: 3px; border-radius: 10px; }
textarea { caret-color: var(--accent); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
kbd {
  font: 600 0.82em/1 var(--text-font);
  background: var(--card); border-radius: 6px; padding: 0.22em 0.5em;
  box-shadow: var(--shadow-key), 0 0 0 1px var(--hairline);
  color: var(--text); white-space: nowrap;
}

.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- type ---------- */
.display, .headline, .title { font-family: var(--rounded); font-weight: 800; margin: 0; text-wrap: balance; }
.display { font-size: clamp(40px, 4.4vw, 62px); line-height: 1.03; letter-spacing: -0.025em; }
.display span { display: block; color: var(--tertiary); }
.headline { font-size: clamp(32px, 3.6vw, 46px); line-height: 1.06; letter-spacing: -0.022em; }
.title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.lead { font-size: clamp(18px, 1.5vw, 20px); line-height: 1.5; color: var(--secondary); margin: 0; max-width: 34em; text-wrap: pretty; }
.caption { color: var(--secondary); font-size: 15px; margin: 4px 0 0; }
.fine { color: var(--secondary); font-size: 14px; margin: 14px 0 0; }

/* ---------- buttons ---------- */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 28px; border-radius: var(--r-control);
  background: linear-gradient(90deg, var(--btn-a), var(--btn-b));
  color: #fff; font: 600 18px/1.2 var(--text-font); text-decoration: none;
  box-shadow: var(--glow-btn);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), filter 0.2s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 28px -8px rgba(10, 132, 198, 0.55); filter: saturate(1.08); }
.btn-primary:active { transform: scale(0.97); opacity: 0.9; }
.btn-quiet {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px;
  color: var(--accent); font: 600 17px/1.2 var(--text-font); text-decoration: none;
  background: none; border: 0; cursor: pointer;
}
.btn-quiet:hover { text-decoration: underline; }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; padding: 6px 2px; cursor: pointer;
  color: var(--accent); font: 600 15px/1 var(--text-font);
  border-radius: 8px;
}
.link-btn:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 0.25em; }
.link-btn:disabled { color: var(--tertiary); cursor: default; }
.link-btn.done { color: var(--done-text); }
.btn-disabled {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 0 22px; border-radius: var(--r-control);
  background: var(--quiet-fill); color: var(--secondary);
  font: 600 17px/1.2 var(--text-font); cursor: not-allowed;
}
.btn-disabled em {
  white-space: nowrap;
  font: 700 12px/1 var(--text-font); font-style: normal; letter-spacing: 0.01em;
  background: var(--card); color: var(--secondary); padding: 6px 9px; border-radius: 999px;
}

.card { background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow-card); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  transition: background-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), backdrop-filter 0.3s;
}
.nav.scrolled {
  background: rgba(242, 243, 246, 0.78);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  box-shadow: 0 1px 0 var(--hairline);
}
.nav-row { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 800 20px/1 var(--rounded); letter-spacing: -0.01em; }
.brand img { border-radius: 22.37%; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.nav-links { margin-left: auto; display: flex; gap: 6px; }
.nav-links a { color: var(--secondary); text-decoration: none; font-size: 16px; padding: 8px 12px; border-radius: 10px; transition: color 0.2s, background-color 0.2s; }
.nav-links a:hover { color: var(--text); background: var(--quiet-fill); }
.store-pill {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 12px;
  background: var(--text); color: #fff; text-decoration: none; font: 600 15px/1 var(--text-font);
  transition: transform 0.25s var(--ease-out), background-color 0.2s;
}
.store-pill:hover { background: #000; transform: translateY(-1px); }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 470px) minmax(0, 1fr); gap: 52px;
  align-items: start; padding-top: 40px; padding-bottom: 32px;
}
.hero-copy { padding-top: 40px; }
.hero-copy .lead { margin-top: 22px; }
.cta { margin-top: 32px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.in-force { margin: 34px 0 0; color: var(--secondary); font-size: 15px; }
.in-force a { font-weight: 600; text-decoration: none; }
.in-force a:hover { text-decoration: underline; }

.conv { padding: 22px; display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); }
.pane { display: flex; flex-direction: column; min-width: 0; }
.pane-head { display: flex; align-items: center; justify-content: space-between; min-height: 32px; margin-bottom: 10px; padding: 0 4px; font: 600 15px/1 var(--text-font); color: var(--secondary); }
.pane-head label, .pane-head > span { color: var(--secondary); }
.box {
  height: 252px; margin: 0; border-radius: var(--r-control); padding: 18px 20px;
  font: 500 22px/1.5 var(--field-font); letter-spacing: -0.005em; color: var(--text);
  overflow: auto; overscroll-behavior: contain; white-space: pre-wrap; overflow-wrap: anywhere;
  scrollbar-width: thin; scrollbar-color: rgba(60, 60, 67, 0.25) transparent;
}
.box-in { width: 100%; resize: none; border: 0; background: var(--quiet-fill); outline: none; transition: box-shadow 0.2s; }
.box-in:focus { box-shadow: inset 0 0 0 2px rgba(0, 112, 176, 0.35); }
.box-in::placeholder { color: var(--tertiary); }
.box-out { background: var(--card); box-shadow: inset 0 0 0 2px var(--icon-blue); }
.box-out:focus-visible { outline-offset: 2px; }
.box-out .nw { color: var(--accent); font-weight: 700; }
.box-out .pre { color: var(--text); font-weight: 500; }
.box-out .empty { color: var(--secondary); }
.box-out .empty button { color: var(--accent); background: none; border: 0; padding: 0; font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; }
.pane-arrow { display: grid; place-items: center; padding-top: 42px; color: var(--tertiary); }
.pane-arrow .ic { width: 24px; height: 24px; }
.conv-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; margin-top: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li { background: var(--quiet-fill); border-radius: 999px; padding: 7px 13px; font: 600 15px/1.1 var(--text-font); color: #3A3A3C; white-space: nowrap; }
.chips b { color: var(--accent); }
.conv-count { margin: 0; color: var(--secondary); font: 600 15px/1.2 var(--text-font); font-variant-numeric: tabular-nums; }
.conv-count b { color: var(--text); }
.conv-note { margin: 14px 6px 0; color: var(--secondary); font-size: 14px; line-height: 1.45; }

.peek {
  position: relative; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 0 18px;
  margin-top: 20px; padding: 18px 22px 0; height: 196px; overflow: hidden;
  color: var(--text); text-decoration: none;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}
.peek:hover { transform: translateY(-2px); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04), 0 24px 48px -28px rgba(20, 30, 50, 0.3); }
.peek-title { font: 700 20px/1.2 var(--rounded); letter-spacing: -0.01em; }
.peek-formula { display: inline-flex; align-items: center; gap: 8px; color: var(--tertiary); font: 600 17px/1 var(--text-font); }
.cap {
  display: inline-grid; place-items: center; min-width: 34px; height: 36px; padding: 0 9px; border-radius: 8px;
  background: var(--card); color: var(--text); box-shadow: var(--shadow-key), 0 0 0 1px var(--hairline);
  font: 500 19px/1 var(--key-font);
}
.cap-out { color: var(--accent); font: 800 21px/1 var(--rounded); box-shadow: none; background: var(--accent-soft); }
.peek-go { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--quiet-fill); color: var(--accent); transition: transform 0.35s var(--ease-out); }
.peek:hover .peek-go { transform: translateY(3px); }
.peek-board {
  grid-column: 1 / -1; align-self: start; margin-top: 14px;
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%); mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
  background: var(--tray); border-radius: 16px 16px 0 0; padding: 9px 6px 14px;
  display: flex; flex-direction: column; gap: 9px;
}
.peek-row { display: flex; gap: 6px; justify-content: center; }
.peek-row.r2 { padding: 0 5%; }
.peek-row i {
  flex: 1; max-width: 58px; height: 52px; border-radius: 7px; background: var(--key); box-shadow: var(--shadow-key);
  display: grid; place-items: center; font: 400 23px/1 var(--key-font); font-style: normal; position: relative;
}
.peek-row i.t { background: linear-gradient(90deg, var(--key-a), var(--key-b)); color: #fff; box-shadow: var(--glow-key); }
/* s, then h: one key lights at a time, like a finger pressing them in turn (static with Reduce Motion) */
@media (prefers-reduced-motion: no-preference) {
  .peek-row i.t { background: var(--key); color: var(--text); box-shadow: var(--shadow-key); isolation: isolate; }
  .peek-row i.t::before {
    content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; opacity: 0;
    background: linear-gradient(90deg, var(--key-a), var(--key-b)); box-shadow: var(--glow-key);
  }
  .peek-row i.k1, .peek-row i.k1::before { animation: peek-s 3.6s var(--ease-out) infinite; }
  .peek-row i.k2, .peek-row i.k2::before { animation: peek-h 3.6s var(--ease-out) infinite; }
  .peek-row i.t::before { animation-name: peek-s-glow; }
  .peek-row i.k2::before { animation-name: peek-h-glow; }
}
@keyframes peek-s { 0%, 8% { color: var(--text); } 12%, 36% { color: #fff; } 42%, 100% { color: var(--text); } }
@keyframes peek-s-glow { 0%, 8% { opacity: 0; } 12%, 36% { opacity: 1; } 42%, 100% { opacity: 0; } }
@keyframes peek-h { 0%, 50% { color: var(--text); } 54%, 78% { color: #fff; } 84%, 100% { color: var(--text); } }
@keyframes peek-h-glow { 0%, 50% { opacity: 0; } 54%, 78% { opacity: 1; } 84%, 100% { opacity: 0; } }
.peek-row s, .key .badge {
  position: absolute; top: -9px; right: -7px; text-decoration: none;
  background: var(--badge); color: #fff; border-radius: 999px; padding: 3px 7px;
  font: 700 11px/1 var(--text-font); letter-spacing: 0.02em;
}

/* ---------- sections ---------- */
.section { padding-top: 128px; }
.section-head { max-width: 760px; margin-bottom: 36px; }
.section-head .lead { margin-top: 16px; }

/* ---------- try ---------- */
.try { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.try-card { padding: 18px; outline: none; transition: box-shadow 0.3s var(--ease-out); }
.try-card:focus-visible { box-shadow: var(--shadow-card), 0 0 0 3px rgba(0, 112, 176, 0.4); }
.try-card.live .field { box-shadow: inset 0 0 0 2px rgba(0, 112, 176, 0.3); }
.try-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--quiet-fill); }
.seg button {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 16px;
  border: 0; border-radius: 9px; background: transparent; cursor: pointer;
  font: 600 15px/1 var(--text-font); color: var(--secondary);
  transition: background-color 0.25s var(--ease-out), color 0.2s, box-shadow 0.25s;
}
.seg button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04); }
.field {
  min-height: 112px; max-height: 168px; overflow: auto; border-radius: var(--r-field);
  background: var(--quiet-fill); padding: 14px 18px;
  font: 500 28px/1.4 var(--field-font); letter-spacing: -0.005em;
  white-space: pre-wrap; overflow-wrap: anywhere; transition: box-shadow 0.25s var(--ease-out), opacity 0.4s var(--ease-soft);
}
/* every letter is its own span, so a new one fades in without moving the others */
.field .hl { color: var(--accent); }
.field .ch.in { animation: ch-in 0.42s var(--ease-soft) both; }
.field .ch.tint { animation: tint 0.8s var(--ease-soft) both; }
.field .ch.in.tint { animation: ch-in 0.42s var(--ease-soft) both, tint 0.8s var(--ease-soft) both; }
@keyframes ch-in { from { opacity: 0; } }
@keyframes tint { from { color: var(--text); } }
.field.fading { opacity: 0; }

/* the demo's formula: [s] + [h] = ş, and a word below; every part fades into its own place */
.field-wrap { position: relative; }
.stage {
  position: absolute; inset: 0; padding: 14px 20px; pointer-events: none;
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
  transition: opacity 0.5s var(--ease-soft);
}
.stage.out { opacity: 0; }
.try-card.demo .field > * { visibility: hidden; }  /* the caret too: its blink would override an opacity */
.formula-line { display: flex; align-items: center; gap: 12px; }
.stage .cap, .stage .plus, .stage .eq, .stage .result span, .stage .word {
  opacity: 0; transform: translateY(6px); transition: opacity 0.55s var(--ease-soft), transform 0.55s var(--ease-soft);
}
.stage .on, .stage .result span.on { opacity: 1; transform: none; }
.stage .cap {
  display: inline-grid; place-items: center; min-width: 48px; height: 48px; padding: 0 12px; border-radius: 11px;
  background: var(--card); box-shadow: var(--shadow-key), 0 0 0 1px var(--hairline);
  font: 400 24px/1 var(--key-font); color: var(--text);
}
.stage .cap.word { font-size: 15px; font-weight: 600; }
.stage .plus, .stage .eq { color: var(--tertiary); font: 400 22px/1 var(--text-font); }
.stage .result { display: inline-grid; min-width: 1.4em; }
.stage .result span { grid-area: 1 / 1; font: 800 40px/1 var(--rounded); color: var(--accent); }
.stage .result span:not(.on) { transform: scale(0.92); }
.stage .word { font: 500 26px/1.2 var(--field-font); color: var(--secondary); }
.stage .word b { color: var(--accent); font-weight: 600; }
.field .pend { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.16em; text-decoration-color: var(--accent); }
.field .ph { color: var(--tertiary); }
.caret { display: inline-block; width: 2.5px; height: 1.1em; margin: 0 1px -0.18em; border-radius: 2px; background: var(--accent); animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 0%, 38% { opacity: 1; } 55%, 85% { opacity: 0.1; } 100% { opacity: 1; } }
.hint { min-height: 1.5em; margin: 12px 4px 14px; color: var(--secondary); font-size: 16px; }
.hint b { color: var(--text); }
.hint .k { display: inline-grid; place-items: center; min-width: 1.6em; padding: 0 0.35em; height: 1.55em; border-radius: 6px; background: var(--card); box-shadow: var(--shadow-key), 0 0 0 1px var(--hairline); color: var(--text); font-weight: 600; margin: 0 1px; }
.hint .nl { color: var(--accent); font: 800 1.1em/1 var(--rounded); }

.board { position: relative; background: var(--tray); border-radius: var(--r-control); touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.key {
  position: absolute; display: grid; place-items: center;
  background: var(--key); color: var(--text); border-radius: var(--r-key); box-shadow: var(--shadow-key);
  font-family: var(--key-font); font-weight: 400; cursor: pointer; isolation: isolate;
  transition: transform 0.45s var(--ease-soft), background-color 0.35s var(--ease-soft), box-shadow 0.5s var(--ease-soft), color 0.4s var(--ease-soft), opacity 0.6s var(--ease-soft);
  -webkit-tap-highlight-color: transparent;
}
/* the new letter's gradient lives on a layer, so it fades in and out instead of switching */
.key::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: linear-gradient(90deg, var(--key-a), var(--key-b)); opacity: 0; transition: opacity 0.5s var(--ease-soft);
}
.key .ic { width: 46%; height: 46%; max-width: 30px; max-height: 30px; stroke-width: 1.6; }
.key.fill .ic { fill: currentColor; }
.key.small { font-size: 0.62em; font-weight: 500; }
.key .lbl { line-height: 1; }
.key .mod { position: absolute; left: 10%; bottom: 14%; font-size: var(--mod-size, 11px); line-height: 1; color: var(--secondary); white-space: nowrap; }
.key .tri { width: 34%; height: 34%; color: var(--secondary); }
.key.latched { background: var(--accent-soft); color: var(--accent); }
.key.latched .mod { color: var(--accent); }
.key .mod.r { left: auto; right: 10%; }
.key .two { display: grid; gap: 2px; text-align: center; line-height: 1; }
.key .two small { font-size: 0.72em; color: var(--secondary); }
.key .space-tag { position: absolute; right: 10px; bottom: 7px; font-size: 11px; color: var(--tertiary); }
.key.down { background: var(--key-pressed); transform: translateY(-2px) scale(1.04); z-index: 2; }
.try-card.spot .key { opacity: 0.3; }
.try-card.spot .key.lit { opacity: 1; }
.key.hit { color: #fff; box-shadow: var(--glow-key); transform: scale(0.96); }
.key.hit::before { opacity: 1; }
.key.hit .two small, .key.hit .mod { color: rgba(255, 255, 255, 0.85); }
.key.next { color: var(--accent); box-shadow: 0 0 0 2px var(--accent), var(--shadow-key); z-index: 1; }
.key.inert { cursor: default; color: var(--tertiary); }

.letters { padding: 22px 18px 14px; }
.letters .title, .letters .caption { padding: 0 6px; }
.letters-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.letters-head .link-btn { font-size: 14px; }
.letters-head .link-btn .ic { width: 16px; height: 16px; }
.formula-list { list-style: none; margin: 14px 0 0; padding: 0; }
.formula-list li + li { border-top: 1px solid var(--hairline); margin-left: 60px; }
.formula-list li + li button { margin-left: -60px; width: calc(100% + 60px); }
.formula {
  display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 12px;
  width: 100%; min-height: 58px; padding: 6px; border: 0; border-radius: 14px; background: none; text-align: left; cursor: pointer;
  transition: background-color 0.45s var(--ease-out);
}
.formula:hover { background: rgba(118, 118, 128, 0.07); }
.formula.playing, .formula.shown { background: var(--accent-soft); }
.formula .glyph { font: 800 28px/1 var(--rounded); color: var(--icon-blue); text-align: center; }
.formula .keys { display: inline-flex; align-items: center; gap: 5px; color: var(--secondary); font-size: 14px; }
.formula .mini { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 7px; border-radius: 7px; background: var(--card); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 0 0 1px var(--hairline); color: var(--text); font: 500 16px/1 var(--key-font); }
.formula .mini.word { font-size: 12px; font-weight: 600; }
.formula .ex { color: var(--secondary); font: 500 16px/1 var(--field-font); }
.formula .glyph.mark, .rules td.mark { font-family: var(--field-font); font-size: 34px; font-weight: 700; }
.key.apos .lbl { font-size: 1.3em; font-weight: 500; }

/* ---------- iPhone ---------- */
.iphone { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 72px; align-items: center; }
.phone { margin: 0; justify-self: center; }
.phone-frame {
  width: 300px; padding: 11px; border-radius: 54px; background: #1D1D1F;
  box-shadow: 0 0 0 1.5px #3A3A3C inset, 0 30px 60px -30px rgba(20, 30, 50, 0.45), 0 12px 24px -16px rgba(20, 30, 50, 0.3);
  position: relative;
}
.phone-frame::before { content: ""; position: absolute; top: 21px; left: 50%; width: 82px; height: 24px; margin-left: -41px; border-radius: 999px; background: #000; z-index: 1; }
.phone-frame img { width: 100%; border-radius: 43px; }
.phone figcaption { margin-top: 14px; text-align: center; color: var(--secondary); font-size: 14px; }
.iphone-copy .lead { margin-top: 16px; }
.timeline { list-style: none; margin: 32px 0 28px; padding: 0; position: relative; max-width: 520px; }
.timeline::before { content: ""; position: absolute; left: 17px; top: 26px; bottom: 26px; width: 2px; background: var(--hairline); border-radius: 2px; }
.timeline li { display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: center; position: relative; }
.timeline li + li { margin-top: 8px; }
.step {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); color: var(--secondary); font: 800 16px/1 var(--rounded);
  box-shadow: 0 0 0 1px var(--hairline);
}
.timeline li.lit .step { background: linear-gradient(90deg, var(--key-a), var(--key-b)); color: #fff; box-shadow: none; }
.timeline .row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; border-radius: var(--r-control); background: var(--card); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); font-size: 16px; }
.timeline li:last-child .row { font-weight: 600; }
.tile { width: 29px; height: 29px; border-radius: 7px; flex: none; display: grid; place-items: center; }
.tile-gray { background: #8E8E93; color: #fff; }
.tile-gray .ic { width: 19px; height: 19px; stroke-width: 1.7; }
.tile-key { background: var(--card); color: var(--text); box-shadow: var(--shadow-key), 0 0 0 1px var(--hairline); }
.tile-key .ic { width: 18px; height: 18px; }
.facts { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 14px; max-width: 520px; }
.facts li { display: grid; grid-template-columns: 24px 1fr; gap: 12px; color: var(--secondary); font-size: 16px; line-height: 1.45; }
.facts .ic { width: 22px; height: 22px; color: var(--accent); margin-top: 1px; }
.facts b { color: var(--text); font-weight: 600; }

/* ---------- Mac ---------- */
.mac { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; padding: 48px; align-items: center; }
.mac-copy .lead { margin-top: 16px; }
.mac-copy .cta { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.mac-steps { list-style: none; margin: 0; padding: 0 0 0 40px; border-left: 1px solid var(--hairline); display: grid; gap: 18px; }
.mac-steps li { display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: center; font-size: 16px; }

/* ---------- rules ---------- */
.rules { padding: 10px 32px 30px; }
.rules table { width: 100%; border-collapse: collapse; }
.rules th { text-align: left; color: var(--secondary); font: 600 14px/1 var(--text-font); padding: 22px 0 14px; }
.rules td { padding: 16px 0; border-top: 1px solid var(--hairline); font: 400 20px/1.3 var(--field-font); vertical-align: middle; }
.rules td.old { font: 600 23px/1 var(--field-font); color: var(--secondary); width: 20%; }
.rules td b.tq { font-size: 1.35em; line-height: 0; }
.rules td.new { font: 800 34px/1 var(--rounded); color: var(--icon-blue); width: 20%; }
.rules td b { color: var(--accent); }
.rules .to { color: var(--tertiary); margin: 0 4px; }
.rules-notes { margin-top: 18px; padding-top: 22px; border-top: 1px solid var(--hairline); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.rules-notes p { margin: 0; color: var(--secondary); font-size: 16px; line-height: 1.5; }
.rules-notes b { color: var(--text); font-weight: 600; }

/* ---------- footer ---------- */
.foot { margin-top: 128px; padding: 40px 0 36px; border-top: 1px solid var(--hairline); }
.foot-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot-brand { display: flex; gap: 14px; align-items: center; color: var(--secondary); font-size: 15px; }
.foot-brand img { border-radius: 22.37%; }
.foot-brand p { margin: 0; }
.foot-name { color: var(--text); font: 800 18px/1.3 var(--rounded); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 15px; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }
/* the same page in the old Latin and in Cyrillic, for readers (and searches) in the old scripts */
.foot-scripts { margin-top: 28px; display: grid; gap: 8px; color: var(--secondary); font-size: 13.5px; line-height: 1.55; }
.foot-scripts p { margin: 0; max-width: 860px; }
.foot-scripts span { color: var(--text); font-weight: 600; }
.foot-legal { margin-top: 18px; color: var(--secondary); font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; gap: 36px; }
  .hero-copy { padding-top: 16px; max-width: 640px; }
  .try { grid-template-columns: 1fr; }
  .iphone { grid-template-columns: 300px minmax(0, 1fr); gap: 48px; }
  .mac { grid-template-columns: 1fr; padding: 36px; }
  .rules-notes { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .store-pill { margin-left: auto; }
  .iphone { grid-template-columns: 1fr; gap: 40px; }
  .phone { order: 2; }
}
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  html { scroll-padding-top: 68px; }
  .nav-row { height: 60px; }
  .hero { padding-top: 12px; gap: 20px; }
  .display { font-size: 34px; }
  .hero-copy .lead .more { display: none; }
  .hero-copy .lead { margin-top: 16px; }
  .cta { margin-top: 18px; width: 100%; gap: 2px; }
  .cta .btn-primary { width: 100%; }
  .in-force { display: none; }
  .conv { grid-template-columns: 1fr; padding: 14px; }
  .pane-arrow { padding: 8px 0; transform: rotate(90deg); }
  .box { height: 116px; font-size: 19px; padding: 12px 14px; }
  .pane-head { margin-bottom: 6px; }
  .conv-foot { margin-top: 12px; }
  .chips li { font-size: 14px; padding: 6px 11px; }
  .peek { padding: 16px 16px 0; height: 178px; grid-template-columns: 1fr auto; }
  .peek-formula { display: none; }
  .peek-row i { height: 44px; font-size: 20px; }
  .section { padding-top: 88px; }
  .section-head { margin-bottom: 24px; }
  .try-card { padding: 12px; border-radius: 22px; }
  .field { font-size: 24px; min-height: 92px; padding: 12px 14px; }
  .stage { padding: 10px 14px; gap: 8px; }
  .formula-line { gap: 8px; }
  .stage .cap { min-width: 40px; height: 40px; font-size: 20px; padding: 0 9px; }
  .stage .plus, .stage .eq { font-size: 18px; }
  .stage .result span { font-size: 32px; }
  .stage .word { font-size: 21px; }
  .hint { font-size: 15px; margin: 10px 2px 12px; }
  .board { border-radius: 14px; }
  .letters { padding: 18px 10px 8px; }
  .mac { padding: 22px; }
  .mac-steps { padding: 22px 0 0; border-left: 0; border-top: 1px solid var(--hairline); }
  .btn-disabled { width: 100%; justify-content: space-between; gap: 8px; padding: 0 14px; font-size: 16px; white-space: nowrap; }
  .btn-disabled em { margin-left: auto; }
  .mac { gap: 24px; }
  .rules { padding: 4px 16px 20px; }
  .rules td.old { font-size: 18px; }
  .rules td.new { font-size: 26px; }
  .rules td { font-size: 16px; }
  .phone-frame { width: 260px; border-radius: 48px; padding: 10px; }
  .phone-frame img { border-radius: 38px; }
  .phone-frame::before { top: 19px; width: 72px; height: 21px; margin-left: -36px; }
  .foot { margin-top: 88px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
  .key.down, .key.hit { transform: none; }
}
