/* ==========================================================================
   10 Minutes AI — Design System
   Concept: "The Dial". Every lesson is a full turn of 10 minutes.
   The mark is 10 minutes of an hour: a 60° arc ending in a spark.
   ========================================================================== */

:root {
  /* Core brand */
  --navy: #101D32;
  --mint: #63E2C4;
  --white: #FFFFFF;

  /* Extended navy scale (derived, same hue) */
  --ink: #0A1322;          /* deepest ground */
  --navy-2: #14243D;       /* raised surface */
  --navy-3: #1B2E4C;       /* hover surface */
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);

  /* Text */
  --text: #F4F7FB;
  --text-2: #A9B6CB;       /* 8.4:1 on navy */
  --text-3: #73839D;       /* labels only */

  /* Mint scale */
  --mint-soft: rgba(99, 226, 196, .12);
  --mint-line: rgba(99, 226, 196, .35);
  --mint-deep: #2FB394;

  /* Track accents — used only to code Explore / Learn / Build */
  --explore: #63E2C4;
  --learn: #9DB8FF;
  --build: #FFC285;

  /* Type */
  --font-sans: "Instrument Sans", "Readex Pro", system-ui, sans-serif;
  --font-display: "Instrument Sans", "Readex Pro", system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Rhythm */
  --gutter: clamp(20px, 4vw, 56px);
  --maxw: 1280px;
  --radius: 18px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2, .7, .1, 1);

  color-scheme: dark;
}

:root[lang="ar"] {
  --font-sans: "Readex Pro", "Instrument Sans", system-ui, sans-serif;
  --font-display: "Readex Pro", system-ui, sans-serif;
  /* JetBrains Mono has no Arabic glyphs; without Readex Pro in the stack the browser falls back to a
     system monospace face that draws Arabic letters disconnected. Latin and digits stay in the mono face. */
  --font-mono: "JetBrains Mono", "Readex Pro", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
:root[lang="ar"] body { line-height: 1.8; }

img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--mint); color: var(--navy); }

/* Film grain: barely there, keeps large navy fields from looking flat */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.hero .wrap > *, .build-grid > *, .creator-grid > *, .section-head > *, .bb-cols > * { min-width: 0; }
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Type primitives ---------- */
.mono { font-family: var(--font-mono); font-feature-settings: "zero" 1; letter-spacing: 0; }
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-3); display: inline-flex; align-items: center; gap: 10px;
}
:root[lang="ar"] .eyebrow { letter-spacing: 0; font-family: var(--font-sans); font-size: 13px; }
.eyebrow .ts { color: var(--mint); font-family: var(--font-mono); letter-spacing: 0; }
.eyebrow .bar { width: 28px; height: 1px; background: var(--line-strong); }

.display {
  font-family: var(--font-display); font-weight: 600; letter-spacing: -.035em; line-height: .95; margin: 0;
}
:root[lang="ar"] .display { letter-spacing: 0; line-height: 1.2; font-weight: 600; }
.display em, .h2 em {
  font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -.02em; color: var(--mint);
}
:root[lang="ar"] .display em, :root[lang="ar"] .h2 em {
  font-family: var(--font-display); font-style: normal; font-weight: 300; letter-spacing: 0;
}
.h2 {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(34px, 5vw, 64px);
  letter-spacing: -.03em; line-height: 1.02; margin: 18px 0 0;
}
:root[lang="ar"] .h2 { letter-spacing: 0; line-height: 1.3; text-wrap: pretty; }
/* Arabic is cursive: any tracking breaks the letter joins. Zero it on every tracked Arabic heading. */
:root[lang="ar"] .sheet a, :root[lang="ar"] .dial-core .title, :root[lang="ar"] .tl-detail h3,
:root[lang="ar"] .ep h3, :root[lang="ar"] .quote { letter-spacing: 0; }
.lede em { font-family: var(--font-serif); font-size: 1.1em; color: var(--text); }
:root[lang="ar"] .lede em { font-family: inherit; font-size: 1em; font-style: normal; color: var(--mint); }
.lede { color: var(--text-2); font-size: clamp(17px, 1.6vw, 20px); max-width: 56ch; margin: 22px 0 0; }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--mint); --fg: var(--navy);
  display: inline-flex; align-items: center; gap: 10px; height: 52px; padding-inline: 24px;
  border-radius: 999px; background: var(--bg); color: var(--fg); font-weight: 600; font-size: 16px;
  transition: transform .4s var(--ease), background .3s, box-shadow .4s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -12px rgba(99, 226, 196, .55); }
.btn svg { width: 18px; height: 18px; transition: transform .4s var(--ease); }
.btn:hover svg.arrow { transform: translateX(3px); }
[dir="rtl"] .btn svg.arrow { transform: scaleX(-1); }
[dir="rtl"] .btn:hover svg.arrow { transform: scaleX(-1) translateX(3px); }
.btn--ghost { --bg: transparent; --fg: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1px var(--mint-line); background: var(--mint-soft); }
.btn--sm { height: 40px; padding-inline: 18px; font-size: 14px; }

/* ---------- Brand mark ---------- */
.logo { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; }
.logo svg { width: 34px; height: 34px; flex: none; }
.wordmark { font-family: "Instrument Sans", sans-serif; font-size: 18px; letter-spacing: -.02em; line-height: 1; direction: ltr; }
.wordmark b { font-family: var(--font-mono); font-weight: 700; letter-spacing: -.04em; }
.wordmark i { font-style: normal; color: var(--mint); }
.mark-ring { stroke: currentColor; opacity: .22; }
.mark-arc { stroke: var(--mint); }
.mark-dot { fill: var(--mint); }

/* ---------- Header ---------- */
.header {
  position: fixed; inset-inline: 0; top: 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  transition: background .4s, border-color .4s, backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.header.is-scrolled { background: rgba(10, 19, 34, .78); backdrop-filter: blur(14px) saturate(140%); border-color: var(--line); }
.header .wrap { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 24px; }
.nav { display: flex; gap: 4px; }
.nav a {
  font-size: 15px; color: var(--text-2); padding: 8px 14px; border-radius: 999px; transition: color .3s, background .3s;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang {
  display: inline-flex; padding: 4px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-strong); font-size: 13px;
}
.lang button { padding: 6px 12px; border-radius: 999px; color: var(--text-3); transition: .3s; }
.lang button[aria-pressed="true"] { background: var(--white); color: var(--navy); font-weight: 600; }
.lang button:not([aria-pressed="true"]):hover { color: var(--text); }
.lang [data-lang="ar"] { font-family: "Readex Pro", sans-serif; }
.menu-btn { display: none; width: 44px; height: 44px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-strong); place-items: center; }
.menu-btn span { display: block; width: 16px; height: 1.5px; background: currentColor; position: relative; transition: .3s; }
.menu-btn span::before, .menu-btn span::after { content: ""; position: absolute; inset-inline: 0; height: 1.5px; background: currentColor; transition: .3s var(--ease); }
.menu-btn span::before { top: -5px; } .menu-btn span::after { top: 5px; }
.menu-open .menu-btn span { background: transparent; }
.menu-open .menu-btn span::before { top: 0; transform: rotate(45deg); }
.menu-open .menu-btn span::after { top: 0; transform: rotate(-45deg); }

.sheet {
  position: fixed; inset: 0; z-index: 40; background: var(--ink); padding: 110px var(--gutter) 40px;
  display: flex; flex-direction: column; gap: 6px; opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s;
}
.menu-open .sheet { opacity: 1; visibility: visible; }
.sheet a { font-size: 34px; font-weight: 600; letter-spacing: -.02em; padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; }
.sheet a .mono { font-size: 13px; color: var(--mint); font-weight: 400; }
.sheet .btn { margin-top: 28px; justify-content: center; }

