/* Metis website. Tokens come from /shared/tokens.css.
   The page is a frame; each major section is a sheet resting on it.
   Rules from the brief: no all-caps, no letter-spacing, logical properties so Arabic mirrors. */

:root {
  --gutter: clamp(16px, 4vw, 40px);
  --page: 1240px;
  --r-plate: 22px;
  --nav-h: 60px;
}

html { scroll-behavior: smooth; scroll-padding-top: 96px; }
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }
.lenis.lenis-stopped { overflow: hidden; }
body { font-size: 17px; line-height: 1.65; overflow-x: clip; }
:lang(ar) body { line-height: 1.85; }
p { margin: 0; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.skip { position: fixed; inset-block-start: 8px; inset-inline-start: 8px; z-index: 100; padding: 10px 14px; background: var(--accent); color: var(--on-accent); border-radius: var(--r-control); transform: translateY(-160%); text-decoration: none; }
.skip:focus { transform: none; }

/* ---------- Type ---------- */
.display { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.3rem, 5.3vw, 4.7rem); line-height: 1.04; }
/* Latin display type sits a little tighter; Arabic keeps its natural spacing (letter-spacing breaks joined letters). */
:lang(en) :is(.display, .mega, .h2, .h3, .doc-head h1) { letter-spacing: -0.025em; }
:lang(en) .mega { letter-spacing: -0.045em; }
.display-sm { font-size: clamp(2.2rem, 5vw, 4.2rem); }
.h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(2rem, 4.4vw, 3.6rem); line-height: 1.06; }
.h3 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.45rem, 2.3vw, 2.05rem); line-height: 1.18; }
.h4 { font-weight: 600; font-size: 1.125rem; line-height: 1.35; margin: 0; }
:lang(ar) .display { line-height: 1.3; }
:lang(ar) .h2 { line-height: 1.35; }
:lang(ar) .h3 { line-height: 1.5; }
.lede { font-size: clamp(1.05rem, 1.5vw, 1.3rem); color: var(--ink-2); max-width: 44em; margin-inline: auto; text-wrap: pretty; }
.fine { font-size: 0.875rem; color: var(--ink-3); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border: 1px solid transparent; border-radius: var(--r-control); font-weight: 500; font-size: 0.95rem; line-height: 1.3; text-decoration: none; white-space: nowrap; transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease), box-shadow var(--fast) var(--ease); will-change: transform; }
.btn-sm { padding: 7px 13px; font-size: 0.875rem; }
.btn-lg { padding: 14px 22px; font-size: 1.02rem; border-radius: 8px; }
.btn-block { display: flex; width: 100%; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset, 0 6px 16px -8px var(--accent); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-quiet { border-color: var(--line-strong); background: transparent; color: var(--ink); }
.btn-quiet:hover { background: var(--raised); border-color: var(--ink-3); }
.btn-glass { background: color-mix(in srgb, var(--sheet) 55%, transparent); border-color: color-mix(in srgb, var(--ink) 18%, transparent); backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2); }
.btn-primary, .btn-quiet { border-radius: 999px; }
.btn-lg { padding: 15px 26px; }

/* ---------- Nav ---------- */
.nav { position: fixed; inset-block-start: 12px; inset-inline: 0; z-index: 50; display: flex; align-items: center; gap: 20px; width: min(var(--page), calc(100% - 2 * var(--gutter))); height: var(--nav-h); margin-inline: auto; padding-inline: 16px 10px; border: 1px solid transparent; border-radius: 14px; transition: background var(--slow) var(--ease), border-color var(--slow) var(--ease), box-shadow var(--slow) var(--ease), transform var(--slow) var(--ease); }
/* Frosted at once on the home page, where the nav sits over the hero picture. */
.nav.is-stuck, body:has([data-cine]) .nav { background: color-mix(in srgb, var(--sheet) 82%, transparent); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border-color: var(--line); box-shadow: var(--shadow-sheet); }
.nav.is-hidden { transform: translateY(calc(-100% - 20px)); }
.brand { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; border-radius: 8px; }
.logo { display: block; height: 40px; width: auto; aspect-ratio: 413.25 / 193.81; overflow: visible; }
.logo-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
/* The logo's green is the brand emerald; on charcoal the guideline keeps it, and the ink turns beige. */
:root { --logo-accent: #2bb673; }
.nav-links { display: flex; gap: 4px; margin-inline-start: auto; }
.nav-links a { padding: 8px 12px; border-radius: var(--r-control); font-size: 0.95rem; color: var(--ink-2); text-decoration: none; transition: color var(--fast), background var(--fast); }
.nav-links a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nav-tools { display: flex; align-items: center; gap: 6px; }
.tool { display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding-inline: 10px; border: 0; border-radius: var(--r-control); background: transparent; color: var(--ink-2); font-size: 0.95rem; transition: color var(--fast), background var(--fast); }
.tool:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.tool-lang { font-family: var(--font-ui); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.theme-toggle .i-sun, .menu-toggle { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: inline-flex; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: inline-flex; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
@media (max-width: 920px) { .nav-links { display: none; } .nav-tools { margin-inline-start: auto; } .menu-toggle { display: inline-grid; } }
@media (max-width: 420px) { .nav-cta { display: none; } .nav { gap: 8px; } }

/* The menu on small screens: a sheet that drops from the top. Native popover, no script. */
.menu { position: fixed; inset: 12px var(--gutter) auto; width: auto; max-width: 480px; margin: 0 0 0 auto; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--sheet); color: var(--ink); box-shadow: var(--shadow-float); }
[dir="rtl"] .menu { margin: 0 auto 0 0; }
.menu::backdrop { background: color-mix(in srgb, var(--night) 30%, transparent); backdrop-filter: blur(3px); }
.menu nav { display: grid; gap: 2px; padding-inline-end: 44px; }
.menu nav a { padding: 12px 14px; border-radius: 10px; font-size: 1.08rem; text-decoration: none; }
.menu nav a:hover, .menu nav a[aria-current="page"] { background: var(--sunken); }
.menu-close { position: absolute; inset-block-start: 12px; inset-inline-end: 12px; }
.menu:popover-open { animation: drop 0.28s var(--ease); }
@keyframes drop { from { opacity: 0; transform: translateY(-10px) scale(0.98); } }

/* Moving between pages: the browser cross-fades, and the nav stays where it is. */
@view-transition { navigation: auto; }
.nav { view-transition-name: nav; }
/* Transition layers paint in DOM order, so the hero picture would cover the nav while pages switch. */
::view-transition-group(nav) { z-index: 1; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.24s; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block-start: clamp(88px, 12vh, 140px); text-align: center; overflow: clip; }
.hero-copy { position: relative; z-index: 6; width: min(1120px, calc(100% - 2 * var(--gutter))); margin-inline: auto; }
.hero-copy .lede { margin-block-start: 22px; }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-block-start: 30px; }
.hero-copy .fine { margin-block-start: 16px; }
.js:not(.no-motion) [data-hero-title], .js:not(.no-motion) [data-hero-fade] { opacity: 0; }
.js:not(.no-motion) [data-sheet], .js:not(.no-motion) [data-chip], .js:not(.no-motion) .orbit-rings, .js:not(.no-motion) .orbit-dust { opacity: 0; }
.line-mask { display: block; overflow: clip; overflow-clip-margin: 0.14em; }

.orbit-stage { position: relative; padding-block-end: 84px; margin-block-start: clamp(28px, 5vh, 52px); }
.orbit-dust, .orbit-rings { position: absolute; inset: -30% 0 0 0; width: 100%; height: 130%; pointer-events: none; }
.orbit-dust { z-index: 0; }
.orbit-rings { z-index: 1; overflow: visible; }
.orbit-rings-front { z-index: 4; }
.orbit-rings path { fill: none; stroke: var(--line-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.orbit-rings-front path { stroke: color-mix(in srgb, var(--accent) 30%, var(--line-strong)); }

.chip, .planet { position: absolute; inset-block-start: 0; left: 0; z-index: 2; will-change: transform; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 11px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--raised); color: var(--ink); font-size: 0.9rem; font-weight: 500; line-height: 1.2; text-decoration: none; white-space: nowrap; box-shadow: var(--shadow-sheet); transition: border-color var(--fast), color var(--fast), background var(--fast); }
[dir="rtl"] .chip { padding: 8px 11px 8px 14px; }
.chip .icon { color: var(--accent); }
.chip:hover, .chip:focus-visible { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.chip:hover .icon, .chip:focus-visible .icon { color: inherit; }
.planet { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 32% 30%, #fbe6bd, var(--gold-fill) 46%, #c99848 100%); box-shadow: 0 0 0 6px color-mix(in srgb, var(--gold-fill) 18%, transparent), 0 6px 18px -4px rgba(138, 90, 18, 0.5); }

/* The sheet: a page you can hold */
.sheet { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-sheet); box-shadow: var(--shadow-float); }
.hero-sheet { position: relative; z-index: 3; width: min(840px, calc(100% - 2 * var(--gutter))); margin-inline: auto; text-align: start; transform-origin: 50% 0; will-change: transform; }
.sheet-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-block-end: 1px solid var(--line); font-size: 0.82rem; color: var(--ink-2); }
.crumb { display: inline-flex; align-items: center; gap: 7px; }
.crumb b { font-weight: 500; color: var(--ink); }
.saved { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.sheet-body { padding: clamp(22px, 4vw, 44px) clamp(20px, 6vw, 72px) clamp(22px, 4vw, 40px); }
.masthead { display: flex; align-items: center; gap: 18px; }
.orbit-icon { position: relative; display: grid; place-items: center; flex: none; width: 60px; height: 60px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--accent); }
.orbit-icon::after { content: ""; position: absolute; inset-block-start: 3px; inset-inline-end: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold-fill); box-shadow: 0 0 0 3px var(--sheet); }
.sheet-title { font-size: clamp(1.5rem, 3vw, 2.125rem); font-weight: 600; line-height: 1.3; }
.sheet-meta { font-size: 0.82rem; color: var(--ink-3); }
.sheet-p { margin-block-start: 22px; font-size: 1.02rem; line-height: 1.75; color: var(--ink); max-width: 38em; }
.todo { display: grid; gap: 8px; margin-block-start: 16px; font-size: 1rem; }
.todo li { display: flex; align-items: center; gap: 11px; transition: color var(--slow); }
.box { position: relative; flex: none; width: 17px; height: 17px; border: 1.5px solid var(--line-strong); border-radius: 4px; transition: background var(--slow), border-color var(--slow); }
.box::after { content: ""; position: absolute; inset: 2px 5px 4px 5px; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(40deg) scale(0); transition: transform var(--slow) var(--ease); }
.todo li.is-done { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.todo li.is-done .box { background: var(--accent); border-color: var(--accent); }
.todo li.is-done .box::after { transform: rotate(40deg) scale(1); }

.mini-db { margin-block-start: 26px; border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.mini-db-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; background: var(--sunken); border-block-end: 1px solid var(--line); font-size: 0.86rem; }
.mini-db-title { display: inline-flex; align-items: center; gap: 8px; }
.mini-db-title b { font-weight: 600; }
.mini-tabs { display: inline-flex; gap: 2px; color: var(--ink-3); }
.mini-tabs span { padding: 3px 9px; border-radius: 5px; }
.mini-tabs .is-on { background: var(--raised); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.mini-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px 12px 6px; }
.mini-col-name { display: flex; align-items: center; gap: 7px; margin-block-end: 8px; font-size: 0.8rem; font-weight: 500; color: var(--ink-2); }
.st { width: 7px; height: 7px; border-radius: 50%; }
.st-idle { background: var(--ink-3); } .st-doing { background: var(--gold-fill); box-shadow: 0 0 0 1px var(--gold); } .st-done { background: var(--good); }
.mini-card { display: grid; gap: 7px; margin-block-end: 8px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); font-size: 0.86rem; }
.mini-card b { font-weight: 500; }
.pills { display: flex; flex-wrap: wrap; gap: 5px; }
.pills i { padding: 1px 7px; border-radius: 5px; background: var(--sunken); color: var(--ink-2); font-size: 0.74rem; font-style: normal; }
@media (max-width: 640px) {
  .mini-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-col:nth-child(3) { display: none; }
  .mini-tabs { display: none; }
  .chip span:not(.icon) { display: none; }
  .chip, [dir="rtl"] .chip { padding: 9px; }
  .saved { display: none; }
}

/* ---------- Statement ---------- */
.statement { width: min(1040px, calc(100% - 2 * var(--gutter))); margin-inline: auto; padding-block: clamp(88px, 16vh, 180px); }
.statement-text { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.6rem, 3.5vw, 3rem); line-height: 1.3; text-wrap: pretty; }
:lang(ar) .statement-text { line-height: 1.7; }
.statement-text .w { opacity: 0.16; transition: opacity 0.3s linear; }
.statement-text .w.is-lit { opacity: 1; }
.no-motion .statement-text .w { opacity: 1; }

