/* Forty5 public site. Shared by every page; colours follow the app's indigo and Plus amber.
   Fonts are self-hosted (SIL Open Font License, see fonts/) so pages load nothing from other domains. */
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

:root {
  /* Type. Russian pages swap both for the system font (see the :lang rules near the end). */
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-text: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", "SF Arabic", "Geeza Pro", "Noto Sans Arabic", "Noto Naskh Arabic", Tahoma, sans-serif;
  --bg: #f7f6f2;
  --surface: #ffffff;
  --ink: #15192b;
  --muted: #5b6072;
  --line: #e2e0d8;
  --primary: #1e3a8a;
  --on-primary: #ffffff;
  --primary-ink: #1e3a8a;
  --primary-soft: #e3e8fb;
  --plus: #b45309;
  --plus-soft: #fdf0d8;
  --on-plus: #ffffff;
  --fill: #fff1b8;
  --fill-ink: #6b4a00;
  --shadow: 0 1px 2px rgb(21 25 43 / 6%), 0 12px 32px rgb(21 25 43 / 8%);
  --glow-a: rgb(79 111 216 / 22%);
  --glow-b: rgb(245 158 11 / 20%);
  --primary-2: #3b5bdb;
  --accent-2: #ea580c;
  --pain: #b42318;
  --pain-soft: #fdeceb;
  --header-h: 64px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1220;
    --surface: #171d2e;
    --ink: #eef0f6;
    --muted: #a3a9ba;
    --line: #2a3247;
    --primary: #4f6fd8;
    --on-primary: #ffffff;
    --primary-ink: #a9bbff;
    --primary-soft: #222c50;
    --plus: #fbbf24;
    --plus-soft: #36280c;
    --on-plus: #1b1200;
    --fill: #4a3a08;
    --fill-ink: #ffe28a;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 12px 32px rgb(0 0 0 / 35%);
    --glow-a: rgb(79 111 216 / 30%);
    --glow-b: rgb(251 191 36 / 16%);
    --primary-2: #2c47b5;
    --accent-2: #fb923c;
    --pain: #f97066;
    --pain-soft: #3a1a1c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1220;
  --surface: #171d2e;
  --ink: #eef0f6;
  --muted: #a3a9ba;
  --line: #2a3247;
  --primary: #4f6fd8;
  --on-primary: #ffffff;
  --primary-ink: #a9bbff;
  --primary-soft: #222c50;
  --plus: #fbbf24;
  --plus-soft: #36280c;
  --on-plus: #1b1200;
  --fill: #4a3a08;
  --fill-ink: #ffe28a;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 12px 32px rgb(0 0 0 / 35%);
  --glow-a: rgb(79 111 216 / 30%);
    --glow-b: rgb(251 191 36 / 16%);
    --primary-2: #2c47b5;
    --accent-2: #fb923c;
    --pain: #f97066;
    --pain-soft: #3a1a1c;
    color-scheme: dark;
}

* { box-sizing: border-box; }
@view-transition { navigation: auto; }
header.site { view-transition-name: site-header; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-12px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(18px); } }
::view-transition-old(root) { animation: vt-out 0.25s ease-in both; }
::view-transition-new(root) { animation: vt-in 0.5s var(--ease) both; }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  /* Atkinson has no Arabic: Arabic letters use a system Arabic font (nothing is downloaded). */
  font: 17px/1.6 var(--font-text);
}
img { max-width: 100%; height: auto; }
h1, h2, h3, .brand { font-family: var(--font-display); line-height: 1.15; text-wrap: balance; }
.brand { font-family: "Bricolage Grotesque", system-ui, sans-serif; }
a { color: var(--primary-ink); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--plus); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 1080px; margin: 0 auto; padding-inline: 20px; }
.prose { max-width: 68ch; }
.muted { color: var(--muted); }

.skip { position: absolute; inset-inline-start: 8px; top: 8px; transform: translateY(-200%); background: var(--surface); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { transform: none; }

header.site { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 84%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; transition: box-shadow 0.3s; }
header.site.scrolled { box-shadow: 0 6px 24px rgb(21 25 43 / 8%); }
.scroll-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: linear-gradient(90deg, var(--primary), var(--plus)); transform: scaleX(0); transform-origin: left; }
header.site .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding-block: 12px; }
.brand { font-size: 1.5rem; font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.brand b { color: var(--plus); }
nav.site { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-weight: 700; font-size: 0.95rem; }
nav.site a { color: var(--muted); text-decoration: none; }
nav.site a[aria-current="page"], nav.site a:hover { color: var(--ink); }
a.nav-cta { color: var(--on-primary); background: var(--primary); padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: 0.95rem; text-decoration: none; transition: transform 0.25s var(--ease), filter 0.2s; }
a.nav-cta:hover { filter: brightness(1.1); transform: translateY(-1px); }
header.site nav.site { margin-inline-start: auto; }

main { padding-block: 48px 72px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 72px; }
main.bare { min-height: 60vh; align-content: center; }
.eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--plus); margin: 0 0 10px; }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); margin: 0 0 16px; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin: 0 0 14px; letter-spacing: -0.02em; }
h3 { font-size: 1.15rem; margin: 0 0 6px; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 54ch; margin: 0; }
.section-lede { color: var(--muted); margin: -4px 0 20px; max-width: 64ch; }

