/*  MedScan IQ — site styles
    Layout concept: a dark product stage. One 3D capsule lives behind the page;
    text sits on a strict 12-column grid with hairline rules, square edges
    and mono annotations, like a technical sheet laid over a studio shot.     */

@font-face { font-family: "Archivo"; src: url("../fonts/archivo-var.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url("../fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Plex Arabic"; src: url("../fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Plex Arabic"; src: url("../fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Kufi"; src: url("../fonts/noto-kufi-arabic-arabic-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Kufi"; src: url("../fonts/noto-kufi-arabic-arabic-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }

:root {
  color-scheme: dark;
  /* colour — graphite stage, ivory type, one ice-blue accent */
  --void: #07080B;           /* stage black */
  --char: #0F1115;           /* graphite surfaces */
  --ink: #EEEDE8;            /* ivory: primary text */
  --mute: #9A9EA8;           /* secondary text */
  --dim: #5C616B;            /* labels */
  --line: rgba(238, 237, 232, .11);
  --line-2: rgba(238, 237, 232, .2);
  --accent: #A9C4FF;         /* ice blue, the scan light */
  --accent-deep: #1B2C78;    /* the capsule's cobalt glaze */
  --glass: rgba(15, 17, 21, .5);
  --tick: rgba(169, 196, 255, .55);
  --metal: linear-gradient(180deg, #FFFFFF 0%, #EEEDE8 38%, #B9BDC6 72%, #7F8592 100%);
  /* type */
  --display: "Archivo", "Kufi", "Helvetica Neue", Arial, sans-serif;
  --body: "Archivo", "Plex Arabic", "Helvetica Neue", Arial, sans-serif;
  --mono: "Plex Mono", "Plex Arabic", ui-monospace, "SF Mono", Menlo, monospace;
  --t-xs: .72rem; --t-s: .875rem; --t-m: 1rem; --t-l: clamp(1.06rem, .95rem + .45vw, 1.3rem);
  --t-xl: clamp(1.5rem, 1.1rem + 1.6vw, 2.4rem);
  --t-2xl: clamp(2.2rem, 1.2rem + 4.2vw, 5.2rem);
  --t-hero: clamp(2.6rem, min(.6rem + 8.4vw, 16vh), 10.5rem);
  /* space */
  --g: clamp(16px, 4vw, 64px);
  --sect: clamp(110px, 16vw, 240px);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --mast-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--void); -webkit-tap-highlight-color: transparent; }
a, button, summary { touch-action: manipulation; }
/* smooth scrolling (desktop) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body { margin: 0; background: var(--void); color: var(--ink); font: 400 var(--t-m)/1.6 var(--body); font-stretch: 100%; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
[dir="rtl"] body { line-height: 1.85; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--void); }
.metal { background: var(--metal); -webkit-background-clip: text; background-clip: text; color: transparent; }
:focus { outline: none; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
.mono { font-family: var(--mono); font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; font-weight: 400; }
[dir="rtl"] .mono { letter-spacing: 0; text-transform: none; font-size: .8rem; }
.wrap { width: 100%; max-width: 1680px; margin-inline: auto; padding-inline: var(--g); }
.skip { position: fixed; z-index: 100; inset-block-start: 12px; inset-inline-start: 12px; padding: 10px 16px; background: var(--ink); color: var(--void); transform: translateY(-200%); transition: transform .3s var(--ease); }
.skip:focus { transform: none; }

/* ───────── stage (3D canvas, fallback poster, vignette, grain) ───────── */
.stage { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: var(--void); }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.4s var(--ease); }
.scene-ready #scene { opacity: 1; }
/* right-to-left pages: mirror the stage so the object sits opposite the text */
[dir="rtl"].no-webgl .poster { transform: scaleX(-1); }
@media (max-width: 820px) { .scene-ready:not([data-chapter="0"]) #scene { opacity: .3; } }
.poster { position: absolute; inset: 0; background: radial-gradient(60% 55% at 70% 45%, rgba(27, 44, 120, .32), transparent 70%), radial-gradient(40% 40% at 72% 48%, rgba(169, 196, 255, .12), transparent 70%), var(--void); opacity: 1; transition: opacity 1.4s var(--ease); }
.scene-ready .poster { opacity: 0; }
.no-webgl .poster { background: url("../img/poster.jpg") 70% 50% / cover no-repeat, var(--void); }
@media (max-width: 820px) { .no-webgl .poster { background-position: 60% 20%; opacity: .7; } }
.vignette { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0, 0, 0, .65) 100%); }
.grain { position: absolute; inset: -50%; opacity: .07; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); animation: grain 1.2s steps(6) infinite; }
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-4%, 3%); } 40% { transform: translate(3%, -5%); } 60% { transform: translate(-6%, -2%); } 80% { transform: translate(5%, 4%); } 100% { transform: translate(0, 0); } }
main, .foot { position: relative; z-index: 1; }
/* sub-pages: a calm, fixed backdrop instead of the scene */
.page .poster { background: radial-gradient(50% 45% at 85% 0%, rgba(27, 44, 120, .28), transparent 70%), var(--void); }

/* ───────── loader ───────── */
.loader { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; color: var(--ink); visibility: hidden; }
.js .home .loader { visibility: visible; animation: loader-failsafe 0s 8s forwards; }
@keyframes loader-failsafe { to { visibility: hidden; } }
.lp { position: absolute; inset-inline: 0; height: 50.5%; background: var(--void); }
.lp-a { top: 0; } .lp-b { bottom: 0; }
.loader-mark { position: relative; direction: ltr; display: flex; gap: .3em; font: 800 clamp(1.4rem, 4vw, 2.6rem)/1 var(--display); font-stretch: 125%; letter-spacing: -.01em; overflow: hidden; padding-block: .1em; }
.loader-mark span:last-child { color: var(--accent); }
.loader-foot { position: absolute; inset-inline: var(--g); bottom: calc(var(--g) + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: space-between; color: var(--mute); }
.loader-num { font-variant-numeric: tabular-nums; color: var(--ink); }
.loader-line { position: absolute; inset-inline: 0; top: 50%; height: 1px; background: var(--line); transform-origin: center; }
.loader-line::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform: scaleX(var(--p, 0)); transform-origin: left; }
[dir="rtl"] .loader-line::after { transform-origin: right; }
.loader-mark { transform: translateY(-1.4em); }

