/* The story mockup (2026-10-11). The film's palette and fonts; whole lines; the camera moves, not the words. */
:root {
  --ink: #070708; --ink2: #121214; --graphite: #4c4a46; --ash: #8f8a82; --bone: #eee8dc;
  --violet: #836bff; --violet-down: #5a47d4; --tile: #141416; --tile-edge: #232326;
  --disp: 'Alexandria', sans-serif; --text: 'IBM Plex Sans Arabic', sans-serif; --mono: 'IBM Plex Mono', monospace;
  --chamfer: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--bone); font-family: var(--text); -webkit-font-smoothing: antialiased; }
.mono { font-family: var(--mono); }
button { font: inherit; color: inherit; }

#stage { position: fixed; inset: 0; overflow: hidden; z-index: 0; }
#film, #gl, #c2d, .ov, #flyfx { position: absolute; inset: 0; width: 100%; height: 100%; }
#film { border: 0; pointer-events: none; visibility: hidden; background: var(--ink); }
#gl, #c2d { display: block; visibility: hidden; }
.ov { pointer-events: none; display: none; }
.ov.on { display: block; }
.ov .press, .ov a { pointer-events: auto; }
.js-hide { visibility: hidden; }

/* type: Alexandria for display, Plex Arabic for text, Plex Mono for the machine voice */
.big { font-family: var(--disp); font-weight: 800; font-size: clamp(34px, 11vw, 96px); line-height: 1.12; margin: 0; letter-spacing: 0; }
.line { position: absolute; inset-inline: 24px; bottom: max(14vh, 96px); margin: 0; font-family: var(--disp); font-weight: 700;
  font-size: clamp(21px, 6.2vw, 44px); line-height: 1.35; transform-origin: 50% 100%; visibility: hidden; text-wrap: balance; }
.sechead { position: absolute; top: 64px; inset-inline-start: 20px; margin: 0; font-size: 14px; color: var(--ash); visibility: hidden; }
.sechead b { color: var(--bone); margin-inline-end: 6px; font-weight: 500; }
.illus { position: absolute; bottom: 18px; inset-inline-end: 20px; margin: 0; font-size: 12px; color: var(--ash); }
.caption { position: absolute; top: 108px; inset-inline-start: 20px; margin: 0; font-size: 13px; color: var(--ash); visibility: hidden; }
.tag { position: absolute; margin: 0; padding: 4px 10px; font-size: 14px; font-weight: 600; background: var(--violet); color: #fff;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); visibility: hidden; transform: translate(-50%, -130%); }

/* the section card: a hard cut to the section's number and name */
.card { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  padding: 0 24px; visibility: hidden; transform-origin: 70% 50%; background: var(--ink); }
.card b { font-size: 15px; color: var(--ash); font-weight: 500; margin-bottom: 10px; }
.card .sub { font-family: var(--disp); font-weight: 600; font-size: clamp(20px, 5.6vw, 40px); margin: 14px 0 0; color: var(--ash); }

/* WHO */
.hint { position: absolute; bottom: max(5vh, 28px); inset-inline: 0; text-align: center; margin: 0; font-size: 13px; color: var(--ash); letter-spacing: .04em; }
.oneline { position: absolute; inset-inline: 24px; top: 30%; display: flex; flex-direction: column; gap: .18em;
  font-family: var(--disp); font-weight: 800; font-size: clamp(20px, 5.9vw, 60px); line-height: 1.3; transform-origin: 80% 30%; visibility: hidden; }
.oneline span { white-space: nowrap; }
.oneline span { display: block; }
.oneline span:nth-child(1) { font-size: 1.5em; line-height: 1.1; }
.oneline span:nth-child(3), .oneline span:nth-child(4) { font-weight: 600; }
.mark { position: absolute; inset-inline-start: 24px; top: calc(30% + 7.6em); width: min(150px, 34vw); visibility: hidden; font-size: clamp(20px, 5.9vw, 60px); }

/* WHAT: the contents */
#what-h { position: absolute; top: 22%; inset-inline: 24px; visibility: hidden; transform-origin: 80% 50%; }
.toc { position: absolute; top: calc(22% + clamp(34px, 11vw, 96px) * 1.35); inset-inline: 24px; list-style: none; margin: 0; padding: 0;
  font-family: var(--disp); font-weight: 600; font-size: clamp(22px, 6.4vw, 46px); }
.toc li { display: flex; align-items: baseline; gap: 14px; padding: 14px 0; border-top: 1px solid var(--graphite); visibility: hidden; }
.toc li b { font-size: 14px; font-weight: 500; color: var(--ash); min-width: 2.2em; }

/* 04 */
.counter { position: absolute; inset-inline: 0; text-align: center; top: 34%; margin: 0; font-family: var(--disp); font-size: clamp(30px, 9vw, 64px); font-weight: 600; visibility: hidden; font-variant-numeric: tabular-nums; }
#mvp-ticks span { position: absolute; transform: translate(-50%, 18px); font-size: 14px; font-weight: 600; white-space: nowrap; }
#mvp-ticks span.off { color: var(--graphite); }
.manifesto { position: absolute; inset-inline: 24px; top: 36%; display: flex; flex-direction: column; font-family: var(--disp); font-weight: 800;
  font-size: clamp(30px, 9.6vw, 84px); line-height: 1.25; visibility: hidden; transform-origin: 80% 40%; }
.manifesto span { display: block; white-space: nowrap; }

/* YOU */
.ask { position: absolute; top: 16%; inset-inline: 24px; visibility: hidden; transform-origin: 80% 50%; }
#final { position: absolute; transform: translate(-50%, -50%); visibility: hidden; }
#final-hint { visibility: hidden; position: absolute; bottom: auto; }

/* the press: violet means a human decided */
.press { background: var(--violet); color: #fff; border: 0; padding: 16px 34px; font-family: var(--disp); font-weight: 700; font-size: 20px;
  clip-path: var(--chamfer); cursor: pointer; transition: transform .2s, background-color .2s; touch-action: manipulation;
  animation: breathe 1.6s steps(8) infinite; }
.press:hover { transform: translateY(-4px); }
.press:active { transform: translateY(-2px); background: var(--violet-down); }
.press:focus-visible { outline: 2px solid var(--bone); outline-offset: 4px; }
@keyframes breathe { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.22); } }
#final.press { transform: translate(-50%, -50%); }
#final.press:hover { transform: translate(-50%, calc(-50% - 4px)); }
#final-hint { transform: translateX(-50%); inset-inline: auto; }

