/* ══════════════════════════════════════════════════════════════════════════
   Mualo landing page — layout and scroll-story styling.
   Tokens come from tokens.css; nothing here hard-codes a palette value
   except the two ink/accent literals the canvas painter needs (landing.js).
   ══════════════════════════════════════════════════════════════════════ */

:root {
  --header-h: 72px;
  --gutter: 48px;
  /* Section scroll depths are written by landing.js from CONFIG.scrollDepth. */
  --depth-hero: 340vh;
  --depth-journey: 360vh;
  --depth-map: 320vh;
}

html { scroll-behavior: auto; }
body { -webkit-font-smoothing: antialiased; }
/* `clip`, not `hidden`: `overflow: hidden` here would turn the body into a
   scroll container and every sticky pane below would stop pinning. */
html { overflow-x: clip; }

a { color: var(--color-accent-700); text-decoration: none; border-bottom: 2px solid var(--color-accent); }
a:hover { color: var(--color-accent); }

@keyframes om-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: 0.55; } }
@keyframes om-nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--color-text); color: var(--color-bg);
  padding: 10px 16px; border: 0;
  font-family: var(--font-heading); font-weight: 600; font-size: 13px;
}
.skip-link:focus { left: 0; }

/* ── header ─────────────────────────────────────────────────────────── */

.site-header {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter);
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-divider);
}
.site-header-left { display: flex; align-items: center; gap: 32px; }
.brand { font-family: var(--font-heading); font-weight: 800; font-size: 22px; letter-spacing: -0.5px; }
.brand-dot { color: var(--color-accent); }
.brand-tag { font-family: var(--font-ar); font-weight: 500; font-size: 14px; color: var(--color-neutral-600); }

.nav { display: flex; align-items: center; gap: 26px; }
.nav-link {
  font-family: var(--font-heading); font-weight: 600; font-size: 13px;
  color: var(--color-text); border-bottom: 0; padding: 6px 0;
}
.nav-link:hover { color: var(--color-accent-700); }
.nav-sep { width: 2px; height: 20px; background: var(--color-divider); }

.menu { position: relative; }
.menu-btn {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-heading); font-weight: 600; font-size: 13px;
  color: var(--color-text); background: transparent; border: 0;
  padding: 6px 0; cursor: pointer; white-space: nowrap;
}
.menu-btn:hover { color: var(--color-accent-700); }
.menu-chevron { transition: transform 180ms ease; }
.menu[data-open] .menu-chevron { transform: rotate(180deg); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 15px); min-width: 322px;
  background: var(--color-bg); border: 2px solid var(--color-text);
  box-shadow: var(--shadow-md); z-index: 40;
  display: flex; flex-direction: column;
}
.menu-panel[hidden] { display: none; }
.menu-item {
  font-family: var(--font-heading); font-weight: 500; font-size: 14px;
  color: var(--color-text); border-bottom: 0; padding: 14px 18px;
}
.menu-item + .menu-item { border-top: 2px solid var(--color-divider); }
.menu-item:hover { background: var(--color-accent-100); color: var(--color-accent-700); }

/* ── shared section chrome ──────────────────────────────────────────── */

.eyebrow { display: flex; align-items: baseline; gap: 16px; }
.eyebrow-num { font-family: var(--font-heading); font-weight: 600; font-size: 11px; letter-spacing: 1.4px; white-space: nowrap; }
.eyebrow-rule { flex: 1; height: 2px; background: var(--color-divider); }
.eyebrow-meta { font-family: var(--font-heading); font-weight: 600; font-size: 11px; letter-spacing: 1.4px; color: var(--color-neutral-600); }
.eyebrow-ar { font-family: var(--font-ar); font-weight: 500; font-size: 12px; letter-spacing: 0; }

.duo { display: grid; grid-template-columns: 1fr 2px 1fr; gap: 32px; }
.duo-sep { background: var(--color-divider); align-self: stretch; }
.duo-en { margin: 0; font-family: var(--font-body); font-weight: 400; font-size: 16px; line-height: 26px; color: var(--color-neutral-700); text-wrap: pretty; }
.duo-ar { margin: 0; font-family: var(--font-ar); font-weight: 400; font-size: 16px; line-height: 30px; color: var(--color-neutral-700); text-align: right; text-wrap: pretty; }

/* ── 01 / hero ──────────────────────────────────────────────────────── */

.hero { height: var(--depth-hero); position: relative; }
.hero-inner {
  position: sticky; top: var(--header-h);
  height: calc(100svh - var(--header-h));
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 var(--gutter); overflow: hidden;
}
.hero .eyebrow { margin-bottom: 20px; }