/* page transition curtain */
.curtain { position: fixed; inset: 0; z-index: 95; background: var(--char); transform: scaleY(0); pointer-events: none; }
.curtain::after { content: ""; position: absolute; inset-inline: 0; top: 0; height: 1px; background: var(--accent); }

/* ───────── masthead ───────── */
.mast { position: fixed; z-index: 50; inset-inline: 0; top: 0; padding-top: env(safe-area-inset-top, 0px); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: stretch; gap: 0; height: calc(var(--mast-h) + env(safe-area-inset-top, 0px)); border-bottom: 1px solid transparent; transition: background-color .5s, border-color .5s, backdrop-filter .5s; }
.scrolled .mast, .page .mast { background: rgba(7, 8, 11, .55); border-bottom-color: var(--line); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); }
.mark { display: flex; align-items: center; gap: .32em; padding-inline: var(--g) 28px; font: 800 .95rem/1 var(--display); font-stretch: 125%; letter-spacing: .01em; }
.mark b { color: var(--accent); font-weight: 800; }
[dir="rtl"] .mark { direction: ltr; }

/* chapter index: one cell per chapter, a hairline fills as you read it */
.chapters { min-width: 0; border-inline: 1px solid var(--line); }
.chapters ol { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); height: 100%; }
.chapters li { min-width: 0; }
.chapters li + li { border-inline-start: 1px solid var(--line); }
.chapters a { position: relative; height: 100%; display: flex; align-items: center; gap: 10px; padding-inline: 14px; color: var(--mute); overflow: hidden; transition: color .35s, background-color .35s; }
.chapters .n { font: 400 var(--t-xs)/1 var(--mono); letter-spacing: .08em; font-variant-numeric: tabular-nums; color: var(--dim); transition: color .35s; }
.chapters .t { font-size: .82rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .01em; }
.chapters .track { position: absolute; inset-inline: 0; bottom: -1px; height: 1px; }
.chapters .track i { position: absolute; inset: 0; background: var(--accent); transform: scaleX(var(--f, 0)); transform-origin: left; }
[dir="rtl"] .chapters .track i { transform-origin: right; }
.chapters a:hover, .chapters a[aria-current] { color: var(--ink); background: rgba(238, 237, 232, .035); }
.chapters a[aria-current] .n { color: var(--accent); }
.mast-end { display: flex; align-items: stretch; }
.langs { display: flex; align-items: stretch; }
.mast .langs button { min-width: 44px; padding-inline: 10px; font: 500 .74rem/1 var(--mono); color: var(--dim); border-inline-end: 1px solid var(--line); transition: color .3s, background-color .3s; }
.mast .langs button:hover { color: var(--ink); }
.mast .langs button[aria-pressed="true"] { color: var(--ink); background: rgba(238, 237, 232, .06); }
.pill-cta { position: relative; display: flex; align-items: center; gap: 10px; padding-inline: 22px var(--g); font-size: .86rem; font-weight: 600; overflow: hidden; isolation: isolate; }
.pill-cta::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ink); transform: scaleY(0); transform-origin: bottom; transition: transform .55s var(--ease); }
.pill-cta:hover { color: var(--void); }
.pill-cta:hover::before { transform: scaleY(1); }
.pill-cta svg, .btn svg, .links svg, .sources svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: square; flex: none; }
[dir="rtl"] .pill-cta svg, [dir="rtl"] .links svg, [dir="rtl"] .sources svg { transform: scaleX(-1); }
.index-btn { display: none; align-items: center; gap: 12px; padding-inline: 18px var(--g); font-size: .86rem; font-weight: 600; border-inline-start: 1px solid var(--line); }
.index-btn .mono { color: var(--accent); font-variant-numeric: tabular-nums; }

@media (max-width: 1180px) { .chapters .t { display: none; } .chapters a { justify-content: center; } }
@media (max-width: 900px) {
  .chapters, .pill-cta { display: none; }
  .mast { grid-template-columns: auto 1fr auto; }
  .mast .langs { display: flex; border-inline-start: 1px solid var(--line); }
  .mast .langs button { min-width: 38px; padding-inline: 4px; font-size: .74rem; }
  .index-btn { display: flex; }
}
@media (max-width: 520px) { .index-btn .mono, .index-btn > span:last-child { display: none; } .index-btn { padding-inline: 16px; } }
.burger { position: relative; display: block; width: 20px; height: 9px; }
.burger i { position: absolute; inset-inline: 0; height: 1.5px; background: currentColor; transition: transform .5s var(--ease), top .5s var(--ease); }
.burger i:first-child { top: 0; } .burger i:last-child { top: 7.5px; }
.sheet-open .burger i:first-child { top: 3.75px; transform: rotate(45deg); }
.sheet-open .burger i:last-child { top: 3.75px; transform: rotate(-45deg); }

/* full-screen index sheet */
.sheet { position: fixed; inset: 0; z-index: 45; padding: calc(var(--mast-h) + env(safe-area-inset-top, 0px) + 20px) var(--g) calc(var(--g) + env(safe-area-inset-bottom, 0px)); background: rgba(7, 8, 11, .92); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; overflow-y: auto; }
.sheet ol { border-top: 1px solid var(--line); }
.sheet li { border-bottom: 1px solid var(--line); overflow: hidden; }
.sheet li a { display: flex; align-items: baseline; gap: 18px; padding-block: 14px; font: 700 clamp(1.9rem, 8vw, 3.6rem)/1.05 var(--display); font-stretch: 112%; letter-spacing: -.02em; transition: color .3s, padding .5s var(--ease); }
[dir="rtl"] .sheet li a { font-family: "Kufi", var(--display); font-weight: 800; letter-spacing: 0; }
.sheet li a:hover { color: var(--accent); padding-inline-start: 12px; }
.sheet .n { color: var(--dim); }
.sheet-foot { display: grid; gap: 18px; }
.sheet .langs { flex-wrap: wrap; border: 1px solid var(--line); }
.sheet .langs button { flex: 1 1 auto; padding: 14px 12px; font-size: .95rem; color: var(--mute); border-inline-end: 1px solid var(--line); }
.sheet .langs button:last-child { border-inline-end: 0; }
.sheet .langs button[aria-pressed="true"] { color: var(--void); background: var(--ink); }
.sheet-open body { overflow: hidden; }

