/* halfscarf landing — "matchday editorial": exaggerated-minimal sport poster.
   The page itself is a half-and-half scarf: two color worlds meeting at a knitted seam.
   Palette mirrors the product UI (deep navy, green #3ddc97, coral #ff5d73, gold #ffd166). */

:root {
  --bg: #0a0e1a;
  --bg-2: #0e1526;
  --card: #121a2e;
  --line: #232c47;
  --ink: #f2f5ff;
  --muted: #93a1c4;
  --green: #3ddc97;
  --coral: #ff5d73;
  --gold: #ffd166;
  --paper: #f4efe6;
  --paper-ink: #17130c;
  --seam-w: 16px;
  --wrap: 1180px;
  --disp: "Big Shoulders", "Archivo", sans-serif;
  --body: "Archivo", sans-serif;
  --mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}
/* film grain over everything — atmosphere, not decoration-noise */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 3; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { max-width: 100%; }
a { color: var(--green); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.mono { font-family: var(--mono); }
b, strong { color: var(--ink); }

/* ---------- scoreboard ticker ---------- */
.ticker { overflow: hidden; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.ticker-track {
  display: inline-flex; align-items: center; gap: 28px; white-space: nowrap;
  padding: 9px 0; font-family: var(--mono); font-size: 12px; letter-spacing: .14em;
  color: var(--gold); animation: tick 38s linear infinite; will-change: transform;
}
.ticker-track i { font-style: normal; opacity: .55; }
@keyframes tick { to { transform: translateX(-50%); } }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 22px;
  max-width: var(--wrap); margin: 0 auto; padding: 18px 22px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { font-size: 22px; }
.brand-name { font-family: var(--disp); font-weight: 800; font-size: 22px; letter-spacing: .02em; }
.topnav { display: none; gap: 22px; margin-left: auto; }
.topnav a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.topnav a:hover { color: var(--ink); }
.gh-btn {
  display: inline-flex; align-items: center; gap: 8px; margin-left: auto;
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px;
  color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600;
  transition: border-color .2s, background .2s;
}
.gh-btn:hover { border-color: var(--green); background: rgba(61, 220, 151, .08); }
.topnav + .gh-btn { margin-left: 0; }
@media (min-width: 860px) { .topnav { display: flex; } }

/* ---------- hero ---------- */
.hero { position: relative; isolation: isolate; padding: clamp(56px, 10vh, 128px) 0 96px; }
.hero-half { position: absolute; inset: 0 50% 0 0; z-index: -2; background: radial-gradient(900px 520px at 30% 8%, rgba(61, 220, 151, .16), transparent 68%); }
.hero-right { inset: 0 0 0 50%; background: radial-gradient(900px 520px at 70% 8%, rgba(255, 93, 115, .15), transparent 68%); }
/* the knitted seam — chevron "stitches" over team-band stripes */
.seam {
  position: absolute; top: 0; bottom: -1px; left: calc(50% - var(--seam-w) / 2);
  width: var(--seam-w); z-index: -1; opacity: .95;
  background:
    repeating-linear-gradient(45deg, transparent 0 5px, rgba(0, 0, 0, .30) 5px 10px),
    repeating-linear-gradient(-45deg, transparent 0 5px, rgba(255, 255, 255, .07) 5px 10px),
    repeating-linear-gradient(180deg,
      var(--green) 0 44px, var(--paper) 44px 54px,
      var(--coral) 54px 98px, var(--bg-2) 98px 108px);
  box-shadow: 0 0 34px rgba(0, 0, 0, .55);
}
.hero-inner { position: relative; max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
.kicker {
  font-family: var(--mono); font-size: 13px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 26px;
}
.kicker strong { color: var(--gold); font-weight: 500; }
.display {
  font-family: var(--disp); font-weight: 900; text-transform: uppercase;
  font-size: clamp(3rem, 10.5vw, 9rem); line-height: .92; letter-spacing: .005em;
}
.display .line { display: block; }
.display em { font-style: normal; }
.accent-a { color: var(--green); }
.accent-b { color: var(--coral); }
.lede { max-width: 560px; margin-top: 30px; color: var(--muted); font-size: 18px; }
.lede b { color: var(--ink); }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px; text-decoration: none;
  font-weight: 700; font-size: 15px; padding: 14px 24px; border-radius: 12px;
  transition: transform .18s, box-shadow .18s, background .18s;
}
.btn:active { transform: scale(.97); }
.btn-solid { background: var(--green); color: #06281a; box-shadow: 0 10px 30px rgba(61, 220, 151, .25); }
.btn-solid:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(61, 220, 151, .32); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--coral); background: rgba(255, 93, 115, .08); }

/* match ticket — paper artifact overlapping the dark poster */
.ticket {
  position: relative; margin-top: 58px; max-width: 380px;
  background: var(--paper); color: var(--paper-ink); border-radius: 14px;
  padding: 16px 18px 0; transform: rotate(-1.6deg);
  box-shadow: 14px 18px 0 rgba(0, 0, 0, .35);
}
.ticket-head { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .2em; border-bottom: 2px solid var(--paper-ink); padding-bottom: 8px; }
.ticket-body { padding: 12px 0; display: grid; gap: 9px; }
.ticket-row { display: grid; grid-template-columns: 10px 56px 1fr; gap: 10px; align-items: baseline; font-size: 13px; }
.ticket-row b { font-family: var(--disp); font-weight: 800; letter-spacing: .04em; }
.ticket-row span:last-child { color: #4c443a; }
.dot { width: 9px; height: 9px; border-radius: 50%; align-self: center; }
.dot-a { background: #0ea86e; }
.dot-g { background: #b98900; }
.dot-b { background: #e0293f; }
.ticket-tear { border-top: 2px dashed #b9ad9a; margin: 2px -18px 0; position: relative; }
.ticket-tear::before, .ticket-tear::after {
  content: ""; position: absolute; top: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg);
}
.ticket-tear::before { left: -9px; }
.ticket-tear::after { right: -9px; }
.ticket-stub {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0 12px; font-size: 11px; letter-spacing: .22em; color: #4c443a;
}
/* mini barcode */
.ticket-stub::after {
  content: ""; height: 16px; flex: 0 0 92px;
  background: repeating-linear-gradient(90deg, var(--paper-ink) 0 2px, transparent 2px 5px, var(--paper-ink) 5px 6px, transparent 6px 10px);
}
@media (min-width: 1020px) {
  .ticket { position: absolute; right: 24px; bottom: -10px; margin-top: 0; transform: rotate(2.4deg); }
}

/* ---------- shared section chrome ---------- */
section { padding: clamp(72px, 11vh, 130px) 22px; }
.problem, .match, .tracks, .run { max-width: var(--wrap); margin: 0 auto; }
.sect-title {
  font-family: var(--disp); font-weight: 800; text-transform: uppercase;
  font-size: clamp(1.9rem, 4.6vw, 3.4rem); line-height: 1.02; margin-bottom: 20px;
}
.sect-no { display: block; font-size: 13px; color: var(--gold); letter-spacing: .3em; margin-bottom: 14px; font-weight: 500; }
.sect-sub { color: var(--muted); max-width: 620px; margin-bottom: 44px; }

/* ---------- problem stubs ---------- */
.stubs { display: grid; gap: 18px; margin-top: 48px; }
.stub {
  position: relative; border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  padding: 26px 24px 22px; transition: transform .25s, border-color .25s;
}
.stub:hover { transform: translateY(-4px); border-color: #35406a; }
.stub-no { font-size: 11px; letter-spacing: .26em; color: var(--muted); }
.stub h3 { font-family: var(--disp); font-weight: 800; text-transform: uppercase; font-size: 26px; margin: 10px 0 8px; }
.stub p { color: var(--muted); font-size: 15px; }
.stub-fix { display: inline-block; margin-top: 16px; font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em; }
.fix-a { color: var(--green); }
.fix-g { color: var(--gold); }
.fix-b { color: var(--coral); }
@media (min-width: 860px) {
  .stubs { grid-template-columns: repeat(3, 1fr); }
  /* asymmetry: middle stub sits lower, like torn stubs on a table */
  .stub:nth-child(2) { transform: translateY(26px); }
  .stub:nth-child(2):hover { transform: translateY(22px); }
  .stub:nth-child(3) { transform: translateY(-8px); }
  .stub:nth-child(3):hover { transform: translateY(-12px); }
}

/* ---------- matchday demo (14s master loop, pure CSS) ---------- */
.match { position: relative; }
.pitch {
  display: grid; gap: 20px; margin-top: 26px; align-items: stretch;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) { .pitch { grid-template-columns: 1fr 170px 1fr; } }
.pane {
  border-radius: 18px; border: 1px solid var(--line); padding: 20px;
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  display: flex; flex-direction: column; gap: 16px; min-height: 250px; position: relative; overflow: hidden;
}
.pane-a { border-top: 3px solid var(--green); }
.pane-b { border-top: 3px solid var(--coral); }
.pane-head { display: flex; align-items: center; gap: 12px; }
.pane-flag { width: 38px; height: auto; flex: 0 0 auto; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); border-radius: 3px; }
.pane-head b { font-family: var(--disp); font-size: 20px; font-weight: 800; letter-spacing: .03em; display: block; }
.pane-lang { font-size: 11px; color: var(--muted); letter-spacing: .08em; }
.pane-bal { margin-left: auto; font-size: 14px; color: var(--gold); position: relative; }
.pane-bal i { font-style: normal; font-size: 10px; opacity: .7; }
.bal-bump { position: absolute; right: 0; top: -16px; font-size: 11px; color: var(--green); opacity: 0; font-style: normal; animation: balbump 14s infinite; }
@keyframes balbump { 0%, 74% { opacity: 0; transform: translateY(4px); } 78%, 92% { opacity: 1; transform: translateY(0); } 97%, 100% { opacity: 0; } }

.mic-chip {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px;
  font-size: 13.5px; color: var(--muted); animation: micglow 14s infinite;
}
.mic-ring { width: 10px; height: 10px; border-radius: 50%; background: var(--coral); animation: micring 14s infinite; }
@keyframes micglow { 0%, 14% { border-color: var(--coral); color: var(--ink); } 16%, 100% { border-color: var(--line); color: var(--muted); } }
@keyframes micring {
  0%, 13% { box-shadow: 0 0 0 0 rgba(255, 93, 115, .55); opacity: 1; }
  3%, 9% { box-shadow: 0 0 0 9px rgba(255, 93, 115, 0); }
  15%, 100% { opacity: .35; box-shadow: none; }
}
.said { opacity: 0; animation: appear-said 14s infinite; }
.said-label { display: block; font-size: 11px; letter-spacing: .14em; color: var(--muted); margin-bottom: 5px; }
.said-text { font-size: 17px; font-weight: 600; }
@keyframes appear-said { 0%, 13% { opacity: 0; transform: translateY(8px); } 17%, 96% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; } }
.toast-paid {
  position: absolute; left: 20px; bottom: 16px; font-size: 12.5px; color: var(--green);
  border: 1px solid rgba(61, 220, 151, .4); border-radius: 10px; padding: 8px 12px;
  background: rgba(61, 220, 151, .08); opacity: 0; animation: toastpaid 14s infinite;
}
@keyframes toastpaid { 0%, 73% { opacity: 0; transform: translateY(8px); } 77%, 93% { opacity: 1; transform: translateY(0); } 98%, 100% { opacity: 0; } }

/* the wire between the fans */
.wire { position: relative; min-height: 84px; }
.wire-line {
  position: absolute; inset: 50% 0 auto 0; height: 2px;
  background: repeating-linear-gradient(90deg, var(--line) 0 8px, transparent 8px 15px);
}
.wire-tag {
  position: absolute; top: calc(50% + 14px); left: 50%; transform: translateX(-50%);
  font-size: 10.5px; letter-spacing: .12em; color: var(--muted); white-space: nowrap;
}
.packet {
  position: absolute; top: 50%; left: 0; transform: translate(-8%, -130%);
  font-size: 10.5px; padding: 5px 9px; border-radius: 8px; white-space: nowrap; opacity: 0;
}
.packet-voice { color: #06281a; background: var(--green); animation: fly-voice 14s infinite; }
.packet-coin { color: #2b0a10; background: var(--gold); animation: fly-coin 14s infinite; }
@keyframes fly-voice {
  0%, 24% { opacity: 0; left: 0; }
  26% { opacity: 1; }
  33% { opacity: 1; left: calc(100% - 90px); }
  35%, 100% { opacity: 0; left: calc(100% - 90px); }
}
@keyframes fly-coin {
  0%, 64% { opacity: 0; left: calc(100% - 70px); }
  66% { opacity: 1; }
  73% { opacity: 1; left: 0; }
  75%, 100% { opacity: 0; left: 0; }
}
@media (max-width: 899px) {
  .wire { min-height: 64px; }
  .wire-line { inset: 50% 12% auto 12%; }
}

/* Bob's idle state — visible only while the banner is off (opposite phase of bannerpop) */
.idle { font-size: 12px; color: var(--muted); letter-spacing: .1em; animation: idlefade 14s infinite; }
@keyframes idlefade { 0%, 33% { opacity: .7; } 37%, 96% { opacity: 0; } 100% { opacity: .7; } }
.banner {
  border: 1px solid rgba(255, 209, 102, .4); border-radius: 14px; padding: 14px 16px;
  background: rgba(255, 209, 102, .07); opacity: 0; animation: bannerpop 14s infinite;
  margin-top: -30px; /* occupies the idle line's spot once it pops in */
}
.banner-meta { display: block; font-size: 10.5px; letter-spacing: .14em; color: var(--gold); margin-bottom: 6px; }
.banner-text { font-family: var(--disp); font-size: 24px; font-weight: 800; line-height: 1.1; }
@keyframes bannerpop {
  0%, 33% { opacity: 0; transform: scale(.94); }
  37%, 96% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; }
}
.tip-chip {
  align-self: flex-start; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-2); color: var(--ink); font-family: var(--body);
  font-size: 14px; font-weight: 600; padding: 10px 18px; cursor: default;
  animation: tippress 14s infinite;
}
@keyframes tippress {
  0%, 60% { transform: scale(1); border-color: var(--line); }
  62% { transform: scale(.93); border-color: var(--gold); background: rgba(255, 209, 102, .14); }
  64% { transform: scale(1); }
  66%, 100% { border-color: var(--line); background: var(--bg-2); }
}

.loop-legend {
  display: grid; gap: 10px 26px; margin-top: 34px; padding-left: 0;
  list-style: none; font-size: 12.5px; color: var(--muted); letter-spacing: .02em;
}
.loop-legend b { color: var(--gold); margin-right: 8px; font-weight: 500; }
.loop-legend em { color: var(--ink); font-style: normal; }
@media (min-width: 860px) { .loop-legend { grid-template-columns: 1fr 1fr 1fr; } }

/* ---------- tracks bento ---------- */
.bento { display: grid; gap: 18px; margin-top: 48px; }
.card {
  border: 1px solid var(--line); border-radius: 18px; padding: 28px 26px;
  background: linear-gradient(180deg, var(--card), var(--bg-2));
}
.card header h3 { font-family: var(--disp); font-weight: 800; text-transform: uppercase; font-size: 27px; line-height: 1.05; margin: 14px 0 12px; }
.card header h3 em { font-style: normal; color: var(--gold); }
.card > p { color: var(--muted); font-size: 15.5px; }
.chip {
  display: inline-block; font-family: var(--mono); font-size: 11px; letter-spacing: .2em;
  padding: 6px 12px; border-radius: 999px;
}
.chip-a { color: var(--green); border: 1px solid rgba(61, 220, 151, .45); }
.chip-g { color: var(--gold); border: 1px solid rgba(255, 209, 102, .45); }
.chip-b { color: var(--coral); border: 1px solid rgba(255, 93, 115, .45); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }
.stats div { border-top: 1px solid var(--line); padding-top: 12px; }
.stats dt { font-size: 11px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.stats dd { font-size: 34px; color: var(--ink); font-weight: 600; line-height: 1.15; }
.stats dd i { font-style: normal; font-size: 15px; color: var(--muted); }
.stat-hero { grid-column: 1 / -1; }
.stat-hero dd { font-size: 56px; color: var(--green); }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 22px; font-size: 12.5px; }
.flow span { border: 1px solid var(--line); border-radius: 9px; padding: 7px 11px; background: var(--bg); }
.flow i { color: var(--gold); font-style: normal; }
.fine { margin-top: 18px; font-size: 12px; color: var(--muted); }
.fine a { color: var(--gold); text-decoration-color: rgba(255, 209, 102, .4); }
.card-zero { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-content: center; }
.zero { display: flex; align-items: baseline; gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.zero b { font-family: var(--disp); font-size: 54px; font-weight: 900; color: var(--coral); line-height: 1; }
.zero span { font-size: 12px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
@media (min-width: 980px) {
  .bento { grid-template-columns: repeat(12, 1fr); }
  .card-qvac { grid-column: span 7; }
  .card-pears { grid-column: span 5; }
  .card-wdk { grid-column: span 5; }
  .card-zero { grid-column: span 7; grid-template-columns: repeat(4, 1fr); }
  .zero { flex-direction: column; gap: 6px; }
}

/* ---------- run it ---------- */
.term { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-top: 40px; background: #070b14; }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.term-bar i:first-child { background: var(--coral); }
.term-bar i:nth-child(2) { background: var(--gold); }
.term-bar i:nth-child(3) { background: var(--green); }
.term-bar span { margin-left: auto; font-size: 11px; letter-spacing: .16em; color: var(--muted); }
.term pre { padding: 22px 20px; overflow-x: auto; font-size: 13.5px; line-height: 1.9; }
.term .cmt { color: #55648f; }
.term .ps { color: var(--coral); user-select: none; }
.run-tip { margin-top: 20px; font-size: 13px; color: var(--muted); }
.run-tip b { color: var(--gold); font-weight: 500; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); margin-top: 40px; }
.foot-seam {
  height: 10px;
  background: repeating-linear-gradient(90deg,
    var(--green) 0 44px, var(--paper) 44px 54px, var(--coral) 54px 98px, var(--bg-2) 98px 108px);
  opacity: .85;
}
.foot-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 40px 22px 56px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px;
}
.foot-brand { font-family: var(--disp); font-weight: 800; font-size: 20px; }
.foot-note { color: var(--muted); font-size: 13px; }
.foot .gh-btn { margin-left: auto; }

/* ---------- scroll reveals (gated on .js so no-JS never hides content) ---------- */
html.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
html.js .reveal.in { opacity: 1; transform: none; }
html.js .d2.in { transition-delay: .08s; }
html.js .d3.in { transition-delay: .16s; }
html.js .d4.in { transition-delay: .24s; }
html.js .d5.in { transition-delay: .32s; }
html.js .d6.in { transition-delay: .4s; }

/* ---------- reduced motion: freeze the loop at its most legible frame ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-track { animation: none; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  .mic-chip, .mic-ring, .said, .banner, .tip-chip, .toast-paid, .bal-bump, .idle { animation: none; }
  .said, .banner { opacity: 1; }
  .idle { opacity: 0; } /* banner is frozen visible in its place */
  .packet { animation: none; opacity: 0; }
  .btn, .stub { transition: none; }
}
