:root {
  --paper: #13162a;
  --paper-2: #1c2038;
  --paper-3: #272b46;
  --ink: #f0e7d6;
  --ink-2: #c7bda8;
  --ink-3: #9e977f;
  --rule: rgba(240, 231, 214, 0.12);
  --rule-soft: rgba(240, 231, 214, 0.06);
  --amber: #e8b56b;
  --amber-deep: #c98a3a;
  --coral: #e89485;
  --dusk: #7b8aae;
  --green: #9bb87a;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --glow: 0 0 48px rgba(232, 181, 107, 0.2);
  --font: "Cabinet Grotesk", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Consolas, ui-monospace, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 18%, rgba(232, 181, 107, 0.12), transparent 24rem),
    radial-gradient(circle at 80% 8%, rgba(123, 138, 174, 0.14), transparent 22rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--font);
  letter-spacing: -0.005em;
  text-rendering: optimizeLegibility;
}

body.panel-open { overflow: hidden; }

a { color: inherit; }
img, video { max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; border-radius: 10px; }
.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 50;
  transform: translateY(-160%);
  background: var(--amber);
  color: var(--paper);
  padding: 0.75rem 1rem;
  border-radius: 999px;
  font-weight: 800;
}
.skip-link:focus { transform: translateY(0); }
.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3.5rem);
  border-bottom: 1px solid transparent;
  transition: background 200ms var(--ease), border-color 200ms var(--ease), backdrop-filter 200ms var(--ease);
}
.site-header[data-elevated="true"], .site-header.compact {
  background: rgba(19, 22, 42, 0.82);
  backdrop-filter: blur(18px);
  border-color: var(--rule);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  min-height: 44px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(232, 181, 107, 0.44);
  border-radius: 14px;
  background: rgba(232, 181, 107, 0.1);
  color: var(--amber);
  font-weight: 900;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 0.95rem; }
.brand small { color: var(--ink-3); font-size: 0.72rem; margin-top: 0.12rem; }
.nav { display: flex; align-items: center; gap: clamp(0.4rem, 2vw, 1.1rem); flex-wrap: wrap; justify-content: flex-end; }
.nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.86rem;
  transition: color 180ms var(--ease), background 180ms var(--ease);
}
.nav a:hover { color: var(--ink); background: rgba(240, 231, 214, 0.07); }

.hero {
  position: relative;
  min-height: calc(100svh - 78px);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(290px, 0.62fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding: clamp(4rem, 10vw, 8rem) clamp(1.25rem, 5vw, 6rem) clamp(5rem, 9vw, 7rem);
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.42;
  filter: saturate(0.8) contrast(1.1);
}
.hero-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(19, 22, 42, 0.96), rgba(19, 22, 42, 0.72) 48%, rgba(19, 22, 42, 0.9)),
    linear-gradient(180deg, rgba(19, 22, 42, 0.2), var(--paper) 92%);
}
.grid-field {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(240, 231, 214, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240, 231, 214, 0.055) 1px, transparent 1px);
  background-size: 84px 84px;
  mask-image: radial-gradient(circle at 52% 45%, black, transparent 74%);
}
.hero-copy, .proof-console { position: relative; z-index: 1; }
.eyebrow, .section-kicker {
  color: var(--amber);
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-block-start: 0; }
h1 {
  max-width: 13.5ch;
  margin-block-end: 1.35rem;
  font-size: clamp(3.1rem, 7.6vw, 7.6rem);
  line-height: 0.91;
  letter-spacing: -0.052em;
}
h2 {
  margin: 0;
  font-size: clamp(2.3rem, 5vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
}
h3 { font-size: clamp(1.2rem, 2vw, 1.55rem); line-height: 1.04; margin-block-end: 0.8rem; }
.lede {
  max-width: 66ch;
  color: var(--ink-2);
  font-size: clamp(1.08rem, 1.6vw, 1.35rem);
  line-height: 1.55;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2rem; }
.button, .ghost-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  padding: 0.86rem 1rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 180ms var(--ease), background 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease);
}
.button:hover, .ghost-button:hover { transform: translateY(-2px); }
.button.primary { background: var(--amber); color: var(--paper); box-shadow: var(--glow); }
.button.secondary, .ghost-button { border: 1px solid var(--rule); color: var(--ink); background: rgba(240, 231, 214, 0.06); }
.ghost-button { cursor: pointer; font: inherit; font-size: 0.9rem; }
.artifact-rail {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0;
  margin: 1.1rem 0 0;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.artifact-rail li {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  min-height: 34px;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--rule-soft);
  border-radius: 999px;
  background: rgba(240, 231, 214, 0.045);
}
.artifact-rail span { color: var(--amber); }

.proof-console {
  justify-self: end;
  width: min(100%, 430px);
  border: 1px solid rgba(232, 181, 107, 0.22);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(19, 22, 42, 0.72), rgba(39, 43, 70, 0.58));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
}
.console-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--rule);
  padding: 0.9rem 1rem;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.76rem;
}
.console-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--coral); }
.console-bar span:nth-child(2) { background: var(--amber); }
.console-bar span:nth-child(3) { background: var(--green); }
.console-bar strong { margin-left: auto; color: var(--ink-2); font-weight: 600; }
.proof-stats { margin: 0; padding: 1.1rem; display: grid; gap: 0.8rem; }
.proof-stats div {
  padding: 1rem;
  border: 1px solid var(--rule-soft);
  border-radius: 18px;
  background: rgba(240, 231, 214, 0.045);
}
.proof-stats dt { color: var(--ink); font-weight: 900; margin-bottom: 0.28rem; }
.proof-stats dd { margin: 0; color: var(--ink-2); line-height: 1.45; }
.verify-strip {
  list-style: none;
  display: grid;
  gap: 0.42rem;
  margin: 0;
  padding: 0 1.1rem 1.1rem;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.verify-strip li {
  position: relative;
  padding-left: 1rem;
}
.verify-strip li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 18px rgba(155, 184, 122, 0.5);
}