/* ---------- Plates and section heads ---------- */
.plate { width: min(calc(var(--page) + 80px), calc(100% - 2 * var(--gutter) + 16px)); margin-inline: auto; padding: clamp(44px, 7vw, 96px) clamp(18px, 5vw, 72px); background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-plate); box-shadow: var(--shadow-sheet); }
.section-head { max-width: 760px; margin-block-end: clamp(32px, 5vw, 64px); }
.section-sub { margin-block-start: 14px; font-size: 1.1rem; color: var(--ink-2); max-width: 36em; }
.more, .people, .faq { width: min(var(--page), calc(100% - 2 * var(--gutter))); margin-inline: auto; padding-block: clamp(80px, 12vw, 150px); }

.ticks { display: grid; gap: 9px; margin-block-start: 18px; }
.ticks li { position: relative; padding-inline-start: 26px; color: var(--ink-2); font-size: 0.98rem; line-height: 1.5; }
.ticks li::before { content: ""; position: absolute; inset-inline-start: 4px; inset-block-start: 0.34em; width: 6px; height: 11px; border: solid var(--accent); border-width: 0 1.75px 1.75px 0; transform: rotate(40deg); }

/* ---------- Story ---------- */
.story-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(24px, 5vw, 80px); align-items: start; }
.step { display: flex; flex-direction: column; justify-content: center; min-height: 72vh; max-width: 30em; transition: opacity var(--slow) var(--ease); }
.step > p { margin-block-start: 14px; color: var(--ink-2); }
.step:not(.is-active) { opacity: 0.32; }
.step:first-child { justify-content: flex-start; min-height: 58vh; padding-block-start: 6vh; }
.story-stage { position: sticky; inset-block-start: max(88px, calc(50vh - 300px)); }
.stage-frame { position: relative; aspect-ratio: 16 / 11.6; max-height: 78vh; border: 1px solid var(--line); border-radius: var(--r-sheet); background: var(--sunken); overflow: hidden; }
.visual { position: absolute; inset: 0; display: flex; flex-direction: column; padding: clamp(14px, 2vw, 26px); opacity: 0; visibility: hidden; transform: translateY(14px) scale(0.985); transition: opacity 0.5s var(--ease), transform 0.7s var(--ease), visibility 0s 0.5s; }
.visual.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: 0.08s, 0.08s, 0s; }
.shot { position: relative; flex: 1; min-height: 0; border: 1px solid var(--line); border-radius: var(--r-card); background: #fbf8f1; overflow: hidden; box-shadow: var(--shadow-sheet); }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: 0 0; transition: opacity 0.25s var(--ease); }
.shot-db img { position: absolute; inset-block-start: 0; left: -5%; width: 150%; height: auto; max-width: none; }
.shot-crop img { position: absolute; inset-block-start: 0; right: 0; left: auto; width: 134%; height: auto; max-width: none; }
.view-switch { display: inline-flex; align-self: flex-start; gap: 2px; margin-block-end: 12px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--raised); }
.view-switch button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); font-size: 0.86rem; font-weight: 500; transition: background var(--fast), color var(--fast); }
.view-switch button:hover { color: var(--ink); }
.view-switch button.is-on { background: var(--accent); color: var(--on-accent); }
.stage-dots { display: flex; justify-content: center; gap: 7px; margin-block-start: 16px; }
.stage-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); transition: background var(--slow), width var(--slow) var(--ease); }
.stage-dots span.is-on { width: 22px; border-radius: 3px; background: var(--gold-fill); }

/* Agent */
.agent, .voice { display: flex; flex-direction: column; gap: 12px; width: min(540px, 100%); margin: auto; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-sheet); background: var(--sheet); box-shadow: var(--shadow-float); font-size: 0.93rem; }
.agent-head, .voice-head { display: flex; align-items: center; gap: 9px; color: var(--ink-2); }
.agent-head b, .voice-head b { color: var(--ink); font-weight: 600; }
.agent-ask { align-self: flex-end; max-width: 88%; padding: 11px 14px; border-radius: 12px 12px 3px 12px; background: var(--accent); color: var(--on-accent); line-height: 1.5; }
[dir="rtl"] .agent-ask { border-radius: 12px 12px 12px 3px; }
.agent-steps { display: grid; gap: 7px; }
.agent-steps li { display: flex; align-items: center; gap: 10px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); color: var(--ink); opacity: 0; transform: translateY(8px); transition: opacity 0.4s var(--ease), transform 0.5s var(--ease); }
.agent-steps .icon { color: var(--accent); }
.visual.is-active .agent-steps li { opacity: 1; transform: none; }
.visual.is-active .agent-steps li:nth-child(1) { transition-delay: 0.5s; }
.visual.is-active .agent-steps li:nth-child(2) { transition-delay: 0.9s; }
.visual.is-active .agent-steps li:nth-child(3) { transition-delay: 1.3s; }
.visual.is-active .agent-steps li:nth-child(4) { transition-delay: 1.7s; }
.visual.is-active .agent-steps li:nth-child(5) { transition-delay: 2.1s; }
.agent-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block-start: 12px; border-block-start: 1px solid var(--line); color: var(--ink-2); font-size: 0.86rem; opacity: 0; transition: opacity 0.4s var(--ease); }
.visual.is-active .agent-foot { opacity: 1; transition-delay: 2.6s; }
.agent-actions { display: inline-flex; gap: 6px; }