.nav a, .wordmark { white-space: nowrap; }
/* "About the Creator" / "المسارات التعليمية" are longer labels: tighten the bar just above the menu breakpoint so it never overflows. */
@media (min-width: 1101px) and (max-width: 1240px) {
  .header .wrap { gap: 14px; }
  .nav { gap: 0; }
  .nav a { padding: 8px 9px; }
  .header-actions { gap: 8px; }
}
@media (max-width: 1100px) {
  .nav, .header-actions .btn { display: none; }
  .menu-btn { display: grid; }
}

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; padding-top: 140px; padding-bottom: 80px; display: flex; align-items: center; overflow: hidden; }
.hero::before {
  /* single, purposeful light source behind the dial */
  content: ""; position: absolute; width: 900px; height: 900px; inset-inline-end: -220px; top: 50%; transform: translateY(-50%);
  background: radial-gradient(closest-side, rgba(99, 226, 196, .10), rgba(99, 226, 196, 0) 70%); pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1.2px); background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 30% 50%, #000 0%, transparent 75%);
          mask-image: radial-gradient(ellipse 60% 70% at 30% 50%, #000 0%, transparent 75%);
}
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 40px; }
.hero h1 { font-size: clamp(56px, 9.2vw, 136px); margin-top: 28px; }
.hero h1 .line { display: block; }
:root[lang="ar"] .hero h1 { font-size: clamp(48px, 7.2vw, 108px); }
.hero .lede { margin-top: 30px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); max-width: 560px; }
.hero-meta div { display: flex; flex-direction: column; gap: 2px; }
.hero-meta .mono { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; }
:root[lang="ar"] .hero-meta .mono { text-transform: none; letter-spacing: 0; font-family: var(--font-sans); }
.hero-meta strong { font-weight: 500; font-size: 15px; }

.philosophy { display: inline-flex; align-items: center; gap: 0; font-family: var(--font-mono); font-size: 13px; }
.philosophy span { padding: 7px 14px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text-2); }
.philosophy span + span { margin-inline-start: -1px; }
.philosophy i { width: 18px; height: 1px; background: var(--line-strong); }
.philosophy span:nth-of-type(1) { color: var(--explore); }
.philosophy span:nth-of-type(2) { color: var(--learn); }
.philosophy span:nth-of-type(3) { color: var(--build); }
:root[lang="ar"] .philosophy { font-family: var(--font-sans); }

/* Dial */
.dial { position: relative; width: 100%; max-width: 560px; aspect-ratio: 1; margin-inline: auto; }
.dial svg { width: 100%; height: 100%; overflow: visible; }
.dial .tick { stroke: rgba(255, 255, 255, .16); stroke-width: 2; stroke-linecap: round; transition: stroke .5s; }
.dial .tick.major { stroke: rgba(255, 255, 255, .32); stroke-width: 2.4; }
.dial .tick.on { stroke: var(--mint); }
.dial .num { fill: var(--text-3); font-family: var(--font-mono); font-size: 13px; text-anchor: middle; dominant-baseline: middle; }
.dial .seg { fill: none; stroke-width: 6; stroke-linecap: butt; opacity: .9; }
.dial .seg-track { fill: none; stroke: var(--line); stroke-width: 6; }
.dial .hand { stroke: var(--white); stroke-width: 2; stroke-linecap: round; }
.dial .hand-dot { fill: var(--mint); }
.dial .hub { fill: var(--ink); stroke: var(--line-strong); }
.dial-core {
  position: absolute; inset: 27%; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 8px; padding: 6%;
}
.dial-core .now { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; color: var(--mint); text-transform: uppercase; display: flex; gap: 8px; align-items: center; }
:root[lang="ar"] .dial-core .now { font-family: var(--font-sans); letter-spacing: 0; text-transform: none; font-size: 12px; }
.dial-core .now::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.dial-core .title { font-size: clamp(17px, 2vw, 24px); font-weight: 600; line-height: 1.2; letter-spacing: -.015em; transition: opacity .5s, transform .5s var(--ease); }
.dial-core .title.swap { opacity: 0; transform: translateY(8px); }
.dial-core .clock, .tl-seg .mono, .stage .step, .ep-d { direction: ltr; unicode-bidi: isolate; }
.dial-core .clock { font-family: var(--font-mono); font-size: 14px; color: var(--text-2); }
.dial-core .clock b { color: var(--text); font-weight: 500; }
.dial-chapter { font-size: 13px; color: var(--text-3); min-height: 1.6em; }

.dial-caption { position: absolute; inset-inline-start: 0; bottom: -10px; font-size: 12px; color: var(--text-3); font-family: var(--font-mono); }

@media (max-width: 960px) {
  .hero { padding-top: 120px; min-height: auto; }
  .hero .wrap { grid-template-columns: 1fr; }
  .hero .dial { max-width: 440px; order: 2; margin-top: 20px; }
  .hero::before { inset-inline-end: -50%; top: 70%; }
}

/* ---------- Sections ---------- */
section { position: relative; }
.section { padding-block: clamp(96px, 14vw, 180px); }
.section-head { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; margin-bottom: clamp(48px, 7vw, 88px); }
.section-head .lede { margin: 0; justify-self: end; }
@media (max-width: 860px) { .section-head { grid-template-columns: 1fr; } .section-head .lede { justify-self: start; } }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- Anatomy (the format) ---------- */
.anatomy { background: var(--navy); border-block: 1px solid var(--line); }
.timeline { position: relative; }
.tl-scale { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 12px; color: var(--text-3); margin-bottom: 14px; direction: ltr; }
[dir="rtl"] .tl-scale { direction: rtl; }
.tl-bar { display: flex; gap: 6px; height: 88px; }
.tl-seg {
  position: relative; flex: var(--w); border-radius: 12px; background: var(--navy-2); box-shadow: inset 0 0 0 1px var(--line);
  text-align: start; padding: 14px 16px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
  transition: background .4s, box-shadow .4s, flex .6s var(--ease);
}
.tl-seg::before { content: ""; position: absolute; inset-block-start: 0; inset-inline: 0; height: 3px; background: var(--c); opacity: .5; transition: opacity .4s; }
.tl-seg .mono { font-size: 11px; color: var(--text-3); }
.tl-seg strong { font-size: 15px; font-weight: 600; white-space: nowrap; }
.tl-seg[aria-selected="true"] { background: var(--navy-3); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent); }
.tl-seg[aria-selected="true"]::before { opacity: 1; }
.tl-seg:hover:not([aria-selected="true"]) { background: #172A47; }

.tl-detail { display: grid; grid-template-columns: 220px 1fr 1fr; gap: 40px; margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--line); min-height: 220px; }
.tl-detail .big { font-family: var(--font-mono); font-size: clamp(44px, 6vw, 72px); line-height: 1; letter-spacing: -.04em; color: var(--c, var(--mint)); direction: ltr; text-align: start; }
.tl-detail h3 { font-size: 28px; margin: 0 0 12px; letter-spacing: -.02em; font-weight: 600; }
.tl-detail p { color: var(--text-2); margin: 0; }
.tl-example { background: var(--ink); border-radius: var(--radius); padding: 22px 24px; box-shadow: inset 0 0 0 1px var(--line); }
.tl-example .eyebrow { margin-bottom: 10px; }
.tl-example p { color: var(--text); font-size: 16px; }
.tl-anim { animation: rise .6s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 860px) {
  .tl-bar { height: auto; flex-direction: column; }
  .tl-seg { flex: none; flex-direction: row; align-items: center; height: 56px; }
  .tl-seg::before { inset-block: 0; inset-inline-end: auto; width: 3px; height: auto; }
  .tl-scale { display: none; }
  .tl-detail { grid-template-columns: 1fr; gap: 20px; }
}

/* ---------- Paths (Explore. Learn. Build.) ---------- */
.who { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.who button {
  height: 44px; padding-inline: 18px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--text-2); font-size: 15px; transition: .3s var(--ease); display: inline-flex; align-items: center; gap: 8px;
}
.who button:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--mint-line); }
.who button[aria-selected="true"] { background: var(--white); color: var(--navy); box-shadow: none; font-weight: 600; }
.who-q { font-size: 15px; color: var(--text-3); margin-bottom: 16px; }

.route { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-radius: 24px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.stage { position: relative; padding: clamp(28px, 3.5vw, 44px); min-height: 400px; display: flex; flex-direction: column; background: var(--navy); transition: background .4s; }
.stage + .stage { border-inline-start: 1px solid var(--line); }
.stage:hover { background: var(--navy-2); }
.stage-top { display: flex; justify-content: space-between; align-items: center; }
.stage-glyph { width: 56px; height: 56px; }
.stage-glyph svg { width: 100%; height: 100%; }
.stage .step { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.stage h3 { font-size: clamp(36px, 4vw, 52px); margin: auto 0 0; padding-top: 48px; letter-spacing: -.035em; font-weight: 600; color: var(--c); line-height: 1; }
:root[lang="ar"] .stage h3 { letter-spacing: 0; line-height: 1.3; }
.stage .desc { color: var(--text-2); margin: 12px 0 24px; font-size: 16px; }
.stage ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.stage li { display: flex; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.route.swap li { animation: rise .5s var(--ease) both; }
.route.swap .stage:nth-child(2) li { animation-delay: .06s; }
.route.swap .stage:nth-child(3) li { animation-delay: .12s; }
@media (max-width: 960px) {
  .route { grid-template-columns: 1fr; }
  .stage + .stage { border-inline-start: 0; border-top: 1px solid var(--line); }
  .stage { min-height: 0; }
  .stage h3 { padding-top: 32px; }
}

/* ---------- Library ---------- */
.library { background: linear-gradient(var(--ink), var(--navy) 30%, var(--navy)); }
.lib-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 28px; }
.tabs { display: inline-flex; padding: 4px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-strong); flex-wrap: wrap; }
.tabs button { padding: 9px 16px; border-radius: 999px; font-size: 14px; color: var(--text-2); display: inline-flex; gap: 8px; align-items: center; transition: .3s; }
.tabs button i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--text-3)); }
.tabs button[aria-selected="true"] { background: var(--navy-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.sample-note { font-size: 13px; color: var(--text-3); display: inline-flex; gap: 8px; align-items: center; }
.sample-note::before { content: ""; width: 6px; height: 6px; border-radius: 2px; border: 1px solid var(--text-3); }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; } }

