:root {
  --ink: #101210;
  --paper: #f2f0e9;
  --lime: #d9ff43;
  --blue: #78d8ff;
  --coral: #ff765f;
  --line: rgba(16, 18, 16, 0.2);
  --muted: #5b615b;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Outfit", Arial, sans-serif;
  letter-spacing: 0;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.page-shell { overflow-x: hidden; width: 100%; max-width: 100%; }
.nav {
  position: absolute;
  z-index: 20;
  top: 24px;
  left: 50%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(1180px, calc(100% - 40px));
  min-height: 58px;
  padding: 8px 10px 8px 20px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 8px;
  background: rgba(12,15,13,.66);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.brand-mark { width: 12px; height: 12px; background: var(--lime); box-shadow: 8px 8px 0 var(--blue); }
.nav-links { display: flex; gap: 28px; font-size: .9rem; color: rgba(255,255,255,.75); }
.nav-links a:hover { color: #fff; }
.nav-cta { justify-self: end; padding: 12px 18px; color: var(--ink); background: #fff; border-radius: 5px; font-weight: 600; }
.hero {
  position: relative;
  min-height: 92svh;
  display: grid;
  place-items: center;
  color: #fff;
  background: #101510;
  isolation: isolate;
}
.hero-media { position: absolute; z-index: -3; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.2); }
.hero-wash { position: absolute; z-index: -2; inset: 0; background: radial-gradient(circle at 50% 46%, rgba(0,0,0,.18), rgba(5,8,6,.86) 76%), linear-gradient(to bottom, rgba(3,7,4,.4), rgba(3,7,4,.75)); }
.hero-content { width: min(1180px, calc(100% - 40px)); padding-top: 70px; text-align: center; }
.eyebrow { margin: 0 0 28px; font-size: .76rem; text-transform: uppercase; font-weight: 700; letter-spacing: .14em; }
.eyebrow.dark { color: var(--muted); }
.hero h1 { max-width: 1180px; margin: 0 auto; font-size: clamp(3rem, 7vw, 7.8rem); line-height: .91; font-weight: 500; letter-spacing: 0; text-wrap: balance; }
.hero-copy { max-width: 660px; margin: 34px auto 0; font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: rgba(255,255,255,.74); line-height: 1.55; }
.hero-actions { display: flex; justify-content: center; gap: 12px; margin-top: 36px; }
.button { display: inline-flex; min-height: 50px; align-items: center; justify-content: center; padding: 0 22px; border: 0; border-radius: 5px; font-weight: 650; cursor: pointer; transition: transform .25s ease, background .25s ease; }
.button:hover { transform: translateY(-2px); }
.button-light { color: var(--ink); background: #fff; }
.button-ghost { color: #fff; border: 1px solid rgba(255,255,255,.45); background: rgba(0,0,0,.2); }
.button-dark { color: #fff; background: var(--ink); }
.scroll-cue { position: absolute; bottom: 24px; display: flex; gap: 12px; font-size: .84rem; color: rgba(255,255,255,.72); }
.chapter { padding: 160px max(24px, calc((100vw - 1180px) / 2)); }
.section-heading { display: grid; grid-template-columns: 1fr 3fr; align-items: start; gap: 40px; margin-bottom: 76px; }
.section-heading h2, .mode-intro h2, .lab-heading h2, .footer h2 { margin: 0; font-size: clamp(2.5rem, 5vw, 5.8rem); line-height: .98; font-weight: 500; letter-spacing: 0; }
.inline-image { display: inline-block; width: 1.55em; height: .58em; margin: 0 .12em; vertical-align: .1em; border-radius: 999px; background: url("https://pbs.twimg.com/amplify_video_thumb/2075639077735395328/img/qvQU8kS1wv088vG6.jpg") center/cover; filter: grayscale(1) contrast(1.25); }
.bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(270px, auto); grid-auto-flow: dense; gap: 1px; background: var(--ink); border: 1px solid var(--ink); }
.bento-card { min-width: 0; padding: 30px; background: var(--paper); display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.bento-card h3 { margin: 12px 0 0; font-size: clamp(1.35rem, 2.2vw, 2rem); line-height: 1.05; font-weight: 550; }
.bento-card p { margin: 0; line-height: 1.5; }
.span-two { grid-column: span 2; }
.dark-card { color: #fff; background: var(--ink); }
.dark-card > p { max-width: 540px; color: rgba(255,255,255,.68); }
.lime-card { background: var(--lime); }
.blue-card { background: var(--blue); }
.coral-card { background: var(--coral); }
.paper-card { background: #fff; }
.card-kicker { font-size: .72rem; text-transform: uppercase; font-weight: 700; letter-spacing: .12em; }
.metric-symbol { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-weight: 700; }
.metric-card p { margin-top: 42px; font-size: .95rem; }
.image-card { position: relative; padding: 0; min-height: 270px; color: #fff; }
.image-card img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.3); transition: transform .7s ease-out; }
.image-card:hover img { transform: scale(1.05); }
.image-card-copy { position: absolute; inset: auto 0 0; padding: 26px 30px; background: linear-gradient(transparent, rgba(0,0,0,.9)); }
.image-card-copy p:last-child { max-width: 560px; margin-top: 10px; }
.mode-chapter { color: #fff; background: var(--ink); }
.mode-intro { display: grid; grid-template-columns: 1fr 3fr; gap: 40px; align-items: start; }
.mode-intro .reveal-copy { max-width: 930px; }
.mode-accordion { display: flex; min-height: 430px; margin-top: 100px; border: 1px solid rgba(255,255,255,.2); }
.mode-panel { flex: 1; min-width: 120px; padding: 34px; color: #fff; text-align: left; border: 0; border-right: 1px solid rgba(255,255,255,.2); background: transparent; cursor: pointer; transition: flex .6s cubic-bezier(.2,.75,.2,1), background .35s ease; display: grid; grid-template-rows: auto 1fr auto; gap: 20px; }
.mode-panel:last-child { border-right: 0; }
.mode-panel:hover, .mode-panel.active { flex: 2.2; background: #1c211d; }
.mode-panel.active { color: var(--ink); background: var(--lime); }
.mode-index { font-size: .8rem; font-weight: 700; }
.mode-title { align-self: center; font-size: clamp(1.7rem, 4vw, 4rem); line-height: 1; font-weight: 500; }
.mode-detail { max-width: 470px; color: rgba(255,255,255,.62); opacity: 0; transform: translateY(10px); transition: .35s ease; }
.mode-panel:hover .mode-detail, .mode-panel.active .mode-detail { opacity: 1; transform: none; }
.mode-panel.active .mode-detail { color: rgba(16,18,16,.7); }
.lab { background: #e8e7df; }
.lab-heading { display: grid; grid-template-columns: 2fr 1fr; gap: 80px; align-items: end; }
.lab-heading > p { margin: 0; color: var(--muted); line-height: 1.6; }
.preset-row { display: flex; gap: 8px; margin: 72px 0 18px; overflow-x: auto; }
.preset { min-height: 42px; padding: 0 16px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: transparent; cursor: pointer; white-space: nowrap; }
.preset.active { color: #fff; background: var(--ink); border-color: var(--ink); }
.lab-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, .82fr); gap: 18px; align-items: stretch; }
.controls { padding: 42px; background: #fff; }
.control-group + .control-group { margin-top: 42px; }
.control-group label { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 20px; font-weight: 600; }
.control-group output { color: var(--muted); font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; accent-color: var(--ink); }
.range-labels { display: flex; justify-content: space-between; margin-top: 8px; color: #858a85; font-size: .75rem; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 42px 0 0; padding: 0; border: 0; }
.mode-switch legend { margin-bottom: 14px; font-weight: 600; }
.mode-choice { min-height: 48px; border: 1px solid var(--line); color: var(--ink); background: #fff; cursor: pointer; }
.mode-choice.active { color: var(--ink); background: var(--lime); border-color: var(--ink); }
.result { position: relative; padding: 42px; color: #fff; background: var(--ink); overflow: hidden; }
.result::before { content: ""; position: absolute; width: 250px; height: 250px; right: -100px; top: -100px; border: 1px solid rgba(217,255,67,.35); transform: rotate(35deg); }
.result-topline { position: relative; display: flex; justify-content: space-between; gap: 20px; color: rgba(255,255,255,.64); font-size: .8rem; }
.score-wrap { display: flex; align-items: baseline; gap: 12px; margin-top: 54px; }
.score-wrap strong { font-size: clamp(4.5rem, 8vw, 7.8rem); line-height: .8; font-weight: 500; color: var(--lime); font-variant-numeric: tabular-nums; }
.score-wrap span { color: rgba(255,255,255,.55); }
.score-track { height: 4px; margin: 34px 0; background: rgba(255,255,255,.14); }
.score-track span { display: block; height: 100%; width: 72.6%; background: var(--lime); transition: width .35s ease; }
.result h3 { margin: 0; font-size: 1.8rem; font-weight: 500; }
.result > p { max-width: 560px; color: rgba(255,255,255,.66); line-height: 1.55; }
.formula { margin-top: 30px; padding: 14px; border: 1px solid rgba(255,255,255,.18); color: var(--blue); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; overflow-wrap: anywhere; }
.result-actions { display: flex; align-items: center; gap: 20px; margin-top: 34px; }
.result .button-dark { color: var(--ink); background: #fff; }
.text-button { padding: 10px 0; border: 0; color: rgba(255,255,255,.7); background: transparent; text-decoration: underline; cursor: pointer; }
.source-note { display: grid; grid-template-columns: 2fr 1fr; gap: 100px; align-items: end; }
.source-note blockquote { margin: 0; }
.source-note blockquote p { margin: 0; font-size: clamp(2.3rem, 4.8vw, 5rem); line-height: 1.02; font-weight: 500; }
.source-note > div { color: var(--muted); line-height: 1.65; }
.footer { min-height: 88svh; padding: 150px max(24px, calc((100vw - 1180px) / 2)) 34px; color: #fff; background: #090b09; display: grid; grid-template-columns: 1fr auto; gap: 70px; align-items: center; }
.footer h2 { max-width: 940px; }
.footer-line { grid-column: 1 / -1; align-self: end; display: flex; justify-content: space-between; gap: 24px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.2); color: rgba(255,255,255,.55); font-size: .8rem; }

@media (max-width: 850px) {
  .nav { grid-template-columns: 1fr auto; width: calc(100% - 24px); top: 12px; }
  .nav-links { display: none; }
  .hero { min-height: 90svh; }
  .hero-content { width: calc(100% - 28px); padding-top: 80px; }
  .hero h1 { font-size: clamp(3rem, 14vw, 5.5rem); }
  .hero-copy { max-width: 560px; }
  .chapter { padding: 112px 18px; }
  .section-heading, .mode-intro, .lab-heading, .source-note { grid-template-columns: 1fr; gap: 26px; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .mode-accordion { min-height: 520px; }
  .lab-layout { grid-template-columns: 1fr; }
  .result { min-height: 560px; }
  .footer { min-height: 82svh; grid-template-columns: 1fr; align-content: center; }
}

@media (max-width: 520px) {
  .brand { font-size: .9rem; }
  .nav-cta { padding: 10px 12px; }
  .hero h1 { font-size: clamp(3rem, 14vw, 4.4rem); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .scroll-cue { display: none; }
  .bento { grid-template-columns: 1fr; }
  .span-two { grid-column: span 1; }
  .mode-accordion { min-height: 600px; flex-direction: column; }
  .mode-panel { min-height: 150px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.2); }
  .mode-panel:last-child { border-bottom: 0; }
  .mode-detail { opacity: 1; transform: none; }
  .controls, .result { padding: 28px 22px; }
  .mode-switch { grid-template-columns: 1fr; }
  .result-actions { align-items: stretch; flex-direction: column; }
  .footer-line { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
