@font-face {
  font-family: "Manrope";
  src: url("../assets/fonts/Manrope-VariableFont_wght.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --peach: #F9855B;
  --watermelon: #F25E86;
  --orchid: #A44EA6;
  --blue: #138AF2;
  --ink: #161822;
  --ink-2: #5b5f6e;
  --ink-3: #9a9eab;
  --line: #ececf1;
  --paper: #ffffff;
  --soft: #f6f6f9;
  --grad: linear-gradient(90deg, var(--peach), var(--watermelon) 35%, var(--orchid) 65%, var(--blue));
  --ease: cubic-bezier(.22, .8, .2, 1);
  --gutter: clamp(16px, 7vw, 120px);
}

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: "Manrope", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Top bar */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  background: linear-gradient(var(--paper) 60%, rgba(255,255,255,0));
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.brand em { font-style: normal; color: var(--ink-3); font-weight: 600; margin-left: 4px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper);
  font-size: 14px; font-weight: 600;
  transition: border-color .2s, box-shadow .2s, transform .2s var(--ease);
}
.pill:hover { border-color: transparent; box-shadow: 0 0 0 1.5px var(--orchid), 0 6px 20px rgba(164,78,166,.15); }
.pill svg { width: 15px; height: 15px; fill: currentColor; }

/* Side arrows */
.nav {
  position: fixed; top: 50%; z-index: 11;
  width: 56px; height: 56px; margin-top: -28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper); border: 1px solid var(--line);
  box-shadow: 0 6px 24px rgba(22,24,34,.08);
  transition: transform .25s var(--ease), box-shadow .25s, opacity .25s;
}
.nav svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: stroke .25s; }
.nav:hover { transform: scale(1.08); box-shadow: 0 0 0 2px var(--watermelon), 0 10px 30px rgba(242,94,134,.22); }
.nav:hover svg { stroke: var(--watermelon); }
.nav.prev { left: clamp(10px, 2vw, 32px); }
.nav.next { right: clamp(10px, 2vw, 32px); }
.nav[disabled] { opacity: 0; pointer-events: none; }

/* Progress */
.progress {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  display: flex; align-items: center; gap: 14px;
  padding: 16px var(--gutter) 20px;
  font-size: 13px; font-weight: 600; color: var(--ink-3);
  background: linear-gradient(rgba(255,255,255,0), var(--paper) 40%);
}
.progress .bar { flex: 1; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .5s var(--ease); }

/* Pages */
#stage { position: fixed; inset: 0; }
.page {
  position: absolute; inset: 0;
  padding: 84px calc(var(--gutter) + 40px) 70px;
  overflow-y: auto;
  display: flex; flex-direction: column; justify-content: center;
  animation: enter .55s var(--ease) both;
}
.page.leaving { animation: leave .3s ease-in both; pointer-events: none; }
.page.from-left { animation-name: enter-left; }
@keyframes enter { from { opacity: 0; transform: translateX(40px); } }
@keyframes enter-left { from { opacity: 0; transform: translateX(-40px); } }
@keyframes leave { to { opacity: 0; } }

.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }

/* Title page */
.cover { align-items: center; text-align: center; }
.cover .glow {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 35% at 30% 70%, rgba(249,133,91,.10), transparent 70%),
    radial-gradient(40% 35% at 70% 30%, rgba(19,138,242,.10), transparent 70%),
    radial-gradient(35% 30% at 55% 60%, rgba(164,78,166,.08), transparent 70%);
}
.cover img { width: 76px; height: 76px; border-radius: 18px; margin-bottom: 32px; box-shadow: 0 18px 50px rgba(164,78,166,.25); }
.cover h1 { font-size: clamp(40px, 7.4vw, 112px); font-weight: 800; letter-spacing: -.045em; line-height: .98; }
.cover h1 span { display: block; }
.cover .byline { margin-top: 28px; font-size: 16px; font-weight: 500; color: var(--ink-2); }
.cover .hint { margin-top: 56px; font-size: 13px; color: var(--ink-3); display: flex; gap: 8px; align-items: center; }
.kbd { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border: 1px solid var(--line); border-radius: 7px; font-weight: 700; color: var(--ink-2); }
.note {
  max-width: 640px; margin-top: 28px; padding: 18px 22px;
  border-radius: 16px; background: var(--soft);
  font-size: 15px; line-height: 1.6; color: var(--ink-2); text-align: left;
  border-left: 3px solid var(--watermelon);
}

/* Script page */
.script { justify-content: flex-start; }
.script .eyebrow { margin-bottom: 28px; }
.script .stanzas { display: grid; gap: clamp(18px, 2.6vh, 34px); }
.script p {
  font-size: clamp(20px, 2.35vw, 38px); font-weight: 600; line-height: 1.28; letter-spacing: -.02em;
  animation: rise .6s var(--ease) both;
}
.script p span { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@media (min-height: 760px) { .script { justify-content: center; } }

/* Scene collection */
.grid-page { justify-content: flex-start; }
.grid-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.grid-head h2 { font-size: clamp(28px, 3.4vw, 48px); font-weight: 800; letter-spacing: -.035em; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px 18px; }
.card { display: block; animation: rise .5s var(--ease) both; }
.card .thumb {
  position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--ink);
  transition: transform .35s var(--ease), box-shadow .35s;
}
.card .thumb::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .35s;
}
.card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease); }
.card:hover .thumb { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(22,24,34,.18); }
.card:hover .thumb::after { opacity: 1; }
.card:hover img { transform: scale(1.04); }
.card .badge {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: rgba(255,255,255,.92); color: var(--ink);
}
.card .meta { display: flex; gap: 10px; align-items: baseline; margin-top: 10px; }
.card .num { font-size: 12px; font-weight: 800; color: var(--ink-3); }
.card .name { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }

