/* OpenNPC — ink on paper. Two faces: Bebas Neue for names, a monospace for everything technical. */

@font-face {
  font-family: "Bebas Neue";
  src: url("assets/fonts/BebasNeue-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "DejaVu Sans Mono";
  src: url("assets/fonts/DejaVuSansMono.ttf") format("truetype");
  font-display: swap;
}

:root {
  --ink: #111111;
  --paper: #f3f1ec;
  --white: #ffffff;
  --muted: #7d7a73;
  --rule: 3px;
  --display: "Bebas Neue", "Oswald", "Arial Narrow", Impact, sans-serif;
  --mono: "DejaVu Sans Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --measure: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--mono);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
code, kbd { font-family: var(--mono); }
img { max-width: 100%; display: block; }

.display { font-family: var(--display); letter-spacing: 0.02em; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.big { font-size: 22px; }

/* ------------------------------------------------------------------ bar */
.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 24px;
  background: var(--paper);
  border-bottom: var(--rule) solid var(--ink);
}
.bar__mark { font: 30px/1 var(--display); text-decoration: none; }
.bar__nav { display: flex; gap: 22px; font-size: 13px; text-transform: uppercase; }
.bar__nav a { text-decoration: none; }
.bar__nav a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }

/* ----------------------------------------------------------------- hero */
.hero { text-align: center; padding: 48px 20px 72px; }
.hero__stage { position: relative; max-width: var(--measure); margin: 0 auto; }
.hero__crowd { position: absolute; inset: -6% 0; width: 100%; height: 112%; }
.hero__title {
  position: relative;
  margin: 0;
  font: clamp(96px, 20vw, 260px)/0.9 var(--display);
  letter-spacing: 0.01em;
  /* paper keyline: people walking behind get cut cleanly around the letters, as in the logo */
  -webkit-text-stroke: 14px var(--paper);
  paint-order: stroke fill;
}
.hero__lede { margin: 28px 0 6px; font: 34px/1.1 var(--display); letter-spacing: 0.03em; }
.hero__copy { margin: 0 0 30px; }

/* --------------------------------------------------------------- button */
.button {
  display: inline-block;
  font: 26px/1 var(--display);
  letter-spacing: 0.06em;
  padding: 14px 26px 11px;
  color: var(--paper);
  background: var(--ink);
  border: var(--rule) solid var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform 80ms ease;
}
.button:hover { background: var(--paper); color: var(--ink); }
.button:active { transform: translate(2px, 2px); }
.button:focus-visible { outline: 3px dashed var(--ink); outline-offset: 4px; }
.button--large { font-size: 34px; padding: 18px 34px 14px; }
.button--small { font-size: 18px; padding: 8px 14px 6px; }
.button:disabled { opacity: 0.35; cursor: default; }

/* -------------------------------------------------------------- section */
.section { max-width: var(--measure); margin: 0 auto; padding: 56px 20px; border-top: var(--rule) solid var(--ink); }
.section__head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 22px; }
.section h2 { margin: 0; font: 56px/1 var(--display); letter-spacing: 0.02em; }
.section h3 { font: 28px/1 var(--display); margin: 0 0 10px; letter-spacing: 0.03em; }
.section--split { display: grid; grid-template-columns: 1fr 1.3fr; gap: 48px; }
.copy { max-width: 62ch; margin-top: 28px; }

/* --------------------------------------------------------------- player */
.player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--paper);
  border: var(--rule) solid var(--ink);
  overflow: hidden;
}
.player__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: var(--paper); }
.player__poster, .player__loading, .player__error {
  position: absolute; inset: 0;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  text-align: center; padding: 24px;
}
.player__poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.02); opacity: 0.45; }
.player__poster > :not(img) { position: relative; }
.player[data-state="idle"] .player__poster,
.player[data-state="loading"] .player__loading,
.player[data-state="error"] .player__error { display: flex; }
.player[data-state="loading"] .player__loading,
.player[data-state="error"] .player__error { background: var(--paper); }
.player__error .display { font-size: 44px; margin: 0; }
.player__error code { background: var(--white); padding: 1px 5px; border: 1px solid var(--ink); }

.progress { width: min(460px, 80%); height: 22px; border: var(--rule) solid var(--ink); background: var(--white); }
.progress__fill { height: 100%; width: 0; background: var(--ink); transition: width 120ms linear; }
.dots::after { content: ""; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

.player__bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; flex-wrap: wrap; }
.keys { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; margin: 0; padding: 0; font-size: 13px; text-transform: uppercase; }
kbd {
  display: inline-block; min-width: 1.8em; text-align: center;
  padding: 1px 6px; margin-right: 4px;
  background: var(--white); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink);
  font-size: 12px; text-transform: uppercase;
}
.try { margin: 4px 0 0; }

/* -------------------------------------------------------------- answers */
.question { font-size: 44px; margin: 0 0 22px; }
.answers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.answer { position: relative; padding-top: 34px; }
.answer__name {
  position: absolute; top: 0; left: 0;
  font: 22px/1 var(--display); letter-spacing: 0.04em;
  color: var(--paper); background: var(--ink); padding: 6px 10px 3px;
}
.answer__bubble {
  margin: 0; padding: 14px 16px;
  background: var(--white); border: var(--rule) solid var(--ink);
  font-size: 14px; min-height: 108px;
}
.answer__meta { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ------------------------------------------------------------- pipeline */
.pipeline { list-style: none; margin: 24px 0 0; padding: 0; counter-reset: step; }
.pipeline li {
  position: relative;
  border: var(--rule) solid var(--ink); background: var(--white);
  padding: 12px 16px 8px; margin-bottom: 34px;
}
.pipeline li:not(:last-child)::after {
  content: "↓"; position: absolute; left: 50%; bottom: -32px; transform: translateX(-50%);
  font: 24px/1 var(--mono);
}
.pipeline span { font: 30px/1 var(--display); letter-spacing: 0.05em; display: block; }
.pipeline small { font-size: 12px; color: var(--muted); }
.pipeline__core { background: var(--ink) !important; color: var(--paper); }
.pipeline__core small { color: #b9b6ae; }

.code {
  margin: 0 0 26px; padding: 16px 18px;
  background: var(--ink); color: var(--paper);
  font-size: 13px; line-height: 1.5; overflow-x: auto;
}
.stack { min-width: 0; }

/* --------------------------------------------------------------- footer */
.footer { border-top: var(--rule) solid var(--ink); text-align: center; padding: 36px 20px 48px; }
.footer .display { font-size: 48px; margin: 0; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 860px) {
  .section--split { grid-template-columns: 1fr; }
  .answers { grid-template-columns: 1fr; }
  .section h2 { font-size: 42px; }
  .bar__nav { gap: 12px; }
  .hero__title { -webkit-text-stroke-width: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dots::after { animation: none; content: "..."; }
}
.player__note { background: var(--paper); padding: 2px 8px; }