.btn { display: inline-block; background: var(--primary); color: var(--on-primary); font-weight: 700; padding: 13px 20px; border-radius: 12px; text-decoration: none; border: 2px solid var(--primary); text-align: center; }
.btn.ghost { background: transparent; color: var(--primary-ink); border-color: var(--line); }
.btn { transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), filter 0.2s; }
.btn:hover { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 8px 20px rgb(30 58 138 / 22%); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn.ghost:hover { box-shadow: none; border-color: var(--primary-ink); }
.btn .arrow { display: inline-block; transition: transform 0.3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
nav.site a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: background-size 0.35s var(--ease), color 0.2s; padding-bottom: 2px; }
nav.site a:hover, nav.site a[aria-current="page"] { background-size: 100% 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px; align-items: center; min-height: min(78vh, 760px); }
.hero-trust { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 0; margin: 18px 0 0; color: var(--muted); font-size: 0.95rem; font-weight: 700; }
.hero-trust li { display: inline-flex; align-items: center; gap: 6px; }
.hero-trust svg { width: 18px; height: 18px; flex: none; color: var(--primary-2); stroke-width: 3; }
.trust-head { max-width: 64ch; }
.review-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.review { display: flex; flex-direction: column; }
.review .stars { margin: 0 0 10px; color: var(--accent-2); font-size: 1.15rem; letter-spacing: 3px; }
.review blockquote { margin: 0; flex: 1; }
.review blockquote p { color: var(--ink); font-size: 1.05rem; line-height: 1.5; }
.review .who { margin: 14px 0 0; color: var(--muted); font-size: 0.9rem; }
.review .who b { color: var(--ink); }
.stats { display: flex; flex-wrap: wrap; gap: 28px; margin: 34px 0 0; font-variant-numeric: tabular-nums; }
.stats div { display: grid; }
.stats dt { order: 2; color: var(--muted); font-size: 0.9rem; }
.stats dd { order: 1; margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 2rem; letter-spacing: -0.02em; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.tile p { margin: 0; color: var(--muted); }
.tile p + p { margin-top: 8px; }
.soon { display: inline-block; vertical-align: middle; font-family: var(--font-text); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--plus); border: 1px solid var(--plus); border-radius: 999px; padding: 0 8px; margin-left: 6px; }

.groups { columns: 2; column-gap: 32px; }
.group { break-inside: avoid; padding-bottom: 28px; }
.group h3 { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; font-family: var(--font-text); margin-bottom: 10px; }
.courses { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.course { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.glyph { display: block; flex-shrink: 0; border-radius: 9px; }
.glyph.sm { width: 22px; height: 22px; }
.glyph.md { width: 30px; height: 30px; }
.glyph-emoji.sm { font-size: 1rem; }
.glyph-emoji.md { font-size: 1.3rem; }
.lucide { display: block; flex-shrink: 0; }
.course .name { font-weight: 700; min-width: 0; }
.course .levels { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.course .levels span { background: var(--primary-soft); color: var(--primary-ink); border-radius: 999px; padding: 1px 9px; white-space: nowrap; }

.split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.split p { max-width: 56ch; }
.quote p:first-child { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--ink); line-height: 1.3; }

.faq { display: grid; gap: 10px; max-width: 76ch; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 18px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 16px 0; list-style-position: outside; }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq details div { padding: 4px 0 6px; color: var(--muted); }

.cta-band { background: var(--primary); color: var(--on-primary); border-radius: 24px; padding: 40px 32px; text-align: center; display: grid; justify-items: center; gap: 6px; }
.cta-band h2 { margin: 0; }
.cta-band p { margin: 0 0 14px; opacity: 0.85; }
.cta-band .btn { background: var(--on-primary); color: #1e3a8a; border-color: var(--on-primary); }

.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: center; }
.plan { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px; display: grid; gap: 8px; align-content: start; transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease); }
.plan:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.plan.best { border: 2px solid var(--plus); background: linear-gradient(180deg, var(--plus-soft), var(--surface) 70%); padding-block: 38px; box-shadow: var(--shadow); }
.plan h2 { font-size: 1.25rem; margin: 0; }
.plan .price { font-family: var(--font-display); font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.plan .price span { font-size: 1.05rem; color: var(--muted); font-weight: 700; letter-spacing: 0; margin-inline-start: 2px; }
.plan .per { color: var(--muted); font-size: 0.95rem; }
.plan p { margin: 4px 0 8px; }
.ribbon { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--plus); color: var(--on-plus); font-weight: 800; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 999px; padding: 4px 14px; white-space: nowrap; box-shadow: 0 6px 16px rgb(180 83 9 / 25%); }
.badge { justify-self: start; background: var(--plus); color: var(--on-plus); font-weight: 700; font-size: 0.8rem; border-radius: 999px; padding: 3px 10px; }
.badge.soft { background: var(--plus-soft); color: var(--plus); }
.badge.none { background: transparent; color: var(--muted); padding-inline: 0; font-weight: 400; }
.fine { color: var(--muted); font-size: 0.85rem; margin: -40px 0 0; text-align: center; }
.pricing-head { text-align: center; display: grid; justify-items: center; }
.pricing-head .lede { margin-inline: auto; }

.year-cost { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 28px; }
.year-cost h2 { margin-bottom: 18px; }
.cost-rows { display: grid; gap: 14px; }
.cost-row { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr) 6.5rem; align-items: center; gap: 16px; font-variant-numeric: tabular-nums; }
.cost-label { font-weight: 700; display: grid; line-height: 1.25; }
.cost-label small { font-weight: 400; color: var(--muted); font-size: 0.8rem; }
.cost-bar { width: 100%; height: 26px; overflow: visible; }
.cost-fill { fill: var(--line); transform-box: fill-box; transform-origin: left; }
.cost-row.annual .cost-fill { fill: var(--plus); }
.cost-row.annual .cost-total { color: var(--plus); }
.cost-total { text-align: end; font-weight: 800; font-family: var(--font-display); font-size: 1.15rem; }
.cost-note { margin: 18px 0 0; color: var(--muted); }
.cost-note strong { color: var(--ink); }
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .year-cost .cost-fill { transform: scaleX(0); transition: transform 1.2s var(--ease); }
  .year-cost.in .cost-fill { transform: none; }
  .year-cost.in .packs .cost-fill { transition-delay: 0.15s; }
  .year-cost.in .annual .cost-fill { transition-delay: 0.3s; }
}
.guarantee { display: flex; align-items: center; gap: 20px; padding: 24px 28px; border-radius: 20px; background: var(--primary-soft); }
.guarantee h2 { font-size: 1.3rem; margin: 0 0 4px; }
.guarantee p { margin: 0; }
.g-icon { width: 44px; height: 44px; color: var(--primary-ink); }
.price-teaser { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px; padding: 32px; border-radius: 24px; border: 1px solid var(--line); background: linear-gradient(120deg, var(--plus-soft), var(--surface) 60%); }
.price-teaser h2 { margin: 0 0 6px; }
.price-teaser p { margin: 0; max-width: 52ch; }
.checks { padding-inline-start: 1.2em; margin: 0; }
.checks li { margin-bottom: 4px; }

