/* =====================================================
   Abdullah Al-Kharusi — alkharusi.co
   Design system v2 (rebuild)
   ===================================================== */

/* --------- TOKENS --------- */
:root {
  /* Brand */
  --red: #e8412e;
  --red-soft: rgba(232, 65, 46, 0.12);
  --red-glow: rgba(232, 65, 46, 0.35);
  --paper: #f5efe2;
  --ink-dark: #0a0a0a;

  /* Type */
  --en: 'Unbounded', system-ui, -apple-system, sans-serif;
  --ar: 'Tajawal', system-ui, sans-serif;
  --serif: 'Fraunces', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Spacing */
  --gutter: clamp(20px, 4vw, 48px);
  --section-y: clamp(72px, 9vw, 128px);

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Theme — dark default (Material Design 3 standard) */
  --bg: #121212;
  --bg-elev: #1d1d1d;
  --bg-card: #212121;
  --ink: #f5efe2;
  --ink-mute: rgba(245, 239, 226, 0.66);
  --ink-faint: rgba(245, 239, 226, 0.42);
  --line: rgba(245, 239, 226, 0.16);
  --line-strong: rgba(245, 239, 226, 0.30);
}

/* Manual theme override */
html[data-theme="light"] {
  --bg: #f5efe2;
  --bg-elev: #ede5d2;
  --bg-card: #f0e9d8;
  --ink: #121212;
  --ink-mute: rgba(18, 18, 18, 0.68);
  --ink-faint: rgba(18, 18, 18, 0.42);
  --line: rgba(18, 18, 18, 0.16);
  --line-strong: rgba(18, 18, 18, 0.32);
}

html[data-theme="dark"] {
  --bg: #121212;
  --bg-elev: #1d1d1d;
  --bg-card: #212121;
  --ink: #f5efe2;
  --ink-mute: rgba(245, 239, 226, 0.66);
  --ink-faint: rgba(245, 239, 226, 0.42);
  --line: rgba(245, 239, 226, 0.16);
  --line-strong: rgba(245, 239, 226, 0.30);
}

/* Auto theme */
@media (prefers-color-scheme: light) {
  html[data-theme="auto"] {
    --bg: #f5efe2;
    --bg-elev: #ede5d2;
    --bg-card: #f0e9d8;
    --ink: #121212;
    --ink-mute: rgba(18, 18, 18, 0.68);
    --ink-faint: rgba(18, 18, 18, 0.42);
    --line: rgba(18, 18, 18, 0.16);
    --line-strong: rgba(18, 18, 18, 0.32);
  }
}

/* --------- RESET --------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--en);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

/* --------- LANG SWITCHING --------- */
html[lang="ar"] body { font-family: var(--ar); line-height: 1.85; word-spacing: 0.04em; }
html[lang="ar"] .en-only { display: none !important; }
html[lang="en"] .ar-only { display: none !important; }

/* Arabic typography refinements */
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { line-height: 1.4; letter-spacing: 0; }
html[lang="ar"] p { line-height: 1.9; }
html[lang="ar"] .mono-label { letter-spacing: 0; }

/* --------- TYPOGRAPHY --------- */
.mono-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
html[lang="ar"] .mono-label { font-family: var(--mono); font-size: 12px; text-transform: none; letter-spacing: 0.04em; }

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 2px; }

::selection { background: var(--red); color: var(--paper); }

/* --------- LAYOUT --------- */
.wrap { max-width: 1320px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.section { padding-top: var(--section-y); padding-bottom: var(--section-y); position: relative; }
.section-divider { height: 1px; background: var(--line); width: 100%; }

/* Defensive: long words and long unbroken Arabic strings should wrap, not overflow */
h1, h2, h3, h4, h5, h6, p, li, a, span, em, strong, blockquote, label {
  overflow-wrap: break-word;
  word-wrap: break-word;
}
img, svg, video { max-width: 100%; height: auto; }

/* --------- SIDE RAILS (dossier frame) --------- */
.rail {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
  z-index: 1;
  pointer-events: none;
}
.rail.left { left: 24px; }
.rail.right { right: 24px; }
.rail::before, .rail::after {
  content: "";
  position: absolute;
  left: -3px;
  width: 7px;
  height: 1px;
  background: var(--ink-faint);
}
.rail::before { top: 14%; }
.rail::after { top: 86%; }

.rail-label {
  position: fixed;
  top: 50%;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
  z-index: 1;
  pointer-events: none;
  writing-mode: vertical-rl;
  white-space: nowrap;
  user-select: none;
}
.rail-label.left {
  left: 18px;
  transform: translateY(-50%) rotate(180deg);
}
.rail-label.right {
  right: 18px;
  transform: translateY(-50%);
}
.rail-label .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red);
  margin: 0 8px;
  vertical-align: middle;
  animation: pulse 1.6s ease-in-out infinite;
}

/* Hide rails on small screens — they crowd the layout */
@media (max-width: 1080px) {
  .rail, .rail-label { display: none; }
}