.section { padding: clamp(4.5rem, 9vw, 8rem) clamp(1.25rem, 5vw, 6rem); }
.split-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.52fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: end;
  margin-top: 0.8rem;
  margin-bottom: 2.2rem;
}
.split-heading p, .closing p, .guide-article p, .guide-article li {
  color: var(--ink-2);
  line-height: 1.65;
  font-size: 1.02rem;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.proof-card, .lab-list article, .pipeline li, .guide-grid div {
  border: 1px solid var(--rule);
  border-radius: 24px;
  background: rgba(240, 231, 214, 0.055);
  padding: clamp(1.1rem, 2vw, 1.45rem);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
}
.proof-card {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  transition: transform 220ms var(--ease), border-color 220ms var(--ease), background 220ms var(--ease);
}
.proof-card:hover { transform: translateY(-5px); border-color: rgba(232, 181, 107, 0.36); background: rgba(240, 231, 214, 0.076); }
.proof-card p { color: var(--ink-2); line-height: 1.58; }
.proof-card a, .footer a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  color: var(--amber);
  font-weight: 800;
  text-underline-offset: 0.22em;
}
.proof-card a { margin-top: auto; }
.footer a { margin-block: -0.7rem; }
.label {
  width: max-content;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0.24rem 0.62rem;
  margin-bottom: 1.2rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.real-label { background: rgba(155, 184, 122, 0.14); color: var(--green); border: 1px solid rgba(155, 184, 122, 0.3); }
.concept-label { background: rgba(232, 148, 133, 0.15); color: var(--coral); border: 1px solid rgba(232, 148, 133, 0.34); }
.built-label { background: rgba(232, 181, 107, 0.14); color: var(--amber); border: 1px solid rgba(232, 181, 107, 0.34); }

.lab { background: linear-gradient(180deg, rgba(28, 32, 56, 0.84), rgba(19, 22, 42, 0.94)); }
.lab-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(300px, 0.74fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.lab-shell > div:first-child p { max-width: 62ch; margin-top: 1.4rem; color: var(--ink-2); line-height: 1.65; font-size: 1.08rem; }
.lab-list { display: grid; gap: 1rem; }
.lab-list span { color: var(--amber); font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }
.lab-list p { color: var(--ink-2); line-height: 1.55; margin-bottom: 0; }

.pipeline {
  list-style: none;
  counter-reset: pipe;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
  padding: 0;
  margin: 0;
}
.pipeline li { position: relative; min-height: 180px; }
.pipeline li::before {
  counter-increment: pipe;
  content: "0" counter(pipe);
  display: block;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 0.78rem;
  margin-bottom: 2rem;
}
.pipeline strong { display: block; font-size: 1.15rem; margin-bottom: 0.55rem; }
.pipeline span { color: var(--ink-2); line-height: 1.5; }
.closing {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 0.52fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  background: radial-gradient(circle at 80% 20%, rgba(232, 181, 107, 0.14), transparent 24rem), var(--paper-2);
}

.concept-panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(5, 6, 12, 0.72);
  backdrop-filter: blur(10px);
}
.concept-panel[hidden] { display: none; }
.panel-card {
  position: relative;
  width: min(560px, 100%);
  border: 1px solid rgba(232, 181, 107, 0.28);
  border-radius: 28px;
  background: var(--paper-2);
  padding: clamp(1.35rem, 4vw, 2rem);
  box-shadow: var(--shadow);
}
.panel-card p { color: var(--ink-2); line-height: 1.6; }
.panel-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 42px;
  height: 42px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: rgba(240, 231, 214, 0.06);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.5rem;
}
.mini-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; margin-top: 1.4rem; }
.mini-metrics div { border: 1px solid var(--rule); border-radius: 18px; padding: 1rem; }
.mini-metrics strong { display: block; color: var(--amber); font-size: 1.8rem; }
.mini-metrics span { color: var(--ink-2); font-size: 0.82rem; }
.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--rule);
  padding: 1.4rem clamp(1.25rem, 5vw, 6rem);
  color: var(--ink-3);
}
.footer p { margin: 0; }

.guide-body { background: var(--paper); }
.guide-main { padding: clamp(3rem, 7vw, 6rem) clamp(1.25rem, 5vw, 6rem); }
.guide-article { width: min(920px, 100%); margin: 0 auto; }
.guide-article h1 { max-width: 12ch; font-size: clamp(3.2rem, 8vw, 7.2rem); }
.guide-article section { border-top: 1px solid var(--rule); padding-top: 2rem; margin-top: 2rem; }
.guide-article code { background: rgba(240, 231, 214, 0.08); color: var(--amber); padding: 0.1rem 0.28rem; border-radius: 6px; }
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.2rem; }
.pass-list { color: var(--ink-2); line-height: 1.65; }

@media (max-width: 980px) {
  .hero, .lab-shell, .closing, .split-heading { grid-template-columns: 1fr; }
  .proof-console { justify-self: stretch; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  .nav { justify-content: flex-start; }
  .hero { padding-top: 3rem; }
  h1 { font-size: clamp(3rem, 17vw, 4.5rem); }
  .card-grid, .pipeline, .mini-metrics { grid-template-columns: 1fr; }
  .proof-card { min-height: unset; }
  .hero-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-video { display: none; }
  .hero-media { background: url('proof-foundry.jpg') center / cover no-repeat; }
}
