/* ═══ HASNAIN.EXE — trailer styles ═══ */
:root {
  --ink: #111010;
  --paper: #EFEBE3;
  --acid: #FFC53D;
  --dim: #5F5952;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --grot: "Satoshi", system-ui, sans-serif;
  --anton: "Clash Display", "Satoshi", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }
body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--grot);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--acid); color: #171204; }
a { color: inherit; text-decoration: none; }
button { background: none; border: none; color: inherit; cursor: pointer; font: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; }

.mono { font-family: var(--mono); }
.acid { color: var(--acid); }

#stage { position: fixed; inset: 0; }
#fx { position: absolute; inset: 0; width: 100%; height: 100%; }

.grain {
  position: absolute; inset: -60px; pointer-events: none; opacity: 0.5; z-index: 4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 25% { transform: translate(-24px, 18px); }
  50% { transform: translate(16px, -22px); } 75% { transform: translate(-12px, -14px); }
  100% { transform: translate(0, 0); }
}

.vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: radial-gradient(ellipse 110% 90% at 50% 50%, transparent 55%, rgba(0,0,0,0.55) 100%);
}
.flash { position: absolute; inset: 0; background: var(--paper); opacity: 0; pointer-events: none; z-index: 5; }

/* ═══ Scenes ═══ */
.scene {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: clamp(24px, 6vw, 96px);
  opacity: 0; visibility: hidden;
}

