@import url("./tokens.css");

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 5%, var(--surface)), var(--surface) 360px);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--space-lg); }
.narrow { max-width: 700px; }

/* =======================================================================
   HEADER
   ======================================================================= */
header.site {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--hairline);
}
header.site .wrap {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  height: 62px;
}
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; margin-right: auto; }
.logo-mark { display: block; }
.logo-text {
  font-family: var(--display);
  font-weight: 600;
  font-size: 19px;
  color: var(--ink);
  letter-spacing: 0;
}
nav.site { display: flex; align-items: center; gap: var(--space-lg); }
nav.site a { color: var(--ink-dim); text-decoration: none; font-size: 15px; font-weight: 500; }
nav.site a:hover { color: var(--ink); }
nav.site a.cta {
  background: var(--brand);
  color: var(--on-brand);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
}
nav.site a.cta:hover { color: var(--on-brand); filter: brightness(1.07); }
/* The section links live in the header row on anything wider than a phone, and
   in their own row below it on a phone. Never nowhere. */
.subnav { display: none; }
@media (max-width: 700px) {
  nav.site.primary a:not(.cta) { display: none; }
  header.site .wrap { height: 56px; }
  .subnav {
    display: flex;
    gap: var(--space-lg);
    padding-bottom: 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .subnav::-webkit-scrollbar { display: none; }
  .subnav a {
    color: var(--ink-dim);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
  }
  .subnav a:hover { color: var(--ink); }
}

/* =======================================================================
   THE FIELD — a hero backdrop of yard lines.
   Pure CSS gradients: no image request, and it scales to any width. Kept at a
   very low contrast so it reads as texture rather than as content.
   ======================================================================= */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--hairline);
  padding: var(--space-2xl) 0 0;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 calc(10% - 1px),
      color-mix(in srgb, var(--ink) 6%, transparent) calc(10% - 1px) 10%
    ),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--accent) 8%, var(--surface)) 0%,
      color-mix(in srgb, var(--brand) 5%, var(--surface)) 58%,
      var(--surface) 100%
    );
  pointer-events: none;
}
.hero > .wrap { position: relative; }

.landing-hero {
  display: grid;
  gap: var(--space-xl);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: var(--space-lg);
}

h1.hero-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(38px, 7vw, 68px);
  line-height: 1.04;
  letter-spacing: 0;
  margin: 0 0 var(--space-md);
  max-width: 16ch;
}
h1.hero-title em { font-style: normal; color: var(--brand); }

.hero .lead { font-size: clamp(18px, 2.2vw, 21px); color: var(--ink-dim); max-width: 52ch; margin-bottom: var(--space-lg); }
.hero-note {
  max-width: 50ch;
  color: var(--ink);
  font-weight: 500;
  margin-bottom: 0;
}
.hero-snapshot {
  display: grid;
  gap: var(--space-md);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-raised) 90%, transparent), var(--surface-raised));
  border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--hairline));
  border-radius: calc(var(--radius) + 4px);
  padding: var(--space-md);
  box-shadow: 0 22px 52px -28px var(--shadow);
  margin: 0 0 calc(var(--space-2xl) * -0.35);
}
.snapshot-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  color: var(--ink-dim);
  font-size: 14px;
}
.snapshot-bar strong {
  color: var(--brand);
  font-family: var(--mono);
  font-size: 13px;
}
.hero-card-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
}
.hero-card-row .pickcard {
  min-height: 100%;
  box-shadow: none;
}
.spend-strip {
  display: grid;
  grid-template-columns: minmax(180px, 0.5fr) 1fr;
  gap: var(--space-md);
  align-items: center;
  border-top: 1px solid var(--hairline);
  padding-top: var(--space-md);
}
.spend-strip .label { margin-bottom: 2px; }
.spend-strip p {
  color: var(--ink-dim);
  font-size: 14px;
  margin-bottom: 0;
}
.spend-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.spend-chip {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 6px 8px;
  background: color-mix(in srgb, var(--surface) 68%, var(--surface-raised));
  color: var(--ink-dim);
  font-size: 12px;
  font-weight: 600;
}
.spend-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.spend-chip.spent {
  opacity: 0.45;
}
.spend-chip.spent .mark {
  filter: grayscale(1);
}
@media (max-width: 820px) {
  .hero-snapshot {
    margin-bottom: calc(var(--space-lg) * -0.4);
  }
  .hero-card-row {
    grid-template-columns: 1fr;
  }
  .spend-strip {
    grid-template-columns: 1fr;
  }
  .spend-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .wrap { padding: 0 var(--space-md); }
  .hero {
    padding-top: var(--space-xl);
  }
  .hero-snapshot {
    border-radius: var(--radius);
    padding: var(--space-sm);
  }
  .snapshot-bar {
    padding: 0 2px;
  }
}

