/* ==========================================================================
   Fox — retro arcade landing page
   ========================================================================== */

:root {
  --bg: #05060b;
  --bg-alt: #070a10;
  --panel: #0a0d14;
  --ink: #e6f1ef;
  --muted: #a9bab7;
  --dim: #8aa19d;
  --rule: #12201e;
  --cyan: #2ef2d0;
  --pink: #ff3ea5;
  --pink-light: #ff6fbd;
  --blue: #3b6cff;
  --yellow: #ffd23f;
  --green: #3dff8a;
  --orange: #ff7a45;
  --violet: #9b7bff;
  --lilac: #c9b8ff;

  --font-display: "Press Start 2P", monospace;
  --font-body: "JetBrains Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* CRT scanlines over the whole page */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 3px);
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, .section-title, .wordmark, .closing-title {
  font-family: var(--font-display);
  line-height: 1.5;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn:active {
  transform: translate(3px, 3px);
}

.btn-primary {
  background: var(--cyan);
  color: #04110e;
  border: 3px solid var(--cyan);
  box-shadow: 4px 4px 0 var(--pink);
}

.btn-primary:hover {
  box-shadow: 2px 2px 0 var(--pink);
  transform: translate(2px, 2px);
}

.btn-ghost {
  background: transparent;
  color: var(--yellow);
  border: 2px solid var(--yellow);
  box-shadow: none;
}

.btn-ghost:hover {
  background: rgba(255, 210, 63, 0.08);
}

/* ==========================================================================
   Section scaffolding
   ========================================================================== */

section {
  padding: 112px 0;
}

.band-alt {
  background: var(--bg-alt);
  border-top: 3px solid var(--rule);
}

.band-plain {
  background: var(--bg);
}

.section-title {
  font-size: clamp(22px, 2.8vw, 34px);
  margin: 0 0 48px;
  color: var(--ink);
}

/* ==========================================================================
   HERO
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding-bottom: 112px;
  display: flex;
  flex-direction: column;
  animation: hero-flicker 5s linear infinite;
}

.bit-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero-fade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 55% at 50% 42%, rgba(5, 6, 11, 0.94) 0%, rgba(5, 6, 11, 0.78) 45%, rgba(5, 6, 11, 0.3) 100%),
    linear-gradient(to bottom, rgba(5, 6, 11, 0) 0%, rgba(5, 6, 11, 0) 75%, #05060b 100%);
}

@keyframes hero-flicker {
  0%, 100% { opacity: 1; }
  98% { opacity: 1; }
  99% { opacity: 0.85; }
}

/* --- header --- */

.site-header {
  position: relative;
  z-index: 2;
  padding: 28px 0;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-family: var(--font-display);
  font-size: 12px;
}

.header-left,
.header-right {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.h-oneup { color: var(--pink); }
.h-you { color: var(--ink); }
.h-live { color: var(--cyan); }
.h-date { color: var(--ink); }

.header-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.header-nav a {
  color: var(--muted);
  transition: color 0.1s ease;
}

.header-nav a:hover {
  color: var(--ink);
}

.header-nav .nav-github {
  color: var(--yellow);
}

/* --- hero content --- */

.hero-content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 34px;
  justify-content: center;
}

.pixel-fox {
  display: grid;
  grid-template-columns: repeat(11, var(--fox-cell));
  grid-auto-rows: var(--fox-cell);
  animation: fox-bob 2.4s ease-in-out infinite;
}

.pixel-fox span {
  display: block;
}

.pixel-fox--hero {
  filter: drop-shadow(0 0 28px rgba(46, 242, 208, 0.55));
}

@keyframes fox-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.wordmark {
  margin: 0;
  font-size: clamp(64px, 10vw, 128px);
  color: var(--cyan);
  text-shadow: 6px 0 0 var(--pink), -6px 0 0 var(--blue), 0 0 40px rgba(46, 242, 208, 0.6);
  letter-spacing: 0.02em;
}

.hero-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-display);
  font-size: clamp(14px, 1.6vw, 20px);
  line-height: 1.5;
}

.hero-line-1 { color: var(--ink); }
.hero-line-2 { color: var(--yellow); }

.hero-copy {
  max-width: 680px;
  color: var(--muted);
  font-size: 17px;
}

.hero-date {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 34px;
  border: 3px solid var(--pink);
  box-shadow: 6px 6px 0 #6b1a46;
  background: #0d0a12;
  font-family: var(--font-display);
}

.hero-date-label {
  color: var(--pink-light);
  font-size: 13px;
}

.hero-date-value {
  color: var(--ink);
  font-size: clamp(22px, 3vw, 34px);
}

.hero-actions {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ==========================================================================
   HOW IT WORKS
   ========================================================================== */

.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 24px;
}

.card {
  background: var(--panel);
  border: 3px solid;
  box-shadow: 6px 6px 0;
  padding: 28px;
}

.card h3 {
  margin: 0 0 16px;
  font-size: 19px;
}

.card p {
  color: var(--muted);
  font-size: 14px;
}

.card-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  margin-bottom: 16px;
}

