/* Reboot — palette pulled from the robot photo: daylight room, lilac shell, cream chassis, brass plate */
:root {
  --sky: #dfeaf8;
  --sky-deep: #c6daf2;
  --lilac: #6b4ba8;
  --lilac-dark: #4f3482;
  --screen: #241836;
  --chassis: #f3ead8;
  --chassis-edge: #e2d4b8;
  --brass: #b8873a;
  --brass-light: #d9b06a;
  --phosphor: #8cf2a8;
  --ink: #21182f;
  --ink-soft: #4d4360;
  --white: #ffffff;

  --pixel: "Pixelify Sans", ui-monospace, monospace;
  --text: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;

  --r-shell: 28px;   /* big molded parts */
  --r-part: 14px;    /* buttons, panels */
  --r-chip: 8px;

  --s1: 0.5rem; --s2: 1rem; --s3: 1.5rem; --s4: 2.5rem; --s5: 4rem; --s6: 6.5rem;
  --wrap: min(1180px, 100% - 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--sky);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--lilac-dark); text-underline-offset: 3px; }
a:hover { color: var(--lilac); }
:focus-visible { outline: 3px solid var(--lilac); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { margin: 0; line-height: 1.1; }
p { margin: 0; }

.skip { position: absolute; left: -999px; top: 0; background: var(--white); padding: var(--s1) var(--s2); z-index: 10; }
.skip:focus { left: var(--s2); top: var(--s2); }

/* ---------- marquee (chassis strip) ---------- */
.marquee {
  background: var(--lilac);
  color: var(--chassis);
  font: 600 0.95rem/1 var(--pixel);
  overflow: hidden;
  border-bottom: 3px solid var(--lilac-dark);
}
.marquee__track {
  display: flex; align-items: center; gap: 1.1rem;
  width: max-content;
  padding: 0.6rem 0;
  animation: crawl 38s linear infinite;
}
.marquee__track i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--phosphor);
  box-shadow: 0 0 6px var(--phosphor);
}
@keyframes crawl { to { transform: translateX(-50%); } }

/* ---------- top bar ---------- */
.top {
  width: var(--wrap); margin: var(--s3) auto 0;
  display: flex; align-items: center; gap: var(--s3);
}
.plate {
  font: 700 1.35rem/1 var(--pixel);
  letter-spacing: 0.06em;
  color: #3b2a12; text-decoration: none;
  padding: 0.55rem 0.9rem 0.5rem;
  background: linear-gradient(180deg, var(--brass-light), var(--brass));
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 -2px 0 rgba(0,0,0,.18), 0 2px 0 #8a6326;
  position: relative;
}
.plate::before, .plate::after { /* rivets */
  content: ""; position: absolute; top: 50%; width: 4px; height: 4px; margin-top: -2px;
  border-radius: 50%; background: #7a5420; box-shadow: inset 0 1px 0 rgba(255,255,255,.3);
}
.plate::before { left: 5px; } .plate::after { right: 5px; }
.plate:hover { color: #3b2a12; }
.top__nav { display: flex; gap: var(--s3); margin-left: auto; }
.top__nav a { color: var(--ink); text-decoration: none; font-weight: 600; }
.top__nav a:hover { color: var(--lilac); text-decoration: underline; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 1.2rem;
  border-radius: var(--r-part);
  font: 600 1rem/1 var(--text);
  color: var(--ink); text-decoration: none;
  background: var(--chassis);
  border: 2px solid var(--chassis-edge);
  box-shadow: 0 3px 0 var(--chassis-edge);
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { color: var(--ink); background: var(--white); }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--chassis-edge); }
.btn--primary, .btn--buy {
  background: var(--lilac); color: var(--white);
  border-color: var(--lilac-dark); box-shadow: 0 3px 0 var(--lilac-dark);
}
.btn--primary:hover, .btn--buy:hover { background: var(--lilac-dark); color: var(--white); }
.btn--buy { min-height: 42px; }
.btn:active.btn--primary, .btn:active.btn--buy { box-shadow: 0 0 0 var(--lilac-dark); }