table.compare { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }
table.compare th, table.compare td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.compare th { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

.legal h2 { font-size: 1.35rem; margin-top: 2em; }
.legal .updated { color: var(--muted); margin: 0; }
.fill { background: var(--fill); color: var(--fill-ink); border-radius: 4px; padding: 0 4px; font-weight: 700; }
.notfound { text-align: center; display: grid; justify-items: center; }
.notfound .actions { justify-content: center; }

footer.site { border-top: 1px solid var(--line); padding-block: 32px; color: var(--muted); font-size: 0.9rem; background: var(--surface); }
footer.site .wrap { display: grid; gap: 10px; }
.foot-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }
footer.site p { margin: 0; max-width: 90ch; }

/* ---------- Home page: hero ---------- */
.hero::before {
  content: "";
  position: absolute;
  inset: -10% 0 -6% 0;
  z-index: -1;
  background:
    radial-gradient(40% 50% at 78% 38%, var(--glow-a), transparent 70%),
    radial-gradient(34% 42% at 18% 70%, var(--glow-b), transparent 70%);
  filter: blur(8px);
  animation: glow 14s ease-in-out infinite alternate;
}
@keyframes glow { to { transform: translate3d(2%, -3%, 0) scale(1.06); } }
.headline .line { display: block; overflow: hidden; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.headline .word { display: inline-block; }
.headline .accent {
  background: linear-gradient(100deg, var(--plus), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 1.12em;
}
@keyframes rise { from { opacity: 0; transform: translateY(0.5em); } }
@keyframes word-up { from { transform: translateY(110%); } }
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise 0.9s var(--ease) both; }
  .headline .word { animation: word-up 1s var(--ease) both; }
  .headline .line:first-child .word:nth-child(2) { animation-delay: 0.06s; }
  .headline .line:nth-child(2) .word:nth-child(1) { animation-delay: 0.14s; }
  .headline .line:nth-child(2) .word:nth-child(2) { animation-delay: 0.2s; }
  .headline .line:nth-child(2) .word:nth-child(3) { animation-delay: 0.3s; }
  .lede.rise { animation-delay: 0.45s; }
  .actions.rise { animation-delay: 0.55s; }
  .stats.rise { animation-delay: 0.65s; }
  .eyebrow.rise { animation-delay: 0s; }
}