.ep {
  position: relative; border-radius: var(--radius); background: var(--navy-2); box-shadow: inset 0 0 0 1px var(--line);
  display: flex; flex-direction: column; overflow: hidden; transition: transform .5s var(--ease), box-shadow .4s, background .4s;
  animation: rise .6s var(--ease) both;
}
.ep:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent); background: var(--navy-3); }
.ep-thumb { position: relative; aspect-ratio: 16 / 10; background: var(--ink); overflow: hidden; display: grid; place-items: center; }
.ep-thumb svg { width: 62%; height: auto; transition: transform .8s var(--ease); }
.ep:hover .ep-thumb svg { transform: rotate(-8deg) scale(1.04); }
.ep-thumb .ep-n { position: absolute; top: 14px; inset-inline-start: 16px; font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.ep-thumb .ep-d { position: absolute; bottom: 12px; inset-inline-end: 12px; font-family: var(--font-mono); font-size: 12px; background: rgba(10,19,34,.85); padding: 3px 8px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line); }
.ep-thumb .ep-play {
  position: absolute; width: 52px; height: 52px; border-radius: 50%; background: var(--white); color: var(--navy); display: grid; place-items: center;
  opacity: 0; transform: scale(.85); transition: .4s var(--ease);
}
.ep:hover .ep-play, .ep:focus-visible .ep-play { opacity: 1; transform: scale(1); }
.ep-play svg { width: 18px !important; height: 18px; margin-inline-start: 3px; transform: none !important; }
.ep-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ep-tag { font-size: 12px; font-family: var(--font-mono); color: var(--c); display: flex; justify-content: space-between; text-transform: uppercase; letter-spacing: .08em; }
:root[lang="ar"] .ep-tag { font-family: var(--font-sans); letter-spacing: 0; text-transform: none; }
.ep-tag .lvl { display: inline-flex; gap: 3px; align-items: center; }
.ep-tag .lvl i { width: 12px; height: 3px; border-radius: 2px; background: var(--line-strong); }
.ep-tag .lvl i.on { background: var(--c); }
.ep h3 { font-size: 18px; margin: 0; line-height: 1.3; letter-spacing: -.01em; font-weight: 600; }
@media (max-width: 520px) {
  .ep { flex-direction: row; }
  .ep-thumb { aspect-ratio: auto; width: 112px; flex: none; }
  .ep-thumb svg { width: 84%; }
  .ep-thumb .ep-n { display: none; }
  .ep-thumb .ep-d { inset-inline-end: 50%; transform: translateX(50%); bottom: 8px; font-size: 11px; }
  [dir="rtl"] .ep-thumb .ep-d { transform: translateX(-50%); }
  .ep-play { display: none !important; }
  .ep-body { padding: 14px 16px; }
  .ep h3 { font-size: 16px; }
}
.ep .alt { font-size: 14px; color: var(--text-3); margin: 0; }
.ep .alt[lang="ar"] { font-family: "Readex Pro", sans-serif; }
.ep .alt[lang="en"] { font-family: "Instrument Sans", sans-serif; }

/* CMS-backed library: series line, real thumbnails, deep-link target, and the
   loading / empty / error states (same card shapes and tokens as above). */
