/* Muhit website. "Ink" direction, shared with the app (docs/design/MUHIT-DESIGN.md):
   true-black canvas, one luminous surface step, hairlines instead of shadows,
   Muhit green as a scarce stamp, light pill as the loudest action. */

@font-face { font-family: "Readex Pro"; font-weight: 400; font-display: swap; src: url("fonts/ReadexPro-Regular.ttf") format("truetype"); }
@font-face { font-family: "Readex Pro"; font-weight: 500; font-display: swap; src: url("fonts/ReadexPro-Medium.ttf") format("truetype"); }
@font-face { font-family: "Readex Pro"; font-weight: 600; font-display: swap; src: url("fonts/ReadexPro-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 500; font-display: swap; src: url("fonts/IBMPlexSansArabic_500Medium.ttf") format("truetype"); }

:root {
  --bg: #000000;
  --surf: #16181a;
  --surf2: #222428;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --tx: #f5f5f7;
  --mut: #9a9da3;
  --ac: #4fa87c;
  --acs: #8ed2ab;
  --acbg: #13291e;
  --err: #e08a76;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--tx);
  font: 400 16px/1.55 "Readex Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--acs); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, .btn:focus-visible { outline: 2px solid var(--acs); outline-offset: 3px; border-radius: 999px; }
h1, h2, h3 { font-weight: 500; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.ar { font-family: "IBM Plex Sans Arabic", "Geeza Pro", Tahoma, sans-serif; font-weight: 500; letter-spacing: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--tx); color: var(--bg); padding: 10px 16px; border-radius: 999px; z-index: 30; }
.skip:focus { left: 16px; }
.label {
  font-family: "Readex Pro", sans-serif; font-weight: 500;
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--acs);
}
[hidden] { display: none !important; }

/* Liquid Glass, for the floating control layer only (Apple's rule: glass is for
   navigation over content, never for the content itself). Frosted everywhere;
   on Chromium site.js adds real refraction at the rim with an SVG displacement
   map built for the element's exact size. The rim catches light where the
   pointer is, and a press lights the glass from the finger. */
@property --mx { syntax: "<length-percentage>"; inherits: true; initial-value: 24%; }
@property --my { syntax: "<length-percentage>"; inherits: true; initial-value: 0%; }
.glass {
  position: relative; isolation: isolate;
  background: rgba(34, 36, 40, 0.36);
  -webkit-backdrop-filter: blur(14px) saturate(180%); backdrop-filter: blur(14px) saturate(180%);
  box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.05), 0 12px 32px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: --mx 160ms linear, --my 160ms linear;
}
.glass::before, .glass::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.glass::before {
  padding: 1px;
  background:
    radial-gradient(110px 60px at var(--mx) var(--my), rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 70%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.1) 30%, rgba(255, 255, 255, 0.03) 50%, rgba(255, 255, 255, 0.1) 70%, rgba(255, 255, 255, 0.34));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.glass::after {
  z-index: -1; opacity: 0; transition: opacity 320ms var(--ease-out);
  background: radial-gradient(180px 120px at var(--mx) var(--my), rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 70%);
}
@media (hover: hover) { .glass:hover::after { opacity: 1; } }
.glass:active::after { opacity: 1; transition-duration: 80ms; background: radial-gradient(200px 140px at var(--mx) var(--my), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 70%); }

/* Navigation: a floating glass capsule; the page scrolls underneath it. */
.nav { position: sticky; top: 0; z-index: 20; padding: 12px var(--gutter) 0; pointer-events: none; }
.nav::before { content: ""; position: absolute; inset: 0 0 auto; height: 44px; z-index: -1; background: linear-gradient(rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0)); }
.nav .wrap {
  pointer-events: auto; max-width: calc(var(--wrap) - 2 * var(--gutter)); height: 60px; padding: 0 8px 0 18px; border-radius: 999px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--tx); text-decoration: none; font-weight: 500; font-size: 18px; letter-spacing: -0.01em; }
.brand img { width: 30px; height: auto; }
.nav-links { position: relative; display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-links a { position: relative; z-index: 1; display: block; padding: 9px 15px; border-radius: 999px; color: var(--mut); text-decoration: none; font-size: 15px; transition: color 160ms ease; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--tx); }
/* The selection: a lighter drop of glass that glides between links on a
   spring and swells while it moves, like the iOS 26 tab bar. */
