/* ═══════════════════════════════════════════════════════════════
   BFTB — GLOBAL RESET + TYPE ROLES
   ───────────────────────────────────────────────────────────────
   Depends on tokens.css. Contains NO colour values of its own —
   every value here resolves through a var(). See BRAND.md.

   LOAD ORDER MATTERS:
     fonts.css → tokens.css → base.css → [screen css]
   During the Phase 3 migration the legacy styles.css still loads
   last on `/`, so its class selectors out-specify the element and
   universal selectors below. That is deliberate: the app keeps
   working screen by screen. /styleguide loads no legacy CSS, so
   the reset is fully live there.
═══════════════════════════════════════════════════════════════ */

/* ── BOX MODEL ──────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

/* ── THE TWO GLOBAL KILLS ───────────────────────────────────────
   Radius is zero and elevation does not exist. Specificity 0, so
   legacy screen CSS still wins until Phase 3 strips it — but any
   NEW markup is square and flat by default with no effort.        */
*, *::before, *::after {
  border-radius: var(--bftb-radius);
  box-shadow: none;
}

/* The single sanctioned exception: the round mascot lockup. */
.bftb-mascot {
  border-radius: var(--bftb-radius-mascot);
}

/* ── PAGE ───────────────────────────────────────────────────── */
html {
  background: var(--bftb-black);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bftb-black);
  color: var(--bftb-white);
  font-family: var(--bftb-font-body);
  font-weight: 600;
  font-size: var(--bftb-body);
  line-height: var(--bftb-lh-body);
  letter-spacing: var(--bftb-track-body);
  /* Columns of odds, scores and units must align. Globally on. */
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
}

img, svg, video, canvas {
  display: block;
  max-width: 100%;
}

a {
  color: var(--bftb-accent);
  text-decoration: none;
}

hr {
  border: 0;
  border-top: var(--bftb-hairline) solid var(--bftb-faint);
  margin: 0;
}

/* ── FORM ELEMENTS INHERIT ──────────────────────────────────── */
button, input, select, textarea {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  background: none;
  border: 0;
  margin: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  color: var(--bftb-faint);
}

/* ── FOCUS — visible, always. Never remove this. ────────────── */
:focus-visible {
  outline: var(--bftb-focus-width) solid var(--bftb-lime);
  outline-offset: var(--bftb-focus-offset);
}

::selection {
  background: var(--bftb-lime);
  color: var(--bftb-lime-ink);
}

/* ── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bftb-black); }
::-webkit-scrollbar-thumb { background: var(--bftb-surface-2); }


/* ═══════════════════════════════════════════════════════════════
   TYPE ROLES
   Five roles, five faces. If text in this app is not one of these,
   it is a mistake. Use the class, never a bespoke font-family.
═══════════════════════════════════════════════════════════════ */

/* DISPLAY — Anton. Hero only. Two fills: solid lime, or black fill
   with a 2px white outline. Never anything else.                 */
.bftb-display {
  font-family: var(--bftb-font-display);
  font-weight: 400;
  font-size: var(--bftb-display);
  line-height: var(--bftb-lh-display);
  letter-spacing: var(--bftb-track-display);
  text-transform: uppercase;
}
.bftb-display--xl { font-size: var(--bftb-display-xl); }
.bftb-display--sm { font-size: var(--bftb-display-sm); }

/* Fill 1 — solid lime. */
.bftb-display--lime { color: var(--bftb-accent); }

/* Fill 2 — PAGE-COLOURED fill with a thick ink outline, so the letterforms
   read as hollow. On the flat page that is the whole effect; over the photo
   wash the fill also masks the image inside each letter.

   Built from eight text-shadows rather than -webkit-text-stroke. A stroke
   straddles the glyph edge, so without paint-order support — patchy on iOS
   Safari, and this is a phone-first PWA — half of it lands INSIDE the letter.
   On a condensed face like Anton that closes the counters and the whole word
   reads as solid black, which is the opposite of the intent. A shadow is
   always painted behind the glyph, so the fill stays pure white everywhere. */