.phones { position: relative; height: 600px; max-width: 100%; }
.phone { position: absolute; margin: 0; width: 270px; transform: translateY(var(--drift, 0px)) rotate(var(--tilt, 0deg)); }
.phone img, .story-phone, .step-shot { border-radius: 34px; border: 8px solid var(--ink); box-shadow: var(--shadow); background: var(--surface); }
.phone img { display: block; width: 100%; }
.phone.back { --tilt: -7deg; left: 0; top: 40px; opacity: 0.92; }
.phone.front { --tilt: 4deg; right: 0; top: 0; }
@media (prefers-reduced-motion: no-preference) {
  .phone.front img { animation: float 7s ease-in-out infinite; }
  .phone.back img { animation: float 8s ease-in-out -3s infinite; }
  .phone { animation: phone-in 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .phone.back { animation-delay: 0.25s; }
}
@keyframes float { 50% { transform: translateY(-12px); } }
@keyframes phone-in { from { opacity: 0; translate: 0 60px; } }

/* ---------- Subjects strip ---------- */
.subjects-strip {
  display: grid;
  gap: 12px;
  margin-inline: -20px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee { display: flex; overflow: hidden; }
.marquee-track { display: flex; flex-shrink: 0; gap: 12px; padding-right: 12px; }
.chip { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-weight: 700; font-size: 0.95rem; }
@media (prefers-reduced-motion: no-preference) {
  .marquee-track { animation: marquee 48s linear infinite; }
  .marquee.reverse .marquee-track { animation-direction: reverse; animation-duration: 56s; }
  .marquee:hover .marquee-track { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee { flex-wrap: wrap; justify-content: center; padding-inline: 20px; }
  .marquee-track { flex-wrap: wrap; justify-content: center; flex-shrink: 1; }
  .marquee-track[aria-hidden] { display: none; }
}
@keyframes marquee { to { transform: translateX(-100%); } }

/* ---------- The 45-point tally ---------- */
.tally-stage { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 40px; align-items: center; }
.tally-total { margin: 8px 0 12px; display: flex; align-items: baseline; gap: 10px; font-family: var(--font-display); font-weight: 800; font-variant-numeric: tabular-nums; }
.tally-num { font-size: clamp(5rem, 13vw, 8.5rem); line-height: 0.9; letter-spacing: -0.05em; min-width: 2ch; text-align: end; color: var(--ink); transition: color 0.4s; }
.tally.full .tally-num { color: var(--plus); animation: pop 0.6s var(--ease); }
@keyframes pop { 40% { transform: scale(1.08); } }
.tally-of { font-size: 1.6rem; color: var(--muted); }
.tally-note { color: var(--muted); margin: 0; max-width: 46ch; }
.tally-rows { list-style: none; margin: 0; padding: 22px; display: grid; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.tally-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 2.4rem; align-items: center; gap: 14px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.tally-row:last-child { border-bottom: 0; }
.tally-label { color: var(--muted); font-size: 0.92rem; line-height: 1.3; transition: color 0.3s; }
.tally-label b { display: block; color: var(--ink); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.tally-row.on .tally-label { color: var(--ink); }
.tally-pts { text-align: end; font-weight: 700; color: var(--muted); }
.tally-row.on .tally-pts { color: var(--ink); }
.pips { display: grid; grid-template-columns: repeat(7, 14px); gap: 5px; }
.pip { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--line); background: var(--bg); transition: background-color 0.25s, border-color 0.25s, transform 0.25s; }
.pip.on { background: var(--primary); border-color: var(--primary); transform: scale(1.08); }
.tally-row.core .pip.on { background: var(--plus); border-color: var(--plus); }

/* ---------- How it works: a pinned phone and steps ---------- */
.story-intro { max-width: 40ch; }
.story-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 56px; }
.story-phone { position: sticky; top: calc(var(--header-h) + 40px); justify-self: center; width: 290px; aspect-ratio: 390 / 844; max-width: 100%; overflow: hidden; }
.story-screen { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.04); transition: opacity 0.5s, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.story-screen.on { opacity: 1; transform: none; }
.story-steps { list-style: none; margin: 0; padding: 0 0 0 34px; position: relative; }
.story-steps::before, .story-steps::after { content: ""; position: absolute; left: 6px; top: 0; bottom: 0; width: 3px; border-radius: 3px; background: var(--line); }
.story-steps::after { background: linear-gradient(var(--primary), var(--plus)); transform-origin: top; transform: scaleY(var(--story-p, 1)); }
.story-step { position: relative; }
.story-step::before { content: ""; position: absolute; left: -34px; top: 50%; width: 15px; height: 15px; margin-top: -7px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line); z-index: 1; transition: border-color 0.4s, transform 0.4s var(--ease); }
.story-step.on::before { border-color: var(--plus); transform: scale(1.2); }
.story-step { min-height: 72vh; display: grid; align-content: center; gap: 8px; opacity: 0.3; transition: opacity 0.4s; }
.story-step.on { opacity: 1; }
.story-step h3 { font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -0.02em; margin: 0; }
.story-step p { color: var(--muted); font-size: 1.1rem; margin: 0; max-width: 44ch; }
.step-num { font-family: var(--font-display); font-weight: 800; font-size: 1rem; color: var(--plus); letter-spacing: 0.1em; }
.step-shot { display: none; }

/* ---------- Tiles, reveals and the call to action ---------- */
.tile { transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s; }
.grid3 .tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--primary-soft); }
.tile-icon { width: 44px; height: 44px; padding: 10px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-ink); margin-bottom: 14px; transition: transform 0.5s var(--ease), background-color 0.3s; }
.grid3 .tile:hover .tile-icon { transform: rotate(-6deg) scale(1.08); }
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  [data-reveal] { opacity: 0; transform: translateY(32px); transition: opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
  [data-reveal].in { opacity: 1; transform: none; }
  .stagger > [data-reveal]:nth-child(3n + 2) { transition-delay: 0.1s; }
  .stagger > [data-reveal]:nth-child(3n) { transition-delay: 0.2s; }
}
.grid3 .tile.in:hover { transition-delay: 0s; }
.cta-band { background: linear-gradient(120deg, var(--primary), var(--primary-2), var(--primary)); background-size: 220% 220%; }
@media (prefers-reduced-motion: no-preference) {
  .cta-band { animation: sheen 12s ease-in-out infinite alternate; }
}
@keyframes sheen { to { background-position: 100% 50%; } }