/* In Arabic mode, swap the rail labels' rotation so reading direction matches */
html[dir="rtl"] .rail-label.left { transform: translateY(-50%); }
html[dir="rtl"] .rail-label.right { transform: translateY(-50%) rotate(180deg); }
html[lang="ar"] .rail-label { font-family: var(--ar); font-size: 11px; letter-spacing: 0.05em; text-transform: none; font-weight: 500; }

/* --------- TOP NAV --------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background 0.3s var(--ease);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--gutter);
  max-width: 1320px;
  margin: 0 auto;
}
.brand-mark {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
}
.brand-mark .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 12px var(--red-glow);
  animation: pulse 2s ease-in-out infinite;
}
html[lang="ar"] .brand-mark { font-family: var(--ar); font-size: 13px; letter-spacing: 0; text-transform: none; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.nav-links {
  display: flex; align-items: center; gap: 28px;
  list-style: none;
}
/* RTL handling — flexbox auto-flips, but be explicit for nav-controls and nav-links */
html[dir="rtl"] .nav-links { flex-direction: row; }
html[dir="rtl"] .nav-controls { flex-direction: row; }
.nav-links a {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  transition: color 0.2s var(--ease);
  position: relative;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 1px; background: var(--red);
}
html[lang="ar"] .nav-links a { font-family: var(--ar); font-size: 14px; text-transform: none; letter-spacing: 0; font-weight: 500; }

.nav-controls { display: flex; align-items: center; gap: 8px; }
.ctrl-btn {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.15s var(--ease);
  border-radius: 2px;
  min-width: 44px;
}
.ctrl-btn:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); transform: translateY(-1px); }
.ctrl-btn:active { transform: translateY(0); }
html[lang="ar"] .ctrl-btn { font-family: var(--mono); }

@media (max-width: 880px) {
  .nav-links { display: none; }
  .topbar-inner { padding: 12px var(--gutter); }
}

/* --------- MOBILE NAV (drawer) --------- */
.menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 7px 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  cursor: pointer;
  border-radius: 2px;
}
@media (max-width: 880px) {
  .menu-btn { display: inline-flex; align-items: center; gap: 6px; }
}
.drawer {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: none;
  flex-direction: column;
  padding: 80px var(--gutter) 40px;
  transition: opacity 0.3s var(--ease);
}
.drawer.open { display: flex; }
.drawer-close {
  position: absolute; top: 18px; right: var(--gutter);
  background: transparent; border: 0; cursor: pointer;
  font-family: var(--mono); font-size: 12px; color: var(--ink);
  letter-spacing: 0.16em;
}
html[dir="rtl"] .drawer-close { right: auto; left: var(--gutter); }
.drawer ul { list-style: none; display: flex; flex-direction: column; gap: 24px; }
.drawer a {
  font-family: var(--en);
  font-size: 28px;
  font-weight: 300;
  color: var(--ink);
  letter-spacing: -0.02em;
}
html[lang="ar"] .drawer a { font-family: var(--ar); font-weight: 600; letter-spacing: 0; }

/* --------- GATE (Pick Red/Blue) --------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px var(--gutter);
  transition: opacity 0.6s var(--ease), visibility 0.6s var(--ease);
  overflow-y: auto;
}
.gate.hide { opacity: 0; visibility: hidden; pointer-events: none; }

/* Fix: prompt-screen wrapper must itself be a flex column so gate-top/center/bottom space out */
.gate-prompt-screen {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  width: 100%;
  min-height: 0;
  gap: 32px;
}

.gate-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
html[lang="ar"] .gate-top { font-family: var(--mono); font-size: 12px; }
.gate-top .blink { color: var(--red); animation: pulse 1.4s ease-in-out infinite; }