.ep .ep-series { margin: 0; font-size: 12px; color: var(--text-3); font-family: var(--font-mono); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root[lang="ar"] .ep .ep-series { font-family: var(--font-sans); letter-spacing: 0; }
.ep-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ep.is-target { box-shadow: inset 0 0 0 2px var(--c); }
.lib-state.is-loading { display: contents; }
.ep-skel { pointer-events: none; animation: none; }
.ep-skel .ep-thumb { background: linear-gradient(100deg, var(--ink) 30%, var(--navy-3) 50%, var(--ink) 70%); background-size: 300% 100%; animation: skel 1.4s linear infinite; }
.ep-skel .ep-body i { display: block; height: 12px; border-radius: 6px; background: var(--line); }
.ep-skel .ep-body i + i { width: 60%; }
@keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .ep-skel .ep-thumb { animation: none; } }
.lib-msg { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 28px; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); background: var(--navy-2); }
.lib-msg p { margin: 0; color: var(--text-2); font-size: 16px; }
.series-chip { display: inline-flex; align-items: center; gap: 10px; padding: 7px 12px; border: 0; border-radius: 999px; background: var(--navy-3); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line-strong); }
.series-chip b { font-weight: 500; color: var(--text-3); }
.series-chip:hover b { color: var(--text); }
/* Editor preview only (/preview/…): a floating note that stays clear of the fixed header. */
.preview-bar { position: fixed; z-index: 60; inset-inline-start: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); max-width: min(520px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; border-radius: 14px; background: #F5C451; color: #0A1322; font-size: 14px; line-height: 1.4; box-shadow: 0 20px 40px -20px rgba(0,0,0,.7); }
.preview-bar ul { margin: 0; padding-inline-start: 18px; }
@media (max-width: 520px) { .preview-bar { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } }

/* ---------- Build (code) ---------- */
.build-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
@media (max-width: 960px) { .build-grid { grid-template-columns: 1fr; } }
.build-list { list-style: none; padding: 0; margin: 36px 0 0; display: grid; gap: 0; }
.build-list li { display: grid; grid-template-columns: 70px 1fr; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.build-list li:last-child { border-bottom: 1px solid var(--line); }
.build-list .mono { color: var(--build); font-size: 13px; padding-top: 3px; }
.build-list strong { display: block; font-weight: 600; }
.build-list span { color: var(--text-2); font-size: 15px; }

.editor { border-radius: 20px; background: #0C1729; box-shadow: inset 0 0 0 1px var(--line), 0 40px 80px -40px rgba(0,0,0,.6); overflow: hidden; direction: ltr; text-align: left; }
.editor-top { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.editor-top .dots { display: flex; gap: 6px; }
.editor-top .dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.editor-top .file { color: var(--text-2); }
.editor-top .rec { margin-left: auto; color: var(--build); display: flex; align-items: center; gap: 6px; }
.editor-top .rec::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--build); animation: blink 1.6s infinite; }
.code { margin: 0; padding: 20px 0; font-family: var(--font-mono); font-size: 14px; line-height: 1.85; overflow-x: auto; counter-reset: l; }
.code .ln { display: grid; grid-template-columns: 76px 1fr; padding-right: 20px; opacity: 0; transform: translateX(-6px); transition: opacity .4s, transform .4s var(--ease); }
.code .ln.in { opacity: 1; transform: none; }
.code .ln .t { color: #4D5E7A; text-align: right; padding-right: 22px; user-select: none; }
.code .ln.hl { background: rgba(255, 194, 133, .06); box-shadow: inset 2px 0 0 var(--build); }
.code .ln.hl .t { color: var(--build); }
.tk-k { color: #C9A7FF; } .tk-f { color: var(--mint); } .tk-s { color: #FFC285; } .tk-c { color: #5E7090; font-style: italic; } .tk-v { color: #9DB8FF; }
.code .ar { font-family: "Readex Pro", sans-serif; }
.editor-foot { display: flex; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.editor-foot .prog { flex: 1; max-width: 220px; height: 3px; background: var(--line); border-radius: 3px; align-self: center; overflow: hidden; }
.editor-foot .prog i { display: block; height: 100%; width: 72%; background: var(--build); }

/* ---------- Creator ---------- */
.creator { background: var(--navy); border-block: 1px solid var(--line); overflow: hidden; }
.creator-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(40px, 7vw, 110px); align-items: center; }
@media (max-width: 960px) { .creator-grid { grid-template-columns: 1fr; } }
.portrait { position: relative; width: min(100%, 460px); aspect-ratio: 1; margin-inline: auto; }
.portrait svg.ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.portrait .ph {
  position: absolute; inset: 11%; border-radius: 50%; overflow: hidden; background: var(--navy-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait .mono-fallback { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.portrait .mono-fallback div { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); line-height: 1.6; padding: 20px; }
.portrait .mono-fallback b { display: block; font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: 88px; color: var(--mint); line-height: 1; margin-bottom: 10px; }
.portrait .badge {
  position: absolute; bottom: 8%; inset-inline-end: 0; background: var(--white); color: var(--navy); border-radius: 999px; padding: 10px 16px 10px 12px;
  font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; box-shadow: 0 20px 40px -20px rgba(0,0,0,.6);
}
.portrait .badge svg { width: 20px; height: 20px; }

.quote { font-family: var(--font-serif); font-style: italic; font-size: clamp(30px, 3.6vw, 46px); line-height: 1.15; letter-spacing: -.01em; margin: 24px 0 0; }
:root[lang="ar"] .quote { font-family: var(--font-display); font-style: normal; font-weight: 400; line-height: 1.5; font-size: clamp(26px, 3vw, 38px); }
.quote mark { background: none; color: var(--mint); }
.principles { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.principles li { padding: 18px 0; border-top: 1px solid var(--line); display: flex; gap: 14px; }
.principles .mono { font-size: 12px; color: var(--mint); padding-top: 4px; }
.principles strong { display: block; font-weight: 600; font-size: 16px; }
.principles span { font-size: 15px; color: var(--text-2); }
@media (max-width: 560px) { .principles { grid-template-columns: 1fr; } }

/* ---------- Ask 10AI (interactive product demo) ---------- */
.ask { overflow: hidden; }
.ask::before {
  /* single light source under the product window, same treatment as the hero */
  content: ""; position: absolute; width: 1100px; height: 900px; inset-inline-end: -160px; top: 62%; transform: translateY(-50%);
  background: radial-gradient(closest-side, rgba(99, 226, 196, .09), rgba(99, 226, 196, 0) 70%); pointer-events: none;
}
.ask .wrap { position: relative; }

/* Layout: questions top-left, CTA bottom-left, product window spanning both rows */
.ask-grid {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); grid-template-rows: auto 1fr;
  grid-template-areas: "side app" "cta app"; column-gap: clamp(32px, 4vw, 56px); row-gap: 20px;
}
.ask-side { grid-area: side; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
/* Desktop: the window matches the left column's height exactly, and its own content never
   resizes the grid (contain: size) — so nothing on the page moves while answers stream. */
.ask-app { grid-area: app; min-width: 0; contain: size; min-height: 640px; }
.ask-cta { grid-area: cta; align-self: end; min-width: 0; }

.ask-side-h { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
:root[lang="ar"] .ask-side-h { font-family: var(--font-sans); font-size: 13px; letter-spacing: 0; text-transform: none; }
.ask-count { font-family: var(--font-mono); letter-spacing: 0; direction: ltr; unicode-bidi: isolate; }
.ask-qs-list { display: grid; gap: 8px; }
.ask-q {
  position: relative; display: grid; grid-template-columns: 26px 1fr; gap: 10px; text-align: start; padding: 14px 16px 16px; border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; transition: background .4s, box-shadow .4s;
}
.ask-q:hover { background: rgba(255, 255, 255, .03); }
.ask-q[aria-pressed="true"] { background: var(--navy-2); box-shadow: inset 0 0 0 1px var(--mint-line); }
.ask-q-n { font-size: 12px; color: var(--text-3); padding-top: 3px; }
.ask-q[aria-pressed="true"] .ask-q-n { color: var(--mint); }
.ask-q-tx strong { display: block; font-weight: 600; font-size: 15.5px; line-height: 1.35; }
.ask-q-tx span { display: block; font-size: 13px; color: var(--text-3); margin-top: 4px; }
.ask-q-bar { position: absolute; inset-inline: 0; bottom: 0; height: 2px; }
.ask-q-bar i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--mint); }
.ask-pause { align-self: flex-start; gap: 8px; }
.ask-pause svg { width: 14px; height: 14px; }

/* CTA card — honest: the live assistant is not open yet */
.ask-cta { display: flex; flex-direction: column; gap: 14px; padding: 22px 22px 18px; border-radius: 20px; background: var(--navy-2); box-shadow: inset 0 0 0 1px var(--line); }
.ask-cta-tag { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-strong); font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
:root[lang="ar"] .ask-cta-tag { font-family: var(--font-sans); font-size: 12px; letter-spacing: 0; text-transform: none; }
.ask-cta-tag i { width: 7px; height: 7px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--text-3); }
.ask-cta h3 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.015em; line-height: 1.25; }
:root[lang="ar"] .ask-cta h3 { letter-spacing: 0; line-height: 1.45; }
.ask-cta-tx p { margin: 6px 0 0; font-size: 14.5px; color: var(--text-2); }
.ask-cta-act { display: flex; flex-direction: column; gap: 8px; }
.ask-cta-act .btn { justify-content: center; }
.ask-note { margin: 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-3); }

/* The product window */
.ask-app {
  display: flex; flex-direction: column; border-radius: 24px; background: var(--navy); overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 60px 120px -60px rgba(0, 0, 0, .85);
}
.ask-bar { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.ask-avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--ink); box-shadow: inset 0 0 0 1px var(--line); display: grid; place-items: center; color: var(--white); }
.ask-avatar svg { width: 66%; height: 66%; }
.ask-id { display: flex; flex-direction: column; line-height: 1.25; }
.ask-id strong { font-size: 15px; font-weight: 600; font-family: "Instrument Sans", sans-serif; }
.ask-id span { font-size: 12px; color: var(--text-3); }
.ask-status {
  margin-inline-start: auto; display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line-strong); font-size: 12px; color: var(--text-3);
}
.ask-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); }

.ask-thread {
  flex: 1 1 0; min-height: 0; overflow-y: auto; padding: 24px 26px 14px; display: flex; flex-direction: column; gap: 18px;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; transition: opacity .22s;
}
.ask-thread.is-out { opacity: 0; }
.ai-in { animation: rise .45s var(--ease) both; }

/* Empty state: the window is never blank — it introduces the assistant while the question is typed */
.ask-empty { margin-block: auto; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 8px; transition: opacity .18s, transform .18s var(--ease); }
.ask-empty.is-leaving { opacity: 0; transform: translateY(-8px) scale(.98); }
.ask-empty-av { width: 52px; height: 52px; margin-bottom: 6px; border-radius: 50%; background: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); display: grid; place-items: center; color: var(--white); }
.ask-empty-av svg { width: 64%; height: 64%; }
.ask-empty strong { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
:root[lang="ar"] .ask-empty strong { letter-spacing: 0; }
.ask-empty p { margin: 0; max-width: 46ch; font-size: 15px; color: var(--text-2); }
.ask-caps { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ask-caps li { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: rgba(255, 255, 255, .02); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; color: var(--text-2); }
.ask-caps svg { width: 15px; height: 15px; color: var(--mint); flex: none; }

.msg-user {
  align-self: flex-end; max-width: 78%; background: var(--white); color: var(--navy); font-weight: 500; font-size: 16px; line-height: 1.5;
  padding: 12px 18px; border-radius: 20px; border-end-end-radius: 6px;
}
.msg-ai { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; align-items: start; }
.msg-ai.is-thinking .spin { animation: askspin 1.1s linear infinite; transform-origin: 24px 24px; transform-box: view-box; }
@keyframes askspin { to { transform: rotate(360deg); } }
.ai-body { display: flex; flex-direction: column; gap: 14px; padding-top: 5px; font-size: 16px; line-height: 1.6; min-width: 0; }
:root[lang="ar"] .ai-body { line-height: 1.85; }
.ai-p { margin: 0; color: var(--text); }

/* Thinking: a visible reasoning trace + a skeleton of the answer that's coming */
.ai-thinking { display: flex; flex-direction: column; gap: 14px; transition: opacity .16s; }
.ai-thinking.is-out { opacity: 0; }
.ai-trace { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--text-3); }
.ai-trace li { display: inline-flex; align-items: center; gap: 8px; transition: color .3s; }
.ai-trace i { width: 16px; height: 16px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-strong); display: grid; place-items: center; transition: background .25s; }
.ai-trace i svg { width: 10px; height: 10px; color: var(--navy); opacity: 0; transition: opacity .2s; }
.ai-trace li.is-active { color: var(--text); }
.ai-trace li.is-active i {
  background: conic-gradient(var(--mint) 0 28%, transparent 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  animation: askspin .8s linear infinite;
}
.ai-trace li.is-done { color: var(--text-2); }
.ai-trace li.is-done i { background: var(--mint); box-shadow: none; }
.ai-trace li.is-done i svg { opacity: 1; }
.ai-skel { display: flex; flex-direction: column; gap: 10px; transition: opacity .2s; }
.ai-skel.is-out { opacity: 0; }
.ai-skel i, .ai-skel b {
  display: block; border-radius: 6px; background: linear-gradient(90deg, rgba(255, 255, 255, .035) 0%, rgba(255, 255, 255, .085) 50%, rgba(255, 255, 255, .035) 100%);
  background-size: 200% 100%; animation: askshimmer 1.3s linear infinite;
}
[dir="rtl"] .ai-skel i, [dir="rtl"] .ai-skel b { animation-direction: reverse; }
.ai-skel i { height: 10px; }
.ai-skel i:nth-child(1) { width: 92%; }
.ai-skel i:nth-child(2) { width: 64%; }
.ai-skel b { height: 110px; border-radius: 14px; margin-top: 4px; }
@keyframes askshimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* Context chips: what the assistant understood about the learner */
.ai-ctx { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-ctx-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); font-size: 12px; line-height: 1.6; }
.ai-ctx-chip i { width: 6px; height: 6px; border-radius: 50%; }
.ai-ctx-chip .k { color: var(--text-3); }
.ai-ctx-chip .v { color: var(--text-2); font-weight: 500; }

