:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5d6876;
  --paper: #f7f2e8;
  --panel: #fffaf0;
  --line: #d8cdb7;
  --green: #0f766e;
  --lime: #9fb33d;
  --coral: #c74d3f;
  --violet: #684b9b;
  --blue: #2f6f9f;
  --shadow: 0 22px 60px rgba(38, 31, 20, .14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(199, 77, 63, .14), transparent 28rem),
    radial-gradient(circle at 88% 16%, rgba(15, 118, 110, .16), transparent 24rem),
    linear-gradient(135deg, #f7f2e8 0%, #eef5f1 50%, #f8efe1 100%);
  line-height: 1.6;
}

img,
svg {
  max-width: 100%;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: .5rem;
  transform: translateY(-150%);
  background: var(--ink);
  color: var(--paper);
  padding: .7rem 1rem;
  border-radius: .5rem;
  z-index: 20;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(23, 32, 42, .12);
  background: rgba(247, 242, 232, .84);
  backdrop-filter: blur(16px);
}

.nav-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fffaf0;
  background: linear-gradient(135deg, var(--green), var(--violet));
  border: 2px solid rgba(23, 32, 42, .18);
  box-shadow: 5px 5px 0 rgba(23, 32, 42, .18);
  font-weight: 800;
  letter-spacing: .04em;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: .82rem;
}

.nav-toggle {
  display: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  padding: .6rem .8rem;
  border-radius: .45rem;
  font-weight: 700;
  font-size: .92rem;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--ink);
  background: rgba(15, 118, 110, .12);
}

.hero,
.section {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  min-height: 640px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding: 5rem 0 4rem;
}

