/* ========== 1. TOKENS ========== */
:root {
  --midnight: #101A3A;
  --royal: #3155D9;
  --cyan: #35D6E8;
  --gold: #F6C85F;
  --coral: #FF6B6B;
  --cream: #FFF7E8;
  --purple: #8B6DFF;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Manrope', system-ui, sans-serif;
}

/* ========== 2. BASE + ATMOSPHERE ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  color: var(--cream);
  font-family: var(--sans);
  background:
    radial-gradient(60% 50% at 18% 18%, rgba(139,109,255,.30), transparent 70%),
    radial-gradient(50% 50% at 86% 78%, rgba(53,214,232,.22), transparent 70%),
    radial-gradient(45% 35% at 55% 105%, rgba(246,200,95,.20), transparent 70%),
    linear-gradient(180deg, #14224a 0%, var(--midnight) 55%, #0d1736 100%);
  background-attachment: fixed;
}
#particles { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

/* Every section is a full-screen "scene" stacked on top of each other.
   GSAP fades them in/out — this is what makes it feel like ONE experience. */
.scene {
  position: fixed; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 5vw; visibility: hidden; opacity: 0;
}
.ch { display: inline-block; white-space: pre; } /* one letter, animated by GSAP */

/* ========== 3. SECTION 01 — HOOK ========== */
.hook-inner { position: relative; z-index: 2; }
h1 {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(3.2rem, 12vw, 11rem);
  letter-spacing: .06em; line-height: 1;
  text-shadow: 0 0 60px rgba(53,214,232,.35);
}
.tagline {
  margin-top: 1.4rem; font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: clamp(1.15rem, 2.6vw, 2.1rem); color: rgba(255,247,232,.88);
}
.branches {
  position: absolute; left: 0; width: 100%; top: 56%; height: 26vh; z-index: 1;
  filter: drop-shadow(0 0 6px rgba(53,214,232,.7)); overflow: visible;
}
.enter {
  position: absolute; bottom: 9vh; z-index: 3; isolation: isolate; overflow: hidden;
  padding: 1.15em 2.6em; background: transparent;
  border: 1px solid rgba(255,247,232,.45);
  font-size: .78rem; letter-spacing: .38em; font-weight: 500;
  transition: color .5s, border-color .5s, box-shadow .6s;
}
.enter::before { /* colour sweep on hover */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, var(--cyan), var(--purple), var(--coral));
  transform: scaleX(0); transform-origin: left;
  transition: transform .8s cubic-bezier(.77, 0, .18, 1);
}
.enter:hover, .enter:focus-visible { color: var(--midnight); border-color: transparent; box-shadow: 0 0 40px rgba(53,214,232,.45); }
.enter:hover::before, .enter:focus-visible::before { transform: scaleX(1); }
.enter span { display: inline-block; transition: letter-spacing .8s cubic-bezier(.22,1,.36,1); }
.enter:hover span { letter-spacing: .5em; }

/* ========== 4. SECTION 02 — CONNECTION ========== */
.hint { position: absolute; bottom: 6vh; font-size: .8rem; letter-spacing: .25em; opacity: .6; }
#concept {
  position: absolute; top: 9vh; font-family: var(--serif); font-weight: 300;
  font-size: clamp(2.6rem, 8vw, 6.5rem); letter-spacing: .12em; min-height: 1.1em;
}
.role { position: absolute; top: calc(9vh + clamp(3rem, 9vw, 7.5rem)); font-size: .75rem; letter-spacing: .4em; color: var(--gold); min-height: 1em; }
.stage { width: min(1100px, 96vw); margin-top: 6vh; will-change: transform; }
#family { width: 100%; height: auto; overflow: visible; }
#links path { opacity: .07; }
.person { cursor: pointer; transition: filter .6s; outline: none; }
.person .body { fill: var(--c); fill-opacity: .16; stroke: var(--c); stroke-opacity: .75; stroke-width: 1.5; transition: fill-opacity .6s; }
.person.on { filter: drop-shadow(0 0 18px var(--c)); }
.person.on .body { fill-opacity: .5; }
#finale {
  position: absolute; bottom: 20vh; max-width: 24ch; opacity: 0;
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: clamp(1.6rem, 4vw, 3.2rem); line-height: 1.25; text-shadow: 0 0 40px rgba(246,200,95,.5);
}