/* ───────── shared type and controls ───────── */
.tag { display: flex; gap: 14px; align-items: center; color: var(--mute); margin-bottom: clamp(24px, 3vw, 40px); }
.tag span:first-child { color: var(--accent); }
.tag::after { content: ""; flex: 0 1 120px; height: 1px; background: var(--line-2); }
.h2 { font: 300 var(--t-2xl)/.98 var(--display); font-stretch: 112%; letter-spacing: -.035em; text-wrap: balance; max-width: 16ch; }
.h3 { font: 500 var(--t-xl)/1.1 var(--display); font-stretch: 108%; letter-spacing: -.02em; text-wrap: balance; }
.h-xl { background: var(--metal); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .06em; font: 800 clamp(2.6rem, .8rem + 7.6vw, 9.5rem)/.9 var(--display); font-stretch: 125%; letter-spacing: -.04em; text-transform: uppercase; text-wrap: balance; }
[dir="rtl"] .h2, [dir="rtl"] .h3, [dir="rtl"] .h-xl { font-family: "Kufi", var(--display); letter-spacing: 0; text-transform: none; line-height: 1.35; }
[dir="rtl"] .h2 { font-weight: 600; }
[dir="rtl"] .h-xl { font-weight: 800; font-size: clamp(2.2rem, .8rem + 5.6vw, 6.5rem); }

.btn { position: relative; display: inline-flex; align-items: stretch; min-height: 56px; font-size: .95rem; font-weight: 600; letter-spacing: .005em; color: var(--void); background: var(--ink); overflow: hidden; isolation: isolate; box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 18px 40px -18px rgba(169, 196, 255, .45); transition: color .45s var(--ease), box-shadow .45s var(--ease), filter .2s; }
.btn > span { display: flex; align-items: center; padding-inline: 24px 22px; white-space: nowrap; }
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--accent); transform: translateY(101%); transition: transform .6s var(--ease); }
.btn:hover::before { transform: none; }
.btn:active { filter: brightness(.92); }
.btn-ico { display: grid; place-items: center; width: 56px; flex: none; border-inline-start: 1px solid rgba(7, 8, 11, .14); }
.btn-ico svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; transition: transform .5s var(--ease); }
.btn:hover .btn-ico svg { transform: translateX(4px); }
[dir="rtl"] .btn-ico svg { transform: scaleX(-1); }
[dir="rtl"] .btn:hover .btn-ico svg { transform: scaleX(-1) translateX(4px); }
.btn.ghost { color: var(--ink); background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost .btn-ico { border-inline-start-color: var(--line-2); }
.btn.ghost::before { background: var(--ink); }
.btn.ghost:hover { color: var(--void); }
.btn.ghost:hover .btn-ico { border-inline-start-color: rgba(7, 8, 11, .14); }
.plan .btn { justify-content: space-between; }

/* mobile download bar: appears after the hero, hides near the contact chapter */
.dock { position: fixed; z-index: 40; inset-inline: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 12px; padding: 8px; padding-inline-start: 10px; background: rgba(15, 17, 21, .74); -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%); box-shadow: inset 0 0 0 1px var(--line-2), 0 24px 48px -16px rgba(0, 0, 0, .8); transform: translateY(160%); transition: transform .7s var(--ease); }
.dock.on { transform: none; }
.dock img { width: 40px; height: 40px; border-radius: 22%; flex: none; }
.dock-text { display: grid; line-height: 1.25; min-width: 0; }
.dock-text b { font-size: .95rem; font-weight: 600; }
.dock-text small { font-size: .76rem; color: var(--mute); }
.dock .btn-ico { margin-inline-start: auto; width: 48px; height: 48px; background: var(--ink); color: var(--void); border: 0; }
.dock:active { filter: brightness(.94); }
@media (min-width: 901px) { .dock { display: none; } }

/* glass: square-edged, a hairline rim and a light that follows the pointer */
.glass { position: relative; background: linear-gradient(160deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, 0) 40%), var(--glass); -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%); box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, .09), 0 40px 80px -40px rgba(0, 0, 0, .7); isolation: isolate; }
.glass::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(420px circle at var(--mx, 30%) var(--my, 0%), rgba(169, 196, 255, .12), transparent 60%); opacity: .8; transition: opacity .4s; }
.glass::after { content: ""; position: absolute; inset: -1px; pointer-events: none;
  background:
    linear-gradient(var(--tick), var(--tick)) 0 0 / 12px 1px no-repeat, linear-gradient(var(--tick), var(--tick)) 0 0 / 1px 12px no-repeat,
    linear-gradient(var(--tick), var(--tick)) 100% 0 / 12px 1px no-repeat, linear-gradient(var(--tick), var(--tick)) 100% 0 / 1px 12px no-repeat,
    linear-gradient(var(--tick), var(--tick)) 0 100% / 12px 1px no-repeat, linear-gradient(var(--tick), var(--tick)) 0 100% / 1px 12px no-repeat,
    linear-gradient(var(--tick), var(--tick)) 100% 100% / 12px 1px no-repeat, linear-gradient(var(--tick), var(--tick)) 100% 100% / 1px 12px no-repeat,
    linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent) 50% 1px / 70% 1px no-repeat; }