.bftb-display--outline {
  color: var(--bftb-black);
  /* Outlined display sets its own line-height, because the outline changes
     what "touching" means.

     --bftb-lh-display is Anton's measured cap height (0.8594), which is where
     two lines of bare CAPS meet. But this variant paints --bftb-stroke beyond
     the glyph top and bottom, so at that value the outlines run into each
     other and the letterforms collide.

     Cap + 2x stroke puts the two OUTLINES edge to edge: no overlap, no gap,
     and the fill of one line sits exactly one stroke-pair away from the next.
     That is the reference. Written as a calc so it tracks the stroke weight
     rather than going stale at a literal 0.9994. */
  line-height: calc(0.8594em + 2 * var(--bftb-stroke));
  text-shadow:
    var(--bftb-stroke) 0 0 var(--bftb-white),
    calc(var(--bftb-stroke) * -1) 0 0 var(--bftb-white),
    0 var(--bftb-stroke) 0 var(--bftb-white),
    0 calc(var(--bftb-stroke) * -1) 0 var(--bftb-white),
    var(--bftb-stroke) var(--bftb-stroke) 0 var(--bftb-white),
    calc(var(--bftb-stroke) * -1) var(--bftb-stroke) 0 var(--bftb-white),
    var(--bftb-stroke) calc(var(--bftb-stroke) * -1) 0 var(--bftb-white),
    calc(var(--bftb-stroke) * -1) calc(var(--bftb-stroke) * -1) 0 var(--bftb-white);
}

/* HEADING — Bebas Neue. Sections and card titles. */
.bftb-head {
  font-family: var(--bftb-font-head);
  font-weight: 400;
  font-size: var(--bftb-head);
  line-height: var(--bftb-lh-head);
  letter-spacing: var(--bftb-track-head);
  text-transform: uppercase;
  color: var(--bftb-white);
}
.bftb-head--lg { font-size: var(--bftb-head-lg); }
.bftb-head--sm { font-size: var(--bftb-head-sm); }

/* LABEL — Oswald, wide-tracked caps. THE texture of the brand.
   Eyebrows, meta, nav, footers, chip text, unit suffixes.         */
.bftb-label {
  font-family: var(--bftb-font-label);
  font-weight: 600;
  font-size: var(--bftb-label);
  line-height: var(--bftb-lh-label);
  letter-spacing: var(--bftb-track-label);
  text-transform: uppercase;
  color: var(--bftb-mute);
}
.bftb-label--sm   { font-size: var(--bftb-label-sm); }
.bftb-label--xs   { font-size: var(--bftb-label-xs); }
.bftb-label--wide { letter-spacing: var(--bftb-track-label-w); }
.bftb-label--tight{ letter-spacing: var(--bftb-track-label-n); }
.bftb-label--lime { color: var(--bftb-accent); }
.bftb-label--white{ color: var(--bftb-white); }
.bftb-label--ink  { color: var(--bftb-lime-ink); }

/* BODY — Barlow Semi Condensed 600, sentence case. Prose. */
.bftb-body {
  font-family: var(--bftb-font-body);
  font-weight: 600;
  font-size: var(--bftb-body);
  line-height: var(--bftb-lh-body);
  letter-spacing: var(--bftb-track-body);
  color: var(--bftb-white);
}
.bftb-body--lg   { font-size: var(--bftb-body-lg); }
.bftb-body--sm   { font-size: var(--bftb-body-sm); }
.bftb-body--mute { color: var(--bftb-mute); }

/* NUM — Bebas Neue. Odds, times, scores, units, percentages. */
.bftb-num {
  font-family: var(--bftb-font-num);
  font-weight: 400;
  font-size: var(--bftb-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  letter-spacing: var(--bftb-track-body);
  color: var(--bftb-white);
}
.bftb-num--lg   { font-size: var(--bftb-num-lg); }
.bftb-num--sm   { font-size: var(--bftb-num-sm); }
.bftb-num--lime { color: var(--bftb-accent); }
.bftb-num--mute { color: var(--bftb-mute); }


/* ── UTILITY ────────────────────────────────────────────────── */

/* Screen-reader only — for icon-only controls, which still need a name. */
.bftb-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Every interactive element clears the 44px tap target. */
.bftb-tap {
  min-width: var(--bftb-tap);
  min-height: var(--bftb-tap);
}


/* ── MOTION ─────────────────────────────────────────────────────
   Mechanical only: opacity + 2–4px translate, 120–160ms, ease-out. */
.bftb-motion {
  transition:
    opacity   var(--bftb-dur) var(--bftb-ease),
    transform var(--bftb-dur) var(--bftb-ease),
    background-color var(--bftb-dur-fast) var(--bftb-ease),
    border-color     var(--bftb-dur-fast) var(--bftb-ease);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