@media (max-width: 860px) {
  .hero, .grid3, .plans, .split { grid-template-columns: minmax(0, 1fr); }
  .groups { columns: 1; }
  main { padding-block: 32px 56px; gap: 56px; }
  header.site { position: static; }
  header.site .wrap { gap: 10px 16px; }
  header.site nav.site { order: 3; width: 100%; margin-inline-start: 0; gap: 4px 18px; font-size: 0.9rem; }
  :root { --header-h: 0px; }
  .plans { gap: 26px; }
  .plan.best { order: -1; }
  .fine { margin-top: -30px; }
  .cost-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .cost-bar { grid-column: 1 / -1; grid-row: 2; height: 18px; }
  .year-cost, .price-teaser { padding: 22px; }
  .guarantee { align-items: flex-start; padding: 20px; }
  .hero { min-height: 0; }
  .phones { height: 470px; width: 100%; max-width: 380px; justify-self: center; }
  .phone { width: 210px; }
  .phone.back { left: 14px; }
  .phone.front { right: 6px; }
  .tally-stage { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .tally-note { display: none; }
  .tally-rows { padding: 14px 16px; }
  .tally-label { font-size: 0.82rem; }
  .pips { grid-template-columns: repeat(7, 11px); gap: 4px; }
  .pip { width: 11px; height: 11px; border-radius: 3px; }
  .story-body { grid-template-columns: minmax(0, 1fr); }
  .story-phone { display: none; }
  .story-step { min-height: 0; opacity: 1; padding-block: 18px; }
  .story-step::before { top: 30px; }
  .step-shot { display: block; width: min(250px, 100%); margin-top: 14px; }
}

/* Buttons match the app: a raised face with a darker lip that presses down. */
:root { --btn: #2d4fd6; --btn-lip: #1e3a8a; --btn-ghost-lip: #d2cec2; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --btn: #4c6ef5; --btn-lip: #2b45b8; --btn-ghost-lip: #323b57; } }
:root[data-theme="dark"] { --btn: #4c6ef5; --btn-lip: #2b45b8; --btn-ghost-lip: #323b57; }
.btn { background: var(--btn); border-color: var(--btn); border-bottom: 4px solid var(--btn-lip); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; font-size: 0.95rem; }
.btn.ghost { background: var(--surface); border-color: var(--btn-ghost-lip); border-bottom-color: var(--btn-ghost-lip); }
.btn:hover { box-shadow: none; transform: translateY(-1px); }
.btn:active { transform: translateY(2px); border-bottom-width: 2px; margin-bottom: 2px; }
.cta-band .btn { border-bottom-color: #c9d2f5; }
a.nav-cta { background: var(--btn); border-bottom: 3px solid var(--btn-lip); }
a.nav-cta:active { transform: translateY(2px); border-bottom-width: 1px; }

/* Course pages */
a.course { color: inherit; text-decoration: none; transition: transform 0.25s var(--ease), border-color 0.2s, box-shadow 0.25s var(--ease); }
a.course:hover { transform: translateY(-2px); border-color: var(--primary-ink); box-shadow: var(--shadow); }
.courses li { list-style: none; }
.glyph.lg { width: 64px; height: 64px; border-radius: 18px; }
.glyph-emoji.lg { font-size: 2.6rem; }
.crumbs { font-size: 0.9rem; color: var(--muted); margin-bottom: 22px; }
.crumbs a { color: var(--muted); }
.course-head { display: flex; align-items: center; gap: 18px; }
.course-head h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.1rem); }
.course-hero .lede { margin-top: 18px; }
.outline { display: grid; gap: 10px; max-width: 820px; }
.unit { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 18px; }
.unit summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding: 16px 0; font-weight: 700; }
.unit[open] summary { border-bottom: 1px solid var(--line); }
.unit-name { min-width: 0; }
.unit-count { color: var(--muted); font-size: 0.9rem; font-weight: 400; font-variant-numeric: tabular-nums; }
.lessons { list-style: none; margin: 0; padding: 8px 0 12px; display: grid; gap: 2px; }
.lessons li { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) auto; align-items: baseline; gap: 10px; padding: 6px 0; }
.lessons .topic { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.hl-tag { background: var(--plus-soft); color: var(--plus); border-radius: 999px; padding: 0 9px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; }
.sample { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 40px; align-items: start; }
.sample-card { display: grid; gap: 14px; }
.sample-prompt { color: var(--ink) !important; font-weight: 700; font-size: 1.1rem; }
.sample-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sample-options li { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 12px; padding: 10px 14px; }
.sample-options .key { flex-shrink: 0; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; font-weight: 700; font-size: 0.85rem; color: var(--muted); }
.sample-answer summary { cursor: pointer; font-weight: 700; color: var(--primary-ink); }
.sample-answer p { margin-top: 8px !important; }
.related { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
a.chip { color: var(--ink); text-decoration: none; transition: border-color 0.2s, transform 0.25s var(--ease); }
a.chip:hover { border-color: var(--primary-ink); transform: translateY(-2px); }
.courses-hero { max-width: 760px; }
@media (max-width: 720px) {
  .sample { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .lessons li { grid-template-columns: 3.4rem minmax(0, 1fr) auto; }
  .course-head { align-items: flex-start; }
  .glyph.lg { width: 52px; height: 52px; }
}
/* On a phone a card is too narrow for the name and both lesson-count pills on one line, so the pills move
   under the name and the name gets the card's full width. The glyph stays centred beside both rows. */
@media (max-width: 600px) {
  .course { grid-template-columns: 2rem minmax(0, 1fr); gap: 6px 12px; padding: 12px 14px; }
  .course .glyph, .course .glyph-emoji { grid-row: 1 / span 2; }
  .course .name { line-height: 1.3; text-wrap: pretty; }
  .course .levels { justify-content: flex-start; font-size: 0.8rem; }
  /* A long course name in the related list wraps inside its chip instead of running off the page. */
  .related a.chip { white-space: normal; max-width: 100%; line-height: 1.3; border-radius: 18px; }
}

/* Course search on courses.html. The box is hidden without scripting (course-search.js shows it), so the
   full list always works. Styled like the app's search field: a 2px edge, a search icon and a clear button. */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.course-search { max-width: 520px; margin-bottom: 18px; }
.course-search[hidden], .groups .group[hidden], .courses li[hidden] { display: none; }
.search-box { position: relative; display: flex; align-items: center; }
.search-box .search-icon { position: absolute; inset-inline-start: 15px; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.search-box input { width: 100%; min-height: 52px; margin: 0; padding-block: 11px; padding-inline: 46px 50px; font: inherit; font-weight: 700; color: var(--ink); background: var(--surface); border: 2px solid var(--btn-ghost-lip); border-radius: 14px; -webkit-appearance: none; appearance: none; }
.search-box input::placeholder { color: var(--muted); font-weight: 400; opacity: 1; }
.search-box input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.search-box input:focus-visible { border-color: var(--primary-ink); border-radius: 14px; }
.search-box:focus-within .search-icon { color: var(--primary-ink); }
.search-clear { position: absolute; inset-inline-end: 4px; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; color: var(--muted); background: none; border: 0; border-radius: 10px; cursor: pointer; }
.search-clear[hidden] { display: none; }
.search-clear svg { width: 18px; height: 18px; stroke-width: 2.75; }
.search-clear:hover { color: var(--ink); }
.search-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; margin-top: 8px; min-height: 1.6em; }
.search-status { margin: 0; color: var(--muted); font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.search-status.none { color: var(--ink); font-size: 1rem; font-weight: 700; }
.link-btn { padding: 0; font: inherit; font-weight: 700; color: var(--primary-ink); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .search-box input { transition: border-color 0.2s; }
  .search-clear { transition: color 0.2s; }
}

/* Pain points and fixes (home). Each pain is struck through as it scrolls in, then its fix slides in. */
.pains-hook { position: relative; display: inline-block; margin: 0 0 18px; padding-bottom: 0.18em; font-family: var(--font-display); font-weight: 800; font-size: clamp(2.6rem, 10vw, 4.75rem); line-height: 1.02; letter-spacing: -0.035em; color: var(--plus); text-wrap: balance; }
:is(:lang(ar), :lang(ur), :lang(hi), :lang(zh-Hans)) .pains-hook { letter-spacing: normal; line-height: 1.25; }
.hw { display: inline-block; }
.hook-line { position: absolute; inset-inline: 0; bottom: -0.08em; width: 100%; height: 0.32em; overflow: visible; }
.hook-line path { fill: none; stroke: var(--accent-2); stroke-width: 4; stroke-linecap: round; vector-effect: non-scaling-stroke; }
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .pains-head[data-reveal] { opacity: 1; transform: none; }
  .pains-head .hw { opacity: 0; transform: translateY(0.55em) rotate(-8deg) scale(0.9); }
  .hw[data-i="0"] { --i: 0; } .hw[data-i="1"] { --i: 1; } .hw[data-i="2"] { --i: 2; } .hw[data-i="3"] { --i: 3; } .hw[data-i="4"] { --i: 4; } .hw[data-i="5"] { --i: 5; } .hw[data-i="6"] { --i: 6; } .hw[data-i="7"] { --i: 7; } .hw[data-i="8"] { --i: 8; } .hw[data-i="9"] { --i: 9; } .hw[data-i="10"] { --i: 10; } .hw[data-i="11"] { --i: 11; }
  .pains-head.in .hw { animation: hook-in 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--i) * 0.12s) both; }
  .pains-head.in .hw-last { animation: hook-in 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--i) * 0.12s) both, hook-wiggle 0.9s ease-in-out calc(var(--i) * 0.12s + 1.1s) 2; transform-origin: 50% 80%; }
  .pains-head .hook-line path { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .pains-head.in .hook-line path { transition: stroke-dashoffset 0.8s cubic-bezier(0.65, 0, 0.35, 1) 0.55s; stroke-dashoffset: 0; }
  .pains-head h2 { opacity: 0; transform: translateY(14px); transition: opacity 0.6s, transform 0.6s var(--ease); transition-delay: 0.7s; }
  .pains-head.in h2 { opacity: 1; transform: none; }
}
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  /* On phones each step's screen swings up into place, then its screen glows briefly. */
  .step-shot[data-reveal] { opacity: 0; transform: perspective(900px) translateY(80px) rotateX(18deg) rotate(-4deg) scale(0.86); transform-origin: 50% 100%; transition: opacity 0.6s ease-out, transform 1.05s cubic-bezier(0.34, 1.35, 0.64, 1); }
  .step-shot[data-reveal].in { opacity: 1; transform: none; animation: shot-glow 1.6s ease-out 0.5s; }
  .story-screen { transform: translateY(6%) scale(1.06); }
}
@keyframes shot-glow { 0% { box-shadow: var(--shadow); } 40% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--plus) 35%, transparent), var(--shadow); } 100% { box-shadow: var(--shadow); } }
@keyframes hook-in { from { opacity: 0; transform: translateY(0.55em) rotate(-8deg) scale(0.9); } to { opacity: 1; transform: none; } }
@keyframes hook-wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-9deg) scale(1.06); } 45% { transform: rotate(7deg) scale(1.06); } 70% { transform: rotate(-4deg); } }
.pain-list { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 14px; }
.pain-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 14px; }
.pain, .fix { margin: 0; display: flex; gap: 14px; align-items: center; padding: 18px 20px; border-radius: 16px; line-height: 1.45; }
.pain { background: var(--pain-soft); color: var(--ink); }
.fix { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 700; }
.pain-icon, .fix-icon { flex: none; width: 40px; height: 40px; padding: 9px; border-radius: 12px; }
.pain-icon { color: var(--pain); background: var(--surface); }
.fix-icon { color: var(--primary-ink); background: var(--primary-soft); }
.pain-text { background: linear-gradient(var(--pain), var(--pain)) no-repeat 0 58% / 100% 2px; }
.pain-arrow { display: grid; place-items: center; color: var(--muted); }
.pain-arrow svg { width: 22px; height: 22px; }
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .pain-row[data-reveal] { opacity: 1; transform: none; }
  .pain-row .pain { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
  .pain-row .pain-text { background-size: 0 2px; transition: background-size 0.7s var(--ease) 0.45s; }
  .pain-row .pain-arrow { opacity: 0; transform: translateX(-10px); transition: opacity 0.4s 0.9s, transform 0.5s var(--ease) 0.9s; }
  .pain-row .fix { opacity: 0; transform: translateX(28px) scale(0.97); transition: opacity 0.6s var(--ease) 1s, transform 0.7s var(--ease) 1s; }
  .pain-row.in .pain, .pain-row.in .pain-arrow, .pain-row.in .fix { opacity: 1; transform: none; }
  .pain-row.in .pain-text { background-size: 100% 2px; }
  .pain-row.in .pain { opacity: 0.85; }
}
@media (max-width: 720px) {
  .pain-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .pain-arrow { transform: rotate(90deg); }
  .pain-row.in .pain-arrow { transform: rotate(90deg); }
}
@media (max-width: 720px) and (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .pain-row .pain-arrow { transform: rotate(90deg) translateX(-10px); }
  .pain-row .fix { transform: translateY(18px) scale(0.97); }
}