/* hero callouts, pinned to points on the capsule by script */
.callouts { position: absolute; inset: 0; opacity: var(--o, 0); transition: opacity .6s var(--ease); }
.co { position: absolute; left: 0; top: 0; width: 0; height: 0; opacity: var(--co, 1); transition: opacity .4s; transform: translate(var(--x, -999px), var(--y, -999px)); }
.co .dot { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border: 1px solid var(--accent); }
.co .dot::after { content: ""; position: absolute; inset: 2px; background: var(--accent); }
.co .arm { position: absolute; left: 6px; top: -.6em; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.co .line { display: block; width: var(--len, 140px); height: 1px; background: linear-gradient(90deg, var(--accent), rgba(169, 196, 255, .25)); }
.co .mono { display: flex; gap: 8px; color: var(--ink); }
.co .mono b { color: var(--accent); font-weight: 500; }
.co.rev .arm { left: auto; right: 6px; flex-direction: row; }
.co.rev .line { background: linear-gradient(270deg, var(--accent), rgba(169, 196, 255, .25)); }
@media (max-width: 1099px) { .callouts { display: none; } }

/* ───────── hero ───────── */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; }
.hero-grid { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: 1fr auto auto; column-gap: 20px; padding-top: calc(var(--mast-h) + 40px + env(safe-area-inset-top, 0px)); padding-bottom: 28px; }
.hero-title { grid-column: 1 / -1; grid-row: 1; align-self: end; font: 200 var(--t-hero)/.86 var(--display); font-stretch: 125%; letter-spacing: -.045em; text-transform: uppercase; margin-bottom: clamp(28px, 4vw, 56px); }
.hero-title .line { display: block; overflow: hidden; padding-block: .04em; }
.hero-title .line > span { display: inline-block; }
.hero-title .l2 { font-weight: 800; background: linear-gradient(100deg, transparent 42%, rgba(255, 255, 255, .95) 50%, transparent 58%) 130% 0 / 260% 100% no-repeat, var(--metal); -webkit-background-clip: text; background-clip: text; color: transparent; }
.intro-done .hero-title .l2 { animation: sheen 8s cubic-bezier(.45, 0, .2, 1) .6s infinite; }
@keyframes sheen { 0% { background-position: 130% 0, 0 0; } 35%, 100% { background-position: -30% 0, 0 0; } }
[dir="rtl"] .hero-title { font-family: "Kufi", var(--display); text-transform: none; letter-spacing: 0; line-height: 1.25; font-size: clamp(2.8rem, min(.8rem + 8vw, 14vh), 9rem); }
[dir="rtl"] .hero-title .l1 { font-weight: 600; color: var(--mute); }
[dir="rtl"] .hero-title .line { padding-block: .08em .3em; margin-block: -.12em; }
.hero-side { grid-column: 1 / span 5; grid-row: 2; display: grid; gap: 22px; justify-items: start; padding-bottom: 36px; }
.lead { font-size: var(--t-l); line-height: 1.55; color: var(--ink); max-width: 44ch; }
.fine { font-size: var(--t-s); color: var(--mute); }
.hero-meta { grid-column: 1 / -1; grid-row: 3; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); color: var(--mute); }
.hero-meta li { padding: 16px 0; padding-inline-end: 16px; }
.hero-meta li + li { padding-inline-start: 16px; border-inline-start: 1px solid var(--line); }
.scroll-cue { position: absolute; right: var(--g); bottom: 92px; display: flex; align-items: center; gap: 14px; color: var(--mute); writing-mode: vertical-rl; }
[dir="rtl"] .scroll-cue { writing-mode: horizontal-tb; right: auto; left: var(--g); }
.scroll-cue i { position: relative; width: 1px; height: 64px; background: var(--line); overflow: hidden; }
[dir="rtl"] .scroll-cue i { width: 64px; height: 1px; }
.scroll-cue i::after { content: ""; position: absolute; inset: 0; background: var(--ink); animation: cue 2.2s var(--ease) infinite; }
@keyframes cue { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }
@media (max-width: 820px) {
  .hero-grid { grid-template-rows: minmax(34vh, 1fr) auto auto auto; padding-top: calc(var(--mast-h) + 16px + env(safe-area-inset-top, 0px)); }
  .hero-title { grid-row: 2; margin-bottom: 18px; font-size: clamp(2.3rem, 11.6vw, 4.4rem); }
  [dir="rtl"] .hero-title { font-size: clamp(2.4rem, 12vw, 4.6rem); }
  .hero-side { grid-column: 1 / -1; grid-row: 3; padding-bottom: 24px; gap: 18px; }
  .hero-side .btn { width: 100%; justify-content: space-between; }
  .lead { font-size: 1.02rem; }
  .hero-meta { grid-row: 4; grid-template-columns: minmax(0, 1fr); }
  .hero-meta li, .hero-meta li + li { padding: 12px 0; border-inline-start: 0; border-top: 1px solid var(--line); }
  .hero-meta li:first-child { border-top: 0; }
  .scroll-cue { display: none; }
}

/* ───────── chapters ───────── */
.chapter { position: relative; padding-block: var(--sect); }