.card-cyan        { border-color: var(--cyan);       box-shadow: 6px 6px 0 #0f6b5d; }
.card-cyan .card-tag { color: var(--cyan); }
.card-pink-light  { border-color: var(--pink-light); box-shadow: 6px 6px 0 #6b1a46; }
.card-pink-light .card-tag { color: var(--pink-light); }
.card-yellow      { border-color: var(--yellow);     box-shadow: 6px 6px 0 #6b5711; }
.card-yellow .card-tag { color: var(--yellow); }
.card-green       { border-color: var(--green);      box-shadow: 6px 6px 0 #155c33; }
.card-green .card-tag { color: var(--green); }
.card-violet      { border-color: var(--violet);     box-shadow: 6px 6px 0 #3c2a7a; }
.card-violet .card-tag { color: var(--violet); }
.card-blue        { border-color: #5c8cff;           box-shadow: 6px 6px 0 #1d3378; }
.card-blue .card-tag { color: #5c8cff; }

/* --- lanes --- */

.lanes {
  margin-top: 48px;
  border: 3px solid #1d3532;
  background: #090e14;
  padding: 28px;
}

.lane-row {
  display: grid;
  grid-template-columns: 170px 1fr 180px;
  align-items: center;
  gap: 24px;
  padding: 12px 0;
}

.lane-row + .lane-row {
  border-top: 1px solid #12201e;
}

.lane-label {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.lane-track {
  height: 14px;
  overflow: hidden;
}

.lane-bar {
  height: 100%;
  background: repeating-linear-gradient(90deg, var(--lane-color) 0 10px, transparent 10px 14px);
  animation: lane-grow 2.6s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  animation-delay: var(--lane-delay);
}

@keyframes lane-grow {
  0%, 100% { width: 12%; }
  50% { width: var(--lane-w); }
}

.lane-status {
  text-align: right;
  color: var(--dim);
  font-size: 13px;
}

/* ==========================================================================
   MODELS
   ========================================================================== */

.models-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.models-copy .section-title {
  margin-bottom: 28px;
}

.models-text {
  color: var(--muted);
  font-size: 16px;
  max-width: 560px;
}

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border: 2px solid var(--tile-color);
  background: var(--panel);
}

.tile-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--tile-color);
}

.tile-note {
  font-size: 12px;
  color: var(--dim);
}

/* ==========================================================================
   FEATURES
   ========================================================================== */

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 24px;
}

.features-grid .card h3 {
  font-size: 20px;
}

/* ==========================================================================
   SHOWCASE
   ========================================================================== */

.showcase-intro {
  color: var(--muted);
  font-size: 16px;
  margin: -24px 0 56px;
}

.showcase-stack {
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.showcase-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  align-items: center;
  border: 3px solid var(--panel-border);
  box-shadow: 8px 8px 0 var(--panel-shadow);
  background: var(--panel-bg);
  padding: 44px 40px;
}

.showcase-tag {
  display: inline-block;
  background: var(--panel-border);
  color: #04110e;
  font-family: var(--font-display);
  font-size: 11px;
  padding: 8px 12px;
  margin-bottom: 20px;
}

.showcase-copy h3 {
  margin: 0 0 20px;
  font-size: clamp(18px, 2.2vw, 26px);
  color: var(--ink);
}

.showcase-copy h3 .tint {
  color: var(--panel-tint);
}

.showcase-copy p {
  color: var(--panel-body);
  font-size: 15px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.chips span {
  border: 2px solid #5a2a48;
  color: #e3c9d7;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
}

/* --- mock windows --- */

.showcase-mock {
  min-width: 0;
}

.mock-window {
  border: 3px solid var(--panel-border);
  background: var(--panel-bg);
}

.mock-titlebar {
  padding: 10px 14px;
  border-bottom: 1px solid var(--panel-border);
  color: var(--dim);
  font-size: 12px;
  font-family: var(--font-body);
}

.mock-window pre {
  margin: 0;
  padding: 20px;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  color: var(--panel-body);
}

/* roster.json colours */
.mock-json { color: #8a6f66; }
.mock-json .j-key { color: #ffa27d; }
.mock-json .j-str { color: #3dff8a; }

/* fox · hub log */
.mock-log { color: var(--ink); }
.mock-log .log-red    { color: #ff6f6f; }
.mock-log .log-yellow { color: var(--yellow); }
.mock-log .log-ink    { color: var(--ink); }
.mock-log .log-green  { color: var(--green); }

/* board diagram */
.mock-board {
  color: #c9b8ff !important;
  line-height: 1.35;
}

/* diff */
.diff-split {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) 1.1fr;
  padding: 20px;
  gap: 0;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--panel-body);
}

.diff-files {
  border-right: 1px solid var(--panel-border);
  padding-right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.diff-file {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 8px;
}

.diff-file.selected {
  background: #2a240c;
}

.diff-file .add { color: var(--green); }
.diff-file .del { color: #ff6f6f; }

.diff-hunk {
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.diff-meta { color: #7fa4ff; }
.diff-add { color: var(--green); }

/* --- browser mock --- */

.mock-browser {
  border: 3px solid var(--panel-border);
  background: #f4f2ee;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #1b1b1b;
}

.browser-topbar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #e4e0d9;
  padding: 10px 12px;
}

.browser-topbar .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #b8b2a7;
}

.browser-topbar .address-pill {
  margin-left: 10px;
  flex: 1;
  background: #fbfaf7;
  border: 1px solid #d8d2c7;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  color: #555;
  text-align: center;
}

.browser-body {
  padding: 16px;
}

.fox-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: #1b1b1b;
  border: 1px solid #d4a24c;
  border-radius: 10px;
  color: #f2efe8;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

.fox-bar-name {
  font-weight: 700;
  color: #d4a24c;
}

.fox-bar-msg {
  flex: 1;
  min-width: 120px;
}

.fox-bar-done {
  background: #d4a24c;
  color: #1b1b1b;
  font-weight: 700;
  border-radius: 6px;
  padding: 4px 12px;
}

.fox-bar-skip {
  border: 1px solid #555;
  color: #f2efe8;
  border-radius: 6px;
  padding: 4px 12px;
}

.mock-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-label {
  font-size: 12px;
  color: #555;
}

.field-value {
  background: #fff;
  border: 1px solid #d8d2c7;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  color: #1b1b1b;
  min-height: 40px;
}

.field-value.empty {
  min-height: 40px;
}

.field-ring .field-value {
  outline: 3px solid #d4a24c;
  outline-offset: 5px;
}

.field-btn {
  align-self: flex-start;
  background: #1b1b1b;
  color: #fff;
  border-radius: 6px;
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 700;
}

/* ==========================================================================
   UNDER THE HOOD
   ========================================================================== */

.hood-intro {
  color: var(--muted);
  margin: -24px 0 40px;
  font-size: 16px;
}

.explorer {
  display: grid;
  grid-template-columns: minmax(300px, 360px) 1fr;
  border: 3px solid #2a2350;
  box-shadow: 8px 8px 0 #1c1838;
  background: #0a0912;
}

.tree {
  background: #08070e;
  border-right: 2px solid #1c1838;
  min-width: 300px;
}

.tree-label {
  padding: 18px 18px 12px;
  color: #6f6a8a;
  font-family: var(--font-body);
  font-size: 12px;
}

.tree-buttons {
  display: flex;
  flex-direction: column;
}

.tree-item {
  display: block;
  width: 100%;
  text-align: left;
  min-height: 44px;
  padding: 12px 18px;
  background: transparent;
  color: #a39fb8;
  border: 0;
  border-left: 3px solid transparent;
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
}

.tree-item:hover {
  color: var(--ink);
}

.tree-item[aria-pressed="true"] {
  color: #ffffff;
  background: #17132b;
  border-left-color: #c9b8ff;
}

.detail {
  padding: 36px;
  min-width: 0;
}

.detail-path {
  color: #6f6a8a;
  font-family: var(--font-body);
  font-size: 13px;
  margin-bottom: 14px;
}

.detail-title {
  margin: 0 0 16px;
  font-size: clamp(16px, 1.8vw, 22px);
  color: #c9b8ff;
}

.detail-body {
  color: #b9b2cc;
  font-size: 15px;
  margin-bottom: 28px;
}

.facts {
  border-top: 1px dashed #2a2350;
}

.fact-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  padding: 14px 0;
  border-top: 1px dashed #2a2350;
}

.fact-row:first-child {
  border-top: 0;
}

.fact-key {
  color: #8a80aa;
  font-size: 14px;
}

.fact-value {
  color: var(--ink);
  font-size: 14px;
}

/* ==========================================================================
   CLOSING CTA
   ========================================================================== */

.closing-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 28px;
}

.closing-title {
  margin: 0;
  font-size: clamp(22px, 3.4vw, 42px);
  color: var(--cyan);
  text-shadow: 4px 0 0 var(--pink), -4px 0 0 var(--blue);
}

.closing-line {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 12px;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
  border-top: 3px solid var(--rule);
  padding: 32px 0;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #6f8b86;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 960px) {
  .models-wrap {
    grid-template-columns: 1fr;
  }

  .showcase-panel {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 720px) {
  section {
    padding: 72px 0;
  }

  .hero {
    min-height: auto;
  }

  .header-row {
    justify-content: center;
  }

  .header-nav {
    order: 3;
    justify-content: center;
    width: 100%;
    gap: 14px;
  }

  .lane-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px 0;
  }

  .lane-status {
    text-align: left;
  }

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

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

  .tree {
    border-right: 0;
    border-bottom: 2px solid #1c1838;
  }

  .diff-split {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .diff-files {
    border-right: 0;
    border-bottom: 1px solid var(--panel-border);
    padding-right: 0;
    padding-bottom: 16px;
  }

  .diff-hunk {
    padding-left: 0;
  }

  .hero-date {
    padding: 20px 22px;
  }

  .showcase-panel {
    padding: 32px 22px;
  }

  .fact-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

@media (max-width: 420px) {
  .hero-actions .btn {
    width: 100%;
  }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .pixel-fox {
    animation: none !important;
  }

  .lane-bar {
    animation: none !important;
    width: var(--lane-w);
  }

  .hero {
    animation: none !important;
  }
}