/* Forty5 vs a private tutor (home and pricing). */
.vs { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 32px; }
.vs h2 { max-width: 24ch; }
.vs-bars { display: grid; gap: 16px; margin: 22px 0 8px; }
.vs-bar { display: grid; grid-template-columns: 11rem minmax(0, 1fr) 7.5rem; align-items: center; gap: 16px; font-variant-numeric: tabular-nums; }
.vs-label, .vs-total { display: grid; line-height: 1.25; font-weight: 700; }
.vs-label small, .vs-total small { font-weight: 400; color: var(--muted); font-size: 0.8rem; font-family: inherit; }
.vs-total { text-align: end; font-weight: 800; font-family: var(--font-display); font-size: 1.25rem; }
.vs-bar.tutor .cost-fill { fill: var(--pain); opacity: 0.55; }
.vs-bar.plus .cost-fill { fill: var(--plus); }
.vs-bar.plus .vs-total { color: var(--plus); }
.vs-big { margin: 18px 0 22px; font-size: 1.1rem; }
.vs-big b { font-family: var(--font-display); font-size: 2.6rem; line-height: 1; color: var(--plus); margin-inline-end: 6px; vertical-align: -0.12em; }
.table-scroll { overflow-x: auto; }
.vs-table { width: 100%; border-collapse: collapse; min-width: 30rem; }
.vs-table th, .vs-table td { text-align: start; padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.vs-table thead th, .vs-table thead td { border-top: 0; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.vs-table tbody th { font-weight: 700; width: 26%; }
.vs-table td:nth-child(2) { color: var(--muted); }
.vs-table td:nth-child(3) { font-weight: 700; background: var(--plus-soft); }
.vs-table thead th:nth-child(3) { color: var(--plus); background: var(--plus-soft); border-radius: 12px 12px 0 0; }
.vs-table tbody tr:last-child td:nth-child(3) { border-radius: 0 0 12px 12px; }
.vs-note { margin: 22px 0 0; max-width: 62ch; }
.vs-source { margin: 10px 0 0; color: var(--muted); font-size: 0.8rem; }
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .vs .cost-fill { transform: scaleX(0); transition: transform 1.3s var(--ease); }
  .vs.in .cost-fill { transform: none; }
  .vs.in .plus .cost-fill { transition-delay: 0.5s; }
  .vs .vs-big b { display: inline-block; transform: scale(0.4); opacity: 0; transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 1.1s, opacity 0.3s 1.1s; }
  .vs.in .vs-big b { transform: none; opacity: 1; }
}
@media (max-width: 720px) {
  .vs { padding: 22px; }
  .vs-bar { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .vs-bar .cost-bar { grid-column: 1 / -1; grid-row: 2; height: 18px; }
}

/* Languages (home). */
.langs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 36px; align-items: center; }
.lang-chips { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lang-chips li { padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; }
.lang-fine { margin: 16px 0 0; color: var(--muted); font-size: 0.9rem; max-width: 52ch; }
.lang-points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.lang-points .tile h3 { margin-top: 0; }
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .langs-head.in .lang-chips li { animation: chip-pop 0.5s var(--ease) both; }
  .langs-head.in .lang-chips li:nth-child(2) { animation-delay: 0.06s; }
  .langs-head.in .lang-chips li:nth-child(3) { animation-delay: 0.12s; }
  .langs-head.in .lang-chips li:nth-child(4) { animation-delay: 0.18s; }
  .langs-head.in .lang-chips li:nth-child(5) { animation-delay: 0.24s; }
  .langs-head.in .lang-chips li:nth-child(6) { animation-delay: 0.3s; }
  .langs-head.in .lang-chips li:nth-child(7) { animation-delay: 0.36s; }
  .langs-head.in .lang-chips li:nth-child(8) { animation-delay: 0.42s; }
  .langs-head.in .lang-chips li:nth-child(9) { animation-delay: 0.48s; }
  .lang-points > [data-reveal]:nth-child(2) { transition-delay: 0.1s; }
  .lang-points > [data-reveal]:nth-child(3) { transition-delay: 0.2s; }
  .lang-points > [data-reveal]:nth-child(4) { transition-delay: 0.3s; }
}
@keyframes chip-pop { from { opacity: 0; transform: translateY(10px) scale(0.85); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) { .langs { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .lang-points { grid-template-columns: minmax(0, 1fr); } }

/* Language menu in the header. */
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 0.85rem; cursor: pointer; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary svg { width: 18px; height: 18px; color: var(--muted); }
.lang-menu summary:hover, .lang-menu[open] summary { border-color: var(--primary-ink); }
.lang-menu ul { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 10; list-style: none; margin: 0; padding: 6px; min-width: 11rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); display: grid; gap: 2px; }
.lang-menu a { display: block; padding: 8px 12px; border-radius: 9px; color: var(--ink); text-decoration: none; font-weight: 700; text-align: start; }
.lang-menu a:hover { background: var(--primary-soft); }
.lang-menu a[aria-current] { color: var(--primary-ink); background: var(--primary-soft); }
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .lang-menu[open] ul { animation: menu-in 0.22s var(--ease); }
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: none; } }