/* Steps: a connected learning path */
.ai-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ai-steps li { position: relative; padding-block: 2px 14px; padding-inline-start: 42px; }
.ai-steps li:last-child { padding-bottom: 0; }
.ai-steps .n { position: absolute; inset-inline-start: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: var(--mint); background: var(--navy); box-shadow: inset 0 0 0 1px var(--mint-line); }
.ai-steps li:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 13.5px; top: 32px; bottom: 2px; width: 1px; background: linear-gradient(var(--mint-line), var(--line)); }
.ai-steps strong { display: block; font-weight: 600; line-height: 1.4; padding-top: 3px; }
.ai-steps .d { display: block; color: var(--text-2); font-size: 15px; }

/* Term: a highlighted concept */
.ai-term { padding: 14px 18px; border-radius: 14px; background: var(--ink); box-shadow: inset 0 0 0 1px var(--line); border-inline-start: 3px solid var(--mint); }
.ai-term-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.ai-term-h strong { font-family: "Instrument Sans", sans-serif; font-size: 24px; font-weight: 600; letter-spacing: -.02em; color: var(--mint); }
.ai-term-h span { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
:root[lang="ar"] .ai-term-h span { font-family: var(--font-sans); font-size: 13px; }
.ai-term p { margin: 4px 0 0; color: var(--text); font-size: 15.5px; }

.ai-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ai-card { border-radius: 14px; padding: 14px 16px; }
.ai-card strong { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.ai-card p { margin: 0; font-size: 15px; color: var(--text-2); }
.ai-card.is-muted { box-shadow: inset 0 0 0 1px var(--line); }
.ai-card.is-muted strong { color: var(--text-3); }
.ai-card.is-accent { background: rgba(99, 226, 196, .06); box-shadow: inset 0 0 0 1px var(--mint-line); }
.ai-card.is-accent strong { color: var(--mint); }
.ai-card.is-accent p { color: var(--text); }

/* Flow: a mini diagram */
.ai-flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px; border-radius: 14px; background: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.ai-node { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; font-size: 14px; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text-2); }
.ai-node b { font-family: var(--font-mono); font-size: 11px; font-weight: 400; color: var(--text-3); }
.ai-node.is-end { color: var(--navy); background: var(--mint); box-shadow: none; font-weight: 600; }
.ai-node.is-end b { color: rgba(16, 29, 50, .6); }
.ai-flow i { width: 24px; color: var(--text-3); display: grid; }
.ai-flow i svg { width: 24px; height: 12px; }
.ai-flow i.ai-in svg { animation: askdraw .45s var(--ease) both; }
@keyframes askdraw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
[dir="rtl"] .ai-flow i { transform: scaleX(-1); }

.ai-prompt { border-radius: 14px; background: var(--ink); box-shadow: inset 0 0 0 1px var(--line); padding: 14px 18px 16px; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.7; }
:root[lang="ar"] .ai-prompt { font-family: var(--font-sans); font-size: 15px; }
.ai-prompt-h { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
:root[lang="ar"] .ai-prompt-h { font-family: var(--font-sans); font-size: 12px; letter-spacing: 0; text-transform: none; }
.ai-prompt-l { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 3px 0; }
.ai-prompt-l .k { color: var(--mint); }
.ai-prompt-l .v { color: var(--text); }

/* Tip: the one thing to remember or do */
.ai-tip { padding: 12px 16px 14px; border-radius: 14px; background: rgba(99, 226, 196, .05); box-shadow: inset 0 0 0 1px rgba(99, 226, 196, .18); }
.ai-tip-h { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--mint); }
.ai-tip-h::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); }
:root[lang="ar"] .ai-tip-h { font-family: var(--font-sans); font-size: 12px; letter-spacing: 0; text-transform: none; }
.ai-tip p { margin: 0; font-size: 15px; color: var(--text); }

/* Quiz: one question at a time, interactive learning */
.ai-quiz { padding: 14px 16px 16px; border-radius: 14px; background: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.ai-quiz-q { font-weight: 600; font-size: 15.5px; color: var(--text); margin-bottom: 12px; }
.ai-quiz-choices { display: flex; flex-direction: column; gap: 8px; }
.ai-quiz-choice {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border-radius: 10px; text-align: start;
  box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text-2); font-size: 14.5px; transition: box-shadow .25s, background .25s, color .25s;
}
.ai-quiz-choice:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--mint-line); background: var(--mint-soft); color: var(--text); }
.ai-quiz-letter { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-size: 11px; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text-3); }
.ai-quiz-choices.is-answered .ai-quiz-choice { cursor: default; }
.ai-quiz-choice.is-correct { box-shadow: inset 0 0 0 1px var(--mint-line); background: rgba(99, 226, 196, .1); color: var(--text); }
.ai-quiz-choice.is-correct .ai-quiz-letter { background: var(--mint); color: var(--navy); box-shadow: none; }
.ai-quiz-choice.is-wrong { box-shadow: inset 0 0 0 1px rgba(255, 143, 143, .35); color: var(--text); }
.ai-quiz-choice.is-wrong .ai-quiz-letter { background: #FF8F8F; color: var(--navy); box-shadow: none; }
.ai-quiz-result { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14.5px; color: var(--text-2); }
.ai-quiz-hint { margin: 10px 0 0; font-size: 13.5px; color: var(--text-3); font-style: italic; }

.ai-lessons { display: flex; flex-direction: column; gap: 10px; padding-top: 2px; }
.ai-lessons-h { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); }
.ai-lessons-h .mono { font-size: 12px; direction: ltr; unicode-bidi: isolate; }
:root[lang="ar"] .ai-lessons-h .mono { direction: rtl; font-family: var(--font-sans); }
.ai-ep-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.ai-ep {
  display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .4s, transform .4s var(--ease);
}
.ai-ep:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent); }
.ai-ep svg { width: 42px; height: 42px; flex: none; }
.ai-ep-tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.ai-ep-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
:root[lang="ar"] .ai-ep-meta { font-family: var(--font-sans); }
.ai-ep-meta b { color: var(--c); font-weight: 500; font-family: var(--font-mono); }
.ai-ep-tx strong { font-size: 14px; font-weight: 600; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ai-ep-note { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Scripted-demo cards: sample lessons, labelled and not clickable */
.ai-ep.is-example { cursor: default; }
.ai-ep.is-example:hover { transform: none; box-shadow: inset 0 0 0 1px var(--line); }
.ai-ep-tag {
  display: inline-block; margin-inline-end: 6px; padding: 0 6px; border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2);
}
:root[lang="ar"] .ai-ep-tag { letter-spacing: 0; font-size: 11px; }

.ai-follow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ai-follow-h { font-size: 13px; color: var(--text-3); margin-inline-end: 4px; }
.ai-chip { padding: 7px 14px; border-radius: 999px; font-size: 14px; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-strong); transition: color .3s, box-shadow .3s, background .3s; text-align: start; }
.ai-chip:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--mint-line); background: var(--mint-soft); }

