/* ============ SARAB — PERSIAN FUTURISM AFTER DARK ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --night: #070510;
  --night-2: #0e0a1f;
  --gold: #d9a956;
  --gold-soft: rgba(217,169,86,.65);
  --cyan: #55d7f2;
  --violet: #9d7bff;
  --paper: #efeaf7;
  --paper-soft: rgba(239,234,247,.6);
  --glass: rgba(255,255,255,.055);
  --glass-border: rgba(255,255,255,.14);
}
body {
  font-family: 'Space Grotesk', 'Vazirmatn', sans-serif;
  background: var(--night); color: var(--paper);
  overflow-x: hidden; cursor: none; min-height: 100vh;
}
html[dir="rtl"] body { font-family: 'Vazirmatn', 'Space Grotesk', sans-serif; }
::selection { background: var(--gold); color: var(--night); }

.grain {
  position: fixed; inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  opacity: .05; pointer-events: none; z-index: 200;
  animation: grainShift .5s steps(4) infinite;
}
@keyframes grainShift { 0%{transform:translate(0,0)} 25%{transform:translate(-1.5%,1%)} 50%{transform:translate(1%, -1.5%)} 75%{transform:translate(-1%, -1%)} 100%{transform:translate(0,0)} }

#stars { position: fixed; inset: 0; z-index: 1; pointer-events: none; }

/* ---------- cursors ---------- */
.cursor-glow {
  position: fixed; width: 340px; height: 340px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(217,169,86,.14), rgba(157,123,255,.06) 45%, transparent 70%);
  transform: translate(-50%,-50%); z-index: 2; filter: blur(6px);
}
.cursor-ring {
  position: fixed; width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--gold-soft); pointer-events: none; z-index: 300;
  transform: translate(-50%,-50%);
  transition: width .35s cubic-bezier(.22,1,.36,1), height .35s cubic-bezier(.22,1,.36,1), border-color .3s, background .3s;
}
.cursor-ring.hovering { width: 64px; height: 64px; border-color: var(--gold); background: rgba(217,169,86,.08); backdrop-filter: blur(2px); }
@media (hover: none) { .cursor-glow, .cursor-ring { display: none; } body { cursor: auto; } }