/* Voice */
.rec { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); animation: pulse 1.6s ease-in-out infinite; }
.voice-time { margin-inline-start: auto; font-family: var(--font-mono); font-size: 0.82rem; }
.wave { display: flex; align-items: center; gap: 3px; height: 54px; padding-inline: 4px; direction: ltr; }
.wave i { flex: 1; min-width: 2px; height: 100%; border-radius: 2px; background: var(--accent); transform: scaleY(0.2); transform-origin: center; animation: wave 1.3s ease-in-out infinite; opacity: 0.85; }
.visual:not(.is-active) .wave i, .visual:not(.is-active) .rec { animation-play-state: paused; }
.transcript { display: grid; gap: 10px; }
.transcript p { display: grid; grid-template-columns: 58px 1fr; gap: 10px; line-height: 1.5; opacity: 0; transition: opacity 0.5s var(--ease); }
.visual.is-active .transcript p { opacity: 1; }
.visual.is-active .transcript p:nth-child(1) { transition-delay: 0.5s; }
.visual.is-active .transcript p:nth-child(2) { transition-delay: 1.3s; }
.visual.is-active .transcript p:nth-child(3) { transition-delay: 2.1s; }
.spk { font-weight: 600; font-size: 0.86rem; }
.spk-a { color: var(--accent); } .spk-b { color: var(--gold); }
@keyframes wave { 0%, 100% { transform: scaleY(0.18); } 50% { transform: scaleY(var(--h, 0.8)); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

@media (max-width: 900px) {
  .story-grid { display: block; }
  .story-stage { display: none; }
  .step { min-height: 0; max-width: none; margin-block-end: 56px; opacity: 1 !important; }
  .step .visual { position: relative; inset: auto; opacity: 1; visibility: visible; transform: none; margin-block-start: 22px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sheet); background: var(--sunken); }
  .step .shot { aspect-ratio: 16 / 10; flex: none; }
  .shot-db img { width: 185%; }
  .view-switch { max-width: 100%; overflow-x: auto; }
  .view-switch .icon { display: none; }
}

/* ---------- Bento ---------- */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.card { position: relative; grid-column: span 4; display: flex; flex-direction: column; gap: 22px; min-height: 300px; padding: 22px; border: 1px solid var(--line); border-radius: var(--r-sheet); background: var(--sheet); overflow: hidden; isolation: isolate; transform-style: preserve-3d; transition: border-color var(--slow), box-shadow var(--slow); }
.card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 13%, transparent), transparent 62%); opacity: 0; transition: opacity var(--slow); }
.card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: var(--shadow-sheet); }
.card:hover::before { opacity: 1; }
.card-text p { margin-block-start: 8px; color: var(--ink-2); font-size: 0.97rem; }
.card-text { margin-block-start: auto; }
.card-offline { grid-column: span 7; }
.card-bidi { grid-column: span 5; }
.card-draw { grid-column: span 5; }
.card-connect { grid-column: span 7; }
.card-wide { flex-direction: row; align-items: stretch; }
.card-wide .card-text { flex: 1; margin-block: auto 0; }
.card-wide .demo { flex: 1.1; }
.demo { flex: 1; display: grid; place-items: center; min-height: 130px; border-radius: var(--r-card); background: var(--sunken); }
@media (max-width: 960px) { .card, .card-offline, .card-bidi, .card-draw, .card-connect { grid-column: span 6; } .card-wide { flex-direction: column; } }
@media (max-width: 620px) { .card, .card-offline, .card-bidi, .card-draw, .card-connect { grid-column: span 12; min-height: 0; } }

.demo-offline { align-content: center; gap: 18px; }
.signal { display: inline-flex; align-items: flex-end; gap: 5px; height: 40px; }
.signal i { width: 9px; border-radius: 3px; background: var(--line-strong); transition: background 0.4s var(--ease); }
.signal i:nth-child(1) { height: 25%; } .signal i:nth-child(2) { height: 50%; } .signal i:nth-child(3) { height: 75%; } .signal i:nth-child(4) { height: 100%; }
.signal i.is-on { background: var(--accent); }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--raised); font-size: 0.88rem; font-weight: 500; }

.demo-bidi { align-content: center; gap: 12px; padding: 18px; }
.bidi-line { width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); font-size: 1.02rem; line-height: 1.7; text-align: start; }
.bidi-line span { padding: 1px 6px; border-radius: 5px; background: var(--gold-soft); color: var(--gold); unicode-bidi: isolate; }

.demo-modules { grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 14px; place-items: stretch; }
.mod { display: grid; place-content: center; justify-items: center; gap: 3px; padding: 12px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--raised); font-size: 0.78rem; color: var(--ink-2); text-align: center; line-height: 1.3; }
.mod-num { font-family: var(--font-display); font-size: 2rem; line-height: 1; color: var(--ink); }
.mod-ring { position: relative; }
.mod-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.8rem; color: var(--ink); }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 4; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 1.2s var(--ease); }
.card.is-seen .ring-fg { stroke-dashoffset: 30; }
.mod-habit { grid-template-columns: repeat(7, 1fr); gap: 3px; place-content: center; padding: 10px; }
.mod-habit i { width: 9px; height: 9px; border-radius: 2.5px; background: var(--line); transition: background 0.4s var(--ease); }
.mod-habit i.is-on { background: var(--accent); }
.mod-habit i.is-today { background: var(--gold-fill); }

.demo-palette { align-content: start; place-items: stretch; padding: 14px; gap: 8px; }
.palette-input { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid var(--accent); border-radius: 8px; background: var(--raised); font-size: 0.93rem; }
.caret { width: 1.5px; height: 1.1em; margin-inline-start: -7px; background: var(--ink); animation: pulse 1s steps(2) infinite; }
.palette-list { display: grid; gap: 2px; font-size: 0.88rem; }
.palette-list li { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 6px; color: var(--ink-2); }
.palette-list li.is-on { background: var(--accent-soft); color: var(--ink); }
.palette-list kbd { margin-inline-start: auto; padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 4px; font-family: var(--font-ui); font-size: 0.72rem; color: var(--ink-3); }

.demo-import { grid-auto-flow: column; gap: 12px; padding: 14px; font-size: 0.88rem; }
.zip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px dashed var(--line-strong); border-radius: 8px; color: var(--ink-2); font-family: var(--font-mono); font-size: 0.76rem; direction: ltr; }
.import-arrow { color: var(--ink-3); }
.import-count { display: grid; justify-items: center; line-height: 1.3; color: var(--ink-2); font-size: 0.8rem; }
.import-count b { font-family: var(--font-display); font-size: 1.7rem; color: var(--ink); font-variant-numeric: tabular-nums; direction: ltr; }

.sketch { width: min(280px, 90%); }
.sk { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 400; stroke-dashoffset: 400; transition: stroke-dashoffset 1.4s var(--ease); }
.sk-arrow { stroke: var(--accent); transition-delay: 0.5s; }
.sk-gold { stroke: var(--gold-fill); stroke-width: 4; transition-delay: 0.9s; }
.card.is-seen .sk { stroke-dashoffset: 0; }

.demo-connect { position: relative; grid-template-columns: repeat(2, auto); gap: 10px 60px; padding: 18px; align-content: center; justify-content: center; }
.node { padding: 7px 13px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--raised); font-size: 0.86rem; font-weight: 500; }
.node-metis { position: absolute; inset: 50% auto auto 50%; translate: -50% -50%; padding: 7px; border-radius: 12px; box-shadow: 0 0 0 6px color-mix(in srgb, var(--gold-fill) 26%, transparent); }
.node-metis img { border-radius: 7px; }

/* ---------- Privacy (night plate) ---------- */
.plate-night { background: var(--night); border-color: var(--night-line); color: var(--night-ink); --ink: var(--night-ink); --ink-2: var(--night-ink-2); --line: var(--night-line); --accent: var(--night-accent); }
.plate-night .section-sub, .plate-night .promise p { color: var(--night-ink-2); }
.route { display: flex; align-items: center; gap: 0; margin-block-end: clamp(36px, 6vw, 72px); }
.route-node { display: grid; justify-items: center; gap: 10px; flex: none; width: 150px; font-size: 0.9rem; color: var(--night-ink-2); text-align: center; }
.route-node .icon { display: grid; place-items: center; width: 64px; height: 64px; border: 1px solid var(--night-line); border-radius: 50%; background: var(--night-raised); color: var(--night-ink); }
.route-cloud .icon { border-color: color-mix(in srgb, var(--gold-fill) 50%, var(--night-line)); color: var(--gold-fill); }
.route-line { position: relative; flex: 1; height: 1px; margin-block-end: 32px; background: repeating-linear-gradient(90deg, var(--night-ink-2) 0 6px, transparent 6px 14px); opacity: 0.9; }
.packet { position: absolute; inset-block-start: -13px; inset-inline-start: 0; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--night-accent); color: var(--night); animation: travel 3.6s var(--ease) infinite; }
.route-line:nth-of-type(4) .packet { animation-delay: 1.8s; }
@keyframes travel { 0% { inset-inline-start: 0; opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { inset-inline-start: calc(100% - 26px); opacity: 0; } }
.promises { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 44px); }
.promise { padding-block-start: 20px; border-block-start: 1px solid var(--night-line); }
.promise p { margin-block-start: 8px; font-size: 0.98rem; }
@media (max-width: 760px) {
  .promises { grid-template-columns: 1fr; }
  .route { flex-direction: column; gap: 6px; }
  .route-line { flex: none; width: 1px; height: 46px; margin: 0; background: repeating-linear-gradient(180deg, var(--night-ink-2) 0 6px, transparent 6px 14px); }
  .packet { display: none; }
}