/* Inline notice in the live-chat window: errors, "conversation full", retry */
.ask-soon { margin: 0 18px; padding: 10px 14px; border-radius: 12px; background: var(--navy-2); box-shadow: inset 0 0 0 1px var(--mint-line); font-size: 13.5px; color: var(--text-2); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.ask-soon.is-error { box-shadow: inset 0 0 0 1px rgba(255, 143, 143, .35); }
.ask-soon a { color: var(--mint); text-decoration: underline; text-underline-offset: 3px; }
.ask-soon-retry { color: var(--mint); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Live chat: top-bar controls */
.ask-back-demo { font-size: 13px; color: var(--text-3); padding: 6px 10px; border-radius: 999px; transition: color .25s, background .25s; white-space: nowrap; }
.ask-back-demo:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
/* The arrow is drawn here (not typed into the string) so it follows the reading direction. */
.ask-back-demo::before { content: "\2190\00a0"; }
[dir="rtl"] .ask-back-demo::before { content: "\2192\00a0"; }
.ask-status.is-live i { background: #FF6B6B; animation: askpulse 1.6s ease-in-out infinite; }
@keyframes askpulse { 50% { opacity: .35; } }

/* Live chat: side column (replaces the question list + pause while live) */
.ask-live-side { display: flex; flex-direction: column; gap: 14px; }
.ask-live-turns { font-size: 12px; color: var(--text-3); direction: ltr; unicode-bidi: isolate; }
:root[lang="ar"] .ask-live-turns { direction: rtl; font-family: var(--font-sans); }
.ask-live-clear { align-self: flex-start; }
.ask-live-privacy { margin: 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-3); line-height: 1.6; }

/* Live chat: real composer (textarea + send/stop) */
.ask-live-composer {
  display: flex; align-items: flex-end; gap: 8px; min-height: 54px; padding: 7px 7px 7px 20px; border-radius: 26px;
  background: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); transition: box-shadow .3s;
}
[dir="rtl"] .ask-live-composer { padding: 7px 20px 7px 7px; }
.ask-live-composer:focus-within { box-shadow: inset 0 0 0 1px var(--mint-line), 0 0 0 5px var(--mint-soft); }
.ask-live-input {
  flex: 1; min-width: 0; resize: none; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 15px;
  max-height: 120px; padding-block: 14px; line-height: 1.4; font-family: inherit;
}
.ask-live-input::placeholder { color: var(--text-3); }
.ask-live-input:disabled { opacity: .6; }
.ask-live-send, .ask-live-stop {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 7px;
  background: var(--line-strong); color: var(--text-3); transition: background .25s, color .25s, transform .15s var(--ease);
}
.ask-live-send svg, .ask-live-stop svg { width: 18px; height: 18px; }
.ask-live-input:not(:placeholder-shown):not(:disabled) ~ .ask-live-send { background: var(--mint); color: var(--navy); }
.ask-live-send:disabled { cursor: not-allowed; }
.ask-live-send:active:not(:disabled) { transform: scale(.9); }
.ask-live-stop { background: #FF6B6B; color: var(--navy); }
.ask-live-stop:active { transform: scale(.9); }

/* Live chat: "conversation is full" state inside the thread */
.ask-limit { padding: 16px 18px; border-radius: 14px; background: var(--navy-2); box-shadow: inset 0 0 0 1px var(--line); text-align: center; margin: auto; }
.ask-limit strong { display: block; font-size: 16px; margin-bottom: 4px; }
.ask-limit p { margin: 0 0 12px; font-size: 14px; color: var(--text-2); }

/* Composer: shows the learner typing; clicking it explains live questions aren't open yet */
.ask-composer { padding: 12px 18px 18px; }
.ask-input {
  width: 100%; display: flex; align-items: center; min-height: 54px; padding-block: 6px; padding-inline: 20px 7px; border-radius: 999px; text-align: start; cursor: text;
  background: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); font-size: 15px; transition: box-shadow .3s;
}
.ask-input:hover { box-shadow: inset 0 0 0 1px var(--mint-line); }
.ask-input.is-typing { box-shadow: inset 0 0 0 1px var(--mint-line), 0 0 0 5px var(--mint-soft); }
.ask-text { display: block; min-width: 0; flex: 0 1 auto; white-space: pre; overflow: hidden; }
.ask-caret { display: none; width: 2px; height: 18px; margin-inline-start: 2px; background: var(--mint); animation: caret 1s steps(1) infinite; }
.ask-input.is-typing .ask-caret { display: inline-block; }
@keyframes caret { 50% { opacity: 0; } }
.ask-ph { color: var(--text-3); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask-input.has-text .ask-ph, .ask-input.is-typing .ask-ph { display: none; }
.ask-send {
  margin-inline-start: auto; width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--line-strong); color: var(--text-3); transition: background .3s, color .3s, transform .17s var(--ease);
}
.ask-send svg { width: 18px; height: 18px; }
.ask-input.has-text .ask-send { background: var(--mint); color: var(--navy); }
.ask-send.is-press { transform: scale(.86); }
.ask-app.is-paused .spin, .ask-app.is-paused .ai-trace i, .ask-app.is-paused .ai-skel i, .ask-app.is-paused .ai-skel b, .ask-app.is-paused .ask-caret { animation-play-state: paused; }

/* Tablet: stack; questions become a 3-up row; CTA becomes a horizontal band */
@media (max-width: 960px) {
  .ask-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "side" "app" "cta"; row-gap: 24px; }
  .ask-app { contain: none; min-height: 0; }
  .ask-thread { flex: none; height: 500px; }
  .ask-qs-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ask-cta-act { flex-direction: row; }
  .ask-cta { align-self: stretch; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "tag tag" "tx act" "note note"; column-gap: 24px; align-items: center; }
  .ask-cta-tag { grid-area: tag; justify-self: start; }
  .ask-cta-tx { grid-area: tx; }
  .ask-cta-act { grid-area: act; justify-content: flex-end; }
  .ask-note { grid-area: note; }
}
/* Phone: questions become a snap-scrolling strip; CTA stacks */
@media (max-width: 640px) {
  .ask-qs-list { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-snap-type: x mandatory; }
  .ask-qs-list::-webkit-scrollbar { display: none; }
  .ask-q { flex: 0 0 min(280px, 80%); scroll-snap-align: start; }
  .ask-cta { display: flex; align-items: stretch; }
  .ask-cta-act { flex-direction: column; }
}
@media (max-width: 520px) {
  .ask-thread { height: 480px; padding: 18px 16px 10px; }
  .ask-bar { padding: 12px 14px; }
  .ask-status { display: none; }
  .ask-empty strong { font-size: 20px; }
  .msg-ai { grid-template-columns: 1fr; gap: 10px; }
  .msg-user { max-width: 88%; }
  .ai-compare { grid-template-columns: 1fr; }
  .ai-flow { flex-direction: column; align-items: flex-start; }
  .ai-flow i, [dir="rtl"] .ai-flow i { transform: rotate(90deg); margin-inline-start: 14px; }
  .ai-prompt-l { grid-template-columns: 1fr; gap: 0; }
  .ask-composer { padding: 10px 12px 14px; }
  .ask-soon { margin: 0 12px; }
}

/* ---------- Letter (newsletter) ---------- */
.letter { text-align: center; }
.letter .h2 { font-size: clamp(40px, 6.5vw, 88px); max-width: 15ch; margin-inline: auto; text-wrap: balance; }
.nb { white-space: nowrap; }
.letter .lede { margin-inline: auto; }
.form { display: flex; gap: 8px; max-width: 520px; margin: 40px auto 0; padding: 6px; border-radius: 999px; background: var(--navy-2); box-shadow: inset 0 0 0 1px var(--line-strong); transition: box-shadow .3s; }
.form:focus-within { box-shadow: inset 0 0 0 1px var(--mint-line), 0 0 0 6px var(--mint-soft); }
.form input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; padding-inline: 20px; font-size: 16px; }
.form input::placeholder { color: var(--text-3); }
.form-msg { margin-top: 16px; font-size: 14px; color: var(--text-3); min-height: 1.6em; }
.form-msg.ok { color: var(--mint); }
/* "Coming soon" state that stands in for the form until a newsletter backend exists. */
.soon-pill {
  display: inline-flex; align-items: center; gap: 12px; margin: 40px 0 0; padding: 14px 26px; border-radius: 999px;
  background: var(--navy-2); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text-2); font-size: 16px;
}
.soon-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px var(--mint-soft); flex: none; }@media (max-width: 520px) {
  .form { flex-direction: column; border-radius: 22px; padding: 8px; }
  .form input { height: 50px; }
  .form .btn { justify-content: center; }
}