.gate-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: clamp(28px, 6vw, 60px);
  min-height: 0;
}
.gate-prompt {
  font-family: var(--en);
  font-weight: 200;
  font-size: clamp(48px, 10vw, 132px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  max-width: 14ch;
}
html[lang="ar"] .gate-prompt {
  font-family: var(--ar);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
}
.gate-prompt em {
  color: var(--red);
  font-style: italic;
  font-family: var(--serif);
  font-weight: 300;
}
html[lang="ar"] .gate-prompt em {
  font-family: var(--ar);
  font-style: normal;
  font-weight: 900;
}

.gate-hint {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
html[lang="ar"] .gate-hint { font-family: var(--ar); font-size: 14px; text-transform: none; letter-spacing: 0; }

.gate-buttons { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.gate-btn {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  padding: 22px 56px;
  min-width: 160px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  border-radius: 2px;
}
.gate-btn:hover { background: var(--ink); color: var(--bg); }
html[lang="ar"] .gate-btn { font-family: var(--ar); font-weight: 500; letter-spacing: 0; }

.gate-bottom {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
}
html[lang="ar"] .gate-bottom { font-family: var(--ar); font-size: 13px; text-transform: none; letter-spacing: 0; }

/* Gate result screen */
.gate-result {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 32px;
  max-width: 920px;
  margin: 0 auto;
  flex: 1;
  width: 100%;
  padding: 32px 0;
}
.gate-result.show { display: flex; }
.gate-result .stamp {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  border: 1px solid var(--red);
  padding: 6px 12px;
  border-radius: 2px;
}
.gate-result h2 {
  font-family: var(--en);
  font-weight: 200;
  font-size: clamp(28px, 4.6vw, 60px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
html[lang="ar"] .gate-result h2 { font-family: var(--ar); font-weight: 700; letter-spacing: 0; line-height: 1.4; }
.gate-result h2 em { color: var(--red); font-family: var(--serif); font-style: italic; font-weight: 300; }
html[lang="ar"] .gate-result h2 em { font-family: var(--ar); font-style: normal; font-weight: 900; }
.gate-result .welcome { color: var(--ink-mute); font-size: 18px; }
html[lang="ar"] .gate-result .welcome { font-size: 20px; }

.gate-enter {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--red);
  padding: 8px 4px;
  cursor: pointer;
  transition: color 0.2s var(--ease), letter-spacing 0.3s var(--ease);
}
.gate-enter:hover { letter-spacing: 0.22em; }
html[lang="ar"] .gate-enter { font-family: var(--ar); letter-spacing: 0; font-weight: 500; }

@media (max-width: 640px) {
  .gate { padding: 24px 20px; }
  .gate-buttons { width: 100%; flex-direction: column; }
  .gate-btn { width: 100%; padding: 22px; }
}

/* --------- HERO --------- */
.hero {
  padding-top: 140px;
  padding-bottom: var(--section-y);
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 56px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.hero-meta > div { display: flex; flex-direction: column; gap: 6px; }
.hero-meta-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-mute); }
.hero-meta-value { font-family: var(--mono); font-size: 13px; color: var(--ink); }
html[lang="ar"] .hero-meta-label { font-family: var(--mono); font-size: 12px; }
html[lang="ar"] .hero-meta-value { font-family: var(--ar); font-size: 15px; }

@media (max-width: 720px) {
  .hero-meta { grid-template-columns: 1fr; gap: 20px; }
}

.hero-name {
  font-family: var(--en);
  font-weight: 300;
  font-size: clamp(56px, 12vw, 180px);
  line-height: 0.92;
  letter-spacing: -0.045em;
  margin-bottom: 48px;
}
html[lang="ar"] .hero-name {
  font-family: var(--ar);
  font-weight: 800;
  font-size: clamp(56px, 12vw, 160px);
  letter-spacing: 0;
  line-height: 1.05;
}

.hero-tag {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 80px;
  align-items: end;
}
.hero-claim {
  font-family: var(--en);
  font-weight: 300;
  font-size: clamp(22px, 3.4vw, 38px);
  line-height: 1.25;
  letter-spacing: -0.02em;
  max-width: 22ch;
}
html[lang="ar"] .hero-claim {
  font-family: var(--ar);
  font-weight: 500;
  font-size: clamp(22px, 3.4vw, 38px);
  line-height: 1.5;
  letter-spacing: 0;
}
.hero-claim em {
  color: var(--red);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
}
html[lang="ar"] .hero-claim em {
  font-family: var(--ar);
  font-style: normal;
  font-weight: 900;
}

.hero-roles {
  display: flex; flex-direction: column; gap: 16px;
  text-align: end;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
html[dir="rtl"] .hero-roles { text-align: start; }
.hero-roles strong { color: var(--ink); font-weight: 500; }
.hero-roles span { color: var(--ink-mute); display: block; margin-top: 4px; font-size: 11px; }
html[lang="ar"] .hero-roles { font-family: var(--ar); font-size: 14px; text-transform: none; letter-spacing: 0; }
html[lang="ar"] .hero-roles span { font-size: 13px; }

@media (max-width: 880px) {
  .hero-tag { grid-template-columns: 1fr; gap: 40px; }
  .hero-roles { text-align: start; }
}

/* --------- TICKER --------- */
.ticker {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  overflow: hidden;
  background: var(--bg-elev);
}
.ticker-track {
  display: flex; gap: 60px;
  white-space: nowrap;
  animation: tickerMove 38s linear infinite;
  width: max-content;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.ticker-item::before { content: "// "; color: var(--red); }
html[lang="ar"] .ticker-item { font-family: var(--ar); font-size: 16px; text-transform: none; letter-spacing: 0; font-weight: 500; }
@keyframes tickerMove {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
html[dir="rtl"] .ticker-track { animation-name: tickerMoveRtl; }
@keyframes tickerMoveRtl {
  from { transform: translateX(0); }
  to { transform: translateX(50%); }
}

/* --------- DOSSIER HEADERS --------- */
.dossier-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: end;
  padding-bottom: 28px;
  margin-bottom: clamp(40px, 5vw, 64px);
  border-bottom: 1px solid var(--line-strong);
}
.dossier-head-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.dossier-head h2 {
  font-family: var(--en);
  font-weight: 300;
  font-size: clamp(32px, 4.8vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-align: center;
}
html[lang="ar"] .dossier-head h2 { font-family: var(--ar); font-weight: 700; letter-spacing: 0; line-height: 1.3; }
.dossier-head-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-align: end;
}
html[lang="ar"] .dossier-head-meta { font-family: var(--ar); font-size: 13px; text-transform: none; letter-spacing: 0; }

@media (max-width: 720px) {
  .dossier-head { grid-template-columns: 1fr; gap: 8px; text-align: start; padding-bottom: 24px; margin-bottom: 36px; }
  .dossier-head h2 { text-align: start; }
  .dossier-head-meta { text-align: start; }
}

/* --------- THESIS --------- */
.thesis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}
@media (max-width: 880px) { .thesis-grid { grid-template-columns: 1fr; gap: 40px; } }

.thesis-headline {
  font-family: var(--en);
  font-weight: 200;
  font-size: clamp(32px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
html[lang="ar"] .thesis-headline { font-family: var(--ar); font-weight: 700; line-height: 1.35; letter-spacing: 0; }
.thesis-headline em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  color: var(--red);
}
html[lang="ar"] .thesis-headline em { font-family: var(--ar); font-style: normal; font-weight: 900; }
.thesis-quote {
  text-decoration-line: line-through;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
  text-decoration-skip-ink: none;
}

.thesis-body p { font-size: 17px; line-height: 1.7; color: var(--ink); margin-bottom: 18px; }
.thesis-body p:last-child { margin-bottom: 0; }
.thesis-body em { color: var(--red); font-family: var(--serif); font-style: italic; font-weight: 400; }
html[lang="ar"] .thesis-body p { font-size: 18px; line-height: 1.95; }
html[lang="ar"] .thesis-body em { font-family: var(--ar); font-style: normal; color: var(--red); font-weight: 700; }

.thesis-foot {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.thesis-foot strong { color: var(--ink); font-weight: 500; }
html[lang="ar"] .thesis-foot { font-family: var(--ar); font-size: 14px; text-transform: none; letter-spacing: 0; }

/* --------- LAB --------- */
.lab-intro {
  max-width: 720px;
  margin: 0 auto clamp(48px, 6vw, 80px);
  text-align: center;
  font-family: var(--en);
  font-weight: 300;
  font-size: clamp(20px, 2.6vw, 28px);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--ink);
}
html[lang="ar"] .lab-intro { font-family: var(--ar); font-weight: 500; line-height: 1.7; letter-spacing: 0; }
.lab-intro em { font-family: var(--serif); font-style: italic; font-weight: 300; color: var(--red); }
html[lang="ar"] .lab-intro em { font-family: var(--ar); font-style: normal; font-weight: 700; }

.lab-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 980px) { .lab-grid { grid-template-columns: 1fr; gap: 16px; } }

.experiment {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 32px;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 320px;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.experiment::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--red);
  border-radius: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.experiment:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px -12px rgba(0,0,0,0.25);
}
.experiment.invite::before {
  opacity: 0.4;
  animation: inviteBorder 2s ease-in-out infinite;
}
.experiment[data-interacted="true"]::before { opacity: 0; animation: none; }
@keyframes inviteBorder {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.7; }
}

.experiment-tag {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.experiment-tag .step {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.experiment-tag .step::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red);
  animation: pulse 1.4s ease-in-out infinite;
}
.experiment[data-interacted="true"] .experiment-tag .step::before { animation: none; opacity: 0.3; }
.experiment[data-interacted="true"] .experiment-tag .step { color: var(--ink-mute); }
.experiment-tag .num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
}
html[lang="ar"] .experiment-tag .step { font-family: var(--ar); text-transform: none; letter-spacing: 0; font-weight: 700; font-size: 14px; }
html[lang="ar"] .experiment-tag .num { font-family: var(--mono); }

.experiment h3 {
  font-family: var(--en);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
html[lang="ar"] .experiment h3 { font-family: var(--ar); font-weight: 700; font-size: 28px; line-height: 1.4; letter-spacing: 0; }

.experiment p { color: var(--ink-mute); font-size: 14px; line-height: 1.55; }
html[lang="ar"] .experiment p { font-size: 16px; line-height: 1.85; }

.experiment-body {
  margin-top: auto;
  display: flex; flex-direction: column; gap: 16px;
}

/* Default toggle */
.toggle-row {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.toggle-row:hover { border-color: var(--red); }
.toggle-row label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 500;
  cursor: pointer;
}
html[lang="ar"] .toggle-row label { font-family: var(--ar); font-size: 15px; text-transform: none; letter-spacing: 0; font-weight: 600; }
.switch {
  position: relative;
  width: 56px; height: 28px;
  background: var(--line-strong);
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  transition: background 0.25s var(--ease), box-shadow 0.25s var(--ease);
  padding: 0;
  flex-shrink: 0;
}
.switch::before {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  background: var(--paper);
  border-radius: 50%;
  transition: transform 0.25s var(--ease);
}
.switch[aria-pressed="true"] { background: var(--red); }
.switch[aria-pressed="true"]::before { transform: translateX(28px); }
/* In RTL, anchor the handle at the right edge then translate left when pressed */
html[dir="rtl"] .switch::before { left: auto; right: 3px; }
html[dir="rtl"] .switch[aria-pressed="true"]::before { transform: translateX(-28px); }
/* Pulse on first reveal */
.experiment.invite .switch { box-shadow: 0 0 0 0 var(--red-glow); animation: switchPulse 2s ease-in-out infinite; }
@keyframes switchPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--red-glow); }
  50% { box-shadow: 0 0 0 8px transparent; }
}
.experiment[data-interacted="true"] .switch { animation: none; }