/* ---------- People ---------- */
.people-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.person { display: flex; flex-direction: column; gap: 10px; padding: 22px; border: 1px solid var(--line-strong); border-radius: var(--r-sheet); transition: background var(--slow), box-shadow var(--slow), transform var(--slow) var(--ease); }
.person:hover { background: var(--sheet); box-shadow: var(--shadow-sheet); transform: translateY(-3px); }
.person p:last-child { color: var(--ink-2); font-size: 0.96rem; }
.person-plan { display: inline-flex; align-items: baseline; gap: 8px; align-self: flex-start; padding: 3px 11px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-strong); font-size: 0.84rem; font-weight: 600; }
.person-plan b { font-weight: 500; color: var(--ink-2); }
.people-note { margin-block-start: 18px; }
@media (max-width: 1000px) { .people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .people-grid { grid-template-columns: 1fr; } }

/* ---------- Pricing ---------- */
.pricing .section-head { max-width: none; display: grid; justify-items: start; }
.bill-toggle { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin-block-start: 26px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--sunken); }
.bill-toggle button { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 18px; border: 0; background: transparent; color: var(--ink-2); font-weight: 500; font-size: 0.95rem; white-space: nowrap; transition: color var(--slow); }
.bill-toggle button.is-on { color: var(--ink); }
.bill-toggle em { font-style: normal; font-size: 0.78rem; padding: 1px 8px; border-radius: var(--r-pill); background: var(--gold-soft); color: var(--gold); }
.bill-thumb { position: absolute; inset-block: 4px; inset-inline-start: 4px; width: calc(50% - 4px); border-radius: 7px; background: var(--raised); box-shadow: 0 0 0 1px var(--line), var(--shadow-sheet); transition: transform var(--slow) var(--ease); }
.bill-toggle[data-on="year"] .bill-thumb { transform: translateX(100%); }
[dir="rtl"] .bill-toggle[data-on="year"] .bill-thumb { transform: translateX(-100%); }

.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; padding: 24px 22px 26px; border: 1px solid var(--line); border-radius: var(--r-sheet); background: var(--raised); }
.plan-name { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; line-height: 1.2; }
.plan-for { margin-block-start: 4px; color: var(--ink-2); font-size: 0.95rem; min-height: 3em; }
.price { display: flex; align-items: baseline; gap: 3px; margin-block: 14px 20px; direction: ltr; justify-content: flex-start; }
[dir="rtl"] .price { justify-content: flex-end; }
.price .cur { font-size: 1.3rem; color: var(--ink-2); align-self: flex-start; margin-block-start: 0.55em; }
.price .amt { font-family: var(--font-display); font-size: 3.4rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.price .per { margin-inline-start: 7px; color: var(--ink-3); font-size: 0.9rem; }
.plan .ticks { margin-block-start: 22px; }
.plan-featured { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-float); --ink-2: color-mix(in srgb, var(--on-accent) 80%, transparent); --ink-3: color-mix(in srgb, var(--on-accent) 68%, transparent); }
.plan-featured .ticks li { color: color-mix(in srgb, var(--on-accent) 86%, transparent); }
.plan-featured .ticks li::before { border-color: var(--gold-fill); }
.plan-featured .btn-primary { background: var(--on-accent); color: var(--accent); box-shadow: none; }
.plan-featured .btn-primary:hover { background: var(--gold-fill); color: #414042; }
.plan-flag { position: absolute; inset-block-start: -12px; inset-inline-start: 20px; padding: 2px 11px; border-radius: var(--r-pill); background: var(--gold-fill); color: #414042; font-size: 0.78rem; font-weight: 600; }
.team-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin-block-start: 14px; padding: 22px; border: 1px dashed var(--line-strong); border-radius: var(--r-sheet); }
.team-strip p { margin-block-start: 6px; color: var(--ink-2); font-size: 0.97rem; max-width: 46em; }
.pricing-note { margin-block-start: 18px; }
@media (max-width: 1080px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 22px; } }
@media (max-width: 560px) { .plans { grid-template-columns: 1fr; } .plan-for { min-height: 0; } }

/* ---------- Questions ---------- */
.faq { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 80px); align-items: start; }
.faq .section-head { position: sticky; inset-block-start: 110px; margin: 0; }
.faq-list { border-block-start: 1px solid var(--line-strong); }
.q { border-block-end: 1px solid var(--line-strong); }
.q summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 20px; font-weight: 500; font-size: 1.1rem; line-height: 1.4; cursor: pointer; list-style: none; }
.q summary::-webkit-details-marker { display: none; }
.q summary .icon { color: var(--ink-3); transition: transform var(--slow) var(--ease), color var(--fast); }
.q summary:hover .icon { color: var(--accent); }
.q[open] summary .icon { transform: rotate(45deg); }
.q .a { padding-block-end: 22px; color: var(--ink-2); max-width: 40em; }
.q::details-content { block-size: 0; overflow: clip; transition: block-size var(--slow) var(--ease), content-visibility var(--slow) allow-discrete; }
.q[open]::details-content { block-size: auto; }
@supports (interpolate-size: allow-keywords) { :root { interpolate-size: allow-keywords; } }
@media (max-width: 860px) { .faq { grid-template-columns: 1fr; } .faq .section-head { position: static; } }

/* ---------- Footer ---------- */
.footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px 64px; width: min(var(--page), calc(100% - 2 * var(--gutter))); margin-inline: auto; padding-block: 44px 36px; border-block-start: 1px solid var(--line-strong); font-size: 0.93rem; }
.footer-brand p { margin-block-start: 10px; color: var(--ink-2); }
.footer-cols { display: flex; flex-wrap: wrap; gap: 28px 56px; }
.footer-cols div { display: grid; gap: 7px; align-content: start; }
.footer-h { font-weight: 600; margin-block-end: 2px; }
.footer-cols a { color: var(--ink-2); text-decoration: none; }
.footer-cols a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.footer-fine { grid-column: 1 / -1; color: var(--ink-3); font-size: 0.85rem; }
@media (max-width: 760px) { .footer { grid-template-columns: 1fr; } }


/* ---------- Moving from Notion (home) ---------- */
.move { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 80px); align-items: center; width: min(var(--page), calc(100% - 2 * var(--gutter))); margin-inline: auto; padding-block: clamp(72px, 10vw, 130px) 0; }
.move-links { display: flex; flex-wrap: wrap; gap: 10px; margin-block-start: 26px; }
.move-steps { display: grid; counter-reset: step; border-block-start: 1px solid var(--line-strong); }
.move-steps li { display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; padding-block: 16px; border-block-end: 1px solid var(--line-strong); counter-increment: step; }
.move-steps li::before { content: counter(step); grid-row: span 2; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line-strong); border-radius: 50%; font-family: var(--font-display); font-weight: 600; color: var(--accent); }
.move-steps b { font-weight: 600; }
.move-steps span { color: var(--ink-2); font-size: 0.95rem; }
@media (max-width: 860px) { .move { grid-template-columns: 1fr; } }

/* =================================================================
   Inner pages. Each one is drawn as a page in Metis: a sheet on the
   paper, a bar that says where you are, the page icon on its orbit.
   ================================================================= */
.doc { width: min(var(--page), calc(100% - 2 * var(--gutter))); margin: calc(var(--nav-h) + 30px) auto 0; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-plate); box-shadow: var(--shadow-sheet); }
.doc-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px clamp(16px, 3vw, 24px); border-block-end: 1px solid var(--line); font-size: 0.84rem; color: var(--ink-2); }
.doc-bar .crumb a { color: var(--ink-2); text-decoration: none; }
.doc-bar .crumb a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.doc-bar .crumb b { font-weight: 500; color: var(--ink); }
.doc-bar time { white-space: nowrap; }
.doc-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px clamp(16px, 3vw, 28px); align-items: start; padding: clamp(32px, 6vw, 72px) clamp(18px, 6vw, 80px) clamp(28px, 4vw, 48px); }
.doc-head .orbit-icon { width: 64px; height: 64px; margin-block-start: 6px; background: var(--raised); }
.doc-head h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.1rem, 4.6vw, 3.8rem); line-height: 1.1; }
:lang(ar) .doc-head h1 { line-height: 1.4; }
.doc-head .lede { margin: 16px 0 0; max-width: 38em; }
.doc-head .cta-row { justify-content: flex-start; margin-block-start: 26px; }
@media (max-width: 640px) { .doc-head { grid-template-columns: 1fr; } .doc-head .orbit-icon { width: 52px; height: 52px; } .doc-bar time { display: none; } }
.doc-body { padding: 0 clamp(18px, 6vw, 80px) clamp(48px, 7vw, 88px); }
.doc-section { padding-block-start: clamp(40px, 6vw, 72px); }
.doc-section:first-child { padding-block-start: 0; }
.doc-section > .h2, .doc-section > .h3 { max-width: 24em; }
.doc-section > .section-sub { margin-block-end: clamp(22px, 3vw, 34px); }
.doc-section > .h2 + .matrix-wrap, .doc-section > .h2 + .pair, .doc-section > .h2 + .steps, .doc-section > .h2 + .faq { margin-block-start: clamp(22px, 3vw, 34px); }
.doc-section + .doc-section { border-block-start: 1px solid var(--line); margin-block-start: clamp(40px, 6vw, 72px); }
.prose { max-width: 40em; color: var(--ink-2); }
.prose p + p { margin-block-start: 14px; }
.prose a, .link { color: var(--accent); font-weight: 500; text-underline-offset: 3px; }
.after-doc { width: min(var(--page), calc(100% - 2 * var(--gutter))); margin-inline: auto; }

