:root {
  --ink: #100d0c;
  --ink-2: #171312;
  --bone: #ede6df;
  --muted: rgba(237, 230, 223, 0.62);
  --faint: rgba(237, 230, 223, 0.38);
  --hair: rgba(237, 230, 223, 0.1);
  --oxblood: #84313c;
  --terracotta: #c85f48;
  --apricot: #f5a16b;
  --gradient: linear-gradient(100deg, var(--terracotta) 0%, var(--apricot) 100%);

  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(20px, 5vw, 56px);
  --section: clamp(96px, 13vw, 176px);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 350;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Fine film grain over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0.05;
  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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--terracotta); color: var(--ink); }

a { color: inherit; }
a:focus-visible { outline: 1px solid var(--apricot); outline-offset: 4px; border-radius: 2px; }

.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Header ---------- */

.site-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(20px, 3vw, 32px) var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-mark { width: 30px; height: 28px; flex: none; }
.brand-mark.small { width: 20px; height: 19px; }

.brand-word {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}
.brand-word span { color: var(--faint); }

.header-link {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.3s;
}
.header-link:hover { color: var(--bone); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 600px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.arcade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Fade the scene into the page and keep the headline legible */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(16, 13, 12, 0) 45%, rgba(16, 13, 12, 0.7) 78%, var(--ink) 100%),
    radial-gradient(ellipse at 0% 100%, rgba(16, 13, 12, 0.75), transparent 60%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-bottom: clamp(48px, 9vh, 96px);
}

.eyebrow,
.label {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(237, 230, 223, 0.82);
  margin: 0;
}

/* A short gradient rule marks each section label */
.label::before {
  content: "";
  display: block;
  width: 24px;
  height: 1px;
  margin-bottom: 14px;
  background: var(--gradient);
}

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 8.4vw, 128px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 20px 0 0;
  max-width: 14ch;
}

h1 em,
.contact h2 {
  font-style: italic;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.06em;
}

.hero-sub {
  margin: 28px 0 0;
  max-width: 34rem;
  font-size: clamp(16px, 1.5vw, 19px);
  color: var(--muted);
}

/* ---------- Sections ---------- */

.section { padding-block: var(--section); }
.section + .section { border-top: 1px solid var(--hair); }

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: minmax(180px, 3fr) minmax(0, 9fr);
    gap: 48px;
  }
  .grid > .label { padding-top: 0.6em; }
}

.prose { max-width: 40rem; }
.prose p { margin: 0 0 1.2em; color: var(--muted); }

.prose .lead {
  font-family: var(--serif);
  font-size: clamp(32px, 4.2vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--bone);
  margin-bottom: 0.9em;
}

.prose .note {
  margin: 2.4em 0 0;
  padding-top: 1.4em;
  border-top: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--faint);
}

/* ---------- Episode log ---------- */

.caption {
  margin: 16px 0 0;
  max-width: 22rem;
  color: var(--muted);
  font-size: 15px;
}

.log {
  margin: 0;
  border: 1px solid var(--hair);
  border-radius: 6px;
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  overflow: hidden;
}

.log-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--hair);
  color: var(--faint);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}

.log-tag {
  color: var(--apricot);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.log-lines {
  list-style: none;
  margin: 0;
  padding: 12px 0;
}

.log-lines li {
  display: grid;
  grid-template-columns: 64px 84px minmax(0, 1fr);
  gap: 16px;
  padding: 6px 20px;
  color: var(--muted);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.log-lines time { color: var(--faint); font-variant-numeric: tabular-nums; }
.log-lines b { font-weight: 400; }
.log-lines .env { color: var(--faint); }
.log-lines .agent { color: var(--apricot); }
.log-lines .human { color: var(--bone); }
.log-lines .verifier { color: var(--terracotta); }

.log-lines .verdict {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px dashed var(--hair);
  color: var(--bone);
}
.log-lines .verdict em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Lines play in once the log scrolls into view */
.js .log-lines li { opacity: 0; transform: translateY(4px); }
.js .log-lines li.on { opacity: 1; transform: none; }

.footnote {
  grid-column: -2 / -1;
  margin: 0;
  font-size: 14px;
  color: var(--faint);
}

@media (max-width: 640px) {
  .log { font-size: 12px; }
  .log-head { padding: 12px 16px; }
  .log-lines li {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 2px 12px;
    padding: 7px 16px;
  }
  .log-lines li span { grid-column: 2; }
}

/* ---------- What we model ---------- */

.rows { margin: 0; }

.rows > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  padding: 26px 0;
  border-top: 1px solid var(--hair);
}
.rows > div:last-child { border-bottom: 1px solid var(--hair); }

@media (min-width: 700px) {
  .rows > div { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; align-items: baseline; }
}

.rows dt {
  font-family: var(--serif);
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 1.15;
}
.rows dd { margin: 0; color: var(--muted); }

/* ---------- For labs ---------- */

.offer {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
}

@media (min-width: 800px) {
  .offer { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
}

.offer h3 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.15;
}
.offer li { border-top: 1px solid var(--hair); padding-top: 22px; }
.offer p { margin: 0; color: var(--muted); font-size: 16px; }

.domain {
  margin: 64px 0 0;
  color: var(--muted);
}
.domain span {
  display: inline-block;
  margin-right: 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--apricot);
}

/* ---------- Contact ---------- */

.contact {
  position: relative;
  overflow: hidden;
  text-align: center;
}

/* Echo of the hero's vanishing light */
.contact::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -40%;
  width: min(1100px, 140vw);
  aspect-ratio: 2 / 1;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(245, 161, 107, 0.16), rgba(200, 95, 72, 0.07) 40%, transparent 70%);
  pointer-events: none;
}

.contact-inner { position: relative; }

.contact h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(56px, 9vw, 132px);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0 auto;
  display: inline-block;
}

.contact p {
  max-width: 30rem;
  margin: 28px auto 44px;
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 26px;
  border: 1px solid rgba(245, 161, 107, 0.45);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 14px;
  text-decoration: none;
  color: var(--bone);
  transition: background 0.3s, border-color 0.3s, color 0.3s;
  overflow-wrap: anywhere;
}
.button span { transition: transform 0.3s; }
.button:hover { background: var(--bone); border-color: var(--bone); color: var(--ink); }
.button:hover span { transform: translateX(4px); }

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding-block: 32px 40px;
  border-top: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}
.site-footer a { margin-left: auto; text-decoration: none; transition: color 0.3s; }
.site-footer a:hover { color: var(--bone); }

/* ---------- Reveal ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(4px);
  transition:
    opacity 1.1s cubic-bezier(.2,.7,.2,1),
    transform 1.1s cubic-bezier(.2,.7,.2,1),
    filter 1.1s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--d, 0ms);
}
.js .reveal.in { filter: none; }
/* Stagger only on the way in; leaving is immediate and quicker */
.js .reveal:not(.in) { transition-delay: 0ms; transition-duration: 0.6s; }

.arcade, .hero-content { will-change: transform, opacity; }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .log-lines li { opacity: 1; transform: none; filter: none; transition: none; }
}
