/* UPEND — share surface.
   Committed dark: these pages are the app's design system on the open web,
   and the app itself is dark-first by product thesis (see design-direction.md §2). */

/* Archivo (Omnibus-Type, SIL OFL — fonts/OFL.txt). Self-hosted rather than
   loaded from a CDN: this is the primary acquisition channel, so it gets no
   third-party request, and og/generate.sh renders from the same typeface
   instead of depending on macOS resolving a system font by name.
   The wdth axis is the reason this face was chosen — see design-direction §3.
   Served immutable for a year (vercel.json), so if the file ever changes it
   must be renamed, not overwritten. */
@font-face {
  font-family: "Archivo";
  src: url("/fonts/Archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink:       #0A0810;
  --surface:   #15111C;
  --surface-2: #1E1826;
  --line:      #2E2637;

  --bone:      #F2EDE4;   /* 17.07:1 on ink — highlights and numerals, never body */
  --muted:     #8B8296;   /*  5.43:1 — the real body colour */
  --faint:     #7D7489;   /*  4.50:1 — was #5D5568 at 2.81:1, below the AA floor */

  /* The dawn ramp. An OKLCH lightness ladder from night to amber:
     L 0.30 → 0.85 at hue 30° → 85°. --ember and --amber are steps on it,
     not separate choices — see docs/design/studies/01-in-app.html §02.
     r40 derives to #FF5A20 and r60 to #F5A100; both are snapped to the
     locked ember/amber values, which the ladder validated to within one
     channel. Contrast on ink: r00 1.40, r10 2.01, r20 3.05, r30 4.42,
     r40 6.38, r50 7.89, r60 9.53, r70 12.47. */
  --r00:       #5E0000;   /* ground only */
  --r10:       #851700;   /* ground only */
  --r20:       #B12B00;   /* large text only */
  --r30:       #DA3E00;   /* large text only */
  --r40:       #FF5A1F;   /* = --ember */
  --r50:       #FB8304;
  --r60:       #F0A431;   /* = --amber */
  --r70:       #FFC42D;

  --night:     #7E2411;
  --ember:     var(--r40);
  --amber:     var(--r60);

  --volt:      #D9F02B;   /* 77.2% luminance — wins only. The rarity is photometric. */
  --steel:     #6B6478;   /*  3.52:1 — display sizes only */
  --steel-body:#7C7589;   /*  4.50:1 — steel where it has to carry body text */

  --display: "Archivo", Impact, Haettenschweiler, "Arial Narrow Bold", "Franklin Gothic Bold", sans-serif;

  /* Archivo is variable, so every --display use must state its axes or it
     renders at the SemiBold/normal default. Numerals and marks take the
     narrowest, heaviest cut; sentences ease off both so words stay readable. */
  --display-num-wght: 900;  --display-num-wdth:  62%;
  --display-say-wght: 800;  --display-say-wdth:  68%;
  --ui: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --data: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--ui);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 40px;
}

/* the dawn ramp, as ambient ground */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(120% 70% at 50% 118%, var(--ember) 0%, var(--night) 32%, transparent 66%),
    linear-gradient(to top, #17070A 0%, var(--ink) 60%);
  opacity: 0.6;
  z-index: 0;
  pointer-events: none;
}

.shell { position: relative; z-index: 1; width: 100%; max-width: 420px; }

/* ---------- the card ---------- */

.card {
  border: 1px solid var(--line);
  background: rgba(21, 17, 28, 0.86);
  /* no backdrop-filter: there is nothing behind this card but a near-black
     ground, so the blur cost a compositing pass and rendered no difference. */
  padding: 30px 26px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  overflow: hidden;
}
.card::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--ember);
}
.card.win::after     { background: var(--volt); }
.card.forfeit::after { background: var(--steel); }

.label {
  font-family: var(--data);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0;
}

.verdict {
  font-family: var(--display);
  font-weight: var(--display-say-wght);
  font-stretch: var(--display-say-wdth);
  font-size: clamp(34px, 10vw, 46px);
  line-height: 0.92;
  text-transform: uppercase;
  margin: 0;
  color: var(--ember);
}
.card.win .verdict     { color: var(--volt); }
.card.forfeit .verdict { color: var(--steel); }

.score {
  display: flex;
  /* not baseline: each .side is a flex column, so its baseline is the *name*
     label's, which left the dash floating above the numerals */
  align-items: flex-end;
  gap: 14px;
  font-variant-numeric: tabular-nums;
}
.score .side { display: flex; flex-direction: column; gap: 2px; }
.score .name {
  font-family: var(--data);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.score .num {
  font-family: var(--display);
  font-weight: var(--display-num-wght);
  font-stretch: var(--display-num-wdth);
  font-size: 60px;
  line-height: 0.84;
  color: var(--bone);
  margin: 0;
}
.score .num.dns { font-size: 36px; color: var(--steel); letter-spacing: 0.02em; }
.score .dash {
  font-family: var(--display);
  font-weight: var(--display-num-wght);
  font-stretch: var(--display-num-wdth);
  font-size: 34px; color: var(--faint); line-height: 1; margin-bottom: 8px;
}

.times {
  display: flex;
  gap: 22px;
  font-family: var(--data);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* The lower third. Broadcast already has a form for attributed commentary,
   and it is a filled slab bleeding to the frame edges — not a coloured rule.
   It also survives thumbnail size, which the rule did not, and it gives the
   voice packs somewhere to be named. */
.commentary {
  margin: 0 -26px;
  background: var(--ember);
  color: #200609;
  padding: 13px 26px 15px;
  font-size: 16.5px;
  line-height: 1.4;
  font-weight: 500;
}
.commentary .src {
  display: block;
  font-family: var(--data);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 400;
  opacity: 0.62;
  margin-bottom: 5px;
}
.card.win .commentary { background: var(--volt); color: #14180A; }
/* steel carries bone, not ink: ink on steel is 3.44:1 and fails AA at this
   size, bone on steel is 4.84:1 — and the inversion reads as drained. */
.card.forfeit .commentary { background: var(--steel); color: var(--bone); }

.meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-family: var(--data);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.badge.verified { color: var(--volt); }

/* ---------- call to action ---------- */

.cta {
  display: block;
  margin-top: 18px;
  padding: 17px 20px;
  background: var(--ember);
  color: #26060A;
  text-align: center;
  text-decoration: none;
  font-family: var(--display);
  font-weight: var(--display-say-wght);
  font-stretch: var(--display-say-wdth);
  font-size: 21px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 0;
  width: 100%;
  cursor: pointer;
}
.cta:hover, .cta:focus-visible { background: var(--amber); }

.cta-note {
  font-family: var(--data);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: center;
  margin: 14px 0 0;
}

/* ---------- wordmark ---------- */

.wordmark {
  font-family: var(--display);
  font-weight: var(--display-num-wght);
  font-stretch: 70%;
  font-size: 26px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--bone);
  margin: 0 0 20px;
  text-align: center;
}
.wordmark span { color: var(--ember); }

.defn {
  font-family: var(--data);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--faint);
  text-align: center;
  margin: 26px 0 0;
}

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

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