/* Tables of facts: features by plan, and the side-by-side comparisons */
.matrix-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sheet); background: var(--raised); }
.matrix { width: 100%; min-width: 620px; border-collapse: collapse; table-layout: fixed; font-size: 0.95rem; }
.matrix th, .matrix td { padding: 13px 16px; border-block-end: 1px solid var(--line); text-align: start; vertical-align: top; }
.matrix thead th { background: var(--sunken); font-weight: 600; white-space: nowrap; }
.matrix tbody th { font-weight: 500; color: var(--ink); width: 34%; }
.matrix td { color: var(--ink-2); }
.matrix tr:last-child > * { border-block-end: 0; }
.matrix .group th { padding-block: 22px 8px; font-family: var(--font-display); font-size: 1.12rem; font-weight: 600; color: var(--ink); }
.matrix .yes, .matrix .no { display: inline-flex; align-items: center; gap: 6px; }
.matrix .yes .icon { color: var(--good); }
.matrix .no { color: var(--ink-3); }
.matrix .col-us { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.matrix-note { margin-block-start: 12px; }

/* Pricing: what a team pays */
.calc { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(20px, 4vw, 56px); align-items: center; padding: clamp(20px, 3vw, 32px); border: 1px solid var(--line); border-radius: var(--r-sheet); background: var(--raised); }
.calc label { display: block; font-weight: 600; }
.calc-seats { display: flex; align-items: baseline; gap: 10px; margin-block: 8px 14px; }
.calc-seats output { font-family: var(--font-display); font-size: 3.2rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.calc-seats span { color: var(--ink-2); }
.calc input[type="range"] { width: 100%; accent-color: var(--accent); }
.calc-rows { display: grid; gap: 8px; }
.calc-row { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--sheet); }
.calc-row b { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.calc-row [data-total] { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; direction: ltr; }
.calc-row small { grid-column: 1 / -1; color: var(--ink-3); font-size: 0.85rem; }
.calc-row small bdi { direction: ltr; }
@media (max-width: 760px) { .calc { grid-template-columns: 1fr; } }

/* Download */
.dl-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px 32px; align-items: center; padding: clamp(22px, 3vw, 34px); border: 1px solid var(--accent); border-radius: var(--r-sheet); background: var(--raised); box-shadow: 0 0 0 4px var(--accent-soft); }
.dl-hero h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.25; }
.dl-hero p { margin-block-start: 6px; color: var(--ink-2); max-width: 36em; }
.dl-hero .actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 760px) { .dl-hero { grid-template-columns: 1fr; } }
.dl-list { display: grid; border-block-start: 1px solid var(--line-strong); }
.dl-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 4px 18px; align-items: center; padding-block: 20px; border-block-end: 1px solid var(--line-strong); }
.dl-row > .icon { grid-row: span 2; display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--accent); background: var(--raised); }
.dl-row h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-weight: 600; font-size: 1.08rem; }
.dl-row p { grid-column: 2; color: var(--ink-2); font-size: 0.95rem; }
.dl-row .btn { grid-column: 3; grid-row: 1 / span 2; }
.dl-row .mine { display: none; }
.dl-row.is-mine .mine { display: inline; padding: 1px 9px; border-radius: var(--r-pill); background: var(--gold-soft); color: var(--gold); font-size: 0.78rem; font-weight: 600; }
.status { padding: 1px 9px; border-radius: var(--r-pill); font-size: 0.78rem; font-weight: 600; }
.status-ready { background: var(--good-soft); color: var(--good); }
.status-soon { color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line-strong); }
@media (max-width: 620px) { .dl-row { grid-template-columns: 44px minmax(0, 1fr); } .dl-row > .icon { width: 44px; height: 44px; } .dl-row .btn { grid-column: 2; grid-row: auto; justify-self: start; margin-block-start: 8px; } }
.specs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 3vw, 40px); }
.specs div { padding-block-start: 16px; border-block-start: 1px solid var(--line-strong); }
.specs p { margin-block-start: 6px; color: var(--ink-2); font-size: 0.96rem; }
@media (max-width: 760px) { .specs { grid-template-columns: 1fr; } }

/* Steps that happen in order */
.steps { display: grid; gap: clamp(28px, 4vw, 44px); counter-reset: step; }
.steps > li { display: grid; grid-template-columns: 52px minmax(0, 5fr) minmax(0, 6fr); gap: 12px clamp(16px, 3vw, 36px); align-items: start; counter-increment: step; }
.steps > li::before { content: counter(step); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }
.steps h3 { font-weight: 600; font-size: 1.2rem; line-height: 1.35; }
.steps p { margin-block-start: 8px; color: var(--ink-2); }
@media (max-width: 860px) { .steps > li { grid-template-columns: 44px minmax(0, 1fr); } .steps .shot-ui { grid-column: 2; } }
.shot-ui { display: grid; gap: 8px; align-content: center; min-height: 100%; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--sunken); font-size: 0.88rem; }
.ui-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); }
.ui-row .icon { color: var(--accent); }
.ui-row.is-on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ui-row em { margin-inline-start: auto; font-style: normal; color: var(--ink-3); font-size: 0.8rem; }
.ui-drop { display: grid; justify-items: center; gap: 6px; padding: 22px 12px; border: 1.5px dashed var(--line-strong); border-radius: 10px; background: var(--raised); color: var(--ink-2); text-align: center; }
.ui-drop .icon { color: var(--accent); }
.ui-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.ui-bar i { display: block; width: 72%; height: 100%; background: var(--accent); }
.ui-file { font-family: var(--font-mono); font-size: 0.76rem; direction: ltr; unicode-bidi: isolate; }

/* Two lists side by side: what arrives and what does not, or when to choose which */
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pair > div { padding: clamp(20px, 3vw, 28px); border: 1px solid var(--line); border-radius: var(--r-sheet); background: var(--raised); }
.pair > div.is-us { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.pair h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; line-height: 1.3; }
.dashes { display: grid; gap: 9px; margin-block-start: 18px; }
.dashes li { position: relative; padding-inline-start: 26px; color: var(--ink-2); font-size: 0.98rem; line-height: 1.5; }
.dashes li::before { content: ""; position: absolute; inset-inline-start: 4px; inset-block-start: 0.72em; width: 10px; height: 1.75px; background: var(--ink-3); }
@media (max-width: 760px) { .pair { grid-template-columns: 1fr; } }

/* Inner-page questions: one column */
.doc .faq { display: block; width: auto; padding: 0; }
.doc .faq-list { max-width: 48em; }

/* What's new: one entry per day, newest first */
.timeline { display: grid; max-width: 58em; }
.day { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 8px clamp(18px, 4vw, 48px); padding-block: 30px; border-block-start: 1px solid var(--line); }
.day:first-child { border-block-start: 0; padding-block-start: 0; }
.day-when { align-self: start; position: sticky; inset-block-start: 96px; }
.day-when time { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; line-height: 1.35; }
.day-when span { display: block; margin-block-start: 2px; font-size: 0.84rem; color: var(--ink-3); }
.day h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.3rem, 2.2vw, 1.65rem); line-height: 1.3; }
.day ul { display: grid; gap: 8px; margin-block-start: 14px; }
.day li { position: relative; padding-inline-start: 20px; color: var(--ink-2); }
.day li::before { content: ""; position: absolute; inset-inline-start: 2px; inset-block-start: 0.66em; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--accent); }
@media (max-width: 640px) { .day { grid-template-columns: 1fr; } .day-when { position: static; } }

/* A closing band under an inner page */
.next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; padding-block: clamp(56px, 8vw, 96px); }
.next h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.2; max-width: 18em; }
:lang(ar) .next h2 { line-height: 1.5; }
.next .cta-row { margin: 0; }

/* Not found */
.lost { display: grid; justify-items: center; gap: 18px; padding: clamp(140px, 22vh, 220px) var(--gutter) clamp(80px, 12vh, 140px); text-align: center; }
.lost .lede { max-width: 30em; }
.lost .cta-row { margin: 8px 0 0; }


/* =================================================================
   The film: the first screen. A looping render of the page in orbit,
   giant type over it, the call to action beside it.
   ================================================================= */