/* Anchor pricing */
.pricing { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.price-card {
  border: 1px solid var(--line-strong);
  padding: 20px 16px;
  text-align: center;
  border-radius: 2px;
  background: var(--bg-elev);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease);
  position: relative;
  font-family: inherit;
}
.price-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 2px;
  pointer-events: none;
  box-shadow: 0 0 0 0 var(--red-glow);
}
.price-card:hover {
  border-color: var(--red);
  transform: translateY(-2px);
  background: var(--bg-card);
}
.price-card.picked {
  border-color: var(--red);
  background: var(--red-soft);
}
.experiment.invite .price-card::after { animation: priceInvite 2.4s ease-in-out infinite; }
.experiment[data-interacted="true"] .price-card::after { animation: none; }
@keyframes priceInvite {
  0%, 100% { box-shadow: 0 0 0 0 var(--red-glow); }
  50% { box-shadow: 0 0 0 6px transparent; }
}
.pricing-hint {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  text-align: center;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.pricing-hint::before, .pricing-hint::after {
  content: "↑"; font-size: 12px; animation: bounceUp 1.4s ease-in-out infinite;
}
.experiment[data-interacted="true"] .pricing-hint { display: none; }
@keyframes bounceUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
html[lang="ar"] .pricing-hint { font-family: var(--ar); font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 600; }
.price-card .strike {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-mute);
  text-decoration: line-through;
  margin-bottom: 4px;
  min-height: 18px;
}
.price-card .price {
  font-family: var(--en);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.price-card .label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 4px;
}
html[lang="ar"] .price-card .label { font-family: var(--ar); font-size: 13px; text-transform: none; letter-spacing: 0; }