/* =======================================================================
   TYPE
   ======================================================================= */
h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(34px, 5vw, 46px);
  line-height: 1.1;
  letter-spacing: 0;
  margin: 0 0 var(--space-md);
}
h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.15;
  letter-spacing: 0;
  margin: 0 0 var(--space-sm);
}
h3 { font-size: 19px; font-weight: 600; margin: 0 0 var(--space-xs); letter-spacing: 0; }
p { margin: 0 0 var(--space-md); }
.lead { font-size: 19px; color: var(--ink-dim); }
.label {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}
a { color: var(--brand); text-underline-offset: 3px; }
code, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* =======================================================================
   SECTIONS
   ======================================================================= */
section { padding: var(--space-2xl) 0; }
section.alt { background: var(--surface-raised); border-block: 1px solid var(--hairline); }
.section-head { max-width: 60ch; margin-bottom: var(--space-xl); }
.section-head p { color: var(--ink-dim); margin-bottom: 0; }

.cols { display: grid; gap: var(--space-lg); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.split { display: grid; gap: var(--space-2xl); grid-template-columns: 1fr; align-items: center; }
@media (min-width: 860px) { .split { grid-template-columns: 1fr 1fr; } }

/* =======================================================================
   PANELS AND CARDS
   ======================================================================= */
.panel {
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: var(--space-lg);
  box-shadow: 0 10px 24px -12px var(--shadow);
}
section.alt .panel { background: var(--surface); }

/* A pick card, as the app draws it. Same rounding, same hairline, same shadow —
   somebody who has used the app should recognise this immediately. */
.pickcard {
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: var(--space-md);
  box-shadow: 0 10px 24px -12px var(--shadow);
  display: grid;
  gap: 10px;
}
section.alt .pickcard { background: var(--surface); }
.pickcard .slotname { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); font-weight: 700; }
.pickcard .team { display: flex; align-items: center; gap: 10px; }
.pickcard .chip {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  color: #fff; letter-spacing: 0;
}
.pickcard .tname { font-weight: 600; font-size: 16px; }
.pickcard .vs { color: var(--ink-dim); font-size: 13px; }
.pickcard .line { font-family: var(--mono); font-size: 22px; font-weight: 600; }
.pickcard .pts {
  justify-self: start;
  font-family: var(--mono); font-weight: 600; font-size: 15px;
  background: var(--brand); color: var(--on-brand);
  border-radius: 8px; padding: 3px 11px;
}
.pickcard.won { border-color: color-mix(in srgb, var(--accent) 55%, var(--hairline)); }
.pickcard .verdict { font-size: 13px; font-weight: 600; color: var(--accent); }
.pickcard .verdict.lost { color: var(--ink-dim); }

.cardstack { display: grid; gap: var(--space-md); }

/* The mark's plate: the ground the football sits on. Two values per team,
   because a colour that is legible on paper may not be on ink — the app makes
   the same choice in TeamMarkPalette. */
.mark .plate { fill: var(--pl); }
@media (prefers-color-scheme: dark) { .mark .plate { fill: var(--pd); } }
.mark { display: block; flex: none; }

/* =======================================================================
   THE SCARCITY GRID — 32 teams, some spent.
   The game's central mechanic, shown rather than described.
   ======================================================================= */
.teamgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; }
.teamgrid .t {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 9px 4px 7px;
  border-radius: 10px;
  border: 1px solid var(--hairline);
  background: var(--surface-raised);
  overflow: hidden;
}
section.alt .teamgrid .t { background: var(--surface); }
.teamgrid .city {
  font-size: 10.5px;
  line-height: 1.15;
  text-align: center;
  color: var(--ink-dim);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.teamgrid .t.spent { opacity: 0.34; }
.teamgrid .t.spent .mark { filter: grayscale(1); }
/* The strike is clipped by the tile's own rounding rather than running past
   its corner, which is what it did when the tile had visible overflow. */
.teamgrid .t.spent::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom right,
    transparent calc(50% - 1px),
    var(--ink-dim) calc(50% - 1px),
    var(--ink-dim) calc(50% + 1px),
    transparent calc(50% + 1px));
}
.gridkey { display: flex; gap: var(--space-lg); flex-wrap: wrap; margin-top: var(--space-md); font-size: 14px; color: var(--ink-dim); }
.gridkey span { display: inline-flex; align-items: center; gap: 7px; }
/* The key shows the TREATMENT, not an arbitrary colour. Available teams are
   drawn in their own team colours, so a green swatch beside "available" would
   claim a meaning green does not carry here. */