.lens {
  position: absolute; left: 0; top: 50%; height: 40px; margin-top: -20px; border-radius: 999px; pointer-events: none;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 -6px 12px rgba(255, 255, 255, 0.04);
  opacity: 0; transition: opacity 220ms ease;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 26px; border: 0; border-radius: 999px;
  background: var(--tx); color: var(--bg);
  font: 600 16px/1 "Readex Pro", sans-serif; letter-spacing: 0.01em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 140ms var(--ease-out), background-color 160ms ease;
}
.btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .btn:hover { background: #ffffff; } }
.btn.ghost { background: transparent; color: var(--tx); box-shadow: inset 0 0 0 1px var(--line-strong); }
@media (hover: hover) and (pointer: fine) { .btn.ghost:hover { background: rgba(255, 255, 255, 0.06); } }
.btn svg { width: 20px; height: 20px; flex: none; }

/* Store badge: a pill, not a fake App Store graphic. Not a link until launch. */
.store {
  display: inline-flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 24px 0 18px; border-radius: 999px;
  background: var(--tx); color: var(--bg); text-decoration: none;
}
.store svg { width: 26px; height: 26px; }
.store span { display: flex; flex-direction: column; line-height: 1.15; }
.store small { font-size: 11px; font-weight: 500; letter-spacing: 0.04em; opacity: 0.7; }
.store b { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }

/* Phone frame around real screenshots */
.phone {
  position: relative; border-radius: 15% / 7%; padding: 2.4%;
  background: #0b0c0d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09), 0 0 0 1px #000;
}
.phone img { width: 100%; border-radius: 13% / 6%; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: clamp(40px, 8vw, 96px) 0 0; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 140px; background: linear-gradient(rgba(0, 0, 0, 0), var(--bg)); pointer-events: none; z-index: 3; }
.hero::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  right: -10%; top: 4%; width: 70vw; max-width: 900px; aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(79, 168, 124, 0.20), rgba(79, 168, 124, 0.05) 55%, transparent 72%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; align-items: end; gap: 48px; }
.hero-copy { padding-bottom: clamp(48px, 9vw, 120px); }
.hero h1 { font-size: clamp(52px, 6.4vw, 92px); line-height: 0.98; letter-spacing: -0.045em; }
.hero h1 .line { display: block; }
.hero h1 em { font-style: normal; color: var(--acs); }
.hero-sub { margin-top: 28px; max-width: 30ch; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.5; color: var(--mut); }
.hero-sub strong { color: var(--tx); font-weight: 500; }
.hero-cta { margin-top: 36px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.hero-cta .note { color: var(--mut); font-size: 14px; }
.hero-phones { position: relative; height: clamp(440px, 52vw, 680px); }
.hero-phones .phone { position: absolute; width: clamp(220px, 23vw, 310px); }
.hero-phones .front { right: 4%; bottom: -12%; z-index: 2; }
.hero-phones .back { right: 44%; bottom: -24%; transform: rotate(-7deg); opacity: 0.55; }

/* Numbers */
.numbers { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.numbers ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.numbers li { padding: 40px 0; }
.numbers li + li { padding-left: 32px; border-left: 1px solid var(--line); }
.numbers b { display: block; font-size: clamp(32px, 4vw, 52px); font-weight: 500; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.numbers span { display: block; margin-top: 10px; color: var(--mut); font-size: 15px; }

/* Shared section rhythm */
.section { padding: clamp(80px, 11vw, 136px) 0; scroll-margin-top: 40px; }
.section-title { font-size: clamp(36px, 5.4vw, 72px); line-height: 1.02; letter-spacing: -0.035em; max-width: 14ch; }
.section-lead { margin-top: 20px; max-width: 52ch; color: var(--mut); font-size: 18px; }

/* A word, all of it: annotated phone */
.anatomy { display: grid; grid-template-columns: 1fr minmax(260px, 340px) 1fr; gap: clamp(24px, 4vw, 64px); align-items: center; margin-top: 64px; }
.anatomy .phone { width: 100%; }
.notes { display: grid; gap: 48px; }
.notes.left { text-align: right; }
.note-item h3 { font-size: 22px; letter-spacing: -0.015em; }
.note-item p { margin-top: 8px; color: var(--mut); font-size: 16px; }
.note-item .ar { display: block; margin-bottom: 12px; font-size: 30px; line-height: 1.3; color: var(--acs); }
.notes:not(.left) .note-item .ar { text-align: left; }

/* Bento: one focal specimen per tile, set in real type from the dictionary
   rather than shrunken screenshots, so every tile is sharp and full. */
.bento { margin-top: 56px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.tile {
  position: relative; overflow: hidden; border-radius: 28px; background: var(--surf);
  box-shadow: inset 0 0 0 1px var(--line); padding: clamp(24px, 3vw, 36px); display: flex; flex-direction: column; gap: 28px;
}
.tile h3 { font-size: 24px; line-height: 1.2; letter-spacing: -0.02em; }
.tile p { margin-top: 10px; color: var(--mut); font-size: 15.5px; max-width: 38ch; }
.tile p .ar { font-size: 1.12em; color: var(--tx); }
.t-roots, .t-conj { grid-column: span 4; display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); align-items: center; gap: clamp(24px, 3vw, 40px); }
.t-offline, .t-search { grid-column: span 2; }
.t-books { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: center; gap: clamp(24px, 3vw, 48px); }

/* Staggered children inside a tile, once the tile is revealed. */
.js [data-stagger] > * {
  opacity: 0; translate: 0 10px;
  transition: opacity 600ms var(--ease-out), translate 600ms var(--ease-out);
  transition-delay: calc(260ms + var(--i, 0) * 70ms);
}
.js .in [data-stagger] > *, .revealed:not(.io) [data-stagger] > * { opacity: 1; translate: none; }

/* Roots */
.root-demo { display: grid; justify-items: center; gap: 18px; }
.root-letters { display: flex; gap: 10px; }
.root-letters span {
  width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px;
  font-family: "IBM Plex Sans Arabic", sans-serif; font-weight: 500; font-size: 32px; line-height: 1;
  color: var(--acs); background: var(--acbg); box-shadow: inset 0 0 0 1px rgba(142, 210, 171, 0.3);
}
.fam { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fam li, .chips li { padding: 12px 10px 10px; border-radius: 16px; background: var(--surf2); box-shadow: inset 0 0 0 1px var(--line); text-align: center; }
.fam .ar, .chips .ar { display: block; font-size: 24px; line-height: 1.5; }
.fam small, .chips small { display: block; color: var(--mut); font-size: 13px; line-height: 1.3; }
.fam-more { color: var(--mut); font-size: 13px; }

/* Offline */
.t-offline {
  justify-content: space-between; min-height: 300px;
  background:
    radial-gradient(120% 90% at 85% 0%, rgba(79, 168, 124, 0.38), transparent 60%),
    linear-gradient(160deg, #10241a, var(--surf) 70%);
}
.t-offline .glyph { width: 44px; height: 44px; color: var(--acs); }
.t-offline .big { font-size: clamp(34px, 3.2vw, 46px); line-height: 1; letter-spacing: -0.04em; font-weight: 500; }
.t-offline p { margin-top: -14px; }

/* Search */
.t-search { justify-content: space-between; }
.search-demo { display: grid; gap: 10px; }
.search-field {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px; border-radius: 999px;
  background: var(--surf2); box-shadow: inset 0 0 0 1px var(--line-strong); font-size: 17px;
}
.lens-icon { width: 18px; height: 18px; color: var(--mut); flex: none; }
.q { display: inline-grid; }
.q > span { grid-area: 1 / 1; }
.q > span::after { content: ""; display: inline-block; width: 2px; height: 1.1em; margin-inline-start: 3px; vertical-align: -0.18em; background: var(--acs); animation: caret 1s steps(1) infinite; }
.q .ar { font-size: 19px; }
.result { padding: 16px 18px; border-radius: 20px; background: var(--surf2); box-shadow: inset 0 0 0 1px var(--line); }
.result-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.result-top .ar { font-size: 28px; line-height: 1.4; }
.pos { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--acs); padding: 4px 9px; border-radius: 999px; background: var(--acbg); }
.gloss { display: block; margin-top: 2px; color: var(--mut); font-size: 14px; }
@media (prefers-reduced-motion: no-preference) {
  .q > span { animation: query 8s infinite both; }
  .q > span + span { animation-delay: -4s; }
}
@media (prefers-reduced-motion: reduce) { .q > span + span { visibility: hidden; } .q > span::after { animation: none; } }
@keyframes query { 0%, 46% { opacity: 1; translate: 0 0; } 50%, 96% { opacity: 0; translate: 0 -6px; } 100% { opacity: 1; translate: 0 0; } }
@keyframes caret { 50% { opacity: 0; } }

/* Conjugation */
.conj-demo { border-radius: 22px; background: var(--surf2); box-shadow: inset 0 0 0 1px var(--line); padding: 18px 20px 10px; }
.verb-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.verb-head .ar { font-size: 26px; line-height: 1.4; color: var(--acs); }
.verb-head span:last-child { color: var(--mut); font-size: 14px; }
.conj { width: 100%; border-collapse: collapse; font-family: "IBM Plex Sans Arabic", sans-serif; font-weight: 500; }
.conj th, .conj td { padding: 7px 4px; text-align: right; border-bottom: 1px solid var(--line); }
.conj tbody tr:last-child > * { border-bottom: 0; }
.conj thead th { font-size: 14px; color: var(--mut); font-weight: 500; padding-top: 12px; }
.conj thead small { font-family: "Readex Pro", sans-serif; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; margin-inline-start: 4px; }
.conj tbody th { font-size: 17px; color: var(--mut); font-weight: 500; width: 22%; }
.conj td { font-size: 21px; line-height: 1.5; }

/* Textbooks: the app's own drawn covers (BookCover.js), rendered to images in img/covers/
   so no browser has to shape the Arabic titles. */
.t-books .shelf { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 20px 48px; padding-top: 8px; }
.shelf figure { margin: 0; }
.shelf figcaption { margin-top: 14px; color: var(--mut); font-size: 13px; }
.covers { list-style: none; margin: 0; padding: 0; display: flex; gap: clamp(10px, 1.4vw, 16px); }
.cover { display: block; width: clamp(64px, 7.4vw, 96px); height: auto; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.4)); }
.lesson { border-radius: 22px; background: var(--surf2); box-shadow: inset 0 0 0 1px var(--line); padding: 18px; }
.lesson-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 0 2px 14px; font-size: 13px; color: var(--mut); }
.lesson-head span:first-child { color: var(--tx); font-weight: 500; }
.chips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.chips li { background: var(--surf); }

/* Mi'rab */
.mirab { position: relative; }
.mirab-head { max-width: 760px; }
.mirab-demo { margin-top: 56px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sentence {
  grid-column: 1 / -1; border-radius: 28px; padding: 32px; background: var(--surf);
  box-shadow: inset 0 0 0 1px var(--line); display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.sentence .ar { font-size: clamp(36px, 5vw, 56px); line-height: 1.5; direction: rtl; }
.sentence .tr { color: var(--mut); font-size: 17px; }
/* Each word lights up as the card explaining it arrives. */
.sentence [data-w] {
  background: linear-gradient(currentColor, currentColor) right bottom / 0 2px no-repeat;
  transition: color 600ms var(--ease-out) 380ms, background-size 700ms var(--ease-out) 380ms;
}
.mirab-demo:has([data-for="1"].in) [data-w="1"], .mirab-demo:has([data-for="2"].in) [data-w="2"] { color: var(--acs); background-size: 100% 2px; }
.irab { border-radius: 28px; padding: 28px; background: var(--surf); box-shadow: inset 0 0 0 1px var(--line); }
.irab .top-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.irab .ar.word { font-size: 34px; line-height: 1.4; color: var(--acs); }
.irab .role { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mut); }
.irab .ar.why { display: block; margin-top: 14px; font-size: 19px; line-height: 1.9; direction: rtl; text-align: right; color: var(--tx); }

/* Practice gallery */
.gallery { margin: 56px auto 0; max-width: 820px; display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(16px, 4vw, 64px); }
.gallery figure { margin: 0; }
.gallery .phone { width: min(100%, 320px); margin: 0 auto; }
.gallery figcaption { margin-top: 24px; text-align: center; }
.gallery figcaption b { display: block; font-weight: 500; font-size: 18px; letter-spacing: -0.01em; }
.gallery figcaption span { display: block; margin-top: 4px; color: var(--mut); font-size: 15px; }
.gallery figure:nth-child(2) { margin-top: 72px; }

/* Closing */
.closing { position: relative; overflow: hidden; text-align: center; padding: clamp(96px, 14vw, 180px) 0; border-top: 1px solid var(--line); }
.closing .watermark {
  position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -54%);
  font-size: clamp(180px, 32vw, 420px); line-height: 1; color: rgba(79, 168, 124, 0.08); pointer-events: none; user-select: none; white-space: nowrap;
}
.closing h2 { position: relative; font-size: clamp(40px, 6vw, 80px); line-height: 1; letter-spacing: -0.04em; }
.closing p { position: relative; margin: 22px auto 0; max-width: 44ch; color: var(--mut); font-size: 18px; }
.closing .store { position: relative; margin-top: 36px; }

/* Footer */
.footer { border-top: 1px solid var(--line); }
.footer .wrap { padding-top: 40px; padding-bottom: 48px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer nav { display: flex; gap: 24px; flex-wrap: wrap; }
.footer a { color: var(--mut); text-decoration: none; font-size: 14px; }
.footer a:hover { color: var(--tx); }
.footer small { color: var(--mut); font-size: 13px; }

/* Reveal on scroll (only when JS has marked the page; content is visible without JS).
   .revealed is the inline script's safety net for when site.js never runs; once
   site.js is watching (.io) it no longer applies, so later sections still animate. */
.js [data-reveal] {
  opacity: 0; transform: translateY(18px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out), filter 700ms var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.js :where(.line, .section-title, .closing h2)[data-reveal] { filter: blur(12px); }
.js .notes.left [data-reveal] { transform: translateX(-32px); }
.js .notes:not(.left) [data-reveal] { transform: translateX(32px); }
.js [data-reveal].in, .js .notes [data-reveal].in, .revealed:not(.io) [data-reveal] { opacity: 1; transform: none; filter: none; }
.js .hero [data-reveal] { transition-duration: 900ms; }

/* Scroll-linked motion (Safari 26, Chrome; elsewhere the page is simply still).
   Uses the individual translate/scale/rotate properties so it stacks with the
   reveal transforms above. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero-phones .front { animation: hero-front linear both; animation-timeline: scroll(root); animation-range: 0 90vh; }
    .hero-phones .back { animation: hero-back linear both; animation-timeline: scroll(root); animation-range: 0 90vh; }
    .anatomy .phone { animation: settle linear both; animation-timeline: view(); animation-range: entry 0% cover 45%; }
    .closing { view-timeline: --closing; }
    .closing .watermark { animation: glide linear both; animation-timeline: --closing; animation-range: cover; }
  }
  @media (prefers-reduced-motion: no-preference) and (min-width: 768px) {
    .gallery figure { animation: float-a linear both; animation-timeline: view(); animation-range: cover; }
    .gallery figure:nth-child(2) { animation-name: float-b; }
  }
}
@keyframes hero-front { to { translate: 0 -14%; } }
@keyframes hero-back { to { translate: 0 -4%; rotate: -5deg; } }
@keyframes settle { from { scale: 0.88; } }
@keyframes glide { from { translate: 9% 0; } to { translate: -9% 0; } }
@keyframes float-a { from { translate: 0 40px; } to { translate: 0 -40px; } }
@keyframes float-b { from { translate: 0 100px; } to { translate: 0 -100px; } }

/* Single-message pages (/confirmed, /reset) */
.center { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.panel { width: 100%; max-width: 440px; background: var(--surf); box-shadow: inset 0 0 0 1px var(--line); border-radius: 28px; padding: 40px 28px 32px; text-align: center; }
.panel .logo { width: 64px; height: auto; margin: 0 auto 22px; }
.badge { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 18px; display: flex; align-items: center; justify-content: center; background: var(--acbg); color: var(--acs); font-size: 30px; }
.badge.bad { background: rgba(224, 138, 118, 0.14); color: var(--err); }
.panel .label { display: block; margin-bottom: 8px; }
.panel h1 { font-size: 26px; letter-spacing: -0.02em; margin: 0 0 10px; }
.panel p { color: var(--mut); margin: 0 0 24px; }
.panel .btn { width: 100%; }
.panel .hint { font-size: 13px; margin: 16px 0 0; }

/* Legal pages and guides */
.doc main { max-width: 720px; margin: 40px auto 96px; }
.doc main h1 { font-size: clamp(36px, 6vw, 56px); letter-spacing: -0.035em; line-height: 1.05; margin: 12px 0 32px; }
.doc main h2 { font-size: 20px; letter-spacing: -0.01em; margin: 36px 0 8px; }
.doc main p { color: #c7c9ce; line-height: 1.7; }
.doc main :is(ul, ol) { color: #c7c9ce; line-height: 1.7; padding-left: 1.2em; }
.doc main li { margin: 6px 0; }
.doc main a { color: var(--acs); }
.doc main .ar { font-size: 1.15em; }
.doc main table { border-collapse: collapse; margin: 12px 0 4px; }
.doc main td { padding: 8px 0 8px 22px; border-bottom: 1px solid var(--line); color: #c7c9ce; }
.doc main td:nth-child(odd) { color: var(--mut); }
.crumbs { font-size: 14px; color: var(--mut); }
.crumbs a { color: var(--mut) !important; text-decoration: none; }
.byline { font-size: 14px; color: var(--mut) !important; margin: -20px 0 8px; }
.more { margin-top: 56px; padding-top: 8px; border-top: 1px solid var(--line); }
.guide-list { list-style: none; padding: 0 !important; display: grid; gap: 12px; }
.guide-list a { display: grid; gap: 6px; padding: 20px; border-radius: 16px; background: var(--surf); text-decoration: none; color: var(--tx) !important; transition: transform 120ms var(--ease-out); }
.guide-list a:active { transform: scale(0.98); }
.guide-list span { color: var(--mut); font-size: 15px; line-height: 1.5; }
.more-link { display: inline-block; margin-top: 6px; color: var(--acs); font-weight: 500; }
.top { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.pill { display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--tx); text-decoration: none; font-size: 14px; }

/* Responsive */
@media (max-width: 1023px) {
  .nav-links li.hide-md { display: none; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t-roots, .t-conj, .t-books { grid-column: 1 / -1; }
  .t-offline, .t-search { grid-column: span 1; }
}
@media (max-width: 767px) {
  .nav .wrap { height: 56px; padding: 0 6px 0 16px; }
  .nav-links a { padding: 8px 12px; }
  .lens { height: 38px; margin-top: -19px; }
  .nav-links li.hide-sm { display: none; }
  .hero-grid { grid-template-columns: 1fr; gap: 0; }
  .hero-copy { padding-bottom: 40px; }
  .hero-phones { height: 420px; }
  .hero-phones .front { left: 0; right: 0; margin: 0 auto; width: 240px; bottom: -18%; }
  .hero-phones .back { display: none; }
  .numbers ul { grid-template-columns: 1fr 1fr; }
  .numbers li { padding: 28px 0; }
  .numbers li + li { padding-left: 0; border-left: 0; }
  .numbers li:nth-child(even) { padding-left: 20px; border-left: 1px solid var(--line); }
  .numbers li:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .anatomy { grid-template-columns: 1fr; }
  .anatomy .phone { max-width: 300px; margin: 0 auto; order: -1; }
  .notes, .notes.left { text-align: left; gap: 32px; }
  .bento { grid-template-columns: minmax(0, 1fr); }
  .t-roots, .t-conj, .t-books, .t-offline, .t-search { grid-column: auto; grid-template-columns: minmax(0, 1fr); }
  .t-offline { min-height: 260px; }
  .fam .ar, .chips .ar { font-size: 21px; }
  .mirab-demo { grid-template-columns: 1fr; }
  .gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 16px; margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1); padding: 0 var(--gutter) 8px; }
  .gallery figure { flex: 0 0 72%; scroll-snap-align: center; }
  .gallery figure:nth-child(2) { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { transform: none !important; filter: none !important; transition: opacity 300ms ease; }
  .js [data-stagger] > * { translate: none; transition: opacity 300ms ease; }
  .sentence [data-w] { transition-duration: 200ms; }
  .btn, .btn:active { transition: none; transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .glass { background: var(--surf); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(255, 255, 255, 0.45); --line-strong: rgba(255, 255, 255, 0.6); --mut: #c7c9cd; }
  .glass { background: var(--surf); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: inset 0 0 0 1px var(--line-strong); }
  .glass::before, .glass::after { display: none; }
}