.cine { position: relative; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); grid-template-rows: 1fr auto; align-items: end; gap: 24px clamp(24px, 4vw, 64px); min-height: 100svh; padding: calc(var(--nav-h) + 40px) var(--gutter) clamp(28px, 5vh, 56px); overflow: clip; isolation: isolate; }
.cine-media { position: absolute; inset: 0; z-index: -1; background: var(--frame); }
.cine-media img, .cine-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 72% 50%; }
.cine-video { opacity: 0; transition: opacity 1.2s var(--ease); }
.cine-video.is-playing { opacity: 1; }
/* Mirrored with `scale`; the intro zoom is a CSS animation on `transform`, so the two compose (GSAP would rewrite the mirror as a 180° rotation). */
[dir="rtl"] .cine-media img, [dir="rtl"] .cine-media video { scale: -1 1; }
/* A soft wash keeps the words readable where they cross the picture. */
.cine-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, color-mix(in srgb, var(--frame) 70%, transparent) 0%, transparent 42%), linear-gradient(to right, color-mix(in srgb, var(--frame) 55%, transparent) 0%, transparent 55%); }
[dir="rtl"] .cine-media::after { background: linear-gradient(to top, color-mix(in srgb, var(--frame) 70%, transparent) 0%, transparent 42%), linear-gradient(to left, color-mix(in srgb, var(--frame) 55%, transparent) 0%, transparent 55%); }
.cine-copy { grid-column: 1; grid-row: 2; }
.mega { display: grid; gap: 18px; margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(3.2rem, 9.4vw, 9.6rem); line-height: 0.92; color: var(--ink); text-wrap: balance; }
.mega-text { display: block; }
:lang(ar) .mega { line-height: 1.12; font-size: clamp(2.9rem, 8.4vw, 8.4rem); }
.mega-sm { font-size: clamp(2.6rem, 6.6vw, 6.4rem); }
:lang(ar) .mega-sm { font-size: clamp(2.4rem, 6vw, 5.8rem); }
.kicker { display: inline-flex; align-items: center; gap: 10px; justify-self: start; font-family: var(--font-ui); font-size: clamp(0.9rem, 1.1vw, 1.05rem); font-weight: 500; letter-spacing: 0; line-height: 1.4; color: var(--ink-2); }
.kicker::before { content: ""; width: 26px; height: 2px; border-radius: 2px; background: var(--logo-accent); }
.cine-side { grid-column: 2; grid-row: 2; display: grid; gap: 18px; padding: clamp(18px, 2vw, 26px); border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); border-radius: 22px; background: color-mix(in srgb, var(--sheet) 62%, transparent); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); box-shadow: 0 30px 60px -30px rgba(60, 48, 24, 0.35); }
.cine-lede { max-width: 30em; font-size: clamp(1rem, 1.25vw, 1.15rem); color: var(--ink-2); text-wrap: pretty; }
.cine-side .cta-row { justify-content: flex-start; margin: 0; }
.scroll-cue { position: absolute; inset-block-start: calc(var(--nav-h) + 36px); inset-inline-end: var(--gutter); display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent); border-radius: 999px; font-size: 0.82rem; color: var(--ink-2); text-decoration: none; backdrop-filter: blur(8px); }
.scroll-cue .icon { animation: cue 2.4s var(--ease) infinite; }
@keyframes cue { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }
.js:not(.no-motion) [data-cine-fade] { opacity: 0; }
.js:not(.no-motion) .cine-poster { animation: cine-settle 2.2s cubic-bezier(0.16, 1, 0.3, 1) 0.1s backwards; }
@keyframes cine-settle { from { transform: scale(1.08); } }
.js:not(.no-motion) [data-cine-title] .mega-text { opacity: 0; }
@media (max-width: 900px) {
  .cine { grid-template-columns: 1fr; grid-template-rows: auto auto auto; align-items: start; min-height: 0; padding-block-start: calc(var(--nav-h) + 24px); }
  .cine-media { position: relative; inset: auto; grid-row: 2; margin-inline: calc(-1 * var(--gutter)); aspect-ratio: 4 / 3; z-index: 0; }
  .cine-media::after { background: linear-gradient(to bottom, var(--frame) 0%, transparent 18%, transparent 82%, var(--frame) 100%); }
  .cine-media img, .cine-media video { object-position: 74% 50%; }
  .cine-copy { grid-row: 1; }
  .cine-side { grid-column: 1; grid-row: 3; }
  .scroll-cue { display: none; }
}

/* =================================================================
   Zen: the section does what Zen does. An app window grows to the whole
   screen, the sidebar and bar leave, every line but yours falls quiet.
   Five numbers drive it, set by site.js while scrolling:
   --zs scale, --zr corner, --chrome (1 app, 0 gone), --z (0 app, 1 zen),
   --tp the focus timer, --shift the page moving aside for the words.
   Without scroll scenes the section shows the end state, framed.
   ================================================================= */
.zen { width: min(var(--page), calc(100% - 2 * var(--gutter))); margin-inline: auto; padding-block: clamp(64px, 10vw, 130px); --dir: 1; }
[dir="rtl"] .zen { --dir: -1; }
.zen-pin { display: grid; gap: clamp(28px, 4vw, 48px); }
.zen-window {
  --zs: 1; --zr: var(--r-plate); --chrome: 0; --z: 1; --tp: 0.42; --shift: 0;
  position: relative; display: grid; grid-template-columns: calc(52px * var(--chrome)) calc(228px * var(--chrome)) minmax(0, 1fr);
  aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid color-mix(in srgb, var(--line) calc(var(--chrome) * 100%), transparent); border-radius: var(--zr); background: var(--frame);
  box-shadow: var(--shadow-float); transform: scale(var(--zs)); transform-origin: 50% 50%; will-change: transform;
}
.zw-rail { display: flex; flex-direction: column; align-items: center; gap: 20px; padding-block: 16px; overflow: hidden; color: var(--ink-3); opacity: var(--chrome); }
.zw-dot { width: 22px; height: 22px; border-radius: 7px; background: var(--logo-accent); opacity: 0.85; }
.zw-side { min-width: 0; overflow: hidden; padding: 14px 10px 14px 4px; white-space: nowrap; font-size: 0.86rem; color: var(--ink-2); opacity: var(--chrome); }
.zw-space { display: flex; align-items: center; gap: 8px; margin-block-end: 16px; font-weight: 600; color: var(--ink); }
.zw-space b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--ink); color: var(--sheet); font-size: 0.72rem; }
.zw-label { margin: 14px 8px 4px; font-size: 0.75rem; color: var(--ink-3); }
.zw-item { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; }
.zw-item.is-on { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.zw-main {
  position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  margin: calc(8px * var(--chrome)); border-radius: calc(12px * var(--chrome));
  background: color-mix(in srgb, var(--sunken) calc(var(--z) * 100%), var(--sheet));
  box-shadow: 0 0 0 calc(1px * var(--chrome)) var(--line);
}
.zw-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: calc(46px * var(--chrome)); padding-inline: 18px; overflow: hidden; font-size: 0.82rem; color: var(--ink-2); opacity: var(--chrome); }
.zw-bar .crumb { display: inline-flex; align-items: center; gap: 6px; }
.zw-page-menu { display: inline-flex; align-items: center; gap: 4px; }
.zw-doc {
  width: min(620px, 82%); margin: auto; font-family: Georgia, "Noto Naskh Arabic", serif; font-size: calc(15px + 5px * var(--z)); line-height: 1.75; color: var(--ink);
  translate: calc(var(--shift) * var(--dir) * 15vw) 0;
}
.zw-h { margin-block: 0.9em 0.35em; font-weight: 700; font-size: 1.12em; }
.zw-h:first-child { margin-block-start: 0; }
.zw-list li { display: flex; align-items: baseline; gap: 0.7em; padding-block: 0.12em; }
.zw-bullet { flex: none; width: 0.32em; height: 0.32em; border-radius: 50%; background: currentColor; translate: 0 -0.2em; }
.zw-num { flex: none; min-width: 1.2em; color: var(--ink-2); }
.zw-quote { padding-inline-start: 0.9em; border-inline-start: 3px solid var(--line-strong); }
.zw-p { margin-block-start: 0.6em; color: var(--ink-2); }
[data-zen-dim] { opacity: calc(1 - 0.72 * var(--z)); }
.zw-caret { display: inline-block; width: 2px; height: 1.05em; margin-inline-start: 2px; background: var(--ink); vertical-align: -0.15em; animation: zen-caret 1.1s steps(1) infinite; }
@keyframes zen-caret { 50% { opacity: 0; } }
.zw-timer { position: absolute; inset-inline: 0; inset-block-end: 0; height: 3px; background: color-mix(in srgb, var(--ink) 7%, transparent); opacity: var(--z); }
.zw-timer-fill { display: block; width: calc(var(--tp) * 100%); height: 100%; background: var(--logo-accent); }

.zen-copy { max-width: 620px; }
.zen-kicker { display: inline-flex; align-items: center; gap: 8px; margin-block-end: 14px; font-weight: 500; color: var(--accent); }
.zen-title { font-size: clamp(2.2rem, 4.4vw, 3.9rem); }
.zen-lede { margin-block-start: 18px; font-size: clamp(1.02rem, 1.3vw, 1.18rem); color: var(--ink-2); }
.zen-facts { display: grid; gap: 10px; margin-block: 24px 30px; color: var(--ink-2); font-size: 0.97rem; }
.zen-facts li { display: flex; align-items: center; gap: 10px; }
.zen-facts .icon { flex: none; color: var(--accent); }
.zen-facts kbd { padding: 1px 7px; border: 1px solid var(--line-strong); border-block-end-width: 2px; border-radius: 5px; background: var(--raised); font: 500 0.82rem var(--font-ui); }