/* 01 ask */
.ask-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 20px; row-gap: 56px; align-items: start; }
.ask-copy { grid-column: 1 / span 6; display: grid; gap: clamp(28px, 3vw, 44px); }
.statement { font: 400 var(--t-xl)/1.32 var(--display); font-stretch: 100%; letter-spacing: -.015em; max-width: 30ch; color: var(--ink); }
[dir="rtl"] .statement { font-family: "Plex Arabic", var(--body); font-weight: 500; line-height: 1.75; letter-spacing: 0; }
.statement .w { display: inline; }
.convo { grid-column: 8 / -1; margin-top: clamp(0px, 8vw, 140px); padding: 0; min-width: 0; }
.convo-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line); color: var(--mute); }
.live { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); }
.live i { width: 6px; height: 6px; background: var(--accent); animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.convo-body { display: grid; gap: 14px; padding: 22px; min-height: 360px; align-content: start; }
.bubble { max-width: 88%; padding: 14px 18px; font-size: .95rem; line-height: 1.55; }
.bubble.me { justify-self: end; background: var(--ink); color: var(--void); font-weight: 500; }
.bubble.iq { justify-self: start; background: rgba(238, 237, 232, .05); box-shadow: inset 0 0 0 1px var(--line); }
.bubble.iq ul { display: grid; gap: 8px; }
.bubble.iq li { position: relative; padding-inline-start: 18px; color: var(--ink); }
.bubble.iq li::before { content: ""; position: absolute; inset-inline-start: 0; top: .72em; width: 7px; height: 1px; background: var(--accent); }
.caret { display: inline-block; width: 2px; height: 1em; margin-inline-start: 2px; vertical-align: -2px; background: currentColor; animation: blink .9s steps(2) infinite; }
.typing { display: inline-flex; gap: 5px; padding: 16px 18px; }
.typing span { width: 6px; height: 6px; background: var(--mute); animation: dots 1.1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes dots { 0%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.srcs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: 400 var(--t-xs)/1 var(--mono); letter-spacing: .06em; color: var(--mute); text-transform: uppercase; }
.srcs a { padding: 7px 10px; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink); transition: background-color .3s, color .3s; }
.srcs a:hover { background: var(--ink); color: var(--void); }
@media (max-width: 900px) { .ask-copy, .convo { grid-column: 1 / -1; } .convo { margin-top: 0; } .convo-body { min-height: 0; } }

/* 02 tools: pinned horizontal track on wide screens, swipeable row elsewhere */
.tools { padding-block: 0; }
.tools-pin { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; gap: clamp(28px, 4vh, 48px); padding-block: calc(var(--mast-h) + 32px) 40px; overflow: hidden; }
.tools-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: 32px; }
.tools-head .tag { grid-column: 1 / -1; }
.hint { color: var(--mute); }
.hint-swipe { display: none; }
.track-wrap { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; perspective: 1400px; }
.track-wrap::-webkit-scrollbar { display: none; }
.tools-pinned .track-wrap { overflow: visible; scroll-snap-type: none; }
.track { display: flex; gap: 20px; padding-inline: var(--g); width: max-content; transform-style: preserve-3d; }
.tool { flex: none; width: clamp(290px, 34vw, 520px); min-height: clamp(380px, 52vh, 520px); padding: clamp(22px, 2.4vw, 36px); display: flex; flex-direction: column; gap: 18px; scroll-snap-align: center; transition: box-shadow .5s; }
.tool header { display: flex; align-items: center; gap: 12px; color: var(--mute); }
.tool header svg { margin-inline-start: auto; width: 34px; height: 34px; fill: none; stroke: var(--ink); stroke-width: 1.2; stroke-linecap: square; stroke-linejoin: miter; }
.tool .badge { padding: 5px 8px; color: var(--void); background: var(--accent); letter-spacing: .06em; }
.tool h3 { font: 600 clamp(1.7rem, 1.2rem + 1.6vw, 2.7rem)/1.02 var(--display); font-stretch: 115%; letter-spacing: -.03em; margin-top: auto; }
[dir="rtl"] .tool h3 { font-family: "Kufi", var(--display); font-weight: 800; letter-spacing: 0; line-height: 1.3; }
.tool p { color: var(--mute); max-width: 42ch; }
.tool dl { display: grid; border-top: 1px solid var(--line); }
.tool dl div { display: grid; grid-template-columns: 9ch minmax(0, 1fr); gap: 16px; padding-block: 12px; border-bottom: 1px solid var(--line); font-size: var(--t-s); }
.tool dt { font: 400 var(--t-xs)/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
[dir="rtl"] .tool dt { letter-spacing: 0; text-transform: none; font-size: .78rem; }
.tool dd { color: var(--ink); }
.tool.near { box-shadow: inset 0 0 0 1px var(--line-2), inset 0 1px 0 rgba(255, 255, 255, .12), 0 40px 80px -40px rgba(0, 0, 0, .8); }
.tools-foot { display: flex; align-items: center; gap: 20px; color: var(--mute); font-variant-numeric: tabular-nums; }
.tool-nav { display: flex; }
.tool-nav button { display: grid; place-items: center; width: 48px; height: 48px; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); transition: background-color .3s, color .3s, opacity .3s; }
.tool-nav button + button { margin-inline-start: -1px; }
.tool-nav button:hover:not(:disabled) { background: var(--ink); color: var(--void); }
.tool-nav button:active:not(:disabled) { filter: brightness(.9); }
.tool-nav button:disabled { opacity: .3; cursor: default; }
.tool-nav svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; }
[dir="rtl"] .tool-nav svg { transform: scaleX(-1); }
.tools-progress { position: relative; flex: 1; height: 1px; background: var(--line); }
.tools-progress i { position: absolute; inset: 0; background: var(--accent); transform: scaleX(var(--p, 0)); transform-origin: left; }
[dir="rtl"] .tools-progress i { transform-origin: right; }
@media (min-width: 820px) and (max-height: 760px) { .tool { min-height: 0; } .tool > p { display: none; } .tools .h2 { font-size: clamp(2rem, 3.6vw, 3.4rem); } .tools-pin { gap: 22px; } }
@media (max-width: 819px), (prefers-reduced-motion: reduce) {
  .hint-scroll { display: none; } .hint-swipe { display: inline; }
  .tools-head { grid-template-columns: minmax(0, 1fr); row-gap: 16px; }
  .tools-pin { min-height: 0; padding-block: var(--sect) 0; }
  .tool { width: min(84vw, 440px); min-height: 0; }
  .tool h3 { margin-top: 12px; }
}