.gridkey i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; font-style: normal; }
.gridkey i.spent {
  background: var(--ink-dim);
  opacity: 0.3;
  position: relative;
}
.gridkey i.spent::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom right, transparent calc(50% - 1px), #fff calc(50% - 1px), #fff calc(50% + 1px), transparent calc(50% + 1px));
}

/* =======================================================================
   MINI LEADERBOARD — the app's row treatment, edge stripe and all.
   ======================================================================= */
.board { display: grid; gap: 8px; }
.board .row {
  display: grid;
  grid-template-columns: 26px 16px 1fr auto;
  align-items: center;
  gap: 10px;
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-left: 5px solid var(--edge, var(--hairline));
  border-radius: 10px;
  padding: 10px 14px;
}
section.alt .board .row { background: var(--surface); }
.board .rank { font-family: var(--mono); font-weight: 600; color: var(--ink-dim); }
.board .who { font-weight: 600; }
.board .tot { font-family: var(--mono); font-weight: 600; font-size: 19px; }
.board .tag { font-size: 11px; letter-spacing: 0.08em; font-weight: 700; color: var(--accent); margin-left: 7px; }

/* =======================================================================
   STEPS
   ======================================================================= */
.steps { counter-reset: step; display: grid; gap: var(--space-xl); }
.step { display: grid; grid-template-columns: 44px 1fr; gap: var(--space-md); align-items: start; }
.step::before {
  counter-increment: step;
  content: counter(step);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  width: 36px; height: 36px;
  border-radius: 999px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  color: var(--brand);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
}
.step p { color: var(--ink-dim); margin-bottom: 0; }

/* =======================================================================
   BUTTONS
   ======================================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand);
  color: var(--on-brand);
  padding: 13px 24px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  border: 1px solid transparent;
  transition: filter 140ms ease, transform 140ms ease;
}
.btn:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--hairline); }
.btn.ghost:hover { border-color: var(--ink-dim); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin: var(--space-lg) 0 var(--space-2xl); }
.hero .actions { margin-bottom: var(--space-2xl); }

/* =======================================================================
   FACTS STRIP
   ======================================================================= */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-lg); }
.fact .n { font-family: var(--mono); font-size: 32px; font-weight: 600; color: var(--brand); line-height: 1; }
.fact .d { color: var(--ink-dim); font-size: 15px; margin-top: 6px; }

/* =======================================================================
   TABLES
   ======================================================================= */
.tablewrap { overflow-x: auto; margin: var(--space-md) 0 var(--space-lg); border: 1px solid var(--hairline); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 16px; background: var(--surface-raised); }
section.alt table { background: var(--surface); }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-dim); font-weight: 700; }
td.num { font-family: var(--mono); white-space: nowrap; }

/* =======================================================================
   FAQ
   ======================================================================= */
.qa { border-top: 1px solid var(--hairline); padding: var(--space-lg) 0; }
.qa:last-of-type { border-bottom: 1px solid var(--hairline); }
.qa h3 { margin-bottom: 6px; }
.qa p { color: var(--ink-dim); margin-bottom: 0; }

/* =======================================================================
   CALLOUT
   ======================================================================= */
.callout {
  border-left: 4px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
}
.callout p:last-child { margin-bottom: 0; }

/* =======================================================================
   CLOSING CTA
   ======================================================================= */
.closer { text-align: center; padding: var(--space-2xl) 0; }
.closer h2 { max-width: 20ch; margin-inline: auto; }
.closer p { color: var(--ink-dim); max-width: 48ch; margin-inline: auto; }
.closer .actions { justify-content: center; margin-bottom: 0; }

/* =======================================================================
   FOOTER
   ======================================================================= */
footer.site {
  border-top: 1px solid var(--hairline);
  background: var(--surface-raised);
  padding: var(--space-2xl) 0 var(--space-xl);
  color: var(--ink-dim);
  font-size: 15px;
}
.footcols { display: grid; gap: var(--space-xl); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: var(--space-xl); }
.footcols h4 { font-size: 12px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink); margin: 0 0 10px; }
.footcols a { display: block; color: var(--ink-dim); text-decoration: none; margin-bottom: 7px; }
.footcols a:hover { color: var(--brand); }
.disclaimer { font-size: 13px; line-height: 1.5; border-top: 1px solid var(--hairline); padding-top: var(--space-lg); }

ul { margin: 0 0 var(--space-md); padding-left: 1.2em; }
li { margin-bottom: 6px; }
hr { border: 0; border-top: 1px solid var(--hairline); margin: var(--space-2xl) 0; }

/* Motion is decoration here; anyone who has asked for less gets none. */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .btn:hover { transform: none; }
}