.stage { position: relative; height: clamp(104px, 19vw, 232px); }
.stage-letterform { position: absolute; inset: 0; }
.stage-letterform[hidden] { display: none; }
.stage-matrix { display: block; width: 100%; height: 100%; }
.stage-matrix[hidden] { display: none; }

.ar-word {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  font-family: var(--font-ar); font-weight: 700;
  font-size: clamp(76px, 14vw, 220px); line-height: 1;
  white-space: nowrap; will-change: filter, mask-image;
}
.lt-word {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  display: flex; font-family: var(--font-heading); font-weight: 800;
  font-size: clamp(64px, 12.5vw, 196px); line-height: 1;
  letter-spacing: -0.04em; white-space: nowrap;
}
.lt { display: inline-block; opacity: 0; will-change: transform, opacity, filter; }
.lt-dot { display: inline-block; color: var(--color-accent); opacity: 0; }

.rule { height: 2px; background: var(--color-neutral-300); margin-top: 8px; position: relative; }
.rule-fill { position: absolute; inset: 0; background: var(--color-accent); transform: scaleX(0); transform-origin: left center; }

.gloss { position: relative; height: 34px; margin-top: 16px; }
.gloss-a, .gloss-b { position: absolute; left: 0; top: 0; font-size: 15px; font-weight: 500; white-space: nowrap; }
.gloss-a { font-family: var(--font-ar); color: var(--color-neutral-700); }
.gloss-b { font-family: var(--font-heading); color: var(--color-accent-700); opacity: 0; }

.hero-duo { margin-top: 26px; max-width: 1000px; }

.cta-row { display: flex; align-items: center; gap: 12px; margin-top: clamp(16px, 3vh, 28px); flex-wrap: wrap; }
.cta-row .btn { white-space: nowrap; }
.cta-ar { font-family: var(--font-ar); }
.hint { display: flex; align-items: center; gap: 10px; margin-left: 12px; }
.hint-label { font-family: var(--font-heading); font-weight: 600; font-size: 10px; letter-spacing: 1.6px; color: var(--color-neutral-600); }
.hint-arrow { font-size: 12px; color: var(--color-accent); animation: om-nudge 1.6s ease-in-out infinite; }

/* ── 02 / journey ───────────────────────────────────────────────────── */

.journey { height: var(--depth-journey); position: relative; border-top: 2px solid var(--color-divider); }
.journey-inner {
  position: sticky; top: var(--header-h);
  height: calc(100svh - var(--header-h));
  display: flex; flex-direction: column;
  padding: 26px var(--gutter) 30px; overflow: hidden;
}
.journey .eyebrow { margin-bottom: 26px; }
.journey-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 292px 2px 1fr; gap: 40px; }

.journey-rail { display: flex; flex-direction: column; min-height: 0; }
.level { display: flex; align-items: flex-end; line-height: 0.78; }
.level-code, .level-dot { font-family: var(--font-heading); font-weight: 800; font-size: clamp(56px, 6.6vw, 100px); }
.level-code { letter-spacing: -0.05em; }
.level-dot { color: var(--color-accent); }
.level-en { margin: 14px 0 0; font-family: var(--font-heading); font-weight: 600; font-size: 14px; color: var(--color-text); }
.level-ar { margin: 2px 0 0; font-family: var(--font-ar); font-weight: 500; font-size: 13px; line-height: 24px; color: var(--color-neutral-700); text-align: left; }

.track { position: relative; flex: 1; min-height: 0; margin-top: 22px; }
.track-inner { position: absolute; left: 0; right: 0; top: 14px; bottom: 14px; }
.rail { position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--color-neutral-300); }
.fill { position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--color-accent); transform: scaleY(0); transform-origin: top center; }
.head { position: absolute; top: 0; left: 0; width: 30px; height: 2px; background: var(--color-accent); }
.head-pulse { position: absolute; left: -5px; top: -5px; width: 12px; height: 12px; background: var(--color-accent); animation: om-pulse 1.8s ease-in-out infinite; }

.mk { position: absolute; left: 0; transform: translateY(-50%); display: flex; align-items: center; }
.mk-slot { position: relative; width: 54px; height: 12px; }
.tick {
  position: absolute; top: 50%; left: 0; margin-top: -1px;
  width: 16px; height: 2px; background: var(--color-neutral-400);
  transition: width 260ms cubic-bezier(.16, 1, .3, 1), background 200ms linear;
}
.chip {
  position: absolute; top: 50%; left: 36px; margin-top: -5px;
  width: 10px; height: 10px; background: var(--color-text);
  opacity: 0; transform: scale(0.4);
  transition: opacity 200ms linear, transform 300ms cubic-bezier(.16, 1, .3, 1);
}
.code { font-family: var(--font-heading); font-weight: 600; font-size: 15px; letter-spacing: 1.2px; color: var(--color-neutral-700); transition: color 200ms linear; }

