@import url('https://fonts.googleapis.com/css2?family=Alfa+Slab+One&family=Archivo:ital,wght@0,400;0,500;0,600;0,800;1,500&display=swap');

:root {
  color-scheme: light;
  /* Retro poster palette */
  --paper: #f3e7d0;
  --paper-2: #fdf6e4;
  --ink: #2b1c10;
  --poster-red: #d7431f;
  --poster-red-dark: #c23a18;
  --mustard: #e8a33d;
  --teal: #2e6f6c;
  --font-display: "Alfa Slab One", "Archivo", serif;
  /* Legacy token names mapped onto the retro palette */
  --bg: var(--paper);
  --panel: var(--paper-2);
  --panel-2: #ecdcbd;
  --line: rgba(43, 28, 16, 0.3);
  --line-strong: var(--ink);
  --text: var(--ink);
  --muted: rgba(43, 28, 16, 0.72);
  --dim: rgba(43, 28, 16, 0.55);
  --red: var(--poster-red);
  --amber: var(--mustard);
  --green: var(--poster-red);
  --blue: var(--teal);
  --shadow: 5px 5px 0 rgba(43, 28, 16, 0.85);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Archivo", ui-sans-serif, -apple-system, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at 50% 30%, rgba(232, 163, 61, 0.16), transparent 56%),
    var(--paper);
  color: var(--ink);
  line-height: 1.5;
  overflow-x: hidden;
}

/* Halftone dots + paper vignette */
body::before {
  content: "";
  display: block;
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(43, 28, 16, 0.1) 1px, transparent 1.4px),
    radial-gradient(circle at 50% 50%, transparent 58%, rgba(43, 28, 16, 0.14) 130%);
  background-size: 14px 14px, 100% 100%;
}

/* Print grain over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: multiply;
  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'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

a {
  color: inherit;
}

.app-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(18px, 4vw, 48px);
  border-bottom: 4px double var(--ink);
  background: rgba(243, 231, 208, 0.94);
}

.brand {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 16px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-links a {
  color: rgba(43, 28, 16, 0.72);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: color 160ms ease;
}

.nav-links a:hover {
  color: var(--poster-red);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  padding: 8px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--paper-2);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform 200ms ease, opacity 200ms ease;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.page {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100vw - 36px));
  margin: 0 auto;
  padding: clamp(36px, 7vw, 86px) 0 72px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
  gap: clamp(24px, 5vw, 54px);
  align-items: end;
}

.eyebrow {
  color: var(--poster-red);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.eyebrow::before {
  content: "★ ";
}

.display {
  margin: 12px 0 0;
  max-width: 900px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 7.6vw, 96px);
  letter-spacing: 0.01em;
  line-height: 1.0;
  text-transform: uppercase;
  color: var(--poster-red);
  text-shadow:
    0.035em 0.035em 0 var(--paper-2),
    0.07em 0.07em 0 var(--ink);
}

.lede {
  margin: 22px 0 0;
  max-width: 660px;
  color: rgba(43, 28, 16, 0.78);
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 500;
  font-style: italic;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 3px solid var(--ink);
  border-radius: 6px;
  background: var(--paper-2);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
  background: var(--paper-2);
}

.button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.button.primary {
  background: var(--poster-red);
  color: var(--paper-2);
}

.button.primary:hover {
  background: var(--poster-red-dark);
}

.panel {
  border: 3px solid var(--ink);
  background: var(--paper-2);
  box-shadow: 6px 6px 0 rgba(43, 28, 16, 0.85);
  border-radius: 8px;
}

.content-panel {
  padding: clamp(22px, 4vw, 42px);
}

.stage {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background:
    repeating-conic-gradient(from 0deg at 50% 60%, rgba(232, 163, 61, 0.2) 0deg 7.5deg, transparent 7.5deg 15deg),
    linear-gradient(180deg, transparent 52%, rgba(43, 28, 16, 0.6)),
    var(--teal);
  box-shadow: 6px 6px 0 rgba(43, 28, 16, 0.85);
}

.stage::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 2px dashed rgba(253, 246, 228, 0.4);
  border-radius: 4px;
}

.stage-stack {
  position: absolute;
  right: clamp(16px, 5vw, 52px);
  bottom: clamp(16px, 5vw, 52px);
  display: grid;
  grid-template-columns: repeat(2, minmax(96px, 1fr));
  gap: 10px;
  width: min(360px, 70%);
}

.tile {
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--paper-2);
}

.tile::after {
  content: "";
  display: block;
  width: 34%;
  height: 3px;
  margin: 12px;
  background: rgba(43, 28, 16, 0.35);
}

.tile:nth-child(2) {
  background: var(--mustard);
}

.tile:nth-child(3) {
  background: var(--poster-red);
}

.tile:nth-child(4) {
  background: var(--teal);
}

.stage-copy {
  position: absolute;
  left: clamp(18px, 5vw, 48px);
  bottom: clamp(18px, 5vw, 48px);
  z-index: 1;
  max-width: 360px;
}

.stage-copy strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(32px, 6vw, 64px);
  font-weight: 400;
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--paper-2);
  text-shadow: 0.05em 0.05em 0 var(--ink);
}

.stage-copy span {
  display: block;
  margin-top: 10px;
  color: rgba(253, 246, 228, 0.85);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stage-strip {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(8, minmax(18px, 1fr));
  gap: 8px;
}

.stage-strip span {
  height: 8px;
  border: 1px solid rgba(43, 28, 16, 0.4);
  background: rgba(253, 246, 228, 0.3);
}

.stage-strip span:nth-child(2n) {
  background: var(--mustard);
}

.stage-strip span:nth-child(3n) {
  background: var(--poster-red);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric {
  min-height: 160px;
  padding: 20px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--paper-2);
  box-shadow: 5px 5px 0 rgba(43, 28, 16, 0.85);
}

.metric b {
  display: block;
  color: var(--poster-red);
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 400;
  line-height: 1;
}

.metric span {
  display: block;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section {
  margin-top: clamp(48px, 8vw, 92px);
}

.section h2 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 4.2vw, 52px);
  line-height: 1.08;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--ink);
  text-shadow: 0.05em 0.05em 0 rgba(232, 163, 61, 0.55);
}

.copy {
  max-width: 760px;
  color: rgba(43, 28, 16, 0.75);
  font-size: 18px;
  font-weight: 500;
}

.stack {
  display: grid;
  gap: 18px;
}

.system-list {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.system-list div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px 0;
  border-top: 2px dashed rgba(43, 28, 16, 0.4);
}

.system-list b {
  color: var(--poster-red);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.system-list span {
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

.debug-panel {
  margin-top: 28px;
  padding: 18px;
  overflow: auto;
  color: var(--muted);
}

.footer {
  position: relative;
  z-index: 1;
  padding: 28px;
  border-top: 4px double var(--ink);
  color: var(--dim);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
}

.footer::before {
  content: "★ ";
  color: var(--poster-red);
}

.footer::after {
  content: " ★";
  color: var(--poster-red);
}

code {
  color: var(--poster-red);
  font-weight: 700;
}

@media (max-width: 820px) {
  .app-nav {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0;
    margin-top: 14px;
    padding-top: 6px;
    border-top: 2px dashed rgba(43, 28, 16, 0.4);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 13px 0;
    font-size: 14px;
  }

  .grid.three {
    grid-template-columns: 1fr;
  }

  .stage {
    min-height: 520px;
  }

  .stage-stack {
    width: 82%;
    opacity: 0.68;
  }
}