/* Scene page */
.scene { justify-content: center; }
.scene-wrap { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(260px, 1fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.player { position: relative; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 14px; border-radius: 999px; background: var(--soft); }
.tab { padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--ink-2); transition: background .25s, color .25s, box-shadow .25s; }
.tab:hover { color: var(--ink); }
.tab.on { background: var(--paper); color: var(--ink); box-shadow: 0 2px 10px rgba(22,24,34,.08), inset 0 -2px 0 var(--watermelon); }
.screen { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: var(--ink); box-shadow: 0 24px 60px rgba(22,24,34,.18); }
.screen video { width: 100%; height: 100%; display: block; object-fit: contain; background: var(--ink); }
.screen .loader { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--grad); transition: width .3s, opacity .4s; }
.screen.ready .loader { opacity: 0; }
.vid-actions { display: flex; gap: 8px; margin-top: 12px; }
.vid-actions .pill { padding: 7px 13px; font-size: 13px; }
.copy .eyebrow { margin-bottom: 14px; }
.copy h2 { font-size: clamp(15px, 1.2vw, 18px); font-weight: 700; color: var(--ink-2); margin-bottom: 18px; }
.copy blockquote { font-size: clamp(24px, 2.6vw, 42px); font-weight: 700; line-height: 1.2; letter-spacing: -.03em; }
.copy .note { margin-top: 26px; }

/* End page */
.end { align-items: center; text-align: center; }
.end h2 { font-size: clamp(32px, 5vw, 72px); font-weight: 800; letter-spacing: -.04em; line-height: 1.02; }
.end p { margin-top: 18px; font-size: 17px; color: var(--ink-2); max-width: 520px; line-height: 1.55; }
.end .screen { width: min(100%, 1100px); margin-top: 28px; }
.end .pill { margin-top: 30px; }

/* Phones and small tablets */
@media (max-width: 860px) {
  .page { padding: 76px 16px 76px; justify-content: flex-start; }
  .scene-wrap { grid-template-columns: 1fr; gap: 22px; }
  .nav { top: auto; bottom: 14px; margin-top: 0; width: 46px; height: 46px; }
  .progress { padding: 18px 76px 30px; }
  .brand span { display: none; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 16px 12px; }
  .cover, .end { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Backgrounds page and note page */
.page-title { font-size: clamp(28px, 3.4vw, 48px); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; margin: 12px 0 28px; }
.bg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.bg-card { margin: 0; animation: rise .5s var(--ease) both; }
.bg-card .thumb { aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--ink); box-shadow: 0 16px 40px rgba(22,24,34,.14); }
.bg-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bg-card figcaption { margin-top: 12px; font-size: 15px; font-weight: 700; }
.closing > * { max-width: 900px; }
.closing p { font-size: clamp(18px, 1.7vw, 26px); font-weight: 500; line-height: 1.5; letter-spacing: -.01em; color: var(--ink-2); margin-bottom: 18px; animation: rise .6s var(--ease) both; }
.closing p:last-of-type { color: var(--ink); font-weight: 700; }
.closing .pill { align-self: flex-start; margin-top: 18px; }
@media (max-width: 860px) { .bg-grid { grid-template-columns: 1fr; } }

/* Expandable backgrounds */
.bg-card { cursor: zoom-in; outline: none; }
.bg-card .thumb { position: relative; transition: transform .35s var(--ease), box-shadow .35s; }
.bg-card .thumb::after {
  content: "⤢"; position: absolute; right: 12px; bottom: 10px;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.92); color: var(--ink); font-size: 17px; font-weight: 700;
  opacity: 0; transform: scale(.85); transition: opacity .25s, transform .25s var(--ease);
}
.bg-card:hover .thumb, .bg-card:focus-visible .thumb { transform: translateY(-4px); box-shadow: 0 0 0 2px var(--orchid), 0 22px 50px rgba(22,24,34,.22); }
.bg-card:hover .thumb::after, .bg-card:focus-visible .thumb::after { opacity: 1; transform: none; }
.lightbox {
  position: fixed; inset: 0; z-index: 50; cursor: zoom-out;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding: 24px; background: rgba(10,11,16,.92); backdrop-filter: blur(6px);
  animation: fade .25s ease both;
}
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.5); animation: pop .35s var(--ease) both; }
.lb-bar { display: flex; gap: 18px; align-items: baseline; color: #fff; }
.lb-label { font-size: 17px; font-weight: 700; }
.lb-hint { font-size: 13px; color: rgba(255,255,255,.55); }
.lb-close { position: absolute; top: 18px; right: 22px; color: #fff; font-size: 34px; line-height: 1; opacity: .7; }
.lb-close:hover { opacity: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
