/* ============================================================
   BrettZone v2 — Base styles
   Reset, typography, layout primitives, type utilities.
   Loaded after bz-tokens.css.
   ============================================================ */

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

/* Honor the HTML `hidden` attribute even when component-level CSS
   sets a display value (display:flex / display:grid override the UA
   `[hidden] { display:none }` rule because of equal-specificity ties). */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bz-bg);
  color: var(--bz-text);
  font-family: var(--bz-font-ui);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { min-height: 100vh; }

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

a { color: inherit; text-decoration: none; }
a:hover { color: var(--bz-text); }

button { font-family: inherit; }

::selection { background: var(--bz-accent-bg); color: var(--bz-text); }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bz-bg); }
::-webkit-scrollbar-thumb { background: var(--bz-surface-3); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--bz-border-strong); }

/* ============================================================
   Type utilities
   ============================================================ */

.bz-display {
  font-family: var(--bz-font-display);
  font-weight: 800;                 /* DIN Next Heavy */
  letter-spacing: -0.015em;         /* DIN runs wider than the old condensed face */
  line-height: 0.95;
  text-transform: uppercase;
}
.bz-display-xl { font-size: 56px; }
.bz-display-l  { font-size: 40px; }
.bz-display-m  { font-size: 24px; }
.bz-display-s  { font-size: 17px; font-weight: 600; }

.bz-eyebrow {
  font: 700 11px/1 var(--bz-font-ui);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bz-text-muted);
}

.bz-mono { font-family: var(--bz-font-mono); }
.bz-mono-sm { font: 400 11px/1.2 var(--bz-font-mono); letter-spacing: 0.04em; }
.bz-mono-md { font: 500 12px/1.2 var(--bz-font-mono); letter-spacing: 0.04em; }

.bz-ui {
  font: 600 12px/1 var(--bz-font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bz-text-dim   { color: var(--bz-text-dim); }
.bz-text-muted { color: var(--bz-text-muted); }
.bz-text-faint { color: var(--bz-text-faint); }

/* ============================================================
   Page shell (sidebar + content)
   ============================================================ */

.bz-shell {
  display: grid;
  grid-template-columns: var(--bz-sidebar-w) 1fr;
  min-height: 100vh;
}

.bz-shell__content {
  display: flex;
  flex-direction: column;
  min-width: 0; /* enable child overflow */
}

.bz-page {
  flex: 1;
  padding: 22px 28px;
  max-width: var(--bz-content-max);
  width: 100%;
}

.bz-page--wide { max-width: var(--bz-bracket-max); }
.bz-page--bleed { padding: 0; max-width: none; }

@media (max-width: 1099px) {
  .bz-shell { grid-template-columns: 1fr; }
}

/* Bare shell — used by /create/* tool surfaces that own the viewport.
   No sidebar, no global topbar, no scroll on the body; the editor manages
   its own internal scroll regions. */
body.bz--bare {
  overflow: hidden;
  min-height: 0;
  height: 100vh;
  height: 100dvh;
  margin: 0;
}
.bz-bare {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  min-height: 0;
}

/* ============================================================
   Focus visibility (accessibility)
   ============================================================ */

:focus-visible {
  outline: none;
  box-shadow: var(--bz-glow-focus);
}

/* ============================================================
   Scanline texture (broadcast atmosphere)
   ============================================================ */

.bz-scanlines { position: relative; }
.bz-scanlines::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(255,255,255,0.018) 0px,
    rgba(255,255,255,0.018) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
  z-index: 1;
}

/* ============================================================
   Common keyframes
   ============================================================ */

@keyframes bz-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Gentle live-state breathe — replaces the hard blink on live markers */
@keyframes bz-live-breathe {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

@keyframes bz-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes bz-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes bz-shimmer {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

/* ============================================================
   Inline link treatment (Polish Appendix A #5)
   Dotted underline that solidifies on hover. No blue.
   ============================================================ */

.bz-link {
  color: var(--bz-text-dim);
  text-decoration: underline dotted var(--bz-text-faint);
  text-underline-offset: 2px;
  transition: color var(--bz-d-fast) var(--bz-ease),
              text-decoration-color var(--bz-d-fast) var(--bz-ease);
}
.bz-link:hover {
  color: var(--bz-text);
  text-decoration: underline solid var(--bz-accent-strong);
}

/* ============================================================
   Sticky-section gradient (Polish Appendix A #7)
   Fade beneath sticky table headers so scrolled content
   visibly slides behind them.
   ============================================================ */

.bz-sticky-fade {
  position: relative;
}
.bz-sticky-fade::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 100%;
  height: 12px;
  background: linear-gradient(180deg, rgba(11,10,22,0.85), rgba(11,10,22,0));
  pointer-events: none;
}

/* ============================================================
   NHRL brand motifs
   ============================================================ */

/* Corner cut — the arena-corner triangle from the NHRL logo.
   One clipped corner per element; combine with existing radius-free
   surfaces. Size via --bz-cut / --bz-cut-lg. */
.bz-cut {
  clip-path: polygon(
    0 0,
    calc(100% - var(--bz-cut)) 0,
    100% var(--bz-cut),
    100% 100%,
    0 100%
  );
  border-radius: 0;
}
.bz-cut--lg { --bz-cut: var(--bz-cut-lg); }
.bz-cut--bl {
  clip-path: polygon(
    0 0,
    100% 0,
    100% 100%,
    var(--bz-cut) 100%,
    0 calc(100% - var(--bz-cut))
  );
}

/* Caution strip — diagonal stripes from the brand guide.
   Tinted via currentColor so context decides the hue.
   Use in moderation: ticker edges, ON-AIR rail, hero dividers. */
.bz-caution {
  --bz-caution-w: 7px;
  background-image: repeating-linear-gradient(
    -45deg,
    currentColor 0,
    currentColor var(--bz-caution-w),
    transparent var(--bz-caution-w),
    transparent calc(var(--bz-caution-w) * 2)
  );
}
.bz-caution--thin { --bz-caution-w: 4px; }

/* Ready-made divider bar (brand light blue at low opacity) */
.bz-caution-divider {
  height: 6px;
  color: var(--bz-brand-blue);
  opacity: 0.55;
  border: 0;
  margin: 0;
}

/* ============================================================
   Hero display type — Joyride with the brand guide's layered
   outline echo. Set data-echo to the same text to enable the
   offset outline repetition behind the headline.
   ============================================================ */

.bz-hero-display {
  font-family: var(--bz-font-hero);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  position: relative;
  display: inline-block;
  z-index: 0;   /* own stacking context so the echo stays directly behind */
}
.bz-hero-display::before {
  content: attr(data-echo);
  position: absolute;
  top: -0.09em;
  left: -0.09em;
  font-family: var(--bz-font-hero-outline);
  color: var(--bz-brand-blue);
  opacity: 0.6;
  white-space: nowrap;
  pointer-events: none;
  z-index: -1;
}
/* Joyride runs much wider than DIN — step the scale down */
.bz-hero-display.bz-display-xl { font-size: 40px; }
.bz-hero-display.bz-display-l  { font-size: 28px; }
.bz-hero-display.bz-display-m  { font-size: 18px; }
@media (max-width: 767px) {
  .bz-hero-display.bz-display-xl { font-size: 26px; }
  /* The nowrap echo misaligns once the headline wraps — desktop-only motif */
  .bz-hero-display::before { content: none; }
}