/* Scroll scenes on a wide screen: the section takes the whole screen and the script plays it. */
.zen.is-live { width: 100%; padding-block: 0; }
.zen.is-live .zen-pin { position: relative; display: block; height: 100svh; overflow: hidden; }
.zen.is-live .zen-window { position: absolute; inset: 0; aspect-ratio: auto; }
.zen.is-live .zw-doc { width: min(600px, 48vw); margin-block: calc(44px + var(--z) * 13vh) auto; }
.zen.is-live .zen-copy { position: absolute; z-index: 2; inset-inline-start: clamp(28px, 5vw, 88px); inset-block-end: clamp(48px, 11vh, 130px); width: min(500px, 34vw); }
@media (max-width: 700px) {
  .zen-window { aspect-ratio: 4 / 5; }
  .zw-doc { width: 86%; font-size: calc(14px + 2px * var(--z)); }
}
@media (prefers-reduced-motion: reduce) { .zw-caret { animation: none; } }

/* Study, in the product story: a flashcard, drawn in HTML. The answer and the pick arrive in turn. */
.study { display: flex; flex-direction: column; gap: 14px; width: min(520px, 100%); margin: auto; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-sheet); background: var(--sheet); box-shadow: var(--shadow-float); font-size: 0.93rem; }
.study-head { display: flex; align-items: center; gap: 9px; color: var(--ink-2); }
.study-head b { color: var(--ink); font-weight: 600; }
.study-due { margin-inline-start: auto; font-size: 0.82rem; color: var(--ink-3); }
.flash { display: grid; gap: 10px; justify-items: center; padding: 26px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); text-align: center; }
.flash-q { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: var(--ink); }
.flash-a { font-size: 1.15rem; color: var(--accent); opacity: 0; transform: translateY(6px); transition: opacity 0.45s var(--ease), transform 0.55s var(--ease); }
.flash-hook { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; background: var(--gold-soft); color: var(--ink-2); font-size: 0.84rem; opacity: 0; transition: opacity 0.45s var(--ease); }
.flash-hook .icon { color: var(--gold); }
.grades { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.grades span { display: grid; gap: 2px; padding: 8px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); text-align: center; transition: background 0.35s var(--ease), border-color 0.35s var(--ease), color 0.35s var(--ease); }
.grades b { font-weight: 600; font-size: 0.86rem; }
.grades small { font-size: 0.75rem; color: var(--ink-3); }
.visual.is-active .flash-a { opacity: 1; transform: none; transition-delay: 0.9s; }
.visual.is-active .flash-hook { opacity: 1; transition-delay: 1.5s; }
.visual.is-active .grades .is-pick { border-color: var(--accent); background: var(--accent); color: var(--on-accent); transition-delay: 2.2s; }
.visual.is-active .grades .is-pick small { color: inherit; }

/* The newer small things: sharing, templates, automations. */
.demo-share { padding: 16px; }
.share-pop { width: min(310px, 100%); padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--raised); box-shadow: var(--shadow-sheet); }
.share-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px; font-size: 0.84rem; color: var(--ink); }
.share-row + .share-row { border-block-start: 1px solid var(--line); }
.share-row em { margin-inline-start: auto; font-style: normal; font-size: 0.78rem; color: var(--ink-3); white-space: nowrap; }
.share-row .share-on { color: var(--accent); font-weight: 500; }
.share-row .icon { color: var(--ink-2); }
.share-av { display: grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 0.68rem; font-weight: 600; }
.demo-templates { place-items: stretch; align-content: center; gap: 8px; padding: 16px 22px; }
.tpl { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--raised); font-size: 0.86rem; color: var(--ink); }
.tpl .icon { color: var(--ink-2); }
.tpl-on { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.tpl-on .icon { color: var(--accent); }
.demo-flow { grid-auto-flow: column; gap: 10px; padding: 14px; font-size: 0.85rem; }
.flow-line { color: var(--accent); }
.flow-row { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--raised); color: var(--ink); }
.flow-row .icon { color: var(--accent); }

/* =================================================================
   Privacy: a full-width night band with the sealed parcel in it.
   ================================================================= */
.band-night { position: relative; overflow: clip; isolation: isolate; background: #2b2a2c; color: var(--night-ink); --ink: var(--night-ink); --ink-2: var(--night-ink-2); --line: var(--night-line); --accent: var(--night-accent); --logo-accent: #2bb673; }
.band-media { position: absolute; inset: 0 0 auto auto; z-index: -1; width: min(1500px, 100%); height: 100%; object-fit: cover; object-position: 80% 50%; opacity: 0.95; }
[dir="rtl"] .band-media { inset: 0 auto auto 0; transform: scaleX(-1); }
.band-night::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to right, #2b2a2c 0%, rgba(43, 42, 44, 0.9) 38%, rgba(43, 42, 44, 0.1) 75%), linear-gradient(to top, #2b2a2c 0%, transparent 40%); }
[dir="rtl"] .band-night::before { background: linear-gradient(to left, #2b2a2c 0%, rgba(43, 42, 44, 0.9) 38%, rgba(43, 42, 44, 0.1) 75%), linear-gradient(to top, #2b2a2c 0%, transparent 40%); }
.band-inner { width: min(var(--page), calc(100% - 2 * var(--gutter))); margin-inline: auto; padding-block: clamp(96px, 14vw, 180px) clamp(72px, 9vw, 120px); }
.band-night .section-head { max-width: 600px; }
.band-night .h2 { font-size: clamp(2.4rem, 6vw, 5.2rem); }
.band-night .section-sub, .band-night .promise p { color: var(--night-ink-2); }
.band-night .route { max-width: 540px; }
.band-night .route-node { width: 120px; }
@media (min-width: 761px) { .band-night .promises { grid-template-columns: 1fr; max-width: 520px; gap: 22px; } }
@media (max-width: 760px) {
  .band-media { position: relative; inset: auto; width: 100%; height: auto; aspect-ratio: 16 / 10; }
  .band-night::before { background: linear-gradient(to bottom, transparent 30%, #2b2a2c 56%); }
  .band-inner { padding-block-start: 0; }
}

/* =================================================================
   Closing: the ribbon, and one last invitation.
   ================================================================= */
.closing { position: relative; display: block; padding: 0; text-align: start; overflow: clip; isolation: isolate; }
.closing-media { position: absolute; inset: 0; z-index: -1; }
.closing-media img { width: 100%; height: 100%; object-fit: cover; object-position: 78% 50%; }
[dir="rtl"] .closing-media img { transform: scaleX(-1); }
.closing-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to right, var(--frame) 8%, color-mix(in srgb, var(--frame) 70%, transparent) 42%, transparent 70%); }
[dir="rtl"] .closing-media::after { background: linear-gradient(to left, var(--frame) 8%, color-mix(in srgb, var(--frame) 70%, transparent) 42%, transparent 70%); }
.closing-copy { display: grid; justify-items: start; gap: 22px; width: min(var(--page), calc(100% - 2 * var(--gutter))); margin-inline: auto; padding-block: clamp(120px, 20vw, 260px); }
.closing-copy .mega { justify-self: stretch; max-width: 8.5em; }
.closing-copy .cta-row { justify-content: flex-start; margin: 0; }
@media (max-width: 760px) {
  .closing-media { position: relative; aspect-ratio: 16 / 9; }
  .closing-media::after { background: linear-gradient(to bottom, transparent 60%, var(--frame) 100%); }
  .closing-copy { padding-block: 8px 96px; }
}

/* =================================================================
   Footer: the wordmark, as wide as the page.
   ================================================================= */
.footer-mark { grid-column: 1 / -1; width: 100%; height: auto; margin-block: clamp(24px, 5vw, 56px) clamp(8px, 2vw, 24px); color: var(--ink); }
.footer-brand .logo { height: 46px; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .footer-mark { animation: mark-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
    @keyframes mark-rise { from { clip-path: inset(0 0 100% 0); transform: translateY(18%); } to { clip-path: inset(0 0 0 0); transform: none; } }
  }
}

/* =================================================================
   Blog: an index of cards, and articles set for long reading.
   ================================================================= */
.blog-head { display: grid; justify-items: start; gap: 18px; width: min(var(--page), calc(100% - 2 * var(--gutter))); margin: calc(var(--nav-h) + clamp(48px, 9vw, 110px)) auto clamp(36px, 5vw, 64px); }
.blog-head .mega { max-width: 11em; }
.blog-list { display: grid; gap: clamp(28px, 4vw, 48px); width: min(var(--page), calc(100% - 2 * var(--gutter))); margin-inline: auto; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: clamp(20px, 3vw, 36px); }
.post-card { display: grid; align-content: start; gap: 10px; color: inherit; text-decoration: none; }
.post-card-img { display: block; overflow: hidden; border-radius: var(--r-plate); background: var(--sunken); aspect-ratio: 16 / 9; }
.post-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.post-card:hover .post-card-img img { transform: scale(1.04); }
.post-card-meta { margin-block-start: 6px; font-size: 0.86rem; color: var(--ink-3); }
.post-card-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.3rem, 2vw, 1.6rem); line-height: 1.2; }
:lang(en) .post-card-title { letter-spacing: -0.015em; }
:lang(ar) .post-card-title { line-height: 1.45; }
.post-card:hover .post-card-title { color: var(--accent); }
.post-card-desc { color: var(--ink-2); font-size: 0.98rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-feature .post-card { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-rows: auto auto 1fr; column-gap: clamp(20px, 4vw, 56px); align-items: start; }
.post-feature .post-card-img { grid-row: 1 / span 4; }
.post-feature .post-card-meta { align-self: end; margin-block-start: clamp(12px, 3vw, 40px); }
.post-feature .post-card-title { font-size: clamp(1.8rem, 3.6vw, 3rem); line-height: 1.08; }
:lang(ar) .post-feature .post-card-title { line-height: 1.35; }
@media (max-width: 860px) { .post-feature .post-card { grid-template-columns: 1fr; } .post-feature .post-card-img { grid-row: auto; } }

.post { width: min(1100px, calc(100% - 2 * var(--gutter))); margin: calc(var(--nav-h) + clamp(40px, 7vw, 90px)) auto 0; }
.post-head { display: grid; gap: 16px; max-width: 46rem; margin-inline: auto; }
.post-crumb a { font-weight: 500; color: var(--accent); text-decoration: none; }
.post-crumb a:hover { text-decoration: underline; text-underline-offset: 3px; }
.post-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.04; }
:lang(en) .post-title { letter-spacing: -0.03em; }
:lang(ar) .post-title { line-height: 1.3; }
.post-lede { font-size: clamp(1.08rem, 1.5vw, 1.25rem); color: var(--ink-2); text-wrap: pretty; }
.post-meta { font-size: 0.9rem; color: var(--ink-3); }
.post-cover { margin: clamp(28px, 4vw, 52px) 0; overflow: hidden; border-radius: var(--r-plate); background: var(--sunken); }
.post-cover img { width: 100%; height: auto; }
.post-body { max-width: 42rem; margin-inline: auto; font-size: 1.12rem; line-height: 1.8; color: var(--ink); }
:lang(ar) .post-body { font-size: 1.16rem; line-height: 2; }
.post-body > * + * { margin-block-start: 1.1em; }
.post-body h2 { margin-block-start: 2.2em; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.2; }
:lang(en) .post-body h2 { letter-spacing: -0.02em; }
:lang(ar) .post-body h2 { line-height: 1.45; }
.post-body ul, .post-body ol { display: grid; gap: 0.6em; padding-inline-start: 1.4em; }
.post-body ul { list-style: disc; } .post-body ol { list-style: decimal; }
.post-body li::marker { color: var(--accent); font-weight: 600; }
.post-body a { color: var(--accent); font-weight: 500; text-underline-offset: 3px; }
.post-body blockquote { margin-inline: 0; padding: 18px 22px; border-inline-start: 3px solid var(--logo-accent); border-radius: 0 12px 12px 0; background: var(--sheet); font-family: var(--font-display); font-size: 1.15em; line-height: 1.5; }
[dir="rtl"] .post-body blockquote { border-radius: 12px 0 0 12px; }
.post-body table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 0.92em; line-height: 1.5; }
.post-body th, .post-body td { padding: 8px 12px; border-block-end: 1px solid var(--line, rgba(127,127,127,.25)); text-align: start; white-space: nowrap; }
.post-body thead th { font-weight: 600; }
.post-body pre { overflow-x: auto; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--sheet); direction: ltr; text-align: left; }
.post-body code { font-family: var(--font-mono); font-size: 0.88em; }
.post-body :not(pre) > code { padding: 1px 6px; border-radius: 5px; background: var(--sunken); }
.post-cta { display: grid; justify-items: start; gap: 12px; max-width: 42rem; margin: clamp(48px, 7vw, 80px) auto 0; padding: clamp(22px, 4vw, 36px); border-radius: var(--r-plate); background: #2b2a2c; color: var(--night-ink); --on-accent: #2b2a2c; --accent: var(--night-accent); }
.post-cta h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.4rem, 2.6vw, 2rem); }
.post-cta p { color: var(--night-ink-2); }
.post-more { width: min(1100px, calc(100% - 2 * var(--gutter))); margin: clamp(64px, 9vw, 120px) auto 0; }
.post-more .h3 { margin-block-end: 24px; }