/* the gate */
#gate { position: absolute; inset-inline: 0; bottom: 0; padding: 0 20px max(28px, env(safe-area-inset-bottom)); display: flex; flex-direction: column;
  align-items: stretch; gap: 14px; visibility: hidden; background: linear-gradient(to top, var(--ink) 70%, transparent); padding-top: 40px; z-index: 5; }
#gate.on { visibility: visible; }
#gate.nudge { animation: nudge .35s steps(5); }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-10px); } }
.board { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; }
.board .col { font-size: 11px; color: var(--ash); }
.board .dest { font-family: var(--disp); font-weight: 700; font-size: 22px; }
.flap { display: inline-block; min-width: 5.2em; text-align: center; padding: 6px 10px; background: var(--tile); border: 1px solid var(--tile-edge);
  font-weight: 600; font-size: 15px; transform-origin: 50% 50%; }
.flap.flip { animation: flip .5s steps(6); }
.flap.gone { background: var(--violet); border-color: var(--violet); color: #fff; }
@keyframes flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
#gate .press { align-self: stretch; text-align: center; }
#gate .hint { position: static; }

/* the flight between sections */
#flyfx { pointer-events: none; visibility: hidden; background:
  repeating-conic-gradient(from 0deg at 50% 50%, rgba(238,232,220,.0) 0deg 5deg, rgba(238,232,220,.18) 5deg 5.6deg); z-index: 6; }
#flyfx.on { visibility: visible; animation: fly .9s steps(14) forwards; }
@keyframes fly { 0% { transform: scale(.6); opacity: .0; } 30% { opacity: 1; } 100% { transform: scale(3); opacity: 0; } }
#stage.flying > :not(#flyfx):not(#chip) { animation: push .9s steps(14) forwards; }
@keyframes push { 0% { transform: scale(1); filter: brightness(1); } 100% { transform: scale(1.5); filter: brightness(2.2); } }

/* the index chip and its sheet */
#chip { position: absolute; top: max(14px, env(safe-area-inset-top)); inset-inline-start: 14px; display: flex; gap: 4px; padding: 0;
  background: none; border: 0; cursor: pointer; z-index: 8; }
#chip .flap { min-width: 0; font-size: 12px; padding: 5px 8px; }
#sheet { position: absolute; top: 54px; inset-inline-start: 14px; inset-inline-end: 14px; max-width: 360px; background: var(--ink2);
  border: 1px solid var(--tile-edge); padding: 12px; z-index: 8; }
.sheet-h { margin: 0 0 8px; font-size: 11px; color: var(--ash); }
#sheet ul { list-style: none; margin: 0; padding: 0; }
#sheet li button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 6px;
  background: none; border: 0; border-top: 1px solid var(--tile-edge); cursor: pointer; font-family: var(--disp); font-weight: 600; font-size: 17px; }
#sheet li button:disabled { color: var(--graphite); cursor: not-allowed; }
#sheet li .flap { min-width: 4.6em; font-family: var(--text); font-size: 12px; padding: 4px 6px; }

/* after the last press: the doors and the end credits */
#after { position: relative; z-index: 2; background: var(--ink); padding: 18vh 24px 60px; }
.doors { display: flex; flex-direction: column; gap: 14px; max-width: 720px; }
.doors h2 { margin-bottom: 18px; }
.door { display: grid; gap: 6px; padding: 18px 18px 16px; background: var(--ink2); border: 1px solid var(--tile-edge); color: var(--bone);
  text-decoration: none; clip-path: var(--chamfer); transition: transform .2s, border-color .2s; }
.door:hover { transform: translateY(-4px); border-color: var(--violet); }
.door b { font-family: var(--disp); font-weight: 700; font-size: 24px; }
.door span { color: var(--ash); font-size: 16px; }
.door i { font-style: normal; font-size: 13px; color: var(--violet); }
.credits { margin-top: 26vh; padding-bottom: 8vh; display: grid; gap: 10px; justify-items: start; color: var(--ash); font-size: 15px; }
.credits p { margin: 0; }
.credits a { color: var(--bone); text-decoration: none; }
.credits-mark { width: 120px; margin-bottom: 10px; }
.credits .legal a { color: var(--graphite); font-size: 12px; text-decoration: underline; }

#proto-badge { position: fixed; bottom: 6px; inset-inline-start: 8px; margin: 0; font-size: 9px; color: var(--graphite); z-index: 9; pointer-events: none; }

@media (min-width: 900px) {
  .oneline, #what-h, .toc, .ask, .manifesto { inset-inline-start: 9vw; inset-inline-end: 9vw; }
  .line { inset-inline: 9vw; }
  #gate { inset-inline: auto 0; width: 420px; inset-inline-end: 6vw; inset-inline-start: auto; background: none; }
}
@media (prefers-reduced-motion: reduce) {
  .press { animation: none; }
  #flyfx.on, #stage.flying > * { animation: none !important; }
}