/* Milestone state. `is-on` = reached and shipped, `is-dim` = behind the
   roadmap flag, `is-here` = the level the readout is showing. */
.mk.is-dim .tick { background: var(--color-neutral-300); }
.mk.is-on .tick { width: 34px; background: var(--color-text); }
.mk.is-on .chip { opacity: 1; transform: scale(1); }
.mk.is-here .chip { background: var(--color-accent); }
.mk.is-dim .code { color: var(--color-neutral-600); }
.mk.is-on .code { color: var(--color-text); font-weight: 800; }
.mk.is-here.is-on .code { color: var(--color-accent); }

.journey-points { display: flex; flex-direction: column; min-height: 0; }
.steps { display: flex; align-items: center; gap: 22px; margin-bottom: 30px; }
.step { display: flex; align-items: center; gap: 9px; }
.step-bar {
  width: 30px; height: 2px; background: var(--color-neutral-400);
  transition: width 260ms cubic-bezier(.16, 1, .3, 1), background 200ms linear;
}
.step-num { font-family: var(--font-heading); font-weight: 600; font-size: 11px; letter-spacing: 1.4px; color: var(--color-neutral-600); }
.step.is-past .step-bar { background: var(--color-text); }
.step.is-active .step-bar { width: 44px; background: var(--color-accent); }
.step.is-active .step-num { color: var(--color-text); font-weight: 800; }

.points { position: relative; flex: 1; min-height: 0; }
.point { position: absolute; left: 0; right: 0; top: 50%; opacity: 0; }
.point-h { margin: 0; font-family: var(--font-heading); font-weight: 800; font-size: clamp(30px, 3.5vw, 56px); line-height: 1.06; letter-spacing: -0.035em; text-wrap: pretty; }
.point-rule { width: 96px; height: 2px; background: var(--color-accent); margin: 22px 0; }
.point-ar { margin: 0; font-family: var(--font-ar); font-weight: 600; font-size: clamp(19px, 1.9vw, 27px); line-height: 1.65; color: var(--color-neutral-700); text-align: left; }

/* ── 03 / map ───────────────────────────────────────────────────────── */

.map-sec { height: var(--depth-map); position: relative; border-top: 2px solid var(--color-divider); }
.map-inner {
  position: sticky; top: var(--header-h);
  height: calc(100svh - var(--header-h));
  display: flex; flex-direction: column;
  padding: 0 var(--gutter) 24px; overflow: hidden;
}
.eyebrow-map { margin: 28px 0 22px; }
.map-duo { align-items: start; max-width: 1180px; }
.map-h { margin: 0 0 4px; font-family: var(--font-heading); font-weight: 800; font-size: clamp(28px, 3.2vw, 46px); line-height: 1.05; letter-spacing: -0.03em; }
.map-p { margin: 0; font-family: var(--font-body); font-size: 14px; line-height: 23px; color: var(--color-neutral-700); }
.map-h-ar { margin: 0 0 4px; font-family: var(--font-ar); font-weight: 700; font-size: clamp(26px, 3vw, 42px); line-height: 1.25; text-align: right; }
.map-p-ar { margin: 0; font-family: var(--font-ar); font-size: 14px; line-height: 26px; color: var(--color-neutral-700); text-align: right; }
.map-rule { height: 2px; background: var(--color-divider); margin: 20px 0 0; }
.map-frame { flex: 1; min-height: 0; width: 100%; border: 0; display: block; }

/* ── 04 / app demo ──────────────────────────────────────────────────── */

.demo {
  position: relative; border-top: 2px solid var(--color-divider);
  padding: 30px var(--gutter) 46px;
  min-height: calc(100svh - var(--header-h));
  display: flex; flex-direction: column;
}
.demo > .eyebrow { margin: 0 0 26px; }
.demo-grid { display: grid; grid-template-columns: 1fr 2px 1fr; gap: 48px; align-items: stretch; flex: 1; min-height: 0; }