/* ========== 5. SECTION DOTS ========== */
.steps { position: fixed; z-index: 5; left: 2.2vw; top: 50%; transform: translateY(-50%); display: grid; gap: 1.1rem; }
.steps button { width: 9px; height: 9px; padding: 0; background: transparent; border: 1px solid var(--cream); border-radius: 50%; opacity: .5; transition: .5s; }
.steps button.on { background: var(--gold); border-color: var(--gold); opacity: 1; box-shadow: 0 0 14px var(--gold); }
.steps { opacity: 0; pointer-events: none; transition: opacity 1.2s; }
.steps.show { opacity: 1; pointer-events: auto; }
.steps button:disabled { display: none; }

/* ========== 6. RESPONSIVE ========== */
@media (max-width: 700px) {
  .steps { left: auto; right: 4vw; top: auto; bottom: 3vh; transform: none; display: flex; }
  .hint { bottom: 9vh; text-align: center; }
  .stage { margin-top: 10vh; width: 100vw; }
  #finale { bottom: 23vh; }
}
@media (prefers-reduced-motion: reduce) { .enter::before, .enter span, .person { transition: none; } }

/* ========== 7. SECTION 03 — THE ROOM ========== */
#toRoom { bottom: 4.5vh; opacity: 0; pointer-events: none; }   /* hidden until the task is done */
#room { padding: 0; }
#roomStage { position: fixed; inset: 0; will-change: transform, filter; }
#roomSvg { width: 100%; height: 100%; display: block; }
.obj { cursor: pointer; outline: none; transition: filter .6s; }
.obj.on { filter: drop-shadow(0 0 16px var(--c)) drop-shadow(0 0 4px var(--c)); }
.lbl { font-family: var(--serif); font-style: italic; font-size: 17px; fill: var(--cream); text-anchor: middle; opacity: 0; pointer-events: none; }
.curtain { transform-box: fill-box; }
#roomDone { position: absolute; bottom: 6vh; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 1.6rem; opacity: 0; pointer-events: none; z-index: 3; }
#roomDone p { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: clamp(1.8rem, 4vw, 3rem); text-shadow: 0 0 40px rgba(246,200,95,.6); }
#roomDone .enter { position: static; opacity: 0; pointer-events: none; }
#memory { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 8vw; visibility: hidden; opacity: 0; }
#memory .orb { position: absolute; width: min(80vw, 640px); aspect-ratio: 1; border-radius: 50%; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 30%, transparent), transparent); }
#memName { font-size: .78rem; letter-spacing: .4em; color: var(--c); margin-bottom: 2rem; }
#memText { font-family: var(--serif); font-weight: 300; font-size: clamp(1.9rem, 5vw, 4rem); line-height: 1.2; max-width: 20ch; text-shadow: 0 0 50px rgba(16,26,58,.9); }
.w { display: inline-block; margin-inline: .14em; }
#memClose { margin-top: 3rem; background: transparent; border: 1px solid rgba(255,247,232,.45); padding: 1em 2.2em; font-size: .75rem; letter-spacing: .35em; transition: background .5s, color .5s; }
#memClose:hover, #memClose:focus-visible { background: var(--cream); color: var(--midnight); }
.soon { font-family: var(--serif); font-weight: 300; font-style: italic; font-size: clamp(2rem, 6vw, 4.5rem); }

/* ========== 8. START GATE + SOUND TOGGLE ========== */
#gate { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2rem; text-align: center; padding: 6vw;
  background: radial-gradient(circle at 50% 50%, rgba(16,26,58,.55), rgba(16,26,58,.92)); }
.gate-title { font-family: var(--serif); font-weight: 300; font-size: clamp(1.6rem, 4.5vw, 3.4rem); letter-spacing: .18em; }
.gate-sub { font-size: .75rem; letter-spacing: .3em; opacity: .65; margin-bottom: 1.4rem; }
#gate .enter { position: static; }