/* ---------- hero ---------- */
.hero {
  width: var(--wrap); margin: var(--s4) auto 0;
  display: grid; grid-template-columns: 1fr 1.05fr; gap: var(--s4);
  align-items: center;
}
.crt {
  background: var(--screen);
  border-radius: var(--r-shell);
  border: 10px solid var(--lilac);
  box-shadow: inset 0 0 0 2px #000, inset 0 0 40px rgba(140,242,168,.08), 0 8px 0 var(--lilac-dark);
  padding: 1.1rem 1.3rem;
  min-height: 11.5rem;
  color: var(--phosphor);
  font-family: var(--pixel);
  position: relative; overflow: hidden;
}
.crt::after { /* scanlines, subtle */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px);
}
.crt__log {
  margin: 0; font: 400 0.95rem/1.45 var(--pixel); white-space: pre-wrap;
  color: rgba(140,242,168,.6);
}
.crt__done {
  font: 700 clamp(1.7rem, 3.4vw, 2.5rem)/1.12 var(--pixel);
  text-shadow: 0 0 10px rgba(140,242,168,.45);
  margin-top: 0.4rem;
  visibility: hidden;
}
.crt.is-done .crt__log { display: none; }
.crt.is-done .crt__done { visibility: visible; margin-top: 0; }

.hero h1 {
  margin-top: var(--s4);
  font: 800 clamp(2.2rem, 4.6vw, 3.6rem)/1.04 var(--text);
  letter-spacing: -0.02em;
  max-width: 14ch;
}
.lede { margin-top: var(--s2); font-size: 1.15rem; max-width: 46ch; color: var(--ink-soft); }
.lede a { font-weight: 600; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: var(--s3); }
.hero__art { margin: 0; }
.hero__art img {
  border-radius: var(--r-shell);
  border: 10px solid var(--white);
  box-shadow: 0 18px 40px -18px rgba(79,52,130,.55);
  transform: rotate(1.2deg);
}