/* ---------- Footer ---------- */
/* The page is a 10-minute lesson; the footer is its end screen. */
.letter { padding-bottom: clamp(56px, 7vw, 96px); }
.footer { border-top: 1px solid var(--line); padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); overflow: hidden; }
.footer:has(.end) { border-top: 0; }

/* Part 1: end card ("Up next") */
.end {
  position: relative; isolation: isolate; overflow: hidden;
  padding: clamp(28px, 4vw, 52px); border-radius: 24px;
  background: var(--navy); box-shadow: inset 0 0 0 1px var(--line);
}
.end::before {
  /* one light source: the spark where the lesson ends */
  content: ""; position: absolute; z-index: -1; top: -180px; inset-inline-end: -160px; width: 560px; height: 360px;
  background: radial-gradient(closest-side, rgba(99, 226, 196, .13), rgba(99, 226, 196, 0)); pointer-events: none;
}
.end-track { position: relative; display: flex; gap: 4px; height: 3px; margin-bottom: clamp(28px, 3.5vw, 44px); }
/* A full lesson, played back in 1.1s. Linear: this represents elapsed time (§8.1). */
.end-seg {
  flex: var(--w); border-radius: 2px; background: var(--c); opacity: .9;
  transform: scaleX(0); transform-origin: left;
  transition: transform calc(var(--w) * 110ms) linear calc(var(--s) * 110ms + 250ms);
}
[dir="rtl"] .end-seg { transform-origin: right; }
.end-spark {
  position: absolute; top: 50%; inset-inline-end: -5px; width: 11px; height: 11px; border-radius: 50%; background: var(--mint);
  box-shadow: 0 0 0 4px rgba(99, 226, 196, .14), 0 0 18px rgba(99, 226, 196, .55);
  transform: translateY(-50%) scale(0); transition: transform .5s var(--ease) 1.4s;
}
.end.in .end-seg { transform: none; }
.end.in .end-spark { transform: translateY(-50%); }
.shot .end-seg, .shot .end-spark { transition: none !important; }
@media (prefers-reduced-motion: reduce) { .end-seg, .end-spark { transition: none; } }

.end-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 28px 56px; }
.end .eyebrow { color: var(--text-2); }
.end-title {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(30px, 3.6vw, 48px);
  letter-spacing: -.03em; line-height: 1.05; margin: 16px 0 0; max-width: 18ch; text-wrap: balance;
}
.end-title em, .foot-tagline em { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -.02em; color: var(--mint); }
.end-lede { color: var(--text-2); font-size: 17px; margin: 14px 0 0; max-width: 54ch; text-wrap: pretty; }
.end-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.end-mark svg { width: 20px; height: 20px; display: block; }
:root[lang="ar"] .end-title { letter-spacing: 0; line-height: 1.35; }
:root[lang="ar"] .end-title em, :root[lang="ar"] .foot-tagline em { font-family: var(--font-display); font-style: normal; font-weight: 300; letter-spacing: 0; }

/* Part 2: brand footer */
.foot-main {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, .8fr); gap: 40px 56px;
  padding-block: clamp(48px, 6vw, 76px) clamp(36px, 4.5vw, 52px);
}
.foot-tagline { font-family: var(--font-display); font-weight: 600; font-size: clamp(22px, 2vw, 26px); letter-spacing: -.02em; line-height: 1.15; margin: 22px 0 0; }
:root[lang="ar"] .foot-tagline { letter-spacing: 0; line-height: 1.4; }
.foot-about { color: var(--text-2); font-size: 15px; margin: 10px 0 0; max-width: 38ch; }
.foot-h { font-family: var(--font-mono); font-size: 12px; font-weight: 400; text-transform: uppercase; letter-spacing: .14em; color: var(--text-3); margin: 6px 0 18px; }
:root[lang="ar"] .foot-h { font-family: var(--font-sans); font-size: 13px; letter-spacing: 0; }
.foot-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.foot-links--2 { grid-template-columns: repeat(2, max-content); column-gap: 48px; }
.foot-links a {
  color: var(--text-2); font-size: 15px; padding-bottom: 2px;
  background: linear-gradient(var(--mint), var(--mint)) no-repeat 0 100% / 0 1px;
  transition: color .3s, background-size .45s var(--ease);
}
[dir="rtl"] .foot-links a { background-position: 100% 100%; }
.foot-links a:hover, .foot-links a:focus-visible { color: var(--text); background-size: 100% 1px; }
.foot-channel {
  display: inline-flex; align-items: center; gap: 14px; padding-block: 8px; padding-inline: 8px 20px; border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line-strong); transition: box-shadow .3s, background .3s;
}
.foot-channel:hover { box-shadow: inset 0 0 0 1px var(--mint-line); background: var(--mint-soft); }
.foot-yt { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--mint-soft); color: var(--mint); flex: none; transition: background .3s, color .3s; }
.foot-yt svg { width: 20px; height: 20px; }
.foot-channel:hover .foot-yt { background: var(--mint); color: var(--navy); }
.foot-channel-tx { display: grid; line-height: 1.3; }
.foot-channel-tx b { font-weight: 600; font-size: 15px; }
.foot-channel-tx .mono { font-size: 12px; color: var(--text-3); }

/* Shared with brand.html (which overrides spacing inline) */
.foot-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 24px;
  margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-3);
}
.foot-main + .foot-bottom { margin-top: 0; padding-top: 20px; }
.foot-legal { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot-util { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.lang--sm { font-size: 12px; }
.lang--sm button { padding: 5px 11px; }
.foot-top-link { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; color: var(--text-2); transition: color .3s; }
.foot-top-link .mono { color: var(--mint); }
.foot-top-link svg { width: 15px; height: 15px; transition: transform .4s var(--ease); }
.foot-top-link:hover { color: var(--text); }
.foot-top-link:hover svg { transform: translateY(-2px); }

@media (max-width: 960px) {
  .end-body { grid-template-columns: 1fr; align-items: start; }
  .foot-main { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .end { border-radius: 20px; }
  .end-actions .btn { flex: 1 1 100%; justify-content: center; }
  .foot-main { grid-template-columns: 1fr; gap: 36px; }
  .foot-links--2 { column-gap: 32px; }
  .foot-bottom { flex-direction: column; align-items: flex-start; }
}

/* ---------- Lesson scrubber (scroll = lesson time) ---------- */
.scrubber {
  position: fixed; z-index: 45; inset-inline-end: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 8px; border-radius: 999px;
  background: rgba(20, 36, 61, .88); backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1px var(--line-strong), 0 20px 40px -20px rgba(0,0,0,.7);
  font-family: var(--font-mono); font-size: 13px; transform: translateY(120%); opacity: 0; transition: transform .6s var(--ease), opacity .4s;
}
[dir="rtl"] .scrubber { padding: 8px 8px 8px 16px; }
.scrubber.show { transform: none; opacity: 1; }
.scrubber svg { width: 34px; height: 34px; transform: rotate(-90deg); }
.scrubber .bg { stroke: var(--line-strong); }
.scrubber .fg { stroke: var(--mint); transition: stroke-dashoffset .15s linear; }
.scrubber .time b { color: var(--text); font-weight: 500; }
.scrubber .time { color: var(--text-3); direction: ltr; }
.scrubber .chap { color: var(--text-2); font-family: var(--font-sans); font-size: 13px; padding-inline-start: 12px; border-inline-start: 1px solid var(--line-strong); }
@media (max-width: 520px) { .scrubber .chap { display: none; } }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.hero .reveal { transition-delay: calc(var(--d, 0) * 90ms); }
.shot .reveal, .shot .ln { transition: none !important; }
.shot .ep, .shot .ai-in { animation: none; }
.shot .hero { min-height: 900px; }
.shot .scrubber { display: none; }

/* ==========================================================================
   Brand book page
   ========================================================================== */
.bb-hero { padding-top: 160px; padding-bottom: 80px; }
.bb-hero h1 { font-size: clamp(56px, 10vw, 150px); margin-top: 24px; }
.bb-sec { padding-block: clamp(72px, 10vw, 130px); border-top: 1px solid var(--line); }
.bb-sec .h2 { font-size: clamp(30px, 4vw, 48px); }
.bb-cols { display: grid; grid-template-columns: 300px 1fr; gap: clamp(32px, 6vw, 80px); }
@media (max-width: 960px) { .bb-cols { grid-template-columns: 1fr; } }
.bb-cols > aside p { color: var(--text-2); font-size: 15px; }

.tile { border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); background: var(--navy); position: relative; overflow: hidden; }
.tile .cap { position: absolute; bottom: 14px; inset-inline-start: 16px; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); letter-spacing: .08em; text-transform: uppercase; }
.tiles { display: grid; gap: 16px; }
.tiles-2 { grid-template-columns: 1fr 1fr; }
.tiles-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .tiles-2, .tiles-3 { grid-template-columns: 1fr; } }

