/* =========================================================
   QuestLab — one-page site
   ========================================================= */

:root {
  --ink: #14110d;
  --ink-2: #1d1914;
  --ink-3: #2a241c;
  --paper: #ebe5d6;
  --paper-2: #e2dac7;
  --paper-ink: #1b1712;
  --paper-muted: #5a4f40;
  --smoke: #c9c1b2;
  --smoke-muted: #9a917f;
  --brass: #c9a15a;
  --ember: #e08a3c;
  --blood: #8c2a1f;
  --line-dark: rgba(201, 161, 90, .25);
  --line-paper: rgba(27, 23, 18, .18);

  --f-display: "Cinzel", "Times New Roman", serif;
  --f-body: "EB Garamond", Georgia, serif;
  --f-type: "Special Elite", "Courier New", monospace;

  --gutter: clamp(16px, 4vw, 40px);
  --max: 1160px;
  --nav-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--smoke);
  font-family: var(--f-body);
  font-size: clamp(17px, 1.1vw + 12px, 20px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; line-height: 1.15; margin: 0; letter-spacing: .01em; }
h2 { font-size: clamp(30px, 4vw, 52px); text-wrap: balance; }
h3 { font-size: clamp(19px, 1.4vw, 22px); }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

/* film grain over the whole page */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.eyebrow {
  font-family: var(--f-type);
  font-size: 14px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 18px;
}
.eyebrow--dark { color: var(--blood); }
.lead { font-size: 1.12em; max-width: 680px; margin-top: 22px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 15px 28px;
  border: 1px solid var(--brass);
  border-radius: 2px;
  cursor: pointer;
  transition: background .25s, color .25s, transform .25s, box-shadow .25s;
}
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn--primary { background: var(--brass); color: var(--ink); }
.btn--primary:hover { background: #dcb873; box-shadow: 0 0 30px rgba(224, 138, 60, .35); transform: translateY(-2px); }
.btn--ghost { background: rgba(20, 17, 13, .35); color: var(--paper); backdrop-filter: blur(4px); }
.btn--ghost:hover { background: rgba(201, 161, 90, .15); transform: translateY(-2px); }
.btn--lg { font-family: var(--f-body); font-weight: 600; font-size: clamp(18px, 3vw, 22px); padding: 16px 34px; text-transform: none; letter-spacing: .03em; word-break: break-all; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter);
  transition: background .35s, border-color .35s;
  border-bottom: 1px solid transparent;
}
.nav.is-solid { background: rgba(20, 17, 13, .92); backdrop-filter: blur(8px); border-color: var(--line-dark); }
.nav__brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-display); font-weight: 900;
  font-size: 20px; letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none; color: var(--paper);
}
.nav__brand .star { width: 22px; height: 22px; color: var(--brass); }
.nav__links { display: flex; align-items: center; gap: 34px; }
.nav__links a {
  font-family: var(--f-display); font-size: 14px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase;
  text-decoration: none; color: var(--smoke);
  position: relative; padding: 6px 0;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--brass); transform: scaleX(0); transition: transform .3s;
}
.nav__links a:hover { color: var(--paper); }
.nav__links a:hover::after { transform: scaleX(1); }
.nav__burger { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav__burger span { display: block; width: 24px; height: 2px; background: var(--paper); margin: 5px 0; transition: transform .3s, opacity .3s; }

@media (max-width: 820px) {
  .nav__burger { display: block; z-index: 2; }
  .nav__links {
    position: fixed; inset: 0;
    flex-direction: column; justify-content: center; gap: 30px;
    background: rgba(20, 17, 13, .97);
    opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
  }
  .nav__links a { font-size: 20px; }
  .nav.is-open .nav__links { opacity: 1; visibility: visible; }
  .nav.is-open .nav__burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.is-open .nav__burger span:nth-child(2) { opacity: 0; }
  .nav.is-open .nav__burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center;
  overflow: hidden;
  text-align: center;
  background: var(--ink) url("../img/hero-poster.jpg") center / cover no-repeat;
}
.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: sepia(.25) saturate(.8); transition: opacity .9s ease; }
.hero__video.is-fading { opacity: 0; }
.hero__shade {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(20,17,13,.35) 0%, rgba(20,17,13,.78) 70%, rgba(20,17,13,.95) 100%),
    linear-gradient(to bottom, rgba(20,17,13,.6), rgba(20,17,13,.25) 40%, var(--ink) 100%);
}
.hero__embers { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero__content { position: relative; z-index: 2; padding: calc(var(--nav-h) + 20px) var(--gutter) 80px; max-width: 900px; }
.hero__title {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  color: var(--paper);
  font-weight: 900;
  line-height: .9;
  text-transform: uppercase;
  text-shadow: 0 4px 40px rgba(0,0,0,.6);
}
.hero__q { font-size: clamp(64px, 14vw, 170px); letter-spacing: .04em; }
.hero__lab { font-size: clamp(48px, 10vw, 120px); letter-spacing: .18em; margin-right: -.18em; transform: translateX(.55em); } /* clear the Q tail */
.hero__star {
  width: clamp(36px, 5vw, 60px); height: clamp(36px, 5vw, 60px);
  margin-bottom: 18px;
  color: var(--brass);
  filter: drop-shadow(0 0 18px rgba(224,138,60,.8));
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle { 50% { opacity: .7; transform: rotate(22deg) scale(.92); } }
.rule { display: flex; align-items: center; justify-content: center; margin: 26px auto 22px; width: min(420px, 80%); }
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--brass)); }
.rule::after { transform: scaleX(-1); }
.rule span { width: 8px; height: 8px; background: var(--brass); transform: rotate(45deg); margin: 0 12px; }
.hero__tagline { font-style: italic; font-size: clamp(20px, 2.4vw, 30px); color: var(--paper); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-top: 40px; }
.hero__scroll {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 2;
  width: 26px; height: 42px; border: 1px solid var(--brass); border-radius: 14px;
}
.hero__scroll span { position: absolute; top: 8px; left: 50%; width: 3px; height: 8px; margin-left: -1.5px; background: var(--brass); border-radius: 2px; animation: scroll 2s infinite; }
@keyframes scroll { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- sections ---------- */
.section { position: relative; padding: clamp(80px, 12vw, 150px) 0; }
.section__head { margin-bottom: clamp(48px, 6vw, 80px); }

.paper {
  background-color: var(--paper);
  color: var(--paper-ink);
  background-image:
    radial-gradient(ellipse at 15% 20%, rgba(120, 95, 60, .10), transparent 45%),
    radial-gradient(ellipse at 85% 80%, rgba(120, 95, 60, .12), transparent 50%),
    radial-gradient(ellipse at center, transparent 60%, rgba(90, 70, 40, .18) 100%);
}
.paper--alt { background-color: var(--paper-2); }
.paper .lead { color: var(--paper-muted); }

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 3vw, 48px); }
.pillar { border-top: 1px solid var(--line-paper); padding-top: 32px; }
.pillar svg { width: 54px; height: 54px; color: var(--paper-ink); margin-bottom: 22px; }
.pillar h3 { margin-bottom: 12px; }
.pillar p { color: var(--paper-muted); }