/* Scarcity */
.scarcity-display {
  display: flex; align-items: baseline; gap: 12px;
}
.scarcity-time {
  font-family: var(--en);
  font-size: 56px;
  font-weight: 200;
  letter-spacing: -0.03em;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}
.scarcity-display .live {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
  animation: pulse 1s ease-in-out infinite;
}
.scarcity-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
html[lang="ar"] .scarcity-meta { font-family: var(--ar); font-size: 14px; text-transform: none; letter-spacing: 0; }
.claim-btn {
  background: var(--red);
  border: 1px solid var(--red);
  color: var(--paper);
  padding: 14px 22px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
  align-self: flex-start;
  box-shadow: 0 0 0 0 var(--red-glow);
}
.claim-btn:hover { background: #c73828; transform: translateY(-2px); box-shadow: 0 8px 18px -8px var(--red-glow); }
.claim-btn:active { transform: translateY(0); }
.experiment.invite .claim-btn { animation: claimPulse 1.8s ease-in-out infinite; }
.experiment[data-interacted="true"] .claim-btn { animation: none; }
@keyframes claimPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--red-glow); }
  50% { box-shadow: 0 0 0 10px transparent; }
}
html[lang="ar"] .claim-btn { font-family: var(--ar); font-size: 15px; text-transform: none; letter-spacing: 0; font-weight: 700; }

/* Tap-here affordance label */
.tap-hint {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid var(--red);
  padding: 4px 10px;
  border-radius: 2px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
  z-index: 2;
}
html[dir="rtl"] .tap-hint { right: auto; left: 12px; }
.experiment.invite .tap-hint { opacity: 1; transform: translateY(0); animation: hintPulse 2s ease-in-out infinite; }
.experiment[data-interacted="true"] .tap-hint { opacity: 0; transform: translateY(-4px); }
@keyframes hintPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
html[lang="ar"] .tap-hint { font-family: var(--ar); text-transform: none; letter-spacing: 0; font-weight: 700; font-size: 12px; }

/* Escalation: after 8s without interaction, the affordance gets louder.
   No auto-reveal of finding — the click is the experiment. */
.experiment.escalate .tap-hint {
  background: var(--red);
  color: var(--paper);
  font-size: 11px;
  padding: 6px 12px;
  animation: hintPulseStrong 1.2s ease-in-out infinite;
}
@keyframes hintPulseStrong {
  0%, 100% { transform: translateY(0); box-shadow: 0 0 0 0 var(--red-glow); }
  50% { transform: translateY(-3px); box-shadow: 0 0 0 8px transparent; }
}
.experiment.escalate::before {
  opacity: 0.7 !important;
  animation: inviteBorder 1.2s ease-in-out infinite !important;
}
.experiment.escalate .switch,
.experiment.escalate .claim-btn,
.experiment.escalate .price-card::after {
  animation-duration: 1s !important;
}
.experiment[data-interacted="true"].escalate { animation: none; }
.experiment[data-interacted="true"].escalate .tap-hint { background: transparent; color: transparent; }

/* Finding (revealed after action or auto) */
.finding {
  margin-top: 16px;
  padding: 16px;
  background: var(--red-soft);
  border-left: 2px solid var(--red);
  border-radius: 2px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.4s var(--ease), max-height 0.4s var(--ease);
}
html[dir="rtl"] .finding { border-left: 0; border-right: 2px solid var(--red); }
.finding.show { opacity: 1; max-height: 300px; }
.finding strong { color: var(--red); font-weight: 600; }
.finding cite { color: var(--ink-mute); font-style: italic; font-size: 12px; display: block; margin-top: 6px; }
html[lang="ar"] .finding { font-size: 15px; line-height: 1.85; }
html[lang="ar"] .finding cite { font-size: 13px; font-style: normal; }