.eyebrow {
  margin: 0 0 .8rem;
  color: var(--coral);
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .78rem;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(3.1rem, 8vw, 6.8rem);
  line-height: .9;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 .6rem;
  font-size: 1.1rem;
  line-height: 1.25;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions,
.visit-section {
  display: flex;
  align-items: center;
  gap: .8rem;
  flex-wrap: wrap;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .78rem 1rem;
  border-radius: .5rem;
  border: 2px solid var(--ink);
  text-decoration: none;
  font-weight: 800;
  box-shadow: 4px 4px 0 rgba(23, 32, 42, .18);
}

.button-primary {
  background: var(--green);
  color: #fffaf0;
}

.button-secondary {
  background: var(--panel);
}

.terminal-card,
.lab-panel,
.exhibit-card,
.headers-grid article,
.timeline article {
  border: 2px solid rgba(23, 32, 42, .18);
  background: rgba(255, 250, 240, .82);
  box-shadow: var(--shadow);
}

.terminal-card {
  overflow: hidden;
  transform: rotate(1.2deg);
}

.game-feature {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(380px, 1.08fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  margin-top: 5rem;
  padding: clamp(2rem, 5vw, 4.5rem) 0;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

.game-feature-copy .section-lead { max-width: 58ch; }

.game-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.game-facts li { min-width: 0; padding: .8rem .6rem; }
.game-facts li + li { border-left: 1px solid var(--line); }
.game-facts strong, .game-facts span { display: block; }
.game-facts strong { font-size: 1.25rem; }
.game-facts span { color: var(--muted); font-size: .78rem; }

.game-feature-visual {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border: 2px solid #243930;
  background:
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(50, 230, 161, .09) 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(50, 230, 161, .09) 40px),
    #0b1711;
  box-shadow: var(--shadow);
}

.route { position: absolute; border: 14px solid #1f332a; }
.route-a { inset: 54px 72px 118px 54px; }
.route-b { inset: 152px 148px 48px 190px; }

.arena-node {
  position: absolute;
  width: 58px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 3px solid #07100d;
  color: #07100d;
  font: 900 .8rem ui-monospace, monospace;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .55);
}

.node-a { left: 13%; top: 18%; background: #32e6a1; transform: rotate(-8deg); }
.node-b { right: 16%; top: 30%; background: #ff6b5f; transform: rotate(7deg); }
.node-c { left: 47%; bottom: 20%; background: #55b7ff; transform: rotate(3deg); }

.arena-pulse { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #ffd166; box-shadow: 0 0 18px #ffd166; }
.pulse-a { left: 39%; top: 37%; }
.pulse-b { right: 30%; bottom: 31%; }

.arena-label { position: absolute; right: 1rem; bottom: .8rem; color: #e9f5ee; text-align: right; font-family: ui-monospace, monospace; }
.arena-label small, .arena-label strong { display: block; }
.arena-label small { color: #32e6a1; }

.terminal-top {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem .9rem;
  background: var(--ink);
  color: var(--paper);
}

.terminal-top span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--coral);
}

.terminal-top span:nth-child(2) {
  background: var(--lime);
}

.terminal-top span:nth-child(3) {
  background: var(--blue);
}

.terminal-top strong {
  margin-left: .35rem;
  font-size: .82rem;
}

pre {
  margin: 0;
  padding: 1.2rem;
  overflow-x: auto;
  white-space: pre-wrap;
  color: #d7f7d0;
  background: #182017;
  font: 500 .92rem/1.55 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.intro-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 0 0 4rem;
}

.stat {
  padding: 1rem;
  border-left: 5px solid var(--green);
  background: rgba(255, 250, 240, .62);
}

.stat strong {
  display: block;
  font-size: 1.75rem;
  line-height: 1;
}

.stat span {
  color: var(--muted);
}

.section {
  padding: 4rem 0;
}

.section-heading {
  max-width: 780px;
  margin-bottom: 1.6rem;
}

.exhibit-grid,
.headers-grid,
.lab-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.exhibit-card,
.headers-grid article,
.lab-panel {
  padding: 1.15rem;
}

.exhibit-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  background: #fff;
}

.exhibit-card p,
.headers-grid p,
.lab-panel p,
.timeline p,
.visit-section p {
  color: var(--muted);
  margin: 0;
}

.timeline-section {
  width: 100%;
  max-width: none;
  background:
    linear-gradient(90deg, rgba(23, 32, 42, .05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(23, 32, 42, .05) 1px, transparent 1px),
    rgba(15, 118, 110, .08);
  background-size: 28px 28px;
  padding-inline: max(1rem, calc((100% - 1180px) / 2));
}

.timeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(180px, 1fr));
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: .5rem;
}

.timeline article {
  min-width: 180px;
  padding: 1rem;
}

.timeline time {
  display: inline-block;
  margin-bottom: .7rem;
  color: var(--paper);
  background: var(--violet);
  padding: .2rem .5rem;
  font-weight: 900;
}

.lab-grid {
  align-items: start;
}

.lab-panel {
  min-height: 100%;
}

label {
  display: block;
  margin: 1rem 0 .35rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 2px solid rgba(23, 32, 42, .35);
  border-radius: .45rem;
  padding: .68rem .8rem;
  color: var(--ink);
  background: #fffdf8;
  font: inherit;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
.button:focus-visible {
  outline: 3px solid rgba(199, 77, 63, .42);
  outline-offset: 2px;
}

.meter {
  height: 12px;
  margin: .8rem 0;
  overflow: hidden;
  border: 1px solid rgba(23, 32, 42, .22);
  background: rgba(23, 32, 42, .08);
}

.meter span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--coral);
  transition: width .2s ease, background-color .2s ease;
}

.result {
  min-height: 3.2rem;
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: .5rem;
}

.check-list li {
  padding: .65rem .7rem;
  background: rgba(47, 111, 159, .09);
  border-left: 4px solid var(--blue);
}

.check-list li.warn {
  background: rgba(199, 77, 63, .1);
  border-left-color: var(--coral);
}

.headers-output {
  margin-top: 1rem;
  min-height: 220px;
}

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

.headers-grid article {
  box-shadow: none;
}

.headers-grid article:nth-child(odd) {
  border-left: 6px solid var(--green);
}

.headers-grid article:nth-child(even) {
  border-left: 6px solid var(--coral);
}

.visit-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .72fr);
  align-items: start;
  gap: 2rem;
  padding-bottom: 5rem;
}

.visit-section > div {
  max-width: 760px;
}

.visit-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .65rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.curator-feedback {
  position: relative;
  padding: 1.2rem;
  border: 2px solid var(--ink);
  border-radius: .45rem;
  background: var(--panel);
  box-shadow: 7px 7px 0 rgba(23, 32, 42, .14);
}

.curator-feedback h3 {
  margin-bottom: .2rem;
  font-size: 1.35rem;
}

.curator-feedback label span {
  color: var(--muted);
  font-weight: 500;
}

.curator-feedback .button {
  width: 100%;
  margin-top: .85rem;
}

.curator-feedback .button:disabled {
  cursor: wait;
  opacity: .65;
}

.feedback-trap {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.curator-feedback .feedback-privacy {
  margin-top: .75rem;
  font-size: .78rem;
  line-height: 1.45;
}

.curator-feedback .feedback-status {
  margin-top: .8rem;
  padding: .65rem .75rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: #fffaf0;
  font-weight: 800;
}

.curator-feedback .feedback-status[data-state="success"] {
  border-left: 6px solid var(--green);
}

.curator-feedback .feedback-status[data-state="error"] {
  border-left: 6px solid var(--coral);
}

.retro-return-link {
  border: 2px solid var(--ink);
  color: var(--paper) !important;
  background: var(--violet);
}

.site-footer {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--paper);
  background: var(--ink);
}

.site-footer p {
  margin: .25rem 0;
}

.site-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  flex-wrap: wrap;
  font-size: .8rem;
}