/* Right-to-left pages (Arabic, Urdu): arrows and bars follow the reading direction. Subject names stay
   English, so the marquee keeps running left to right. */
[dir="rtl"] .arrow { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] .pain-arrow svg { transform: scaleX(-1); }
[dir="rtl"] .cost-bar { transform: scaleX(-1); }
[dir="rtl"] .scroll-progress { transform-origin: right; }
[dir="rtl"] .marquee { direction: ltr; }
@media (max-width: 720px) { [dir="rtl"] .pain-arrow svg { transform: none; } }
@media (min-width: 721px) and (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  [dir="rtl"] .pain-row .fix { transform: translateX(-28px) scale(0.97); }
  [dir="rtl"] .pain-row.in .fix { transform: none; }
}

/* Letter-spacing breaks the joined letters of Arabic and Urdu and the conjuncts of Hindi, and uppercase
   does nothing in those scripts or in Chinese, so headings and labels set them back to normal there. */
:lang(ar), :lang(ur), :lang(hi), :lang(zh-Hans) { letter-spacing: normal; }
:is(:lang(ar), :lang(ur), :lang(hi), :lang(zh-Hans)) :is(.eyebrow, h1, h2, h3, .btn, .group h3, .tally-label b, .step-num, table.compare th, .vs-table thead th, .story-step h3) { letter-spacing: normal; }
:lang(ar), :lang(ur) { line-height: 1.75; }
:is(:lang(ar), :lang(ur)) :is(h1, h2, h3) { line-height: 1.4; }
:is(:lang(ar), :lang(ur), :lang(hi), :lang(zh-Hans)) .headline { line-height: 1.25; }
@media (max-width: 860px) { .lang-menu { margin-inline-start: auto; } }

/* Neither Atkinson Hyperlegible nor Bricolage Grotesque has Cyrillic. Rather than set the Russian words in a
   system font and the digits and Latin terms (SL, HL, IB) between them in ours, Russian pages use the
   system font throughout: SF Pro, Segoe UI, Roboto and Noto Sans all have Cyrillic. The logo keeps its font. */
:root:lang(ru) {
  --font-display: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-text: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}

/* Trust tiles sit as compact rows on phones: icon beside the text. */
@media (max-width: 600px) {
  .trust .tile { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; padding: 16px; }
  .trust .tile-icon { grid-row: span 2; margin-bottom: 0; }
  .trust .tile h3 { margin: 2px 0 4px; }
}