/* --------- FILES --------- */
.files-list { display: flex; flex-direction: column; }
.file-row {
  display: grid;
  grid-template-columns: 100px 1fr 1.4fr auto;
  gap: 32px;
  align-items: center;
  padding: 32px 8px;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s var(--ease), padding-left 0.2s var(--ease);
  cursor: pointer;
}
.file-row:first-child { border-top: 1px solid var(--line); }
.file-row { position: relative; }
.file-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 60%;
  background: var(--red);
  transition: width 0.3s var(--ease);
}
html[dir="rtl"] .file-row::before { left: auto; right: 0; }
.file-row:hover { background: var(--bg-card); padding-left: 24px; }
html[dir="rtl"] .file-row:hover { padding-left: 8px; padding-right: 24px; }
.file-row:hover::before { width: 4px; }
.file-row:hover .file-arrow { transform: translateX(8px); color: var(--red); }
html[dir="rtl"] .file-row:hover .file-arrow { transform: translateX(-8px); }
.file-arrow { font-size: 22px !important; }

.file-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.file-title {
  font-family: var(--en);
  font-weight: 400;
  font-size: clamp(28px, 3.4vw, 42px);
  letter-spacing: -0.02em;
  color: var(--ink);
}
html[lang="ar"] .file-title { font-family: var(--ar); font-weight: 700; letter-spacing: 0; line-height: 1.3; }
.file-row:hover .file-title { color: var(--red); }

.file-meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: block;
  margin-top: 4px;
}
html[lang="ar"] .file-meta { font-family: var(--ar); font-size: 13px; text-transform: none; letter-spacing: 0; }

.file-desc { font-size: 14px; line-height: 1.55; color: var(--ink-mute); }
html[lang="ar"] .file-desc { font-size: 16px; line-height: 1.85; }
.file-arrow {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--ink-mute);
  transition: transform 0.2s var(--ease), color 0.2s var(--ease);
}

@media (max-width: 880px) {
  .file-row { grid-template-columns: auto 1fr; gap: 16px; padding: 24px 4px; }
  .file-num { grid-column: 1; grid-row: 1; }
  .file-arrow { grid-column: 2; grid-row: 1; text-align: end; }
  .file-title { grid-column: 1 / -1; grid-row: 2; font-size: 28px; }
  .file-desc { grid-column: 1 / -1; grid-row: 3; }
}

/* --------- MANIFESTO --------- */
.manifesto-list { display: flex; flex-direction: column; }
.manifesto-item {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 32px;
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.manifesto-item:first-child { border-top: 1px solid var(--line); }
.manifesto-num {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.16em;
  color: var(--red);
}
.manifesto-line {
  font-family: var(--en);
  font-weight: 300;
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
html[lang="ar"] .manifesto-line { font-family: var(--ar); font-weight: 600; letter-spacing: 0; line-height: 1.5; }
.manifesto-attr {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-align: end;
  max-width: 220px;
}
html[lang="ar"] .manifesto-attr { font-family: var(--ar); font-size: 13px; text-transform: none; letter-spacing: 0; }

@media (max-width: 720px) {
  .manifesto-item { grid-template-columns: auto 1fr; gap: 16px; padding: 24px 0; }
  .manifesto-attr { grid-column: 1 / -1; text-align: start; max-width: 100%; margin-top: 4px; }
}

/* --------- ON THE DESK --------- */
.desk-list { display: flex; flex-direction: column; }
.desk-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 32px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.desk-row:first-child { border-top: 1px solid var(--line); }
.desk-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
html[lang="ar"] .desk-label { font-family: var(--ar); font-size: 14px; text-transform: none; letter-spacing: 0; }
.desk-content {
  font-family: var(--en);
  font-weight: 400;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.45;
  letter-spacing: -0.01em;
}
html[lang="ar"] .desk-content { font-family: var(--ar); font-weight: 500; font-size: clamp(18px, 2.2vw, 22px); line-height: 1.7; letter-spacing: 0; }
.desk-content em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--red);
}
html[lang="ar"] .desk-content em { font-family: var(--ar); font-style: normal; font-weight: 700; }
@media (max-width: 720px) {
  .desk-row { grid-template-columns: 1fr; gap: 6px; padding: 20px 0; }
}