.logo-hero { aspect-ratio: 16/9; display: grid; place-items: center; }
.logo-hero .lockup { display: flex; align-items: center; gap: clamp(16px, 2.5vw, 28px); }
.logo-hero .lockup svg { width: clamp(64px, 9vw, 120px); height: auto; }
.logo-hero .wordmark { font-size: clamp(36px, 6vw, 80px); }
.logo-sq { aspect-ratio: 1; display: grid; place-items: center; }
.logo-sq > svg { width: 38%; }
.logo-sq > [data-dial] svg { width: 100%; }
.logo-sq.on-mint { background: var(--mint); color: var(--navy); }
.logo-sq.on-mint .mark-arc { stroke: var(--navy); } .logo-sq.on-mint .mark-dot { fill: var(--navy); } .logo-sq.on-mint .mark-ring { opacity: .25; }
.logo-sq.on-white { background: var(--white); color: var(--navy); }
.logo-sq.on-white .mark-arc { stroke: var(--navy); } .logo-sq.on-white .mark-dot { fill: var(--mint-deep); }

.construct { aspect-ratio: 16/9; display: grid; place-items: center; }
.construct svg { width: min(90%, 620px); height: auto; }
.construct text { font-family: var(--font-mono); font-size: 11px; fill: var(--text-3); }

.swatches { display: grid; grid-template-columns: 2fr 1.4fr 1fr; gap: 16px; }
.swatch { border-radius: var(--radius); padding: 22px; min-height: 260px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: inset 0 0 0 1px var(--line); }
.swatch h3 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.swatch .mono { font-size: 12px; opacity: .8; line-height: 1.8; }
.swatches-sub { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-top: 16px; }
.swatches-sub .swatch { min-height: 150px; padding: 16px; }
.swatches-sub .swatch h3 { font-size: 15px; }
@media (max-width: 860px) { .swatches { grid-template-columns: 1fr; } .swatches-sub { grid-template-columns: repeat(2, 1fr); } }

.ratio { display: grid; grid-template-columns: 60fr 30fr 10fr; height: 56px; border-radius: 12px; overflow: hidden; margin-top: 16px; font-family: var(--font-mono); font-size: 12px; }
.ratio div { display: flex; align-items: center; padding-inline: 14px; }

.type-spec { padding: clamp(24px, 4vw, 48px); }
.type-spec .big { font-size: clamp(64px, 10vw, 140px); line-height: .9; letter-spacing: -.045em; font-weight: 600; }
.type-spec .big em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--mint); letter-spacing: -.02em; }
.type-spec .ar { font-family: "Readex Pro", sans-serif; font-size: clamp(44px, 7vw, 96px); line-height: 1.25; font-weight: 600; direction: rtl; text-align: right; }
.type-spec .ar span { font-weight: 300; color: var(--mint); }
.type-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.scale { display: grid; gap: 0; }
.scale div { display: grid; grid-template-columns: 110px 1fr; align-items: baseline; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.scale .mono { font-size: 12px; color: var(--text-3); }

.pattern-tile { aspect-ratio: 21/9; }
.pattern-tile svg { width: 100%; height: 100%; display: block; }

/* Applications */
.thumb { aspect-ratio: 16/9; position: relative; background: var(--navy); overflow: hidden; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); container-type: inline-size; }
/* Thumbnails are fixed compositions for Arabic titles: face + dial left, title right */
.thumb .t-dial { position: absolute; width: 66cqw; aspect-ratio: 1; left: -26cqw; top: 50%; transform: translateY(-50%); }
.thumb .t-face { position: absolute; width: 36cqw; aspect-ratio: 1; left: 1cqw; bottom: 0; border-radius: 50% 50% 0 0; overflow: hidden; }
.thumb .t-face img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.thumb .t-face .fb { position: absolute; inset: 0; background: var(--navy-3); display: grid; place-items: center; font-family: var(--font-serif); font-style: italic; color: var(--mint); font-size: 10cqw; }
.thumb .t-text { position: absolute; right: 5cqw; top: 50%; transform: translateY(-50%); width: 54cqw; text-align: right; }
.thumb .t-ep { font-family: var(--font-mono); font-size: 2.2cqw; color: var(--mint); letter-spacing: .1em; }
.thumb .t-title { font-family: "Readex Pro", sans-serif; font-weight: 700; font-size: 7.4cqw; line-height: 1.15; margin-top: 1.5cqw; }
.thumb .t-title span { color: var(--mint); }
.thumb .t-time { position: absolute; bottom: 4cqw; right: 5cqw; font-family: var(--font-mono); font-size: 2.4cqw; background: var(--mint); color: var(--navy); padding: .6cqw 1.6cqw; border-radius: 99px; font-weight: 700; }
.thumb .t-logo { position: absolute; top: 4cqw; right: 5cqw; z-index: 1; display: flex; gap: 1cqw; align-items: center; }
.thumb .t-logo svg { width: 4cqw; height: 4cqw; }
.thumb .t-logo .wordmark { font-size: 2.4cqw; }
.thumb.v2 { background: var(--mint); color: var(--navy); }
.thumb.v2 .t-ep, .thumb.v2 .t-title span { color: var(--navy); }
.thumb.v2 .t-title span { background: var(--navy); color: var(--mint); padding: 0 1.2cqw; border-radius: 1.2cqw; }
.thumb.v2 .t-time { background: var(--navy); color: var(--mint); }
.thumb.v2 .mark-arc { stroke: var(--navy); } .thumb.v2 .mark-dot { fill: var(--navy); }
.thumb.v2 .wordmark i { color: var(--navy); }

.banner { aspect-ratio: 6.2/1; position: relative; overflow: hidden; border-radius: var(--radius); background: var(--navy); box-shadow: inset 0 0 0 1px var(--line); container-type: inline-size; display: flex; align-items: center; justify-content: center; }
.banner .b-in { display: flex; align-items: center; gap: 3cqw; z-index: 1; }
.banner .b-in .wordmark { font-size: 3.4cqw; }
.banner .b-in svg { width: 5cqw; height: 5cqw; }
.banner .b-tag { font-family: var(--font-serif); font-style: italic; font-size: 2.6cqw; color: var(--text-2); padding-inline-start: 3cqw; border-inline-start: 1px solid var(--line-strong); }
.banner .b-bg { position: absolute; inset: 0; opacity: .5; }

.post { aspect-ratio: 1; position: relative; overflow: hidden; border-radius: var(--radius); background: var(--ink); box-shadow: inset 0 0 0 1px var(--line); container-type: inline-size; padding: 7%; display: flex; flex-direction: column; justify-content: space-between; }
.post .p-q { font-family: "Readex Pro", sans-serif; font-weight: 600; font-size: 8.4cqw; line-height: 1.3; direction: rtl; text-align: right; }
.post .p-q span { color: var(--mint); font-weight: 300; }
.post .p-foot { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-size: 3.4cqw; color: var(--text-3); }
.post .p-foot svg { width: 9cqw; height: 9cqw; }
.post.light { background: var(--white); color: var(--navy); }
.post.light .p-q span { color: var(--mint-deep); }
.post.light .mark-arc { stroke: var(--navy); } .post.light .mark-dot { fill: var(--mint-deep); }
.post.track { background: var(--navy); }
.post .p-dial { position: absolute; width: 120cqw; inset-inline-end: -50cqw; top: -40cqw; opacity: .9; }

.avatar-row { display: flex; gap: 24px; align-items: end; flex-wrap: wrap; padding: 32px; }
.avatar { border-radius: 50%; background: var(--navy); display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line-strong); }
.avatar svg { width: 58%; }
.avatar.mint { background: var(--mint); } .avatar.mint .mark-arc { stroke: var(--navy); } .avatar.mint .mark-dot { fill: var(--navy); } .avatar.mint .mark-ring { stroke: var(--navy); }

.voice { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.voice .tile { padding: 28px; }
.voice h3 { margin: 0 0 14px; font-size: 14px; font-family: var(--font-mono); font-weight: 400; color: var(--mint); text-transform: uppercase; letter-spacing: .1em; }
.voice .tile.no h3 { color: #FF8F8F; }
.voice ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.voice li { font-size: 17px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
@media (max-width: 760px) { .voice { grid-template-columns: 1fr; } }