.phone-cell { position: relative; overflow: hidden; min-height: 420px; }
.phone { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); transform-origin: center center; }
.device {
  width: 340px; height: 720px; border-radius: 48px; overflow: hidden;
  position: relative; background: #000;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.device-screen { position: relative; height: 100%; overflow: hidden; background: #000; }
.demo-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* Shown only when the reel is absent or fails to decode, so a missing asset
   reads as a placeholder rather than a broken page. */
.device-fallback {
  position: absolute; inset: 0; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: #000; color: #fff;
}
.device.is-missing .demo-video { display: none; }
.device.is-missing .device-fallback { display: flex; }
.device-fallback-mark { width: 26px; height: 26px; background: var(--color-accent); animation: om-pulse 1.8s ease-in-out infinite; }
.device-fallback-label { font-family: var(--font-heading); font-weight: 600; font-size: 11px; letter-spacing: 1.6px; }
.device-fallback-note { font-family: var(--font-heading); font-weight: 500; font-size: 11px; letter-spacing: 0.6px; color: rgba(255, 255, 255, 0.45); }

.demo-copy { display: flex; flex-direction: column; justify-content: center; }
.demo-h { margin: 0 0 6px; font-family: var(--font-heading); font-weight: 800; font-size: clamp(28px, 3.2vw, 46px); line-height: 1.05; letter-spacing: -0.03em; }
.demo-h-ar { margin: 0 0 4px; font-family: var(--font-ar); font-weight: 700; font-size: clamp(20px, 2.1vw, 30px); line-height: 1.3; text-align: right; }
.demo-p { margin: 0; font-family: var(--font-body); font-size: 14px; line-height: 23px; color: var(--color-neutral-700); max-width: 46ch; text-wrap: pretty; }

.meter { display: flex; align-items: center; gap: 14px; margin: clamp(16px, 3vh, 30px) 0 12px; }
.meter-dot { width: 9px; height: 9px; background: var(--color-accent); display: block; flex: none; }
.meter-speaker { font-family: var(--font-heading); font-weight: 600; font-size: 11px; letter-spacing: 1.4px; white-space: nowrap; }
.meter-live { font-family: var(--font-heading); font-weight: 600; font-size: 11px; letter-spacing: 1.4px; color: var(--color-neutral-600); }

.wave { display: flex; align-items: center; gap: 3px; height: clamp(52px, 9vh, 84px); }
.bar { flex: 1; height: 100%; transform: scaleY(0.06); transform-origin: center; background: var(--color-accent); }

.script { margin-top: clamp(14px, 2.6vh, 26px); }
.line {
  display: grid; grid-template-columns: 84px 1fr; gap: 20px;
  padding: clamp(8px, 1.5vh, 14px) 0;
  border-top: 2px solid var(--color-divider);
  opacity: 0.28; transition: opacity 0.35s linear;
}
.line-last { border-bottom: 2px solid var(--color-divider); }
.line-who { font-family: var(--font-heading); font-weight: 600; font-size: 11px; letter-spacing: 1.4px; padding-top: 3px; }
.line-who-tutor { color: var(--color-accent-700); }
.line-fr { margin: 0; font-family: var(--font-heading); font-weight: 500; font-size: clamp(14px, 1.9vh, 17px); line-height: 1.5; }
.line-fix { color: var(--color-accent-700); }
.line-ar { margin: 2px 0 0; font-family: var(--font-ar); font-size: clamp(12px, 1.6vh, 14px); line-height: 1.7; color: var(--color-neutral-600); text-align: right; }

.demo-cta { display: flex; align-items: center; gap: 12px; margin-top: clamp(16px, 3vh, 28px); flex-wrap: wrap; }
.btn-solid, .btn-outline { font-weight: 600; font-size: 14px; padding: 12px 20px; cursor: pointer; border-width: 2px; border-style: solid; }
.btn-solid { font-family: var(--font-heading); color: #fff; background: var(--color-accent); border-color: var(--color-accent); text-align: left; }
.btn-solid:hover { background: var(--color-accent-600); border-color: var(--color-accent-600); }
.btn-outline { font-family: var(--font-ar); color: var(--color-text); background: transparent; border-color: var(--color-text); }
.btn-outline:hover { color: var(--color-accent-700); border-color: var(--color-accent-700); }

/* ── 05 / closing poster ────────────────────────────────────────────── */

.closing { background: var(--color-accent); color: #fff; padding: 96px var(--gutter) 104px; }
.closing-eyebrow { margin-bottom: 44px; }
.closing-rule-inline { background: rgba(255, 255, 255, 0.5); }
.closing-ar { margin: 0; font-family: var(--font-ar); font-weight: 700; font-size: clamp(48px, 8vw, 116px); line-height: 1.1; text-align: right; }
.closing-en { margin: 8px 0 0; font-family: var(--font-heading); font-weight: 800; font-size: clamp(48px, 8vw, 116px); line-height: 1.05; letter-spacing: -0.04em; }
.closing-rule { height: 2px; background: rgba(255, 255, 255, 0.45); margin: 64px 0 34px; }

.foot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; align-items: start; }
.foot-col { display: flex; flex-direction: column; gap: 12px; }
.foot-col-ar { text-align: right; }
.foot-head { font-family: var(--font-heading); font-weight: 600; font-size: 11px; letter-spacing: 1.4px; color: rgba(255, 255, 255, 0.72); }
.foot-head-ar { font-family: var(--font-ar); font-size: 12px; letter-spacing: 0; }
.foot-link { font-family: var(--font-heading); font-weight: 500; font-size: 15px; color: #fff; text-decoration: none; border-bottom: 0; }
.foot-link:hover { color: #fff; text-decoration: underline; }
.foot-link-ar { font-family: var(--font-ar); line-height: 28px; }

.foot-bottom {
  display: flex; align-items: baseline; gap: 20px; flex-wrap: wrap;
  margin-top: 44px; padding-top: 18px; border-top: 2px solid rgba(255, 255, 255, 0.45);
}
.foot-brand { font-family: var(--font-heading); font-weight: 800; font-size: 15px; letter-spacing: -0.3px; }
.foot-brand-dot { color: rgba(255, 255, 255, 0.7); }
.foot-copy { font-family: var(--font-heading); font-size: 12px; letter-spacing: 0.6px; color: rgba(255, 255, 255, 0.8); }
.foot-spacer { flex: 1; }
.foot-legal { font-family: var(--font-heading); font-size: 12px; letter-spacing: 0.6px; color: rgba(255, 255, 255, 0.8); text-decoration: none; border-bottom: 0; }
.foot-legal:hover { color: #fff; text-decoration: underline; }

.closing :focus-visible { outline-color: #fff; }

/* ── responsive ─────────────────────────────────────────────────────── */

@media (max-width: 1080px) {
  :root { --gutter: 32px; }
  .journey-grid { grid-template-columns: 220px 2px 1fr; gap: 28px; }
  .demo-grid { gap: 32px; }
}

@media (max-width: 860px) {
  :root { --gutter: 20px; --header-h: 60px; }

  .brand-tag, .nav-link-secondary, .nav-sep { display: none; }
  .nav { gap: 18px; }
  .menu-panel { min-width: min(322px, calc(100vw - 40px)); }

  /* One column: the 2px rules only make sense between two columns. */
  .duo, .demo-grid { grid-template-columns: 1fr; gap: 20px; }
  .duo-sep { display: none; }
  .duo-ar, .map-h-ar, .map-p-ar, .demo-h-ar, .line-ar { text-align: right; }

  .hero-inner, .journey-inner, .map-inner { justify-content: flex-start; padding-top: 20px; }
  .hero-inner { justify-content: center; }
  .hero-duo { margin-top: 20px; }
  .gloss { height: 52px; }
  .gloss-a, .gloss-b { white-space: normal; line-height: 1.5; }
  .hint { display: none; }

  .journey-grid { grid-template-columns: 132px 1fr; gap: 20px; }
  .journey-grid > .duo-sep { display: none; }
  .level-en, .level-ar { display: none; }
  .mk-slot { width: 44px; }
  .chip { left: 28px; }
  .mk.is-on .tick { width: 22px; }
  .code { font-size: 13px; }
  .steps { gap: 12px; margin-bottom: 18px; }
  .step { gap: 6px; }
  .step-bar { width: 18px; }
  .step.is-active .step-bar { width: 26px; }

  .demo-grid { flex: 0 0 auto; }
  .phone-cell { min-height: 62vh; }
  .demo-copy { justify-content: flex-start; }
  .line { grid-template-columns: 60px 1fr; gap: 12px; }

  .closing { padding: 64px var(--gutter) 72px; }
  .closing-rule { margin: 44px 0 28px; }
  .foot-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
}

@media (max-width: 520px) {
  .foot-grid { grid-template-columns: 1fr; }
  .foot-col-ar { text-align: right; }
  .demo-cta, .cta-row { gap: 10px; }
  .btn-solid, .btn-outline { flex: 1 1 100%; text-align: center; }
  .btn-solid { text-align: center; }
}

/* Scroll-linked progress stays (it tracks the reader, it does not autoplay);
   the decorative loops and blur transitions do not. */
@media (prefers-reduced-motion: reduce) {
  .hint-arrow, .head-pulse, .device-fallback-mark { animation: none; }
  .line { transition: none; }
  .ar-word, .lt { filter: none !important; }
}