.site-footer a {
  color: var(--paper);
}

.retro-cookie-panel {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 2000;
  display: none;
  width: min(720px, calc(100% - 1rem));
  max-height: calc(100dvh - 1rem);
  overflow: auto;
  transform: translateX(-50%);
  border: 2px solid var(--ink);
  color: var(--ink);
  background: var(--panel);
  box-shadow: 8px 8px 0 rgba(23, 32, 42, .32);
}

.retro-cookie-panel.is-visible {
  display: block;
}

.retro-cookie-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .4rem .55rem;
  color: var(--paper);
  background: var(--violet);
}

.retro-cookie-titlebar button {
  width: 30px;
  min-height: 28px;
  padding: 0;
  border: 1px solid var(--paper);
  color: var(--paper);
  background: transparent;
  font-weight: 900;
}

.retro-cookie-main {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: .75rem;
  align-items: center;
  padding: .9rem;
}

.retro-cookie-main h2 {
  margin: 0 0 .3rem;
  font-size: 1.1rem;
}

.retro-cookie-main p {
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
}

.retro-cookie-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  color: var(--paper);
  background: var(--green);
  font: 900 1rem/1 ui-monospace, monospace;
}

.retro-cookie-settings {
  margin: 0 .9rem .9rem;
  padding: .75rem;
  border: 1px solid rgba(23, 32, 42, .35);
  background: #fffaf0;
}

.retro-cookie-settings label {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: .45rem 0 .1rem;
}

.retro-cookie-settings input {
  width: auto;
  min-height: auto;
}

.retro-cookie-settings small {
  display: block;
  margin-left: 1.5rem;
  color: var(--muted);
}

.retro-cookie-provider {
  font-size: .75rem;
}

.retro-cookie-actions {
  display: flex;
  justify-content: flex-end;
  gap: .45rem;
  flex-wrap: wrap;
  padding: .7rem .9rem;
  border-top: 1px solid rgba(23, 32, 42, .25);
}

.retro-cookie-actions button {
  min-height: 40px;
  padding: .5rem .75rem;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: #fffaf0;
  font-weight: 900;
}

.retro-cookie-actions [data-cookie-accept],
.retro-cookie-actions [data-cookie-save] {
  color: var(--paper);
  background: var(--green);
}

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 42px;
    border: 2px solid rgba(23, 32, 42, .25);
    background: var(--panel);
    font: inherit;
    font-weight: 800;
    padding: .55rem .7rem;
  }

  .nav-toggle span,
  .nav-toggle span::before,
  .nav-toggle span::after {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    content: "";
  }

  .nav-toggle span::before {
    transform: translateY(-6px);
  }

  .nav-toggle span::after {
    transform: translateY(4px);
  }

  .nav-links {
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: 76px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: .6rem;
    border: 2px solid rgba(23, 32, 42, .18);
    background: var(--panel);
    box-shadow: var(--shadow);
  }

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

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 3rem;
  }

  .terminal-card {
    transform: none;
  }

  .game-feature {
    grid-template-columns: 1fr;
  }

  .intro-band,
  .exhibit-grid,
  .headers-grid,
  .lab-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .brand small {
    display: none;
  }

  .brand strong {
    font-size: .92rem;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  h1 {
    font-size: clamp(2.55rem, 16vw, 4rem);
  }

  .hero-actions,
  .visit-section {
    align-items: stretch;
    flex-direction: column;
  }

  .visit-section {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .visit-actions {
    width: 100%;
  }

  .retro-cookie-main {
    grid-template-columns: 1fr;
  }

  .retro-cookie-icon {
    display: none;
  }

  .retro-cookie-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .retro-cookie-actions button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