/* =================================================================
   Phones: most visitors come on one, so these come last and win.
   ================================================================= */
@media (max-width: 640px) {
  /* Less empty scrolling between sections. */
  .statement, .more, .people, .faq { padding-block: 64px; }
  .zen { padding-block: 48px; }
  .band-inner { padding-block-end: 64px; }
  .closing-copy { padding-block-end: 72px; }
  .doc-section { padding-block-start: 36px; }
  .doc-section + .doc-section { margin-block-start: 36px; }
  /* Sheets reach nearer the edge, so the text inside gets the width. */
  .doc { width: calc(100% - 16px); margin-block-start: calc(var(--nav-h) + 22px); }
  .plate { padding-inline: 14px; }
  /* The orbit circles above the page instead of across its text (site.js lifts its centre to match). */
  .orbit-stage { padding-block-start: 180px; }
  /* Footer links: tall enough for a thumb. */
  .footer-cols div { gap: 0; }
  .footer-cols a { padding-block: 7px; }
  /* Tables: the row's name on its own line, its values side by side under the column names. */
  .matrix-wrap { overflow: visible; }
  .matrix, .matrix tbody, .matrix thead { display: block; min-width: 0; }
  .matrix thead { position: sticky; inset-block-start: calc(var(--nav-h) + 12px); z-index: 1; }
  .matrix tr { display: flex; flex-wrap: wrap; }
  .matrix thead th:first-child { display: none; }
  .matrix th, .matrix td { padding: 10px 12px; }
  .matrix thead th, .matrix td { flex: 1 1 0; min-width: 0; white-space: normal; }
  .matrix tbody th { flex-basis: 100%; width: auto; padding-block-end: 0; border-block-end: 0; }
  .matrix .group th { padding-block: 20px 4px; }
  .matrix thead tr > :nth-child(2) { border-start-start-radius: var(--r-sheet); }
  .matrix thead tr > :last-child { border-start-end-radius: var(--r-sheet); }
}

/* Hero film across a language switch: no cross-fade between the old frame and the new page. */
.cine-media { view-transition-name: hero-media; }
::view-transition-old(hero-media) { animation: none; opacity: 0; }
::view-transition-new(hero-media) { animation: none; }

/* Hero on phones and tablets: one full screen. The film fills the top and fades into the page;
   the title, the words and the buttons sit low, where the thumb is. */
@media (max-width: 900px) {
  .cine { grid-template-rows: minmax(26svh, 1fr) auto auto; align-items: end; gap: 18px; min-height: 100svh; padding-block: calc(var(--nav-h) + 16px) max(28px, env(safe-area-inset-bottom)); }
  .cine-media { position: absolute; inset: 0; grid-area: auto; aspect-ratio: auto; margin-inline: 0; z-index: -1; }
  .cine-media img, .cine-media video { inset: 0 0 auto; height: 48%; object-position: 72% 55%; }
  .cine-media::after, [dir="rtl"] .cine-media::after { background: linear-gradient(to bottom, var(--frame) 0%, transparent 14%, transparent 30%, var(--frame) 48%); }
  .cine-copy { grid-row: 2; }
  .cine-side { grid-row: 3; gap: 14px; padding: 0; border: 0; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .cine-side .fine { text-align: center; }
  /* Same picture in both languages, so switching does not flip it. */
  [dir="rtl"] .cine-media img, [dir="rtl"] .cine-media video { scale: none; }
}
@media (max-width: 640px) {
  .cine .mega { gap: 14px; font-size: clamp(2.6rem, 12vw, 3.4rem); }
  .cine-side .cta-row, .closing-copy .cta-row { display: grid; justify-content: stretch; justify-self: stretch; width: 100%; }
  .cine-side .cta-row .btn, .closing-copy .cta-row .btn { width: 100%; }
}

/* ---------- Touch ----------
   Targets follow Google's 48dp / Apple's 44pt guidance; mouse users keep the tighter desktop sizes. */
html { -webkit-tap-highlight-color: transparent; }
a, button, summary, label, input { touch-action: manipulation; }
/* The menu: the page behind stays put, and a long menu scrolls inside itself. */
html:has(.menu:popover-open) { overflow: hidden; }
.menu { max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
@media (pointer: coarse) {
  .tool { min-width: 44px; height: 44px; }
  .view-switch button { min-height: 40px; padding-inline: 13px; }
  .btn:active { scale: 0.97; }
  .menu nav a:active, .tool:active { background: var(--sunken); }
  /* The orbit's moving icons are small; give each finger a bigger catch. */
  .chip { position: relative; }
  .chip::after { content: ""; position: absolute; inset: -10px; }
  .calc input[type="range"] { height: 44px; }
}
@media (max-width: 420px) {
  /* The nav's Download button is hidden here, so the menu leads with it. */
  .menu nav a[href$="/download/"] { order: -1; margin-block-end: 6px; background: var(--accent); color: var(--on-accent); text-align: center; font-weight: 500; }
}
/* boot.js: a hand-picked theme that differs from the system's; base.js lifts this once the right picture is in. */
.theme-flip [data-themed-media] { visibility: hidden; }