.war { background: var(--ink); overflow: hidden; }
.war h2 { color: var(--paper); max-width: 860px; }
.war__bg {
  position: absolute; inset: 0;
  background: url("../img/dice.jpg") center 30% / cover no-repeat;
  opacity: .18; filter: grayscale(.4) sepia(.3);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 60%, transparent);
          mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 60%, transparent);
}
.war .container { position: relative; }

/* dossier */
.dossier {
  position: relative;
  display: grid; grid-template-columns: minmax(240px, 1fr) 2fr; gap: clamp(28px, 4vw, 56px);
  background: rgba(29, 25, 20, .82);
  border: 1px solid var(--line-dark);
  padding: clamp(28px, 4vw, 52px);
  backdrop-filter: blur(3px);
}
.dossier::before {
  content: ""; position: absolute; inset: 8px; border: 1px dashed rgba(201,161,90,.15); pointer-events: none;
}
.dossier__stamp {
  position: absolute; top: -18px; right: clamp(16px, 4vw, 40px);
  font-family: var(--f-type); font-size: clamp(18px, 2.5vw, 26px); letter-spacing: .25em; text-transform: uppercase;
  color: var(--blood); background: var(--paper);
  border: 3px double var(--blood);
  padding: 4px 16px;
  transform: rotate(-6deg);
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
.dossier__meta { margin: 0; font-family: var(--f-type); font-size: 15px; }
.dossier__meta div { padding: 12px 0; border-bottom: 1px solid var(--line-dark); }
.dossier__meta div:first-child { padding-top: 0; }
.dossier__meta dt { color: var(--smoke-muted); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; margin-bottom: 2px; }
.dossier__meta dd { margin: 0; color: var(--paper); }
.dossier__meta em { color: var(--brass); font-style: normal; font-size: 13px; margin-left: 6px; }
.redacted { color: #000; background: #000; letter-spacing: -2px; user-select: none; }
.dossier__body p { font-size: 1.08em; }
.dossier__body p + p { margin-top: 18px; }
.dossier__body p:first-child::first-letter {
  font-family: var(--f-display); font-weight: 900; color: var(--brass);
  float: left; font-size: 3.6em; line-height: .85; margin: 6px 12px 0 0;
}

.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; margin-top: clamp(40px, 6vw, 72px); background: var(--line-dark); border: 1px solid var(--line-dark); }
.feature { background: var(--ink-2); padding: 34px 28px 38px; transition: background .3s; }
.feature:hover { background: var(--ink-3); }
.feature__num { display: block; font-family: var(--f-display); font-size: 34px; color: var(--brass); margin-bottom: 16px; opacity: .8; }
.feature h3 { color: var(--paper); margin-bottom: 12px; }
.feature p { color: var(--smoke-muted); font-size: .95em; }

/* quote */
.quote { padding: clamp(70px, 10vw, 120px) 0; text-align: center; border-top: 1px solid var(--line-paper); }
.quote blockquote { margin: 0 auto; max-width: 900px; }
.quote p { font-size: clamp(24px, 3.2vw, 40px); font-style: italic; line-height: 1.35; text-wrap: balance; }
.quote cite { display: block; margin-top: 22px; font-family: var(--f-type); font-style: normal; font-size: 14px; letter-spacing: .2em; text-transform: uppercase; color: var(--paper-muted); }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; position: relative; }
.timeline::before { content: ""; position: absolute; top: 9px; left: 0; right: 0; height: 2px; background: repeating-linear-gradient(90deg, var(--paper-muted) 0 8px, transparent 8px 16px); opacity: .5; }
.timeline__item { position: relative; padding-top: 44px; }
.timeline__dot { position: absolute; top: 0; left: 0; width: 20px; height: 20px; border: 2px solid var(--paper-muted); background: var(--paper-2); transform: rotate(45deg); }
.timeline__item.is-done .timeline__dot { background: var(--paper-ink); border-color: var(--paper-ink); }
.timeline__item.is-now .timeline__dot { background: var(--blood); border-color: var(--blood); box-shadow: 0 0 0 6px rgba(140, 42, 31, .18); animation: pulse 2.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 12px rgba(140, 42, 31, 0); } }
.timeline h3 { margin-bottom: 8px; }
.timeline p { color: var(--paper-muted); font-size: .95em; }
.badge { display: inline-block; margin-top: 14px; font-family: var(--f-type); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--paper); background: var(--blood); padding: 4px 10px; }