/* --------- CHALLENGE FORM --------- */
.challenge {
  background: var(--bg-elev);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.challenge-stamp {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  border: 1px solid var(--red);
  padding: 6px 14px;
  border-radius: 2px;
  display: inline-block;
}
html[lang="ar"] .challenge-stamp { font-family: var(--ar); font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 500; }

.challenge-head {
  text-align: center;
  margin-bottom: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}
.challenge-headline {
  font-family: var(--en);
  font-weight: 200;
  font-size: clamp(32px, 5.6vw, 80px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  max-width: 18ch;
}
html[lang="ar"] .challenge-headline { font-family: var(--ar); font-weight: 700; line-height: 1.3; letter-spacing: 0; max-width: 22ch; }
.challenge-headline em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  color: var(--red);
}
html[lang="ar"] .challenge-headline em { font-family: var(--ar); font-style: normal; font-weight: 900; }

.challenge-form {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
html[lang="ar"] .field label { font-family: var(--ar); font-size: 14px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.field input, .field textarea {
  font-family: inherit;
  font-size: 16px;
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 14px 16px;
  border-radius: 2px;
  resize: vertical;
  min-height: 48px;
  transition: border-color 0.2s var(--ease);
}
html[lang="ar"] .field input, html[lang="ar"] .field textarea { font-family: var(--ar); font-size: 17px; }
.field textarea { min-height: 120px; line-height: 1.55; }
html[lang="ar"] .field textarea { line-height: 1.85; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--red); }
.field-hint { font-size: 12px; color: var(--ink-faint); }
html[lang="ar"] .field-hint { font-size: 13px; }
.field-error { color: var(--red); font-size: 12px; min-height: 16px; }
html[lang="ar"] .field-error { font-size: 13px; }

.submit-btn {
  background: var(--red);
  color: var(--paper);
  border: 0;
  padding: 18px 28px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
  align-self: flex-start;
}
.submit-btn:hover { transform: translateY(-2px); background: #c93828; }
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
html[lang="ar"] .submit-btn { font-family: var(--ar); font-size: 15px; text-transform: none; letter-spacing: 0; font-weight: 600; }

.form-success, .form-error-state {
  padding: 18px;
  border-radius: 2px;
  font-size: 14px;
  line-height: 1.55;
}
.form-success { background: rgba(0, 200, 100, 0.1); border: 1px solid rgba(0, 200, 100, 0.3); color: #00cc66; }
.form-error-state { background: var(--red-soft); border: 1px solid var(--red); color: var(--red); }

/* --------- FOOTER --------- */
footer {
  padding: 60px var(--gutter) 40px;
  border-top: 1px solid var(--line);
}
.footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 32px;
  align-items: center;
}
.footer-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
html[lang="ar"] .footer-meta { font-family: var(--ar); font-size: 13px; text-transform: none; letter-spacing: 0; }
.footer-social { display: flex; gap: 24px; justify-content: center; }
.footer-social a {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  transition: color 0.2s var(--ease);
}
.footer-social a:hover { color: var(--red); }
html[lang="ar"] .footer-social a { font-family: var(--ar); font-size: 14px; text-transform: none; letter-spacing: 0; }
.footer-mark {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: end;
}
html[dir="rtl"] .footer-mark { text-align: start; }
html[lang="ar"] .footer-mark { font-family: var(--ar); font-size: 12px; text-transform: none; letter-spacing: 0; }

@media (max-width: 880px) {
  .footer-inner { grid-template-columns: 1fr; gap: 18px; text-align: start; }
  .footer-social { justify-content: flex-start; }
  .footer-mark { text-align: start; }
}

/* --------- MOBILE STICKY CTA --------- */
.sticky-cta {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 90;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 12px var(--gutter);
}
.sticky-cta a {
  display: block;
  text-align: center;
  background: var(--red);
  color: var(--paper);
  padding: 14px;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
html[lang="ar"] .sticky-cta a { font-family: var(--ar); font-size: 14px; text-transform: none; letter-spacing: 0; font-weight: 600; }
@media (max-width: 880px) {
  .sticky-cta { display: block; }
  body { padding-bottom: 64px; }
}

/* --------- SUB-PAGE LAYOUTS --------- */
.subpage-hero {
  padding-top: 120px;
  padding-bottom: 60px;
  border-bottom: 1px solid var(--line);
}
.subpage-back {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
  transition: color 0.2s var(--ease);
}
.subpage-back:hover { color: var(--red); }
html[lang="ar"] .subpage-back { font-family: var(--ar); font-size: 14px; text-transform: none; letter-spacing: 0; }

.subpage-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 16px;
}
html[lang="ar"] .subpage-tag { font-family: var(--ar); font-size: 13px; text-transform: none; letter-spacing: 0; }

.subpage-title {
  font-family: var(--en);
  font-weight: 200;
  font-size: clamp(48px, 9vw, 120px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
}
html[lang="ar"] .subpage-title { font-family: var(--ar); font-weight: 800; line-height: 1.1; letter-spacing: 0; }

.subpage-lede {
  font-family: var(--en);
  font-weight: 300;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.45;
  letter-spacing: -0.01em;
  max-width: 60ch;
  color: var(--ink-mute);
}
html[lang="ar"] .subpage-lede { font-family: var(--ar); font-weight: 500; line-height: 1.7; letter-spacing: 0; }

.subpage-body {
  padding: var(--section-y) 0;
  max-width: 720px;
}
.subpage-body h2 {
  font-family: var(--en);
  font-weight: 300;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 64px 0 24px;
}
.subpage-body h2:first-child { margin-top: 0; }
html[lang="ar"] .subpage-body h2 { font-family: var(--ar); font-weight: 700; line-height: 1.4; letter-spacing: 0; }

.subpage-body p {
  font-family: var(--en);
  font-size: 18px;
  line-height: 1.65;
  margin-bottom: 22px;
  color: var(--ink);
}
html[lang="ar"] .subpage-body p { font-family: var(--ar); font-size: 19px; line-height: 1.95; }

.subpage-body em { color: var(--red); font-family: var(--serif); font-style: italic; font-weight: 400; }
html[lang="ar"] .subpage-body em { font-family: var(--ar); font-style: normal; font-weight: 700; }

.subpage-body strong { color: var(--ink); font-weight: 600; }

.subpage-body ul {
  margin: 0 0 24px 24px;
  padding: 0;
}
html[dir="rtl"] .subpage-body ul { margin: 0 24px 24px 0; }
.subpage-body li {
  font-size: 18px;
  line-height: 1.7;
  margin-bottom: 10px;
  color: var(--ink);
}
html[lang="ar"] .subpage-body li { font-family: var(--ar); font-size: 19px; line-height: 1.95; }

.subpage-body blockquote {
  border-left: 2px solid var(--red);
  padding: 4px 0 4px 20px;
  margin: 32px 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  line-height: 1.5;
  color: var(--ink);
}
html[dir="rtl"] .subpage-body blockquote { border-left: 0; border-right: 2px solid var(--red); padding: 4px 20px 4px 0; }
html[lang="ar"] .subpage-body blockquote { font-family: var(--ar); font-style: normal; font-size: 22px; line-height: 1.7; font-weight: 500; }

/* Field Notes — essay list */
.essay-list { display: flex; flex-direction: column; }
.essay-item {
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 32px;
  align-items: baseline;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}
.essay-item:first-child { border-top: 1px solid var(--line); }
.essay-date { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; color: var(--ink-mute); text-transform: uppercase; }
.essay-title { font-family: var(--en); font-weight: 400; font-size: 24px; letter-spacing: -0.015em; line-height: 1.25; }
html[lang="ar"] .essay-title { font-family: var(--ar); font-weight: 700; font-size: 26px; line-height: 1.4; letter-spacing: 0; }
.essay-status { font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--red); border: 1px solid var(--red); padding: 4px 10px; border-radius: 2px; }
html[lang="ar"] .essay-status { font-family: var(--ar); font-size: 12px; text-transform: none; letter-spacing: 0; }
@media (max-width: 720px) {
  .essay-item { grid-template-columns: 1fr auto; gap: 12px; }
  .essay-date { grid-column: 1 / -1; }
  .essay-title { grid-column: 1; font-size: 22px; }
  .essay-status { grid-column: 2; }
}

/* --------- UTILITIES --------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.text-red { color: var(--red); }
.text-mute { color: var(--ink-mute); }
.serif-italic { font-family: var(--serif); font-style: italic; font-weight: 300; }
.is-hidden { display: none !important; }
.honeypot { position: absolute; left: -9999px; opacity: 0; pointer-events: none; width: 1px; height: 1px; }

/* Inline-link variants (replaces inline style="" usages) */
.link-red { color: var(--red); border-bottom: 1px solid var(--red); transition: background 0.15s var(--ease); }
.link-red:hover { color: var(--paper); background: var(--red); }
.link-mute { color: var(--ink-mute); }
.link-mute:hover { color: var(--red); }

/* Subpage title overrides */
.subpage-title.size-md { font-size: clamp(40px, 7vw, 88px); }
.subpage-title.size-sm { font-size: clamp(36px, 6.5vw, 80px); }

/* Challenge sub-headline */
.challenge-meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 16px;
  max-width: 56ch;
}
html[lang="ar"] .challenge-meta { font-family: var(--ar); font-size: 14px; text-transform: none; letter-spacing: 0; }

/* Footer engagement spacing */
.engagement-line { margin-top: 6px; }

/* Essay newsletter callout (field-notes) */
.essay-callout {
  margin-top: 64px;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 2px;
  max-width: 720px;
}
.essay-callout-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 12px;
}
html[lang="ar"] .essay-callout-label { font-family: var(--ar); font-size: 13px; text-transform: none; letter-spacing: 0; }
.essay-callout-body {
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
}
html[lang="ar"] .essay-callout-body { font-family: var(--ar); font-size: 18px; line-height: 1.85; }

/* --------- 404 PAGE --------- */
.nf-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  gap: 24px;
}
.nf-code {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
}
.nf-title {
  font-family: var(--en);
  font-weight: 200;
  font-size: clamp(72px, 14vw, 200px);
  line-height: 0.9;
  letter-spacing: -0.04em;
}
.nf-title em { font-family: var(--serif); font-style: italic; font-weight: 300; color: var(--red); }
.nf-text {
  font-family: var(--en);
  font-weight: 300;
  font-size: clamp(18px, 2.4vw, 24px);
  color: var(--ink-mute);
  max-width: 46ch;
  line-height: 1.45;
}
.nf-back {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  border-bottom: 1px solid var(--red);
  padding-bottom: 4px;
  transition: letter-spacing 0.3s var(--ease);
}
.nf-back:hover { letter-spacing: 0.22em; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .ticker-track { animation: none; }
  html { scroll-behavior: auto; }
}