/* ---------- preloader (eye) ---------- */
.preloader { position: fixed; inset: 0; z-index: 500; background: var(--night); display: flex; align-items: center; justify-content: center; }
.pre-eye { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pre-lid { position: absolute; left: 0; width: 100%; height: 50%; background: #030208; z-index: 2; }
.pre-lid-top { top: 0; transform-origin: top; }
.pre-lid-bottom { bottom: 0; transform-origin: bottom; }
.pre-word {
  font-family: 'Vazirmatn', sans-serif; font-weight: 100;
  font-size: clamp(4rem, 14vw, 11rem); color: var(--gold);
  text-shadow: 0 0 80px rgba(217,169,86,.5); opacity: 0;
}

/* ---------- aurora ---------- */
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; filter: blur(70px) saturate(1.4); }
.au { position: absolute; border-radius: 50%; opacity: .35; will-change: transform; }
.au-1 { width: 70vw; height: 42vh; background: linear-gradient(90deg, #2b1b6b, #7b3fd4); top: -8%; left: -10%; animation: auMove1 26s ease-in-out infinite alternate; }
.au-2 { width: 55vw; height: 38vh; background: linear-gradient(90deg, #0c4a58, #1fb8c9); top: 20%; right: -15%; animation: auMove2 31s ease-in-out infinite alternate; }
.au-3 { width: 48vw; height: 30vh; background: linear-gradient(90deg, #6b4318, #d9a956); bottom: -10%; left: 20%; animation: auMove3 24s ease-in-out infinite alternate; opacity: .22; }
@keyframes auMove1 { to { transform: translate(18vw, 12vh) rotate(24deg) scale(1.25); } }
@keyframes auMove2 { to { transform: translate(-14vw, 16vh) rotate(-18deg) scale(1.1); } }
@keyframes auMove3 { to { transform: translate(10vw, -10vh) rotate(12deg) scale(1.35); } }

/* ---------- glass utilities ---------- */
.glass-pill {
  background: var(--glass); border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border-radius: 100px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 8px 30px rgba(0,0,0,.45);
}
.glass-panel {
  background: var(--glass); border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-radius: 26px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 24px 70px rgba(0,0,0,.5);
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.3rem 2rem;
}
.nav-logo { display: flex; flex-direction: column; line-height: 1.05; text-decoration: none; }
.logo-en { font-family: 'Syne', sans-serif; font-weight: 800; letter-spacing: .2em; font-size: 1rem; color: var(--paper); }
.logo-fa { font-family: 'Vazirmatn', sans-serif; font-weight: 200; font-size: .85rem; color: var(--gold); }
.nav-center { display: flex; gap: 1.6rem; padding: .7rem 1.6rem; }
.nav-link { color: var(--paper-soft); text-decoration: none; font-size: .86rem; letter-spacing: .04em; transition: color .3s, text-shadow .3s; }
.nav-link:hover { color: var(--gold); text-shadow: 0 0 18px rgba(217,169,86,.7); }
.nav-actions { display: flex; gap: .8rem; }
.lang-toggle { padding: .5rem 1rem; color: var(--paper); font-family: inherit; font-size: .8rem; cursor: none; transition: transform .3s; }
.lang-toggle:hover { transform: scale(1.07); }
.lang-opt { opacity: .4; font-weight: 700; transition: opacity .3s; }
.lang-opt.active { opacity: 1; color: var(--gold); }
.lang-divider { opacity: .3; margin: 0 .2rem; }
@media (max-width: 860px) { .nav-center { display: none; } }

/* ---------- hero ---------- */
.hero {
  position: relative; z-index: 5; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.6rem; padding: 6rem 1.5rem 4rem; text-align: center;
}
.hero-rings { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.ring { position: absolute; border-radius: 50%; border: 1px solid rgba(217,169,86,.16); }
.r1 { width: min(78vmin, 700px); height: min(78vmin, 700px); animation: spin 60s linear infinite; border-style: dashed; }
.r2 { width: min(58vmin, 520px); height: min(58vmin, 520px); animation: spin 45s linear infinite reverse; border-color: rgba(85,215,242,.14); }
.r3 { width: min(38vmin, 340px); height: min(38vmin, 340px); animation: spin 30s linear infinite; border-color: rgba(157,123,255,.16); border-style: dotted; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero-mega { position: relative; display: grid; place-items: center; }
.hm-fa {
  grid-area: 1/1;
  font-family: 'Vazirmatn', sans-serif; font-weight: 100;
  font-size: clamp(5rem, 20vw, 15rem); color: var(--paper);
  text-shadow: 0 0 90px rgba(157,123,255,.35);
}
.hm-en {
  grid-area: 1/1;
  font-family: 'Syne', sans-serif; font-weight: 800; letter-spacing: .42em;
  font-size: clamp(.9rem, 2.6vw, 1.6rem); color: var(--gold);
  transform: translateY(clamp(3.2rem, 11vw, 8.5rem));
  text-indent: .42em;
}
.hero-tag { display: flex; gap: .7rem; align-items: center; font-size: clamp(.95rem, 2vw, 1.25rem); color: var(--paper-soft); font-weight: 300; }
.ht-sep { color: var(--gold); }

.hero-glass-hud {
  display: flex; gap: 1px; margin-top: 1.4rem; border-radius: 18px; overflow: hidden;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 16px 50px rgba(0,0,0,.5);
}
.hud-item { display: flex; flex-direction: column; gap: .25rem; padding: 1rem 1.7rem; background: var(--glass); }
.hud-k { font-size: .65rem; letter-spacing: .25em; text-transform: uppercase; color: var(--gold-soft); }
html[dir="rtl"] .hud-k { letter-spacing: .06em; }
.hud-v { font-size: .95rem; font-weight: 600; direction: ltr; }
@media (max-width: 560px) { .hero-glass-hud { flex-direction: column; } }

.hero-scroll {
  position: absolute; bottom: 1.8rem; display: flex; flex-direction: column; align-items: center; gap: .5rem;
  font-size: .7rem; letter-spacing: .35em; text-transform: uppercase; color: var(--paper-soft);
}
html[dir="rtl"] .hero-scroll { letter-spacing: .1em; }
.hs-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); animation: hsDrop 1.6s cubic-bezier(.65,0,.35,1) infinite; }
@keyframes hsDrop { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(26px); opacity: 0; } }

/* ---------- intro sticky ---------- */
.intro-sticky { position: relative; z-index: 5; padding: 22vh 1.5rem; }
.is-inner { max-width: 900px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; gap: 2.2rem; }
.is-line {
  font-family: 'Syne', 'Vazirmatn', sans-serif;
  font-size: clamp(1.7rem, 4.6vw, 3.6rem); font-weight: 700; line-height: 1.25;
  opacity: .12; filter: blur(3px); transition: none;
}
.is-gold { color: var(--gold); }

/* ---------- chapters ---------- */
.chapters { position: relative; z-index: 5; padding: 7rem 0 5rem; }
.ch-head { text-align: center; margin-bottom: 6rem; padding: 0 1.5rem; }
.ch-index { font-size: .85rem; letter-spacing: .4em; text-transform: uppercase; color: var(--gold-soft); font-weight: 700; display: block; margin-bottom: 0.8rem; }
html[dir="rtl"] .ch-index { letter-spacing: .12em; }
.ch-heading { font-family: 'Syne', 'Vazirmatn', sans-serif; font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; color: var(--paper); }

.chapter {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 3.5rem; align-items: center;
  width: min(1220px, calc(100vw - 3rem)); margin: 0 auto 10rem;
}
.ch-flip .ch-visual { order: 2; }
@media (max-width: 900px) { .chapter { grid-template-columns: 1fr; gap: 2.5rem; } .ch-flip .ch-visual { order: 0; } }

.ch-visual {
  position: relative; height: 500px; border-radius: 32px; overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: 0 25px 80px rgba(0,0,0,0.65), inset 0 1px 0 rgba(255,255,255,0.15);
  perspective: 1000px;
}

.chv-1 { background: radial-gradient(ellipse at 30% 30%, #26135e, #090518 75%); }
.chv-2 { background: radial-gradient(ellipse at 70% 40%, #083c48, #050f1c 75%); }
.chv-3 { background: radial-gradient(ellipse at 50% 70%, #4a280b, #110803 75%); }

.chv-orb {
  position: absolute; width: 220px; height: 220px; border-radius: 50%;
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  filter: blur(6px); opacity: .9; pointer-events: none; will-change: transform;
}
.orb-glass { background: radial-gradient(circle at 35% 30%, #c4b0ff, #5b31cc 60%, transparent); box-shadow: 0 0 140px 45px rgba(125,80,230,.45); }
.orb-signal { background: radial-gradient(circle at 35% 30%, #a4f5ff, #119cb4 60%, transparent); box-shadow: 0 0 140px 45px rgba(30,175,205,.45); }
.orb-simorgh { background: radial-gradient(circle at 35% 30%, #ffe3aa, #be781b 60%, transparent); box-shadow: 0 0 140px 45px rgba(217,169,86,.45); }

/* --- Chapter 1: Isfahan Ayeneh-Kari Mirror Matrix --- */
.chv-mirror-chamber { position: absolute; inset: 0; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.mirror-grid-bg {
  position: absolute; inset: 0;
  background-image: 
    linear-gradient(45deg, rgba(217,169,86,0.06) 25%, transparent 25%), 
    linear-gradient(-45deg, rgba(217,169,86,0.06) 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, rgba(217,169,86,0.06) 75%), 
    linear-gradient(-45deg, transparent 75%, rgba(217,169,86,0.06) 75%);
  background-size: 40px 40px;
  background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
  opacity: 0.7;
}

.mirror-facet {
  position: absolute;
  background: linear-gradient(135deg, rgba(255,255,255,0.18), rgba(217,169,86,0.08));
  border: 1px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 15px 35px rgba(0,0,0,0.4);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.mf-1 { width: 140px; height: 140px; top: 12%; inset-inline-start: 12%; transform: rotate(15deg) translateZ(30px); border-radius: 18px; }
.mf-2 { width: 110px; height: 110px; bottom: 16%; inset-inline-end: 14%; transform: rotate(-22deg) translateZ(45px); border-radius: 50%; }
.mf-3 { width: 85px; height: 85px; top: 18%; inset-inline-end: 18%; transform: rotate(45deg) translateZ(20px); border-radius: 12px; }
.mf-4 { width: 95px; height: 95px; bottom: 15%; inset-inline-start: 18%; transform: rotate(-10deg) translateZ(35px); border-radius: 16px; }
.mf-5 { width: 60px; height: 60px; top: 52%; inset-inline-start: 6%; transform: rotate(30deg); border-radius: 50%; }

.mirror-prism-center {
  position: absolute; width: 130px; height: 130px;
  border-radius: 28px;
  border: 1.5px solid var(--gold);
  background: linear-gradient(135deg, rgba(217,169,86,0.22), rgba(157,123,255,0.15));
  backdrop-filter: blur(16px);
  box-shadow: 0 0 50px rgba(217,169,86,0.35), inset 0 0 20px rgba(255,255,255,0.3);
  animation: prismPulse 6s ease-in-out infinite alternate;
  display: flex; align-items: center; justify-content: center;
}
@keyframes prismPulse { 0% { transform: scale(0.95) rotate(0deg); } 100% { transform: scale(1.08) rotate(12deg); } }
.prism-core { width: 36px; height: 36px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 25px var(--gold); }
.prism-refraction {
  position: absolute; inset: -40px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, rgba(85,215,242,0.3), rgba(217,169,86,0.4), rgba(157,123,255,0.3), transparent);
  animation: spin 14s linear infinite; pointer-events: none;
}

/* --- Chapter 2: Cybernetic Silk Road Landscape --- */
.chv-signal-landscape { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.dune-wave {
  position: absolute; left: -20%; width: 140%; height: 140px; border-radius: 50% 50% 0 0;
  border-top: 1px solid rgba(85,215,242,0.35);
  background: linear-gradient(180deg, rgba(85,215,242,0.06), transparent 80%);
}
.dw-1 { bottom: 0; transform: rotate(-6deg); height: 180px; }
.dw-2 { bottom: 40px; transform: rotate(8deg); height: 150px; border-top-color: rgba(217,169,86,0.3); }
.dw-3 { bottom: 90px; transform: rotate(-3deg); height: 120px; border-top-color: rgba(157,123,255,0.25); }

.fiber-conduit { position: absolute; width: 100%; height: 2px; background: linear-gradient(90deg, transparent, rgba(85,215,242,0.5), transparent); }
.fc-1 { top: 38%; transform: rotate(-14deg); }
.fc-2 { top: 62%; transform: rotate(18deg); }

.signal-packet {
  position: absolute; top: -3px; width: 18px; height: 8px; border-radius: 10px;
  background: var(--gold); box-shadow: 0 0 14px var(--gold), 0 0 25px var(--cyan);
  animation: packetTravel 3.2s linear infinite;
}
.sp-2 { animation-delay: 1.6s; }
.sp-3 { animation-delay: 0.8s; background: var(--cyan); }
@keyframes packetTravel { 0% { left: -10%; opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { left: 110%; opacity: 0; } }

.waypoint-radar { position: absolute; top: 22%; inset-inline-end: 18%; width: 110px; height: 110px; }
.wr-circle { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed rgba(85,215,242,0.4); animation: spin 20s linear infinite; }
.wr-2 { inset: 22px; border-style: dotted; animation-direction: reverse; border-color: rgba(217,169,86,0.4); }
.wr-blip {
  position: absolute; top: 50%; left: 50%; width: 10px; height: 10px; border-radius: 50%;
  background: var(--cyan); transform: translate(-50%,-50%); box-shadow: 0 0 15px var(--cyan);
  animation: dotPulse 1.8s ease-in-out infinite;
}

/* --- Chapter 3: Thirty Simorgh Birds Mandala & Celestial Wings --- */
.chv-simorgh-sky {
  position: absolute; inset: 0; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

.simorgh-wings-backdrop {
  position: absolute; width: 340px; height: 220px; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 0 25px rgba(217, 169, 86, 0.45));
  opacity: 0.85; transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s;
}
.simorgh-wings-svg { width: 100%; height: 100%; overflow: visible; }
.wing-path {
  stroke-dasharray: 400; stroke-dashoffset: 0;
  animation: wingBreathe 6s ease-in-out infinite alternate;
}
.wing-l { transform-origin: 150px 100px; animation: wingFlapL 5s ease-in-out infinite alternate; }
.wing-r { transform-origin: 150px 100px; animation: wingFlapR 5s ease-in-out infinite alternate; }
@keyframes wingFlapL { 0% { transform: rotate(0deg) scale(0.96); } 100% { transform: rotate(-5deg) scale(1.04); } }
@keyframes wingFlapR { 0% { transform: rotate(0deg) scale(0.96); } 100% { transform: rotate(5deg) scale(1.04); } }

.simorgh-mandala {
  position: absolute; width: 280px; height: 280px; z-index: 2;
  display: flex; align-items: center; justify-content: center;
}

.mandala-ring {
  position: absolute; border-radius: 50%;
  pointer-events: none;
}
.mr-outer {
  inset: 0; border: 1px dashed rgba(217, 169, 86, 0.35);
  animation: spin 50s linear infinite;
}
.mr-mid {
  inset: 32px; border: 1px dotted rgba(157, 123, 255, 0.4);
  animation: spin 32s linear infinite reverse;
}
.mr-inner {
  inset: 68px; border: 1px solid rgba(85, 215, 242, 0.3);
  animation: spin 20s linear infinite;
}

.birds-flock {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.flock-bird {
  position: absolute; width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold), 0 0 20px rgba(255,255,255,0.6);
  transform: rotate(var(--a)) translateX(var(--r)) rotate(calc(-1 * var(--a)));
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s;
  animation: birdPulse 3s ease-in-out infinite alternate;
}
.flock-bird:nth-child(3n) { background: var(--cyan); box-shadow: 0 0 12px var(--cyan); animation-delay: 0.5s; }
.flock-bird:nth-child(3n+1) { background: var(--violet); box-shadow: 0 0 12px var(--violet); animation-delay: 1s; }
@keyframes birdPulse { 0% { transform: rotate(var(--a)) translateX(var(--r)) rotate(calc(-1 * var(--a))) scale(0.85); opacity: 0.7; } 100% { transform: rotate(var(--a)) translateX(calc(var(--r) + 8px)) rotate(calc(-1 * var(--a))) scale(1.2); opacity: 1; } }

.simorgh-core-mirror {
  position: relative; z-index: 3; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(217,169,86,0.35), rgba(16,10,34,0.95) 75%);
  border: 1.5px solid var(--gold);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 50px rgba(217,169,86,0.5), inset 0 0 20px rgba(217,169,86,0.3);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s;
}
.scm-aura {
  position: absolute; inset: -15px; border-radius: 50%;
  background: radial-gradient(circle, rgba(217,169,86,0.25), transparent 70%);
  animation: auraBreathe 4s ease-in-out infinite alternate; pointer-events: none;
}
.scm-halo {
  position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
  animation: spin 16s linear infinite; pointer-events: none;
}
@keyframes auraBreathe { 0% { transform: scale(0.9); opacity: 0.4; } 100% { transform: scale(1.25); opacity: 0.9; } }

.scm-symbol {
  font-family: 'Vazirmatn', sans-serif; font-weight: 300; font-size: 1.45rem; color: var(--paper);
  text-shadow: 0 0 20px rgba(217,169,86,0.9), 0 0 40px var(--gold);
  letter-spacing: 0.05em;
}

/* Hover dynamic convergence */
.chv-3:hover .simorgh-wings-backdrop { transform: scale(1.12); opacity: 1; filter: drop-shadow(0 0 35px rgba(217, 169, 86, 0.7)); }
.chv-3:hover .simorgh-core-mirror { transform: scale(1.08); box-shadow: 0 0 70px rgba(217,169,86,0.8); }
.chv-3:hover .flock-bird { transform: rotate(var(--a)) translateX(calc(var(--r) * 0.75)) rotate(calc(-1 * var(--a))) scale(1.3); }

/* --- Telemetry Badges & Watermarks --- */
.chv-telemetry {
  position: absolute; bottom: 1.4rem; inset-inline-start: 1.6rem;
  display: flex; gap: 1rem; flex-wrap: wrap; z-index: 5;
}
.ct-item {
  font-size: 0.68rem; padding: 0.35rem 0.75rem; border-radius: 100px;
  background: rgba(0,0,0,0.5); border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px); color: var(--paper-soft); font-family: monospace;
}
.ct-k { color: var(--gold); font-weight: 700; margin-inline-end: 0.3rem; }
.ct-v { color: var(--paper); }

.chv-watermark {
  position: absolute; top: 1.2rem; inset-inline-end: 1.6rem;
  font-family: 'Vazirmatn', sans-serif; font-size: 2.6rem; font-weight: 100;
  color: rgba(255,255,255,0.12); line-height: 1; pointer-events: none;
}

/* --- Chapter Body & Micro-Features --- */
.ch-body { padding: 3.2rem 2.8rem; display: flex; flex-direction: column; gap: 1.2rem; }
.ch-top { display: flex; justify-content: space-between; align-items: center; }
.ch-num { font-family: 'Syne', 'Vazirmatn', sans-serif; font-weight: 700; font-size: 0.85rem; letter-spacing: .15em; color: var(--gold); }
.ch-badge {
  font-size: 0.7rem; padding: 0.3rem 0.8rem; border-radius: 100px;
  background: rgba(217,169,86,0.12); border: 1px solid rgba(217,169,86,0.3);
  color: var(--gold); font-weight: 700; letter-spacing: 0.15em;
}
html[dir="rtl"] .ch-badge { letter-spacing: 0.05em; }

.ch-title { font-family: 'Syne', 'Vazirmatn', sans-serif; font-size: clamp(2rem, 4.2vw, 3rem); font-weight: 800; line-height: 1.12; color: var(--paper); }
.ch-text { color: var(--paper-soft); line-height: 1.8; font-size: 1.02rem; font-weight: 300; }

.ch-features { display: flex; flex-direction: column; gap: 1rem; margin: 0.6rem 0; }
.ch-feat {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 0.9rem 1.1rem; border-radius: 16px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
  transition: background 0.3s, border-color 0.3s;
}
.ch-feat:hover { background: rgba(217,169,86,0.06); border-color: rgba(217,169,86,0.25); }
.cf-icon { font-size: 1.1rem; color: var(--gold); line-height: 1.4; }
.ch-feat h4 { font-size: 0.88rem; font-weight: 700; color: var(--paper); margin-bottom: 0.2rem; }
.ch-feat p { font-size: 0.82rem; color: var(--paper-dim); line-height: 1.5; font-weight: 300; }

.ch-cta {
  align-self: flex-start; margin-top: 0.8rem; padding: 0.85rem 1.8rem; border-radius: 100px;
  background: transparent; border: 1.5px solid var(--gold); color: var(--gold);
  font-family: inherit; font-weight: 700; font-size: 0.9rem; cursor: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.ch-cta:hover { background: var(--gold); color: var(--night); transform: translateY(-2px); box-shadow: 0 10px 30px rgba(217,169,86,0.4); }

/* --- Chapter Detail Modal --- */
.ch-modal-overlay {
  position: fixed; inset: 0; z-index: 1500;
  background: rgba(5, 3, 10, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  opacity: 0; pointer-events: none; transition: opacity 0.35s ease;
}
.ch-modal-overlay.active { opacity: 1; pointer-events: auto; }

.ch-modal-card {
  position: relative; width: min(780px, 100%); max-height: 85vh; overflow-y: auto;
  padding: 3.5rem 3rem; border-radius: 32px;
  background: linear-gradient(135deg, rgba(20, 14, 38, 0.95), rgba(7, 5, 16, 0.98));
  border: 1.5px solid rgba(217, 169, 86, 0.4);
  box-shadow: 0 30px 100px rgba(0,0,0,0.8), 0 0 70px rgba(217,169,86,0.2);
  transform: scale(0.92) translateY(20px); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.ch-modal-overlay.active .ch-modal-card { transform: scale(1) translateY(0); }

.ch-modal-close {
  position: absolute; top: 1.8rem; inset-inline-end: 2rem;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: 1px solid var(--glass-border);
  color: var(--paper); font-size: 1rem; cursor: none;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s;
}
.ch-modal-close:hover { background: var(--gold); color: var(--night); transform: scale(1.1); }

.modal-detail-tag { font-size: 0.75rem; letter-spacing: 0.25em; color: var(--gold); font-weight: 700; margin-bottom: 0.8rem; display: block; }
.modal-detail-title { font-family: 'Syne', 'Vazirmatn', sans-serif; font-size: clamp(2rem, 4.5vw, 2.8rem); font-weight: 800; color: var(--paper); line-height: 1.15; margin-bottom: 1.4rem; }
.modal-detail-body { color: var(--paper-soft); font-size: 1.05rem; line-height: 1.85; font-weight: 300; margin-bottom: 1.5rem; }
.modal-detail-interactive {
  background: rgba(0,0,0,0.4); border: 1px solid var(--glass-border); border-radius: 20px;
  padding: 1.8rem; margin-top: 1.8rem; display: flex; flex-direction: column; gap: 1rem;
}
.mdi-header { display: flex; justify-content: space-between; align-items: center; font-family: monospace; font-size: 0.8rem; color: var(--gold); }
.mdi-canvas-box { width: 100%; height: 180px; position: relative; border-radius: 14px; overflow: hidden; background: #030207; border: 1px solid rgba(217,169,86,0.2); }
.mdi-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
.mdi-stat { padding: 0.8rem; border-radius: 12px; background: rgba(255,255,255,0.03); text-align: center; }
.mdi-stat-k { font-size: 0.65rem; color: var(--paper-dim); display: block; text-transform: uppercase; }
.mdi-stat-v { font-size: 1rem; font-weight: 700; color: var(--gold); font-family: monospace; }


/* ---------- poetry ---------- */
.poetry { position: relative; z-index: 5; }
.poetry-pin {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; text-align: center; padding: 2rem;
}
.poem { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 1.5rem; }
.poem-fa {
  font-family: 'Vazirmatn', sans-serif; font-weight: 200; direction: rtl;
  font-size: clamp(1.8rem, 5.5vw, 4rem); color: var(--paper);
  text-shadow: 0 0 60px rgba(157,123,255,.3);
}
.poem-en { font-family: 'Syne', sans-serif; font-weight: 400; font-style: italic; font-size: clamp(.95rem, 2vw, 1.3rem); color: var(--paper-soft); letter-spacing: .05em; }
.poem-src { margin-top: 1.6rem; font-size: .8rem; letter-spacing: .28em; text-transform: uppercase; color: var(--gold-soft); }
.poem-veil {
  position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(circle at 50% 50%, rgba(217,169,86,.13), transparent 42%);
  transform: scale(0.4); opacity: 0;
}

/* ---------- stats ---------- */
.stats {
  position: relative; z-index: 5;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem;
  width: min(1180px, calc(100vw - 3rem)); margin: 0 auto; padding: 4rem 0 8rem;
}
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { padding: 2rem 1.4rem; text-align: center; display: flex; flex-direction: column; gap: .5rem; }
.stat-n { font-family: 'Syne', sans-serif; font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 800; color: var(--gold); }
.stat-l { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--paper-soft); }
html[dir="rtl"] .stat-l { letter-spacing: .03em; }

/* ---------- gate ---------- */
.gate { position: relative; z-index: 5; padding: 4rem 1.5rem 0; }
.gate-arch {
  width: min(760px, 100%); margin: 0 auto;
  border-radius: 50% 50% 26px 26px / 38% 38% 26px 26px;
  border: 1px solid rgba(217,169,86,.4);
  background: linear-gradient(180deg, rgba(217,169,86,.07), rgba(255,255,255,.03));
  backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 40px 110px rgba(0,0,0,.55), 0 0 90px rgba(217,169,86,.1);
  padding: clamp(3.5rem, 9vw, 6.5rem) clamp(1.6rem, 6vw, 4.5rem);
  text-align: center;
}
.gate-title {
  font-family: 'Syne', 'Vazirmatn', sans-serif; font-weight: 800;
  font-size: clamp(2.3rem, 6.5vw, 4.8rem); line-height: 1.08; text-transform: uppercase;
  display: flex; flex-direction: column; gap: .1em;
}
.gate-gold {
  background: linear-gradient(100deg, #f3d489, #d9a956, #f7e3b0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.gate-sub { color: var(--paper-soft); margin: 1.6rem auto 2.4rem; max-width: 42ch; line-height: 1.75; font-weight: 300; }
.gate-btn {
  display: inline-block; padding: 1.05rem 2.6rem; border-radius: 100px;
  border: 1.5px solid var(--gold); color: var(--gold); text-decoration: none; font-weight: 600;
  position: relative; overflow: hidden; transition: color .4s;
  background: transparent;
}
.gate-btn::before {
  content: ''; position: absolute; inset: 0; background: var(--gold);
  transform: translateY(101%); transition: transform .45s cubic-bezier(.22,1,.36,1); z-index: 0; border-radius: 100px;
}
.gate-btn span { position: relative; z-index: 1; }
.gate-btn:hover { color: var(--night); }
.gate-btn:hover::before { transform: translateY(0); }

.footer {
  width: min(1180px, calc(100vw - 3rem)); margin: 5rem auto 0; padding: 2rem 0 2.4rem;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
  border-top: 1px solid rgba(255,255,255,.1); font-size: .85rem; color: var(--paper-soft);
}
.footer a { color: var(--paper); text-decoration: none; font-weight: 600; transition: color .3s; }
.footer a:hover { color: var(--gold); }

/* page transition overlay */
.page-exit { position: fixed; inset: 0; z-index: 400; pointer-events: none; display: grid; grid-template-columns: repeat(5, 1fr); }
.page-exit span { background: #030208; transform: scaleY(0); transform-origin: bottom; }

/* ============ MOBILE LIQUID GLASS DOCK ============ */
.mobile-glass-dock {
  display: none;
  position: fixed; bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px));
  left: 50%; transform: translateX(-50%); z-index: 1200;
  width: min(92vw, 410px);
  pointer-events: auto;
  animation: dockSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dockSlideUp {
  0% { opacity: 0; transform: translate(-50%, 40px) scale(0.92); }
  100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.dock-container {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.45rem 0.75rem;
  background: linear-gradient(135deg, rgba(18, 12, 36, 0.82), rgba(7, 5, 18, 0.94));
  border: 1px solid rgba(217, 169, 86, 0.4);
  backdrop-filter: blur(28px) saturate(210%);
  -webkit-backdrop-filter: blur(28px) saturate(210%);
  box-shadow: 
    0 20px 60px rgba(0,0,0,0.85),
    0 0 35px rgba(217, 169, 86, 0.25),
    inset 0 1px 1px rgba(255,255,255,0.25);
  border-radius: 100px;
}

.dock-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.15rem; padding: 0.45rem 0.65rem; border-radius: 100px;
  color: var(--paper-soft); text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 48px; min-height: 48px;
}

.dock-icon { font-size: 1.05rem; color: var(--gold); line-height: 1; transition: transform 0.25s; }
.dock-label { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
html[dir="rtl"] .dock-label { letter-spacing: 0; font-family: 'Vazirmatn', sans-serif; font-size: 0.68rem; }

.dock-item:active { transform: scale(0.88); background: rgba(217, 169, 86, 0.15); }
.dock-item:hover { color: var(--paper); }
.dock-item:hover .dock-icon { transform: translateY(-2px); }

.dock-divider {
  width: 1px; height: 26px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 0.2rem;
}

.dock-lang-btn {
  display: flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; border-radius: 50%;
  background: rgba(217, 169, 86, 0.15); border: 1px solid rgba(217, 169, 86, 0.4);
  color: var(--gold); font-family: 'Vazirmatn', sans-serif; font-weight: 700;
  font-size: 0.82rem; cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.dock-lang-btn:active { transform: scale(0.88); background: var(--gold); color: var(--night); }

/* ============ MOBILE RESPONSIVE OVERRIDES ============ */
@media (max-width: 768px) {
  /* Switch top bar to mobile minimal header */
  .nav { padding: 1rem 1.4rem; }
  .nav-center, .nav-actions { display: none; }
  .nav-logo { font-size: 1.1rem; }

  /* Activate bottom liquid glass dock */
  .mobile-glass-dock { display: block; }

  /* Add bottom padding to avoid dock overlap */
  body { padding-bottom: 5.5rem; }
  .footer { margin-bottom: 3.5rem; }

  /* Chapter layout on mobile */
  .chapter { width: calc(100vw - 2rem); margin-bottom: 6rem; }
  .ch-visual { height: 380px; }
  .ch-body { padding: 2rem 1.6rem; }
  .ch-title { font-size: 1.8rem; }
  .ch-feat { padding: 0.75rem 0.9rem; }
  
  /* Simorgh chapter on mobile */
  .simorgh-mandala { transform: scale(0.85); }
  .simorgh-wings-backdrop { transform: scale(0.85); }
  .chv-3:hover .simorgh-wings-backdrop { transform: scale(0.95); }
  .chv-3:hover .flock-bird { transform: rotate(var(--a)) translateX(calc(var(--r) * 0.65)) rotate(calc(-1 * var(--a))) scale(1.2); }
}

/* ============ MOBILE STABILITY PATCH ============ */

html {
  overflow-x: hidden;
}

body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

img,
svg,
canvas {
  max-width: 100%;
}

@media (max-width: 768px) {
  body {
    font-size: 15px;
    padding-bottom: 5.5rem;
  }

  .nav {
    width: 100%;
    padding: 0.9rem 1rem;
  }

  .nav-logo {
    max-width: calc(100vw - 2rem);
  }

  .hero {
    min-height: 100svh;
    min-height: 100dvh;
    padding: 5.5rem 1rem 6rem;
    overflow: hidden;
  }

  .hero-mega {
    width: 100%;
    max-width: 100%;
    padding-inline: 0.5rem;
    text-align: center;
    overflow-wrap: anywhere;
  }

  .hero-mega .hm-fa,
  .hero-mega .hm-en {
    max-width: 100%;
    font-size: clamp(3.8rem, 19vw, 8rem);
    line-height: 0.95;
    overflow-wrap: anywhere;
  }

  .hero-tag {
    width: 100%;
    max-width: 34rem;
    padding-inline: 0.75rem;
    font-size: clamp(0.85rem, 3.7vw, 1.1rem);
    line-height: 1.6;
    text-align: center;
    overflow-wrap: anywhere;
  }

  .hero-glass-hud {
    width: min(100%, 22rem);
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin-inline: auto;
  }

  .hud-item {
    min-width: 0;
    padding: 0.75rem 1rem;
    text-align: center;
  }

  .hud-k,
  .hud-v,
  .ct-k,
  .ct-v {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .intro-sticky {
    min-height: auto;
    padding: 8rem 1rem;
  }

  .is-inner {
    gap: 1.35rem;
  }

  .is-line {
    font-size: clamp(1.45rem, 7vw, 2.7rem);
    line-height: 1.3;
    overflow-wrap: anywhere;
  }

  .chapters {
    width: 100%;
    padding: 4rem 0 2rem;
    overflow: hidden;
  }

  .chapter {
    display: flex;
    flex-direction: column;
    width: calc(100% - 2rem);
    max-width: 34rem;
    margin-inline: auto;
    margin-bottom: 4rem;
    gap: 1rem;
  }

  .ch-visual {
    width: 100%;
    height: min(72vw, 300px);
    min-height: 245px;
    border-radius: 20px;
  }

  .ch-body {
    width: 100%;
    min-width: 0;
    padding: 1.35rem 1rem 1.5rem;
    border-radius: 20px;
  }

  .ch-top {
    align-items: flex-start;
    gap: 0.65rem;
    flex-wrap: wrap;
  }

  .ch-num,
  .ch-badge {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .ch-badge {
    white-space: normal;
  }

  .ch-title {
    max-width: 100%;
    font-size: clamp(1.55rem, 8vw, 2.25rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .ch-text {
    font-size: 0.95rem;
    line-height: 1.75;
    overflow-wrap: anywhere;
  }

  .ch-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .ch-feat {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    align-items: start;
    gap: 0.55rem;
    min-width: 0;
    padding: 0.75rem;
  }

  .ch-feat h4,
  .ch-feat p {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .ch-feat p {
    font-size: 0.8rem;
    line-height: 1.55;
  }

  .ch-cta {
    width: 100%;
    min-height: 48px;
    padding: 0.85rem 1rem;
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .chv-telemetry {
    inset-inline: 0.75rem;
    max-width: calc(100% - 1.5rem);
    gap: 0.35rem;
    flex-wrap: wrap;
  }

  .ct-item {
    max-width: 100%;
    font-size: 0.58rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .chv-watermark {
    inset-inline-end: 0.8rem;
  }

  .simorgh-mandala {
    transform: scale(0.62);
  }

  .simorgh-wings-backdrop {
    transform: scale(0.62);
  }

  .stats {
    width: calc(100% - 2rem);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-inline: auto;
  }

  .stat {
    min-width: 0;
    padding: 0.8rem 0.5rem;
    overflow-wrap: anywhere;
  }

  .poetry .poem {
    width: 100%;
    max-width: 100%;
    padding-inline: 0.5rem;
  }

  .poem-line {
    font-size: clamp(1.35rem, 6.5vw, 2.5rem);
    line-height: 1.5;
    overflow-wrap: anywhere;
  }

  .gate {
    padding-inline: 1rem;
    overflow: hidden;
  }

  .gate-title {
    font-size: clamp(2rem, 11vw, 4rem);
    overflow-wrap: anywhere;
  }

  .gate-sub {
    font-size: 0.95rem;
    overflow-wrap: anywhere;
  }

  .gate-btn {
    width: 100%;
    min-height: 50px;
    white-space: normal;
  }

  .modal {
    padding: 0.75rem;
  }

  .modal-content,
  .modal-sheet,
  .modal-detail {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 1.5rem);
    overflow-y: auto;
    border-radius: 20px;
  }

  .mobile-glass-dock {
    width: min(94vw, 30rem);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .dock-container {
    width: 100%;
    justify-content: space-around;
    gap: 0.2rem;
    padding: 0.45rem 0.55rem;
  }

  .dock-item,
  .dock-lang-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .dock-label {
    max-width: 4.2rem;
    font-size: 0.62rem;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 420px) {
  .hero {
    padding-inline: 0.65rem;
  }

  .chapter {
    width: calc(100% - 1.25rem);
  }

  .ch-body {
    padding-inline: 0.85rem;
  }

  .ch-title {
    font-size: 1.45rem;
  }

  .ch-text {
    font-size: 0.9rem;
  }

  .chv-telemetry {
    display: none;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .dock-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============ MOBILE STABILITY PATCH ============ */

html {
  overflow-x: hidden;
}

body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

img,
svg,
canvas {
  max-width: 100%;
}

@media (max-width: 768px) {
  body {
    font-size: 15px;
    padding-bottom: 5.5rem;
  }

  .nav {
    width: 100%;
    padding: 0.9rem 1rem;
  }

  .nav-logo {
    max-width: calc(100vw - 2rem);
  }

  .hero {
    min-height: 100svh;
    min-height: 100dvh;
    padding: 5.5rem 1rem 6rem;
    overflow: hidden;
  }

  .hero-mega {
    width: 100%;
    max-width: 100%;
    padding-inline: 0.5rem;
    text-align: center;
    overflow-wrap: anywhere;
  }

  .hero-mega .hm-fa,
  .hero-mega .hm-en {
    max-width: 100%;
    font-size: clamp(3.8rem, 19vw, 8rem);
    line-height: 0.95;
    overflow-wrap: anywhere;
  }

  .hero-tag {
    width: 100%;
    max-width: 34rem;
    padding-inline: 0.75rem;
    font-size: clamp(0.85rem, 3.7vw, 1.1rem);
    line-height: 1.6;
    text-align: center;
    overflow-wrap: anywhere;
  }

  .hero-glass-hud {
    width: min(100%, 22rem);
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin-inline: auto;
  }

  .hud-item {
    min-width: 0;
    padding: 0.75rem 1rem;
    text-align: center;
  }

  .hud-k,
  .hud-v,
  .ct-k,
  .ct-v {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .intro-sticky {
    min-height: auto;
    padding: 8rem 1rem;
  }

  .is-inner {
    gap: 1.35rem;
  }

  .is-line {
    font-size: clamp(1.45rem, 7vw, 2.7rem);
    line-height: 1.3;
    overflow-wrap: anywhere;
  }

  .chapters {
    width: 100%;
    padding: 4rem 0 2rem;
    overflow: hidden;
  }

  .chapter {
    display: flex;
    flex-direction: column;
    width: calc(100% - 2rem);
    max-width: 34rem;
    margin-inline: auto;
    margin-bottom: 4rem;
    gap: 1rem;
  }

  .ch-visual {
    width: 100%;
    height: min(72vw, 300px);
    min-height: 245px;
    border-radius: 20px;
  }

  .ch-body {
    width: 100%;
    min-width: 0;
    padding: 1.35rem 1rem 1.5rem;
    border-radius: 20px;
  }

  .ch-top {
    align-items: flex-start;
    gap: 0.65rem;
    flex-wrap: wrap;
  }

  .ch-num,
  .ch-badge {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .ch-badge {
    white-space: normal;
  }

  .ch-title {
    max-width: 100%;
    font-size: clamp(1.55rem, 8vw, 2.25rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .ch-text {
    font-size: 0.95rem;
    line-height: 1.75;
    overflow-wrap: anywhere;
  }

  .ch-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .ch-feat {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    align-items: start;
    gap: 0.55rem;
    min-width: 0;
    padding: 0.75rem;
  }

  .ch-feat h4,
  .ch-feat p {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .ch-feat p {
    font-size: 0.8rem;
    line-height: 1.55;
  }

  .ch-cta {
    width: 100%;
    min-height: 48px;
    padding: 0.85rem 1rem;
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .chv-telemetry {
    inset-inline: 0.75rem;
    max-width: calc(100% - 1.5rem);
    gap: 0.35rem;
    flex-wrap: wrap;
  }

  .ct-item {
    max-width: 100%;
    font-size: 0.58rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .chv-watermark {
    inset-inline-end: 0.8rem;
  }

  .simorgh-mandala {
    transform: scale(0.62);
  }

  .simorgh-wings-backdrop {
    transform: scale(0.62);
  }

  .stats {
    width: calc(100% - 2rem);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-inline: auto;
  }

  .stat {
    min-width: 0;
    padding: 0.8rem 0.5rem;
    overflow-wrap: anywhere;
  }

  .poetry .poem {
    width: 100%;
    max-width: 100%;
    padding-inline: 0.5rem;
  }

  .poem-line {
    font-size: clamp(1.35rem, 6.5vw, 2.5rem);
    line-height: 1.5;
    overflow-wrap: anywhere;
  }

  .gate {
    padding-inline: 1rem;
    overflow: hidden;
  }

  .gate-title {
    font-size: clamp(2rem, 11vw, 4rem);
    overflow-wrap: anywhere;
  }

  .gate-sub {
    font-size: 0.95rem;
    overflow-wrap: anywhere;
  }

  .gate-btn {
    width: 100%;
    min-height: 50px;
    white-space: normal;
  }

  .modal {
    padding: 0.75rem;
  }

  .modal-content,
  .modal-sheet,
  .modal-detail {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 1.5rem);
    overflow-y: auto;
    border-radius: 20px;
  }

  .mobile-glass-dock {
    width: min(94vw, 30rem);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .dock-container {
    width: 100%;
    justify-content: space-around;
    gap: 0.2rem;
    padding: 0.45rem 0.55rem;
  }

  .dock-item,
  .dock-lang-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .dock-label {
    max-width: 4.2rem;
    font-size: 0.62rem;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 420px) {
  .hero {
    padding-inline: 0.65rem;
  }

  .chapter {
    width: calc(100% - 1.25rem);
  }

  .ch-body {
    padding-inline: 0.85rem;
  }

  .ch-title {
    font-size: 1.45rem;
  }

  .ch-text {
    font-size: 0.9rem;
  }

  .chv-telemetry {
    display: none;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .dock-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* Mobile hero headline: prevent SARAB and سراب overlap */
@media (max-width: 768px) {
  .hero-mega {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 0.45rem;
  }

  .hm-fa,
  .hm-en {
    grid-area: auto;
    transform: none;
    position: relative;
    display: block;
    max-width: 100%;
    text-align: center;
  }

  .hm-en {
    order: 1;
    font-size: clamp(3rem, 16vw, 6rem);
    line-height: 0.95;
    letter-spacing: 0.14em;
    text-indent: 0.14em;
    white-space: nowrap;
  }

  .hm-fa {
    order: 2;
    font-size: clamp(3.2rem, 18vw, 7rem);
    line-height: 1.2;
    white-space: nowrap;
  }

  .hero-tag {
    max-width: calc(100vw - 2rem);
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .hero-mega {
    gap: 0.25rem;
  }

  .hm-en {
    font-size: clamp(2.6rem, 15vw, 4.5rem);
    letter-spacing: 0.1em;
    text-indent: 0.1em;
  }

  .hm-fa {
    font-size: clamp(2.8rem, 17vw, 5.5rem);
  }
}

/* Final mobile headline width correction */
@media (max-width: 768px) {
  .hero-mega {
    width: 100%;
    max-width: 100%;
    overflow: visible;
    padding-inline: 0;
  }

  .hm-en {
    width: 100%;
    max-width: 100%;
    font-size: min(12vw, 4rem);
    line-height: 1;
    letter-spacing: 0.04em;
    text-indent: 0.04em;
    white-space: nowrap;
    text-align: center;
    direction: ltr;
    overflow: visible;
  }

  .hm-fa {
    width: 100%;
    max-width: 100%;
    font-size: min(18vw, 5.5rem);
    line-height: 1.25;
    white-space: nowrap;
    text-align: center;
    overflow: visible;
  }
}

@media (max-width: 420px) {
  .hm-en {
    font-size: min(11vw, 3.4rem);
    letter-spacing: 0.025em;
    text-indent: 0.025em;
  }

  .hm-fa {
    font-size: min(17vw, 4.8rem);
  }
}

/* Smaller mobile SARAB headline */
@media (max-width: 768px) {
  .hm-en {
    width: 100%;
    max-width: 100%;
    font-size: clamp(2rem, 9vw, 3.2rem);
    line-height: 1;
    letter-spacing: 0.02em;
    text-indent: 0.02em;
    white-space: nowrap;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .hm-en {
    font-size: clamp(1.85rem, 8.5vw, 2.8rem);
    letter-spacing: 0.01em;
    text-indent: 0.01em;
  }
}

/* Guaranteed mobile headline size */
@media screen and (max-width: 768px) {
  .hero .hero-mega .hm-en {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    font-size: 2.2rem !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-indent: 0 !important;
    transform: none !important;
    white-space: nowrap !important;
    text-align: center !important;
    overflow: visible !important;
  }
}

@media screen and (max-width: 420px) {
  .hero .hero-mega .hm-en {
    font-size: 1.9rem !important;
  }
}

/* Mobile chapter panel overflow fix */
@media screen and (max-width: 768px) {
  .chapter {
    display: flex !important;
    flex-direction: column !important;
    width: calc(100% - 1.25rem) !important;
    max-width: 34rem !important;
    min-width: 0 !important;
    margin-inline: auto !important;
    overflow: visible !important;
  }

  .chapter > *,
  .ch-visual,
  .ch-body {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .ch-body {
    overflow: hidden !important;
    padding: 1.25rem 1rem !important;
  }

  .ch-top {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.55rem;
  }

  .ch-num,
  .ch-badge,
  .ch-title,
  .ch-text,
  .ch-features,
  .ch-feat,
  .ch-feat > div {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .ch-num,
  .ch-badge,
  .ch-title,
  .ch-text,
  .ch-feat h4,
  .ch-feat p {
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  .ch-badge {
    white-space: normal !important;
    line-height: 1.35;
  }

  .ch-title {
    font-size: clamp(1.45rem, 7vw, 2rem) !important;
    line-height: 1.2 !important;
  }

  .ch-text {
    font-size: 0.92rem !important;
    line-height: 1.75 !important;
  }

  .ch-features {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.65rem !important;
  }

  .ch-feat {
    display: grid !important;
    grid-template-columns: 1.75rem minmax(0, 1fr) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.75rem !important;
  }

  .ch-feat p {
    font-size: 0.78rem !important;
    line-height: 1.55 !important;
  }

  .ch-cta {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 48px;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  .chv-telemetry {
    max-width: calc(100% - 1.5rem) !important;
    inset-inline: 0.75rem !important;
    overflow: hidden !important;
  }

  .ct-item {
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }
}

/* Strict mobile chapter containment */
@media screen and (max-width: 768px) {
  html,
  body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  #main,
  .chapters {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  .chapter {
    display: flex !important;
    flex-direction: column !important;
    width: calc(100% - 1.25rem) !important;
    max-width: calc(100% - 1.25rem) !important;
    min-width: 0 !important;
    margin-inline: auto !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .chapter > *,
  .ch-visual,
  .ch-body {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .ch-visual {
    height: min(72vw, 300px) !important;
    min-height: 220px !important;
    max-height: 300px !important;
    overflow: hidden !important;
  }

  .ch-body {
    overflow: hidden !important;
    padding: 1.1rem 0.85rem !important;
  }

  .ch-top {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 0.5rem !important;
  }

  .ch-num,
  .ch-badge,
  .ch-title,
  .ch-text,
  .ch-features,
  .ch-feat,
  .ch-feat > div,
  .ch-feat h4,
  .ch-feat p {
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  .ch-num,
  .ch-badge {
    display: block !important;
    white-space: normal !important;
    line-height: 1.4 !important;
    letter-spacing: 0.04em !important;
  }

  .ch-title {
    font-size: clamp(1.35rem, 7vw, 1.9rem) !important;
    line-height: 1.25 !important;
  }

  .ch-text {
    font-size: 0.9rem !important;
    line-height: 1.75 !important;
  }

  .ch-features {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.6rem !important;
    overflow: hidden !important;
  }

  .ch-feat {
    display: grid !important;
    grid-template-columns: 1.5rem minmax(0, 1fr) !important;
    gap: 0.5rem !important;
    width: 100% !important;
    padding: 0.7rem !important;
    overflow: hidden !important;
  }

  .ch-feat p {
    font-size: 0.76rem !important;
    line-height: 1.55 !important;
  }

  .ch-cta {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 48px !important;
    padding-inline: 0.75rem !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    box-sizing: border-box !important;
  }

  .chv-telemetry {
    display: flex !important;
    flex-wrap: wrap !important;
    max-width: calc(100% - 1rem) !important;
    inset-inline: 0.5rem !important;
    overflow: hidden !important;
  }

  .ct-item {
    max-width: 100% !important;
    font-size: 0.55rem !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }
}

@media screen and (max-width: 420px) {
  .chapter {
    width: calc(100% - 0.75rem) !important;
    max-width: calc(100% - 0.75rem) !important;
  }

  .ch-body {
    padding-inline: 0.7rem !important;
  }

  .chv-telemetry {
    display: none !important;
  }

  .ch-title {
    font-size: 1.3rem !important;
  }
}
