/* Orvela — the journey after the reel (chapters 02–04).
   Igloo-style: a cold scene, tiny monospace HUD, decoding text, live numbers; the rest of the site stays Zajno-white. */
:root { --mono:ui-monospace, "SF Mono", Menlo, Consolas, monospace; --cold:#8f98a6; --deep:#06080b; --glow:#cfe2ff; --live-on-dark:#7ee0a0; --live-soft:#a6f0c0; --scrim:rgba(10,14,20,.42); }

.sr { position:absolute !important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.mono { font-family:var(--mono), "Alexandria", sans-serif; font-size:11px; letter-spacing:.06em; line-height:1.5; unicode-bidi:plaintext; }
/* Arabic letters must join: no tracking in Arabic, and Alexandria carries the Arabic glyphs */
[dir="rtl"] .mono, [dir="rtl"] .tag .tx .live, [dir="rtl"] .tag .tx em { letter-spacing:0; }

.journey { position:relative; }
.j-track { position:relative; }
.j-stage { position:sticky; top:0; height:100vh; height:100svh; overflow:hidden; }
.j-stage canvas { position:absolute; inset:0; width:100%; height:100%; display:block; }

/* corner HUD, like Igloo: four small mono blocks, no chrome */
.hud { position:absolute; z-index:3; display:flex; flex-direction:column; align-items:flex-start; gap:4px; pointer-events:none; color:#fff; }
/* the HUD sits over bright renders: a small dark scrim keeps it readable (≥4.5:1) on any frame */
.hud .mono, .sys-line > .mono { background:var(--scrim); padding:2px 7px; border-radius:5px; -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); }
.hud.tl { top:18px; inset-inline-start:var(--g); }
.hud.tr { top:18px; inset-inline-end:var(--g); text-align:end; align-items:flex-end; }
.hud.bl { bottom:18px; inset-inline-start:var(--g); }
.hud .dot, .dot { display:inline-block; width:6px; height:6px; border-radius:50%; background:var(--live-on-dark); margin-inline-end:6px; vertical-align:1px; }

/* ---------- chapter 02 ---------- */
.j-system { background:var(--cold); color:#fff; }
.sys-lines { position:absolute; z-index:3; inset-inline:var(--g); bottom:12vh; display:grid; place-items:center; text-align:center; pointer-events:none; }
.sys-line { grid-area:1 / 1; display:flex; flex-direction:column; align-items:center; gap:10px; opacity:0; transform:translateY(10px); transition:opacity .6s var(--ease), transform .6s var(--ease); }
.sys-line.on { opacity:1; transform:none; }
.sys-line b { font-weight:600; font-size:clamp(28px, 4.2vw, 64px); line-height:1.15; letter-spacing:-.02em; text-shadow:0 2px 30px rgba(20,28,40,.45), 0 1px 3px rgba(20,28,40,.35); }

/* live feature tags: a dot on the brick, a thin leader, then the label */
#sysTags { position:absolute; inset:0; z-index:4; pointer-events:none; }
.tag { position:absolute; left:0; top:0; display:flex; align-items:center; gap:0; opacity:0; transition:opacity .45s var(--ease); will-change:transform; direction:ltr; }
.tag.on { opacity:1; }
.tag .pt { width:7px; height:7px; border-radius:50%; background:#fff; box-shadow:0 0 0 4px rgba(255,255,255,.18); flex:none; }
.tag .ln { width:clamp(28px, 5vw, 70px); height:1px; background:linear-gradient(90deg, #fff, rgba(255,255,255,.35)); flex:none; }
.tag.left { flex-direction:row-reverse; }
.tag.left .ln { background:linear-gradient(270deg, #fff, rgba(255,255,255,.35)); }
.tag .tx { direction:rtl; text-align:start; padding:8px 11px 9px; border-radius:10px; background:rgba(18,24,34,.34); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px); border:1px solid rgba(255,255,255,.16); min-width:180px; }
.tag .tx b { display:block; font-weight:600; font-size:15px; letter-spacing:-.01em; }
.tag .tx .live { display:block; font-family:var(--mono), "Alexandria", sans-serif; font-size:11px; color:rgba(255,255,255,.78); margin-top:3px; unicode-bidi:plaintext; }
.tag .tx .live bdi { color:#fff; font-variant-numeric:tabular-nums; }
.tag .tx em { display:block; font-style:normal; font-family:var(--mono), "Alexandria", sans-serif; font-size:11px; color:var(--live-soft); margin-top:4px; }
.tag .tx em::before { content:"● "; }

/* ---------- chapter 03 ---------- */
.j-enter { background:var(--deep); color:#fff; }
.j-enter .j-stage { background:#eef4ff; transition:none; }
.enter-fog { position:absolute; inset:-20%; background:radial-gradient(60% 50% at 50% 50%, rgba(207,226,255,.9), rgba(207,226,255,0) 70%), radial-gradient(40% 30% at 30% 60%, rgba(255,255,255,.6), transparent 70%); filter:blur(30px); }
#noiseCanvas { mix-blend-mode:screen; opacity:0; }
.enter-word { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; z-index:3; text-align:center; }
.enter-word b { font-weight:600; font-size:clamp(34px, 6vw, 96px); letter-spacing:-.02em; }
.enter-word.glitch b { text-shadow:3px 0 rgba(255,60,80,.75), -3px 0 rgba(60,200,255,.75); }

/* ---------- chapter 04 ---------- */
.j-behind { background:var(--deep); color:#fff; }
.behind-copy { position:absolute; z-index:4; inset-inline-start:max(var(--g), 6vw); top:50%; transform:translateY(-50%); width:min(520px, 44vw); opacity:0; transition:opacity .8s var(--ease), transform .8s var(--ease); }
.behind-copy.on { opacity:1; }
.behind-copy h2 { margin-top:16px; }
.behind-copy .bts { display:block; font-weight:600; font-size:clamp(46px, 7.2vw, 124px); line-height:.9; letter-spacing:-.05em; text-align:right; }
.behind-copy .who { margin-top:26px; font-size:clamp(18px, 1.6vw, 24px); }
.behind-copy .who b { font-weight:600; }
.behind-copy .who span { color:rgba(255,255,255,.7); margin-inline-start:6px; }
.behind-copy .what { margin-top:14px; color:rgba(255,255,255,.62); font-size:15px; line-height:1.85; max-width:42ch; }
.j-return { height:50vh; background:linear-gradient(var(--deep), var(--bg)); }

/* sound toggle, bottom corner, always available */
.sound-btn { position:fixed; z-index:60; inset-inline-end:var(--g); bottom:16px; display:flex; align-items:center; gap:8px; padding:8px 12px; border-radius:999px; border:1px solid rgba(127,127,127,.35); background:rgba(236,236,234,.72); color:var(--ink); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px); cursor:pointer; }
.sound-btn i { display:flex; gap:2px; align-items:flex-end; height:10px; }
.sound-btn i::before, .sound-btn i::after { content:""; width:2px; height:4px; background:currentColor; border-radius:1px; }
.sound-btn[aria-pressed="true"] i::before { animation:eq .9s ease-in-out infinite; }
.sound-btn[aria-pressed="true"] i::after { animation:eq .9s ease-in-out infinite .3s; }
@keyframes eq { 50% { height:10px; } }
.sound-btn { transition:opacity .4s var(--ease), transform .4s var(--ease); }
.sound-btn.away { opacity:0; transform:translateY(12px); pointer-events:none; }
body.dark-ui .sound-btn { background:rgba(10,12,16,.6); color:#fff; border-color:rgba(255,255,255,.2); }

@media (max-width:820px) {
  .behind-copy { inset-inline:var(--g); width:auto; top:auto; bottom:8vh; transform:none; }
  .behind-copy .bts { font-size:clamp(44px, 13vw, 72px); }
  .behind-copy .what { display:none; }
  .tag .tx { min-width:0; padding:6px 8px; }
  .tag .tx b { font-size:13px; }
  .tag .tx em { display:none; }
  .hud.tr { display:none; }
}
@media (prefers-reduced-motion: reduce) { .sys-line, .tag, .behind-copy { transition:none; } }