.mega {
  font-family: var(--anton);
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: clamp(56px, 13vw, 190px);
  line-height: 0.92;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.outline {
  color: transparent;
  -webkit-text-stroke: 2px var(--paper);
}
.kicker { font-size: clamp(11px, 1.4vw, 15px); letter-spacing: 0.18em; color: var(--dim); margin-top: 20px; }
.caption { font-size: clamp(11px, 1.3vw, 14px); letter-spacing: 0.22em; color: var(--acid); margin-bottom: 26px; }

/* Scene 1 — boot */
.boot-console { position: absolute; top: clamp(70px, 12vh, 120px); left: clamp(24px, 6vw, 96px); }
.bl { font-family: var(--mono); font-size: clamp(12px, 1.5vw, 16px); color: var(--dim); margin-bottom: 8px; }
.bl .ok { color: var(--acid); }
.title-card .mega .ch { display: inline-block; }

/* Scene 2 — thesis */
#sc-thesis .mega { will-change: transform; }

/* Scene 3 — system */
#sc-system { justify-content: flex-end; align-items: flex-start; padding-bottom: clamp(100px, 14vh, 160px); }
.sysline { font-size: clamp(18px, 2.6vw, 30px); line-height: 1.35; color: var(--dim); }
.sysline strong { color: var(--paper); font-weight: 700; }

/* Scene 4 — numbers */
.stat-slide {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; gap: 18px;
  opacity: 0; visibility: hidden;
}
.stat-num { font-variant-numeric: tabular-nums; }
.stat-label { font-size: clamp(12px, 1.5vw, 16px); letter-spacing: 0.18em; color: var(--dim); max-width: 900px; line-height: 1.7; padding: 0 24px; }
.stat-label strong { color: var(--paper); font-weight: 700; }

/* Scene 5 — cases */
.case-list { list-style: none; width: 100%; max-width: 1080px; }
.case-row {
  display: flex; gap: clamp(18px, 4vw, 48px); align-items: baseline;
  padding: clamp(16px, 2.6vh, 26px) 0;
  border-bottom: 1px solid rgba(242, 239, 230, 0.16);
}
.case-no { color: var(--acid); font-size: clamp(12px, 1.4vw, 15px); }
.case-row h3 {
  font-family: var(--anton); font-weight: 700; text-transform: uppercase;
  font-size: clamp(26px, 4.6vw, 56px); line-height: 1; margin-bottom: 6px;
}
.case-row p { color: var(--dim); font-size: clamp(14px, 1.7vw, 18px); }
.case-row p strong { font-weight: 700; }

/* Scene 6 — stack wall */
#sc-stack { overflow: hidden; align-items: center; justify-content: center; }
.stack-wall {
  position: absolute; inset: -30% 0; display: flex; gap: clamp(24px, 6vw, 90px);
  justify-content: center; align-items: center; opacity: 0.9;
}
.stack-col { display: flex; flex-direction: column; gap: 14px; will-change: transform; }
.stack-col span {
  font-family: var(--anton); font-weight: 700; text-transform: uppercase;
  font-size: clamp(40px, 7.5vw, 110px); line-height: 1;
  white-space: nowrap;
}
.stack-col .outline { -webkit-text-stroke: 1.5px rgba(242,239,230,0.7); }
.stack-tag {
  position: relative; z-index: 2; background: var(--acid); color: var(--ink);
  padding: 10px 22px; letter-spacing: 0.3em; font-weight: 700;
  font-size: clamp(12px, 1.5vw, 16px);
}

/* Scene 7 — end card */
#sc-end { align-items: flex-start; }
.end-title { margin-bottom: clamp(28px, 5vh, 48px); }
.end-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.cta {
  font-family: var(--mono); font-size: clamp(13px, 1.5vw, 15px); letter-spacing: 0.12em;
  border: 1.5px solid var(--paper); padding: 15px 26px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.cta:hover { background: var(--paper); color: var(--ink); }
.cta-solid { background: var(--acid); border-color: var(--acid); color: var(--ink); font-weight: 700; }
.cta-solid:hover { background: var(--paper); border-color: var(--paper); }
.end-meta { color: var(--dim); font-size: clamp(11px, 1.3vw, 13px); letter-spacing: 0.14em; margin-bottom: 40px; }
.replay { font-size: 13px; letter-spacing: 0.14em; color: var(--dim); transition: color 0.2s; }
.replay:hover { color: var(--acid); }

/* ═══ HUD ═══ */
.hud-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px clamp(24px, 4vw, 48px);
}
.hud-name { font-size: 13px; letter-spacing: 0.2em; color: var(--paper); }
.hud-name::before { content: "■ "; color: var(--acid); }
.hud-skip { font-size: 12px; letter-spacing: 0.16em; color: var(--dim); transition: color 0.2s; }
.hud-skip:hover { color: var(--acid); }

.hud-bottom {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; gap: 18px;
  padding: 22px clamp(24px, 4vw, 48px);
}
.hud-play { display: grid; place-items: center; width: 34px; height: 34px; border: 1.5px solid rgba(242,239,230,0.4); border-radius: 50%; transition: border-color 0.2s, color 0.2s; }
.hud-play:hover { border-color: var(--acid); color: var(--acid); }
.hud-track { position: relative; flex: 1; height: 22px; cursor: pointer; }
.hud-track::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px;
  background: rgba(242, 239, 230, 0.18); transform: translateY(-50%);
}
.hud-progress {
  position: absolute; left: 0; top: 50%; height: 2px; width: 0%;
  background: var(--acid); transform: translateY(-50%);
  box-shadow: 0 0 12px rgba(255, 197, 61, 0.6);
}
.hud-dots { position: absolute; inset: 0; }
.hud-dot {
  position: absolute; top: 50%; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink); border: 2px solid rgba(242,239,230,0.45);
  transform: translate(-50%, -50%); padding: 0; transition: border-color 0.2s, background 0.2s;
}
.hud-dot:hover, .hud-dot.past { border-color: var(--acid); }
.hud-dot.past { background: var(--acid); }
.hud-time { font-size: 12px; color: var(--dim); letter-spacing: 0.1em; font-variant-numeric: tabular-nums; }

/* ═══ Fallbacks ═══ */
.nojs { position: fixed; inset: 0; z-index: 50; background: var(--ink); padding: 10vh 8vw; }
.nojs h1 { font-family: var(--anton); font-weight: 700; font-size: clamp(32px, 6vw, 72px); margin-bottom: 20px; }
.nojs p { color: var(--dim); max-width: 640px; margin-bottom: 14px; line-height: 1.6; }
.nojs a { color: var(--acid); }

@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
}
@media (max-width: 640px) {
  .hud-time { display: none; }
  .boot-console { right: 24px; }
  .case-row h3 { font-size: 30px; }
}