/* tool cards: small live diagrams, drawn with CSS */
.viz { position: relative; height: 92px; border: 1px solid var(--line); background: rgba(7, 8, 11, .35); overflow: hidden; }
.viz .mono { font-size: .64rem; color: var(--mute); }
.v-code .bars { position: absolute; inset: 14px 18px 30px; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 9px, var(--ink) 9px 12px, transparent 12px 14px, var(--ink) 14px 15px, transparent 15px 19px); opacity: .75; }
.v-code .beam { position: absolute; inset-inline: 10px; top: 12px; height: 1px; background: var(--accent); box-shadow: 0 0 12px 2px rgba(169, 196, 255, .7); animation: beam 2.4s ease-in-out infinite alternate; }
@keyframes beam { to { transform: translateY(48px); } }
.v-code .mono { position: absolute; bottom: 8px; inset-inline: 0; text-align: center; letter-spacing: .3em; direction: ltr; }
.v-pair { display: flex; align-items: center; gap: 12px; padding-inline: 16px; direction: ltr; }
.v-pair .mono { padding: 8px 10px; border: 1px solid var(--line-2); color: var(--ink); letter-spacing: .08em; }
.v-pair .link { position: relative; flex: 1; height: 1px; background: var(--line-2); overflow: hidden; }
.v-pair .link i { position: absolute; top: 0; left: 0; width: 30%; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: travel 1.8s linear infinite; }
@keyframes travel { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.v-range { padding: 22px 18px 0; direction: ltr; }
.v-range .scale { position: relative; height: 10px; background: repeating-linear-gradient(90deg, var(--line-2) 0 1px, transparent 1px 10%); border-bottom: 1px solid var(--line-2); }
.v-range .ok { position: absolute; left: 25%; right: 25%; bottom: -1px; height: 3px; background: var(--accent); }
.v-range .mk { position: absolute; bottom: -7px; left: 25%; width: 1px; height: 22px; background: var(--ink); animation: mark 4s cubic-bezier(.65, 0, .35, 1) infinite alternate; }
.v-range .mk::before { content: ""; position: absolute; top: -5px; left: -3px; width: 7px; height: 7px; background: var(--ink); }
@keyframes mark { 0% { left: 18%; } 40% { left: 46%; } 100% { left: 62%; } }
.v-range .ticks { display: flex; justify-content: space-between; padding-top: 16px; margin-inline: 22%; }
.v-macro { display: grid; align-content: center; gap: 9px; padding-inline: 18px; direction: ltr; }
.v-macro div { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px; }
.v-macro i { display: block; height: 6px; background: linear-gradient(90deg, var(--accent), rgba(169, 196, 255, .35)); transform-origin: left; animation: grow 3.2s var(--ease) infinite alternate; }
.v-macro div:nth-child(1) i { width: 46%; } .v-macro div:nth-child(2) i { width: 82%; animation-delay: .2s; } .v-macro div:nth-child(3) i { width: 30%; animation-delay: .4s; }
@keyframes grow { from { transform: scaleX(.15); } }
.v-grid { background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 23px, linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 23px 100%; }
.v-grid .focus { position: absolute; width: 46px; height: 46px; top: 22px; left: 22%;
  background: linear-gradient(var(--accent), var(--accent)) 0 0 / 10px 1px no-repeat, linear-gradient(var(--accent), var(--accent)) 0 0 / 1px 10px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 0 / 10px 1px no-repeat, linear-gradient(var(--accent), var(--accent)) 100% 0 / 1px 10px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0 100% / 10px 1px no-repeat, linear-gradient(var(--accent), var(--accent)) 0 100% / 1px 10px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 100% / 10px 1px no-repeat, linear-gradient(var(--accent), var(--accent)) 100% 100% / 1px 10px no-repeat;
  animation: hunt 6s steps(1) infinite; transition: none; }
.v-grid .focus::after { content: ""; position: absolute; inset: 40%; background: var(--accent); opacity: .8; }
@keyframes hunt { 0% { top: 22px; left: 22%; } 25% { top: 12px; left: 58%; } 50% { top: 34px; left: 40%; } 75% { top: 18px; left: 72%; } }
.v-lines { display: grid; align-content: center; gap: 10px; padding-inline: 18px; }
.v-lines i { display: block; height: 6px; background: var(--line-2); transform-origin: left; animation: type 4.5s steps(12) infinite; }
[dir="rtl"] .v-lines i { transform-origin: right; }
.v-lines i:nth-child(1) { width: 84%; } .v-lines i:nth-child(2) { width: 62%; animation-delay: .9s; background: var(--accent); opacity: .7; } .v-lines i:nth-child(3) { width: 74%; animation-delay: 1.8s; }
@keyframes type { 0% { transform: scaleX(0); } 30%, 90% { transform: scaleX(1); } 100% { transform: scaleX(1); opacity: .2; } }

/* 03 languages */
.languages { overflow: hidden; }
.rows { display: grid; gap: .1em; margin-block: clamp(20px, 4vw, 56px) clamp(56px, 8vw, 120px); font-size: clamp(2.6rem, 1rem + 7vw, 8.5rem); }
.row { display: flex; gap: .6em; white-space: nowrap; width: max-content; line-height: 1.15; }
.row[lang="en"] { font: 800 1em/1 var(--display); font-stretch: 125%; letter-spacing: -.04em; text-transform: uppercase; padding-block: .08em; }
.row[dir="rtl"] { font: 800 1em/1.3 "Kufi", var(--display); }
.row.ghost { color: transparent; -webkit-text-stroke: 1px rgba(238, 237, 232, .42); }
.row:not(.ghost) span:nth-child(2) { color: var(--accent); }
.langs-copy { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 20px; row-gap: 28px; }
.langs-copy .h2 { grid-column: 1 / span 7; }
.langs-copy > p { grid-column: 8 / -1; align-self: end; color: var(--mute); font-size: var(--t-l); max-width: 40ch; }
.scripts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); margin-top: 24px; }
.scripts li { display: grid; gap: 10px; padding: 22px 0; padding-inline-end: 16px; color: var(--dim); }
.scripts li + li { padding-inline-start: 18px; border-inline-start: 1px solid var(--line); }
.scripts b { font: 600 clamp(1.4rem, 1rem + 1.2vw, 2rem)/1.2 "Kufi", var(--display); color: var(--ink); text-transform: none; letter-spacing: 0; }
.scripts b[lang="en"] { font-family: var(--display); font-stretch: 115%; font-weight: 600; letter-spacing: -.02em; }
@media (max-width: 900px) {
  .langs-copy .h2, .langs-copy > p { grid-column: 1 / -1; }
  .scripts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scripts li:nth-child(3) { border-inline-start: 0; padding-inline-start: 0; }
  .scripts li:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

/* 04 trust */
.trust-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 20px; row-gap: 56px; align-items: start; }
.trust-col { display: grid; gap: 24px; min-width: 0; }
.trust-col:first-child { grid-column: 1 / span 7; }
.trust-col > p { color: var(--mute); font-size: var(--t-l); max-width: 44ch; }
.trust-col > .list-label { color: var(--dim); margin-top: 20px; font-size: var(--t-xs); }
[dir="rtl"] .trust-col > .list-label { font-size: .8rem; }
.sources { border-top: 1px solid var(--line); }
.sources li { border-bottom: 1px solid var(--line); }
.sources a { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 20px; padding-block: 20px; overflow: hidden; transition: padding .6s var(--ease), color .4s; }
.sources a::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ink); transform: scaleY(0); transform-origin: bottom; transition: transform .6s var(--ease); }
.sources a:hover { color: var(--void); padding-inline: 18px; }
.sources a:hover::before { transform: none; }
.sources li { position: relative; isolation: isolate; }
.sources b { font: 600 clamp(1.4rem, 1rem + 1.4vw, 2.3rem)/1.1 var(--display); font-stretch: 115%; letter-spacing: -.02em; }
.sources .mono { color: var(--mute); transition: color .4s; }
.sources a:hover .mono { color: var(--void); }
.priv { grid-column: 9 / -1; padding: clamp(24px, 2.6vw, 40px); margin-top: clamp(0px, 10vw, 180px); }
.priv dl { display: grid; }
.priv dl div { padding-block: 18px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.priv dt { font-weight: 600; }
.priv dd { color: var(--mute); font-size: var(--t-s); }
@media (max-width: 900px) { .trust-col:first-child, .priv { grid-column: 1 / -1; } .priv { margin-top: 0; } }

/* 05 plans */
.plans-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px; margin-bottom: clamp(36px, 5vw, 64px); }
.plans-head p { color: var(--mute); font-size: var(--t-l); }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.plan { display: flex; flex-direction: column; gap: 22px; padding: clamp(24px, 2.4vw, 40px); min-width: 0; }
.plan + .plan { border-inline-start: 1px solid var(--line); }
.plan.pro { background: linear-gradient(180deg, rgba(27, 44, 120, .38), rgba(27, 44, 120, .12)); box-shadow: inset 0 0 0 1px rgba(169, 196, 255, .35); }
.plan h3 { color: var(--mute); }
.plan.pro h3 { color: var(--accent); }
.price { font: 300 clamp(3rem, 2rem + 3vw, 5.4rem)/1 var(--display); font-stretch: 112%; letter-spacing: -.05em; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 12px; }
.price small { font: 400 var(--t-xs)/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
[dir="rtl"] .price small { text-transform: none; letter-spacing: 0; font-size: .8rem; }
.plan ul { display: grid; border-top: 1px solid var(--line); }
.plan li { display: flex; justify-content: space-between; gap: 16px; padding-block: 12px; border-bottom: 1px solid var(--line); font-size: var(--t-s); }
.plan li span { color: var(--mute); }
.plan li b { font-weight: 600; text-align: end; }
.plan li.off { opacity: .4; }
.plan li.off b { font-weight: 400; }
.plan .btn { margin-top: auto; }
.note { margin-top: 18px; color: var(--dim); font-size: var(--t-xs); max-width: 90ch; }
@media (max-width: 960px) {
  .plan-grid { grid-template-columns: minmax(0, 1fr); }
  .plan + .plan { border-inline-start: 0; border-top: 1px solid var(--line); }
  .plans-head { grid-template-columns: minmax(0, 1fr); }
}

.faq { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 20px; row-gap: 28px; margin-top: var(--sect); }
.faq .h3 { grid-column: 1 / span 4; }
.faq-list { grid-column: 5 / -1; border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-block: 24px; font: 500 var(--t-l)/1.35 var(--display); font-stretch: 105%; transition: color .3s; }
[dir="rtl"] .faq-list summary { font-family: "Plex Arabic", var(--body); font-weight: 600; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary:hover { color: var(--accent); }
.faq-list summary i { position: relative; flex: none; width: 16px; height: 16px; }
.faq-list summary i::before, .faq-list summary i::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: currentColor; transition: transform .5s var(--ease); }
.faq-list summary i::after { transform: rotate(90deg); }
.faq-list details[open] summary i::after { transform: rotate(0deg); }
.faq-list details p { padding-bottom: 26px; color: var(--mute); max-width: 62ch; }
@media (max-width: 900px) { .faq .h3, .faq-list { grid-column: 1 / -1; } }

/* 06 contact */
.contact .h-xl { max-width: 12ch; }
.contact-sub { margin-top: 22px; color: var(--mute); font-size: var(--t-l); }
.links { margin-top: clamp(40px, 6vw, 88px); border-top: 1px solid var(--line); }
.links li { position: relative; border-bottom: 1px solid var(--line); display: flex; align-items: stretch; isolation: isolate; }
.links a { position: relative; flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(110px, 2fr) minmax(0, 7fr) auto; align-items: center; gap: 20px; padding-block: clamp(20px, 2.6vw, 34px); overflow: hidden; transition: color .45s, padding .7s var(--ease); }
.links a::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .7s var(--ease); }
[dir="rtl"] .links a::before { transform-origin: right; }
.links a:hover { color: var(--void); padding-inline: 22px; }
.links a:hover::before { transform: none; }
.links .mono { color: var(--mute); transition: color .45s; }
.links a:hover .mono { color: var(--void); }
.links b { font: 600 clamp(1.5rem, .9rem + 2.4vw, 3.4rem)/1.05 var(--display); font-stretch: 115%; letter-spacing: -.03em; overflow-wrap: anywhere; }
.links svg { width: 22px; height: 22px; }
[dir="rtl"] .links b[dir="ltr"] { text-align: right; }
.mail-row b { font-size: clamp(1.15rem, .6rem + 2.4vw, 3.4rem); }
.copy { flex: none; padding-inline: 22px; color: var(--mute); border-inline-start: 1px solid var(--line); transition: color .3s, background-color .3s; }
.copy:hover { color: var(--ink); background: rgba(238, 237, 232, .05); }
.copy.ok { color: var(--accent); }
@media (max-width: 900px) { .foot { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); } }
@media (max-width: 700px) {
  .links a { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .links a .mono { grid-column: 1 / -1; }
  .links b { font-size: clamp(1.3rem, 6.4vw, 2rem); }
  .mail-row b { font-size: clamp(1rem, 5.1vw, 1.6rem); }
}

/* footer */
.foot { position: relative; padding-block: clamp(56px, 8vw, 100px) calc(24px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); overflow: hidden; background: linear-gradient(180deg, transparent, rgba(7, 8, 11, .85) 40%); }
.foot .wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.disclaimer { color: var(--mute); max-width: 70ch; font-size: var(--t-s); }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; color: var(--mute); }
.foot-row nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot-row a { position: relative; transition: color .3s; }
.foot-row a::after { content: ""; position: absolute; inset-inline: 0; bottom: -4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.foot-row a:hover { color: var(--ink); }
.foot-row a:hover::after { transform: none; }
.foot-mark { font: 800 clamp(2.4rem, 10.4vw, 15rem)/.8 var(--display); font-stretch: 125%; letter-spacing: -.05em; color: transparent; -webkit-text-stroke: 1px rgba(238, 237, 232, .16); margin-top: 24px; white-space: nowrap; direction: ltr; text-align: start; }
.foot-mark b { font-weight: 800; -webkit-text-stroke-color: rgba(169, 196, 255, .4); }

/* ───────── sub-pages (privacy, terms, support, 404) ───────── */
.page main { padding-top: calc(var(--mast-h) + env(safe-area-inset-top, 0px)); }
.page .mast { grid-template-columns: auto minmax(0, 1fr) auto; }
.backlinks { display: flex; align-items: stretch; border-inline: 1px solid var(--line); }
.backlinks a { display: flex; align-items: center; padding-inline: 18px; font-size: .84rem; font-weight: 500; color: var(--mute); transition: color .3s, background-color .3s; }
.backlinks a + a { border-inline-start: 1px solid var(--line); }
.backlinks a:hover, .backlinks a[aria-current] { color: var(--ink); background: rgba(238, 237, 232, .035); }
@media (max-width: 900px) { .backlinks a:not(:first-child) { display: none; } .page .index-btn { display: none; } .page .mast .langs { display: flex; } .page .mast .langs button { min-width: 38px; padding-inline: 6px; } }
@media (max-width: 560px) { .backlinks { display: none; } .page .mast { grid-template-columns: auto 1fr auto; } }
.doc-wrap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 20px; padding-block: clamp(56px, 9vw, 140px); }
.doc-side { grid-column: 1 / span 3; }
.doc-side .tag { position: sticky; top: calc(var(--mast-h) + 32px); }
.doc { grid-column: 4 / span 8; min-width: 0; }
.doc h1 { font: 300 var(--t-2xl)/1 var(--display); font-stretch: 112%; letter-spacing: -.035em; margin-bottom: 18px; text-wrap: balance; }
[dir="rtl"] .doc h1 { font-family: "Kufi", var(--display); font-weight: 600; letter-spacing: 0; line-height: 1.35; }
.doc .updated { font: 400 var(--t-xs)/1.6 var(--mono); letter-spacing: .06em; color: var(--mute); margin-bottom: 48px; text-transform: uppercase; }
.doc h2 { font: 600 1.3rem/1.3 var(--display); font-stretch: 108%; letter-spacing: -.01em; margin: 52px 0 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.doc p, .doc li { color: var(--mute); max-width: 68ch; }
.doc strong { color: var(--ink); font-weight: 600; }
.doc p + p, .doc ul + p, .doc p + ul { margin-top: 14px; }
.doc ul { display: grid; gap: 10px; padding-inline-start: 0; }
.doc ul li { position: relative; padding-inline-start: 22px; }
.doc ul li::before { content: ""; position: absolute; inset-inline-start: 0; top: .8em; width: 10px; height: 1px; background: var(--accent); }
.doc .callout { margin: 28px 0; padding: 22px 24px; }
.doc .callout p { color: var(--ink); }
.doc .alt { margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--line-2); }
.doc a:not(.btn) { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.doc .faq-list { margin-top: 12px; }
.contact-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
@media (max-width: 900px) { .doc-side { display: none; } .doc { grid-column: 1 / -1; } }
.notfound { min-height: 78vh; display: grid; align-content: center; gap: 24px; padding-block: 96px; }
.notfound .code { font: 800 clamp(6rem, 24vw, 22rem)/.8 var(--display); font-stretch: 125%; letter-spacing: -.06em; color: transparent; -webkit-text-stroke: 1px rgba(238, 237, 232, .5); }
.notfound h1 { font: 300 var(--t-xl)/1.15 var(--display); font-stretch: 110%; }
[dir="rtl"] .notfound h1 { font-family: "Kufi", var(--display); font-weight: 600; }
.notfound p { color: var(--mute); }

/* ───────── reduced motion & print ───────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .grain { animation: none; }
}
@media print {
  .stage, .mast, .loader, .curtain, .dock, .sheet, .scroll-cue, .foot-mark, .languages .rows { display: none !important; }
  body { background: #fff; color: #000; }
  .glass { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