/* ========== 9. STAGE 3 — ROOTS + TIMELINE ========== */
#roots, #timeline { padding: 0; }
#rootStage, #tlStage { position: fixed; inset: 0; will-change: transform; }
#rootSvg, #tlSvg { width: 100%; height: 100%; display: block; }
.ritem { cursor: pointer; outline: none; transition: filter .6s; }
.ritem.on { filter: drop-shadow(0 0 16px var(--c)) drop-shadow(0 0 4px var(--c)); }
.ph { transform-box: fill-box; }
#rootCap, #eraCap { position: absolute; left: 0; right: 0; margin: 0 auto; max-width: 20ch; font-family: var(--serif); font-weight: 300; line-height: 1.2; text-shadow: 0 0 40px rgba(16,26,58,.85); }
#rootCap { bottom: 19vh; font-style: italic; font-size: clamp(1.7rem, 4.4vw, 3.4rem); opacity: 0; z-index: 3; }
#toTime { bottom: 4.5vh; opacity: 0; pointer-events: none; z-index: 4; }   /* hidden until all five roots are found */
#eraName { position: absolute; top: 9vh; font-size: .78rem; letter-spacing: .5em; color: var(--gold); }
#eraCap { top: 14vh; font-size: clamp(2rem, 5vw, 4.2rem); max-width: 22ch; }
#eraQ { position: absolute; bottom: 19vh; left: 0; right: 0; opacity: 0; font-family: var(--serif); font-style: italic; font-weight: 300; font-size: clamp(1.8rem, 4.8vw, 3.8rem); text-shadow: 0 0 50px rgba(53,214,232,.7); }
.track { position: absolute; bottom: 6vh; left: 50%; transform: translateX(-50%); width: min(520px, 84vw); display: flex; justify-content: space-between; align-items: center; z-index: 3; }
.track .bar { position: absolute; left: 0; right: 0; top: -10px; height: 1px; background: rgba(255,247,232,.25); }
.track .bar i { display: block; height: 100%; background: var(--gold); transform-origin: left; transform: scaleX(0); box-shadow: 0 0 10px var(--gold); }
.era-tab { background: transparent; border: 0; font-size: .68rem; letter-spacing: .35em; opacity: .5; padding: .4em .2em; transition: opacity .5s, color .5s; }
.era-tab:hover, .era-tab.on { opacity: 1; color: var(--gold); }
@media (max-width: 700px) { #rootCap { bottom: 24vh; } #eraQ { bottom: 22vh; } }

/* ========== 10. SECTION 06 — WHAT HOLDS YOUR FAMILY TOGETHER ========== */
#hold, #word { padding: 0; }
#holdTint { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
#holdSvg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#holdQ { position: absolute; top: 7vh; font-family: var(--serif); font-weight: 300; font-size: clamp(1.4rem, 3.4vw, 2.6rem); letter-spacing: .2em; z-index: 2; }
#holdHint { top: calc(7vh + 4rem); bottom: auto; z-index: 2; }
#choices { position: absolute; inset: 0; z-index: 2; }
.choice { position: absolute; left: var(--x); top: var(--y); background: transparent; border: 0; padding: .3em .5em; color: rgba(255,247,232,.7);
  font-family: var(--serif); font-weight: 300; font-size: clamp(1.6rem, 4.4vw, 3.6rem); letter-spacing: .2em;
  transition: color .6s, text-shadow .6s, letter-spacing .8s cubic-bezier(.22,1,.36,1); }
.choice:hover, .choice:focus-visible { color: var(--cream); letter-spacing: .27em; text-shadow: 0 0 24px var(--c), 0 0 60px var(--c); }
.choice[aria-pressed="true"] { color: var(--c); text-shadow: 0 0 30px var(--c), 0 0 80px var(--c); }
#holdMsg { position: absolute; bottom: 16vh; z-index: 2; max-width: 26ch; font-family: var(--serif); font-style: italic; font-weight: 300; font-size: clamp(1.3rem, 3vw, 2.2rem); text-shadow: 0 0 30px rgba(16,26,58,.9); }
#toWord { bottom: 4.5vh; opacity: 0; pointer-events: none; z-index: 3; }
@media (max-width: 700px) {
  #choices { position: relative; inset: auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem 1.6rem; margin-top: 12vh; }
  .choice { position: static; }
  #holdMsg { bottom: 14vh; }
}

/* ========== 11. SECTION 07 — ONE WORD → LIVING TREE ========== */
#treeSvg { position: absolute; inset: 0; width: 100%; height: 100%; }
#tree { filter: drop-shadow(0 0 5px rgba(53,214,232,.45)); }
.br { stroke-linecap: round; stroke-opacity: .92; pointer-events: stroke; cursor: pointer; transition: stroke-opacity .3s, filter .3s; }
.br.lit { stroke-opacity: 1; filter: drop-shadow(0 0 8px #FFF7E8); }
.nd { filter: drop-shadow(0 0 6px #F6C85F); }
.tw { font-family: var(--serif); font-style: italic; font-size: 26px; fill: var(--cream); paint-order: stroke; stroke: #101A3A; stroke-width: 5px; pointer-events: none; }
#wGlow { position: absolute; width: 70vmin; aspect-ratio: 1; border-radius: 50%; opacity: 0; pointer-events: none; background: radial-gradient(closest-side, rgba(246,200,95,.5), rgba(255,107,107,.15) 55%, transparent); }
#wordStep { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 1.4rem; }
#wKick { font-size: .78rem; letter-spacing: .5em; color: var(--gold); min-height: 1em; }
#wQ { font-family: var(--serif); font-weight: 300; font-size: clamp(1.5rem, 3.8vw, 3rem); }
.winput { position: relative; width: min(84vw, 680px); }
#wordIn { width: 100%; background: transparent; border: 0; outline: 0; text-align: center; color: var(--cream); caret-color: var(--gold);
  font-family: var(--serif); font-weight: 300; text-transform: uppercase; letter-spacing: .12em; font-size: clamp(2.2rem, 8vw, 5.5rem); padding: .1em 0; }
#wordIn::placeholder { color: rgba(255,247,232,.22); }
.wline { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; transform: scaleX(.35); background: linear-gradient(90deg, var(--cyan), var(--gold), var(--coral)); box-shadow: 0 0 18px rgba(53,214,232,.6); }
#wErr { min-height: 1.2em; font-size: .8rem; letter-spacing: .15em; color: var(--coral); }
#wordStep .enter, #wordStep .enter:hover { position: static; }
#wShow { position: absolute; z-index: 3; display: flex; font-family: var(--serif); font-weight: 300; text-transform: uppercase; letter-spacing: .08em; font-size: clamp(3rem, 12vw, 9rem); text-shadow: 0 0 60px rgba(246,200,95,.7); pointer-events: none; }
#seed { position: absolute; z-index: 3; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; opacity: 0; background: var(--gold); box-shadow: 0 0 20px 6px var(--gold), 0 0 60px 16px rgba(255,107,107,.6); }
#mainWord { position: absolute; z-index: 2; bottom: 3vh; opacity: 0; font-family: var(--serif); font-weight: 300; text-transform: uppercase; letter-spacing: .25em; font-size: clamp(1.5rem, 4vw, 3rem); color: var(--gold); text-shadow: 0 0 30px rgba(246,200,95,.8); pointer-events: none; }
#climax { position: absolute; z-index: 2; top: 7vh; max-width: 24ch; opacity: 0; font-family: var(--serif); font-style: italic; font-weight: 300; font-size: clamp(1.4rem, 3.6vw, 2.8rem); line-height: 1.2; text-shadow: 0 0 40px rgba(16,26,58,.9); pointer-events: none; }
#addWrap { position: absolute; z-index: 3; bottom: 4vh; left: 4vw; display: flex; gap: .8rem; align-items: end; opacity: 0; pointer-events: none; }
#addIn { background: transparent; border: 0; border-bottom: 1px solid rgba(255,247,232,.45); color: var(--cream); font-family: var(--serif); font-size: 1.2rem; padding: .3em .2em; width: 11em; outline: 0; }
#addIn:focus { border-color: var(--gold); box-shadow: 0 6px 14px -8px var(--gold); }
#addGo { background: transparent; border: 0; font-size: .7rem; letter-spacing: .3em; color: var(--gold); padding: .6em .2em; }
#toFinal { left: auto; right: 4vw; bottom: 4vh; opacity: 0; pointer-events: none; z-index: 3; padding: 1em 1.8em; }
#toHold { left: auto; right: 4vw; bottom: 4.5vh; opacity: 0; pointer-events: none; z-index: 3; }
@media (max-width: 700px) { #addWrap { left: 50%; transform: translateX(-50%); bottom: 11vh; } #toFinal { right: 3vw; bottom: 3vh; padding: .8em 1.2em; } #toHold { right: 3vw; bottom: 9vh; } }

/* ========== 12. FINAL SCENE + FINISHING TOUCHES ========== */
::selection { background: var(--gold); color: var(--midnight); }
html { -webkit-tap-highlight-color: transparent; }
.steps.calm { opacity: 0 !important; pointer-events: none !important; }
#final { padding: 0; }
#finalTree { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
#fGlow { position: absolute; width: 90vmin; aspect-ratio: 1; border-radius: 50%; pointer-events: none; background: radial-gradient(closest-side, rgba(246,200,95,.28), rgba(139,109,255,.12) 55%, transparent); }
.fline { position: absolute; inset: 0; display: grid; place-items: center; padding: 8vw; z-index: 2; font-family: var(--serif); font-style: italic; font-weight: 300; font-size: clamp(1.8rem, 5vw, 4rem); line-height: 1.2; text-shadow: 0 0 50px rgba(16,26,58,.9); }
#fTitleWrap { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.4rem; text-align: center; padding: 0 6vw; pointer-events: none; }
#fTitle { font-family: var(--serif); font-weight: 300; font-size: clamp(2rem, 7vw, 6rem); letter-spacing: .1em; line-height: 1.1; text-shadow: 0 0 60px rgba(246,200,95,.55); }
#fSub { font-size: clamp(.7rem, 1.4vw, .95rem); letter-spacing: .5em; color: var(--gold); }
#fTag { font-family: var(--serif); font-style: italic; font-size: clamp(1.1rem, 2.4vw, 1.8rem); margin-top: 1rem; }
#fWord { position: absolute; z-index: 2; bottom: 3vh; text-transform: uppercase; letter-spacing: .25em; font-family: var(--serif); font-size: clamp(1.2rem, 3vw, 2.2rem); color: var(--gold); text-shadow: 0 0 30px rgba(246,200,95,.8); }
#again { bottom: 8vh; opacity: 0; pointer-events: none; z-index: 3; }
@media (max-width: 700px) {
  .steps { top: 4vh; left: 50%; right: auto; bottom: auto; transform: translateX(-50%); }          /* dots move to the top corner so they never cover the buttons */
  #again { bottom: 12vh; }
}
@media (prefers-reduced-motion: reduce) { .choice, .br, .enter::before { transition: none; } }

/* ========== 13. MUSIC BUTTON ========== */
.musicbtn { position: fixed; top: 3vh; right: 3vw; z-index: 6; background: transparent; border: 1px solid rgba(255,247,232,.35); padding: .65em 1.2em; font-size: .62rem; letter-spacing: .3em; opacity: .7; transition: opacity .4s, border-color .4s; }
.musicbtn:hover, .musicbtn:focus-visible { opacity: 1; border-color: var(--gold); }
.musicbtn[aria-pressed="false"] { opacity: .45; }

/* roots: continue button under each caption (hidden until the caption has shown) */
#rootNext { bottom: 5vh; opacity: 0; pointer-events: none; z-index: 4; }

/* ========== 14. UAE DESIGN TOUCH ==========
   Eight-pointed star (Khatam) lattice, corner arabesques and Sadu-weaving strips, in the project colours. */
#uae { position: fixed; inset: 0; z-index: 4; pointer-events: none; }
.uae-pattern { position: absolute; inset: 0; opacity: .07; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64' fill='none' stroke='%23F6C85F' stroke-width='1'%3E%3Crect x='14' y='14' width='36' height='36'/%3E%3Crect x='14' y='14' width='36' height='36' transform='rotate%2845 32 32%29'/%3E%3Ccircle cx='32' cy='32' r='3'/%3E%3Cpath d='M0 0L8 8M64 0L56 8M0 64L8 56M64 64L56 56'/%3E%3C/svg%3E") 0 0 / 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 38%, #000 100%); mask-image: radial-gradient(ellipse at center, transparent 38%, #000 100%); }
.corner { position: absolute; width: clamp(80px, 11vw, 160px); aspect-ratio: 1; opacity: .5; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 160' fill='none' stroke='%23F6C85F' stroke-width='1.2'%3E%3Cpath d='M0 44A44 44 0 0 0 44 0'/%3E%3Cpath d='M0 84A84 84 0 0 0 84 0' stroke-opacity='.7'/%3E%3Cpath d='M0 128A128 128 0 0 0 128 0' stroke-opacity='.4'/%3E%3Crect x='-18' y='-18' width='36' height='36'/%3E%3Crect x='-18' y='-18' width='36' height='36' transform='rotate%2845%29'/%3E%3Cg fill='%23F6C85F' stroke='none'%3E%3Cpath d='M31 25l6 6-6 6-6-6z'/%3E%3Cpath d='M59 53l6 6-6 6-6-6z' fill-opacity='.7'/%3E%3Cpath d='M90 84l5 5-5 5-5-5z' fill-opacity='.45'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; }
.corner.tl { top: 0; left: 0; } .corner.tr { top: 0; right: 0; transform: scaleX(-1); }
.corner.bl { bottom: 0; left: 0; transform: scaleY(-1); } .corner.br { bottom: 0; right: 0; transform: scale(-1); }
.sadu { position: absolute; left: 0; right: 0; height: 10px; opacity: .6; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='10' viewBox='0 0 24 10'%3E%3Cpolygon points='12%2C0 22%2C5 12%2C10 2%2C5' fill='%23FF6B6B'/%3E%3Cpolygon points='12%2C3 17%2C5 12%2C7 7%2C5' fill='%23FFF7E8'/%3E%3Ccircle cx='0' cy='5' r='1.2' fill='%23F6C85F'/%3E%3C/svg%3E") 0 0 / 24px 10px repeat-x; }
.sadu.top { top: 0; } .sadu.bot { bottom: 0; }
/* slow-turning star behind the opening title */
.hook-inner::before { content: ""; position: absolute; z-index: -1; left: 50%; top: 50%; width: min(84vmin, 640px); aspect-ratio: 1; opacity: .08;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' fill='none' stroke='%23F6C85F' stroke-width='1'%3E%3Crect x='45' y='45' width='110' height='110'/%3E%3Crect x='45' y='45' width='110' height='110' transform='rotate%2845 100 100%29'/%3E%3Ccircle cx='100' cy='100' r='78'/%3E%3Ccircle cx='100' cy='100' r='30'/%3E%3Cpath d='M100 8V45M100 155V192M8 100H45M155 100H192'/%3E%3C/svg%3E") center / contain no-repeat; transform: translate(-50%, -50%); animation: starTurn 160s linear infinite; }
@keyframes starTurn { to { transform: translate(-50%, -50%) rotate(360deg); } }
/* title card: a pointed arch frames the language choice */
#gate { overflow: hidden; }
.arch { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92vw, 500px, calc(90vh * 400 / 560)); height: auto; aspect-ratio: 400 / 560; overflow: visible; pointer-events: none; }
.arch path { stroke-width: 1.6; stroke-dasharray: 1; stroke-dashoffset: 1; animation: archDraw 3.2s cubic-bezier(.65, 0, .35, 1) .2s forwards; }
.arch path + path { animation-delay: .6s; }
@keyframes archDraw { to { stroke-dashoffset: 0; } }
.arch use { opacity: 0; animation: archFade 1.6s ease 2.2s forwards; } @keyframes archFade { to { opacity: 1; } }
.gate-in { position: relative; z-index: 1; margin-top: 7vh; display: flex; flex-direction: column; align-items: center; gap: 1rem; max-width: min(78vw, 360px); }
.gate-star { width: 44px; height: 44px; stroke-width: 1.4; } .gate-title { font-size: clamp(1.25rem, 3vw, 1.9rem); letter-spacing: .12em; line-height: 1.3; }
#langPick, #startPick { display: flex; flex-direction: column; align-items: center; gap: .9rem; } #langPick[hidden], #startPick[hidden] { display: none; }
#gate .gate-sub { margin-bottom: .4rem; } .lang { min-width: 11em; } .lang[lang="ar"] { font-family: 'Cairo', system-ui, sans-serif; }
/* final scene divider */
.orn { display: flex; align-items: center; gap: 1rem; } .orn i { width: clamp(40px, 12vw, 120px); height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); } .orn i:last-child { transform: scaleX(-1); }
.orn svg { width: 34px; height: 34px; stroke-width: 1.6; }

/* ========== 15. ARABIC (applies when العربية is chosen) ========== */
*:lang(ar) { --serif: 'Amiri', 'Noto Naskh Arabic', serif; --sans: 'Cairo', 'Noto Sans Arabic', system-ui, sans-serif; letter-spacing: 0 !important; font-style: normal !important; }
html:lang(ar) :is(h1, h2, h3, p, label, button, input, .lbl):not([dir]) { unicode-bidi: plaintext; }   /* text we split into animated words gets dir="rtl" from script.js instead */
html:lang(ar) :is(h1, h2, h3, p) { line-height: 1.5 !important; }
html:lang(ar) #wShow { direction: rtl; }
html:lang(ar) .thread { direction: ltr; }
@media (prefers-reduced-motion: reduce) { .hook-inner::before, .arch path, .arch use { animation: none; stroke-dashoffset: 0; opacity: .12; } .arch path { opacity: 1; } .arch use { opacity: 1; } }
@media (max-width: 700px) { .sadu { height: 8px; } }
@media (max-width: 700px) { #gate .gate-sub { letter-spacing: .12em; font-size: .68rem; } #gate .gate-sub span { display: inline-block; } }

/* text overlays never block clicks on the art behind them */
.scene :is(p,h1,h2,h3):not(button *){pointer-events:none}
.hitpad{fill:rgba(0,0,0,0)}