/* ---------- contract chip ---------- */
.ca {
  display: flex; align-items: center; gap: 0.6rem;
  margin-top: var(--s3);
  background: var(--white);
  border: 2px solid var(--chassis-edge);
  border-radius: var(--r-part);
  padding: 0.45rem 0.45rem 0.45rem 0.9rem;
  max-width: 100%;
}
.ca__label { font-weight: 600; color: var(--ink-soft); font-size: 0.9rem; }
.ca__addr {
  font: 400 0.92rem/1.3 ui-monospace, "SF Mono", Menlo, monospace;
  overflow-wrap: anywhere; min-width: 0; flex: 1;
}
.ca__btn {
  font: 600 0.92rem/1 var(--text);
  min-height: 38px; padding: 0 0.9rem; border-radius: 10px; cursor: pointer;
  background: var(--chassis); color: var(--ink); border: 2px solid var(--chassis-edge);
}
.ca__btn:hover { background: var(--sky); }
.ca__btn.is-copied { background: var(--phosphor); border-color: #5ccf7d; }

/* ---------- live readout ---------- */
.readout {
  width: var(--wrap); margin: var(--s5) auto 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--screen);
  border-radius: var(--r-shell);
  border: 10px solid var(--lilac);
  box-shadow: 0 8px 0 var(--lilac-dark);
  color: var(--phosphor);
  padding: var(--s3) var(--s3) var(--s2);
  gap: var(--s2) var(--s3);
}
.readout__item { display: flex; flex-direction: column; gap: 0.2rem; }
.readout__k { font: 600 0.95rem/1.2 var(--text); color: #cbbfe6; }
.readout__v { font: 800 clamp(1.5rem, 2.8vw, 2.2rem)/1.1 var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; text-shadow: 0 0 10px rgba(140,242,168,.35); }
.readout__s { font: 400 0.9rem/1.2 var(--text); color: rgba(140,242,168,.7); }
.readout__note {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.85rem; color: #a99cc6; border-top: 1px solid rgba(203,191,230,.15); padding-top: 0.8rem;
}
.led { width: 9px; height: 9px; border-radius: 50%; background: #8a7da6; flex: none; }
.led.is-on { background: var(--phosphor); box-shadow: 0 0 8px var(--phosphor); }
.led.is-off { background: #f2a08c; }

/* ---------- section headings ---------- */
.log h2, .treasury h2, .wall h2, .get h2 {
  font: 700 clamp(1.9rem, 3.6vw, 2.8rem)/1.05 var(--pixel);
  color: var(--lilac-dark);
}

/* ---------- changelog ---------- */
.log { width: var(--wrap); margin: var(--s6) auto 0; display: grid; grid-template-columns: 1fr 2fr; gap: var(--s4); }
.log__list { list-style: none; margin: 0; padding: 0; border-left: 3px dashed var(--sky-deep); }
.log__list li {
  display: grid; grid-template-columns: 4.5rem 1fr; gap: var(--s2);
  padding: 0 0 var(--s4) var(--s3); position: relative;
}
.log__list li::before {
  content: ""; position: absolute; left: -9px; top: 0.35rem;
  width: 15px; height: 15px; border-radius: 4px; background: var(--lilac);
  box-shadow: 0 0 0 4px var(--sky);
}
.log__list li:last-child { padding-bottom: 0; }
.ver { font: 800 1.15rem/1.5 var(--text); color: var(--lilac); }
.log h3 { font: 800 1.35rem/1.25 var(--text); }
.when { font-size: 0.92rem; color: var(--ink-soft); margin-top: 0.15rem; }
.log__list p:not(.when) { margin-top: 0.5rem; max-width: 60ch; }
.log__next::before { background: var(--sky) !important; border: 3px dashed var(--lilac); }
.log__next .ver, .log__next h3 { color: var(--ink-soft); }

/* ---------- treasury ---------- */
.treasury {
  width: var(--wrap); margin: var(--s6) auto 0;
  background: var(--chassis);
  border-radius: var(--r-shell);
  border: 2px solid var(--chassis-edge);
  box-shadow: 0 8px 0 var(--chassis-edge);
  padding: clamp(1.5rem, 4vw, 3rem);
}
.treasury__head p { margin-top: var(--s1); max-width: 56ch; color: var(--ink-soft); font-size: 1.1rem; }
.split { display: grid; grid-template-columns: 1fr 1fr; margin-top: var(--s4); border-radius: var(--r-part); overflow: hidden; }
.split__half { padding: 1.1rem 1.3rem; font-weight: 600; line-height: 1.35; }
.split__half strong { display: block; font: 800 2.2rem/1 var(--text); margin-bottom: 0.35rem; }
.split__half--burn { background: var(--screen); color: var(--phosphor); }
.split__half--burn strong { color: var(--phosphor); }
.split__half--ops { background: var(--lilac); color: var(--white); }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); margin: var(--s4) 0 0; }
.facts dt { font-size: 0.9rem; color: var(--ink-soft); font-weight: 600; }
.facts dd { margin: 0.2rem 0 0; font-weight: 800; font-size: 1.15rem; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 600; }
.ledger { margin-top: var(--s4); overflow-x: auto; }
.ledger table { width: 100%; border-collapse: collapse; min-width: 640px; }
.ledger th { text-align: left; font-size: 0.9rem; color: var(--ink-soft); font-weight: 600; padding: 0 0.8rem 0.6rem 0; border-bottom: 2px solid var(--chassis-edge); }
.ledger td { padding: 0.85rem 0.8rem 0.85rem 0; border-bottom: 1px solid var(--chassis-edge); vertical-align: top; }
.ledger td:first-child { white-space: nowrap; font-weight: 600; }
.ledger td a { margin-right: 0.7rem; font-weight: 600; }
.facts--totals { grid-template-columns: repeat(3, 1fr); padding-top: var(--s3); border-top: 2px solid var(--chassis-edge); }
.ledger__updated { margin: var(--s2) 0 0; font-size: 0.85rem; color: var(--ink-soft); }

/* ---------- community wall ---------- */
.wall { width: var(--wrap); margin: var(--s6) auto 0; }
.wall__head p { margin-top: var(--s1); max-width: 56ch; color: var(--ink-soft); font-size: 1.1rem; }
.wall__grid { list-style: none; margin: var(--s4) 0 0; padding: 0; columns: 3 260px; column-gap: var(--s3); }
.wall__grid:empty { display: none; }
.wall__item { break-inside: avoid; margin-bottom: var(--s3); }
.wall__screen {
  background: var(--screen);
  border: 10px solid var(--chassis);
  border-radius: var(--r-part);
  box-shadow: 0 0 0 2px var(--chassis-edge), 0 6px 0 var(--chassis-edge);
  overflow: hidden;
}
.wall__screen img, .wall__screen video { display: block; width: 100%; height: auto; }
.wall__by { display: flex; justify-content: space-between; gap: var(--s1); margin-top: 0.6rem; font-size: 0.95rem; }
.wall__by a { font-weight: 700; }
.wall__by span { color: var(--ink-soft); }
.wall__empty {
  margin-top: var(--s4); padding: var(--s4) var(--s3);
  border: 3px dashed var(--sky-deep); border-radius: var(--r-shell);
  text-align: center;
}
.wall__empty p { margin: 0 auto var(--s2); max-width: 44ch; font-size: 1.1rem; }
.wall__empty[hidden] { display: none; }

/* ---------- rating label ---------- */
.label-wrap { width: var(--wrap); margin: var(--s6) auto 0; display: flex; justify-content: center; }
.rating {
  width: min(640px, 100%);
  background: #fbfaf6;
  color: #1a1a1a;
  border: 2px solid #1a1a1a;
  border-radius: 10px;
  padding: 1.2rem 1.4rem 1rem;
  transform: rotate(-1deg);
  box-shadow: 6px 6px 0 rgba(33,24,47,.12);
}
.rating__title {
  font: 700 2rem/1 var(--pixel); display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2);
  border-bottom: 2px solid #1a1a1a; padding-bottom: 0.7rem;
}
.rating__title span { font: 600 1rem/1 var(--text); }
.rating__grid { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.rating__grid div { display: flex; justify-content: space-between; gap: var(--s2); padding: 0.55rem 0; border-bottom: 1px solid #c9c4b8; }
.rating__grid div:nth-child(odd) { padding-right: var(--s2); border-right: 1px solid #c9c4b8; }
.rating__grid div:nth-child(even) { padding-left: var(--s2); }
.rating__grid dt { color: #555; }
.rating__grid dd { margin: 0; font-weight: 800; text-align: right; }
.rating__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); margin-top: 0.9rem; font-size: 0.85rem; }
.barcode { width: 150px; height: 42px; flex: none; }

/* ---------- get ---------- */
.get { width: var(--wrap); margin: var(--s6) auto 0; }
.get__warn { margin-top: var(--s2); font-size: 1.15rem; max-width: 60ch; }
.ca--big { margin-top: var(--s2); padding: 0.6rem 0.6rem 0.6rem 1.1rem; border-color: var(--lilac); }
.ca--big .ca__addr { font-size: clamp(0.95rem, 2vw, 1.3rem); }
.doors { list-style: none; padding: 0; margin: var(--s3) 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); }
.doors a {
  display: flex; flex-direction: column; gap: 0.25rem; height: 100%;
  padding: 1.1rem 1.2rem; border-radius: var(--r-part);
  background: var(--white); border: 2px solid var(--sky-deep);
  text-decoration: none; color: var(--ink);
}
.doors a:hover { border-color: var(--lilac); color: var(--ink); }
.doors strong { font-size: 1.1rem; }
.doors span { color: var(--ink-soft); font-size: 0.95rem; }
.get__safe { margin-top: var(--s3); color: var(--ink-soft); }

/* ---------- footer ---------- */
.foot {
  margin-top: var(--s6);
  background: var(--lilac); color: var(--chassis);
  padding: var(--s4) 0 var(--s4);
  text-align: center;
}
.foot p:first-child { font: 700 clamp(1.3rem, 2.6vw, 1.8rem)/1.2 var(--pixel); }
.foot__fine { margin: var(--s2) auto 0; max-width: 62ch; font-size: 0.88rem; color: #d9cff0; padding: 0 1.25rem; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .hero__art { order: -1; max-width: 560px; }
  .hero h1 { margin-top: var(--s3); max-width: none; }
  .readout { grid-template-columns: 1fr 1fr; }
  .log { grid-template-columns: 1fr; gap: var(--s3); }
  .doors { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .top { flex-wrap: wrap; }
  .top__nav { order: 3; width: 100%; margin-left: 0; gap: var(--s2); font-size: 0.95rem; }
  .btn--buy { margin-left: auto; }
  .split, .facts, .facts--totals { grid-template-columns: 1fr; }
  .rating__grid { grid-template-columns: 1fr; }
  .rating__grid div:nth-child(odd) { padding-right: 0; border-right: 0; }
  .rating__grid div:nth-child(even) { padding-left: 0; }
  .doors { grid-template-columns: 1fr; }
  .crt { min-height: 9.5rem; border-width: 8px; }
  .ca { flex-wrap: wrap; }
  .ca__label { width: 100%; }
  .log__list li { grid-template-columns: 1fr; gap: 0.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee__track { animation: none; }
  .btn, .btn:active { transition: none; transform: none; }
}