/* contact */
.war--contact { text-align: center; background: radial-gradient(ellipse at center, var(--ink-3), var(--ink) 70%); }
.contact { display: flex; flex-direction: column; align-items: center; }
.contact__d20 { width: 64px; height: 64px; color: var(--brass); margin-bottom: 28px; animation: roll 12s linear infinite; }
@keyframes roll { to { transform: rotate(360deg); } }
.contact h2 { margin: 0 auto; }
.contact .lead { margin: 22px auto 40px; }
.contact__soon { margin-top: 34px; font-family: var(--f-type); font-size: 14px; letter-spacing: .1em; color: var(--smoke-muted); }

/* footer */
.footer { border-top: 1px solid var(--line-dark); padding: 30px 0; font-size: 15px; color: var(--smoke-muted); }
.footer__inner { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.footer .nav__brand { font-size: 16px; }

/* trailer dialog */
.trailer { padding: 0; border: 1px solid var(--line-dark); background: #000; width: min(1100px, 94vw); max-width: none; overflow: visible; }
.trailer::backdrop { background: rgba(10, 8, 6, .9); backdrop-filter: blur(4px); }
.trailer video { width: 100%; aspect-ratio: 16 / 9; background: #000; }
.trailer__close { position: absolute; top: -48px; right: 0; background: none; border: 0; color: var(--paper); font-size: 40px; line-height: 1; cursor: pointer; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .timeline { grid-template-columns: repeat(2, 1fr); row-gap: 48px; }
  .timeline::before { display: none; }
}
@media (max-width: 720px) {
  .pillars { grid-template-columns: 1fr; }
  .dossier { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; gap: 36px; padding-left: 8px; }
  .timeline::before { display: block; top: 0; bottom: 0; left: 17px; right: auto; width: 2px; height: auto; background: repeating-linear-gradient(180deg, var(--paper-muted) 0 8px, transparent 8px 16px); }
  .timeline__item { padding: 0 0 0 48px; }
  .timeline__dot { left: 0; }
  .btn { padding: 14px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .hero__video { display: none; }
}
