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

html {
  scroll-behavior: smooth;
  color-scheme: light dark;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background:
    radial-gradient(ellipse 80% 50% at 70% -10%, var(--glow), transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 100%, color-mix(in srgb, var(--chart-3) 8%, transparent), transparent 50%),
    var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-4);
  transform: translateY(-160%);
  background: var(--accent-primary);
  color: var(--accent-foreground);
  padding: var(--space-2) var(--space-4);
  z-index: 100;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--pad-x);
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-canvas) 88%, transparent);
  backdrop-filter: blur(12px);
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.nav {
  display: none;
  flex: 1;
  justify-content: center;
  gap: var(--space-1);
}

.nav a {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.nav a:hover,
.nav a.is-active {
  color: var(--text-primary);
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.theme-toggle,
.nav-cta {
  min-height: 44px;
  min-width: 44px;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border-strong);
  background: transparent;
  font-size: var(--text-sm);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-cta {
  background: var(--accent-primary);
  color: var(--accent-foreground);
  border-color: var(--accent-primary);
}

.nav-cta:hover {
  background: var(--accent-hover);
}

.theme-toggle:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

@media (min-width: 900px) {
  .nav {
    display: flex;
  }
}

/* Shared */
.eyebrow {
  margin: 0 0 var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-primary);
}

.display {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

h2 {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-h2);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h3 {
  margin: 0;
  font-size: var(--text-h3);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.prose {
  margin: 0;
  max-width: 65ch;
  color: var(--text-secondary);
  text-wrap: pretty;
}

.lede {
  margin: var(--space-5) 0 0;
  max-width: 42ch;
  font-size: var(--text-h3);
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-secondary);
  text-wrap: pretty;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--space-5);
  border: 1px solid var(--border-strong);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn.primary {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--accent-foreground);
}

.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn.ghost {
  background: transparent;
}

.btn.ghost:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn-short {
  display: none;
}

@media (max-width: 520px) {
  .btn-full {
    display: none;
  }
  .btn-short {
    display: inline;
  }
}

.cta-row,
.contact-row,
.topic-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-7);
  align-items: center;
  max-width: var(--content);
  margin: 0 auto;
  padding: var(--space-8) var(--pad-x) var(--space-7);
  min-height: min(78dvh, 720px);
}

.hero-copy {
  max-width: 36rem;
}

.hero-visual {
  position: relative;
  aspect-ratio: 1;
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
}

@media (min-width: 880px) {
  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    gap: var(--space-8);
  }
}

.scope {
  position: absolute;
  inset: 8%;
}

.ring {
  position: absolute;
  inset: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
}

.r2 {
  inset: 16%;
  border-color: color-mix(in srgb, var(--accent-primary) 35%, var(--border-subtle));
}

.r3 {
  inset: 32%;
  border-color: color-mix(in srgb, var(--accent-primary) 55%, var(--border-subtle));
}

.axis-x,
.axis-y {
  position: absolute;
  background: var(--border-subtle);
}

.axis-x {
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
}

.axis-y {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
}

.sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 210deg,
    transparent 0deg,
    color-mix(in srgb, var(--accent-primary) 28%, transparent) 42deg,
    transparent 70deg
  );
  animation: sweep 8s linear infinite;
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px));
}

.blip {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-primary);
  top: 28%;
  left: 68%;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent-primary) 25%, transparent);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes sweep {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sweep,
  .blip {
    animation: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* Tier 1 */
.tier {
  max-width: var(--content);
  margin: 0 auto;
  padding: var(--space-7) var(--pad-x);
}

.tier-head {
  margin-bottom: var(--space-6);
}

.signal-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 640px) {
  .signal-strip {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1000px) {
  .signal-strip {
    grid-template-columns: repeat(4, 1fr);
  }
}

.signal-card {
  display: flex;
  flex-direction: column;
  min-height: 180px;
  padding: var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.15s ease;
}

.signal-card:hover {
  border-color: var(--accent-primary);
}

.signal-index {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.signal-card h3 {
  margin-top: var(--space-4);
}

.signal-kpi {
  margin: auto 0 0;
  padding-top: var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-kpi);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--accent-primary);
}

.signal-meta {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Tier 2 stages */
.stage {
  border-top: 1px solid var(--border-subtle);
}

.stage-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  max-width: var(--content);
  margin: 0 auto;
  padding: var(--space-8) var(--pad-x);
  align-items: center;
}

@media (min-width: 900px) {
  .stage-grid {
    grid-template-columns: 1.65fr 1fr;
    gap: var(--space-7);
  }

  .stage-even .stage-grid {
    grid-template-columns: 1fr 1.65fr;
  }
}

.stage-rail {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.stage-visual {
  margin: 0;
  padding: var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.stage-visual figcaption {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.stage-visual svg {
  width: 100%;
  height: auto;
  aspect-ratio: 480 / 300;
}

/* SVG theming */
.stage-visual .grid line,
.stage-visual .rink,
.stage-visual .node,
.stage-visual .dashed,
.stage-visual .bar-track {
  fill: none;
  stroke: var(--border-subtle);
  stroke-width: 1;
}

.stage-visual .bar-track {
  fill: var(--bg-subtle);
  stroke: none;
}

.stage-visual .node {
  fill: var(--bg-subtle);
}

.stage-visual .node-accent {
  fill: color-mix(in srgb, var(--accent-primary) 14%, var(--bg-subtle));
  stroke: var(--accent-primary);
  stroke-width: 1.5;
}

.stage-visual .node.dashed {
  stroke-dasharray: 4 3;
  fill: transparent;
}

.stage-visual .series-1 {
  fill: none;
  stroke: var(--chart-1);
  stroke-width: 2.5;
}

.stage-visual .series-2 {
  fill: none;
  stroke: var(--chart-2);
  stroke-width: 2;
}

.stage-visual .series-muted {
  fill: none;
  stroke: var(--chart-6);
  stroke-width: 1.5;
  opacity: 0.7;
}

.stage-visual .dashed {
  stroke-dasharray: 5 4;
}

.stage-visual .cadence line {
  stroke: var(--border-subtle);
  stroke-dasharray: 2 4;
  stroke-width: 1;
}

.stage-visual .markers circle {
  fill: var(--chart-1);
  stroke: var(--bg-surface);
  stroke-width: 2;
}

.stage-visual .player {
  fill: var(--bg-subtle);
  stroke: var(--text-secondary);
  stroke-width: 1.5;
}

.stage-visual .player-x {
  fill: var(--bg-subtle);
  stroke: var(--chart-2);
  stroke-width: 1.5;
}

.stage-visual .axis-labels,
.stage-visual .body-label,
.stage-visual .on-accent {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--text-muted);
}

.stage-visual .body-label {
  fill: var(--text-secondary);
  font-weight: 500;
}

.stage-visual .accent {
  fill: var(--accent-primary);
}

.stage-visual .on-accent {
  fill: var(--accent-foreground);
  font-weight: 600;
}

.stage-visual .bar-6 {
  fill: var(--chart-6);
  stroke: none;
}

.stage-visual .bar-1 {
  fill: var(--chart-1);
  stroke: none;
}

.stage-visual .funnel {
  fill: color-mix(in srgb, var(--chart-1) 18%, transparent);
  stroke: var(--chart-1);
  stroke-width: 1.5;
}

.stage-visual .pill-row rect {
  fill: transparent;
  stroke: var(--border-strong);
  stroke-width: 1;
}

.stage-visual .pill-row text {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--text-secondary);
}

.stage-visual .flow {
  stroke-width: 2;
  marker-end: none;
}

.stage-visual .vector {
  fill: none;
  stroke-width: 2;
}

/* Hockey coaching board */
.hockey-board .hb-boards {
  fill: var(--bg-subtle);
  stroke: var(--border-strong);
  stroke-width: 2;
}

.hockey-board .hb-blue-line {
  stroke: var(--chart-1);
  stroke-width: 3;
  fill: none;
}

.hockey-board .hb-goal-line {
  stroke: var(--status-negative);
  stroke-width: 2;
  fill: none;
}

.hockey-board .hb-net {
  fill: none;
  stroke: var(--text-secondary);
  stroke-width: 1.5;
}

.hockey-board .hb-crease {
  fill: color-mix(in srgb, var(--chart-1) 12%, transparent);
  stroke: var(--chart-1);
  stroke-width: 1.25;
}

.hockey-board .hb-faceoff {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 1.25;
}

.hockey-board .hb-dot {
  fill: var(--text-secondary);
  stroke: none;
}

.hockey-board .hb-hash {
  stroke: var(--border-strong);
  stroke-width: 1.25;
  fill: none;
}

/* USA Hockey: solid = skate, dashed = pass, wavy path = shot */
.hockey-board .hb-skate {
  fill: none;
  stroke: var(--chart-1);
  stroke-width: 2;
}

.hockey-board .hb-pass {
  fill: none;
  stroke: var(--chart-1);
  stroke-width: 1.75;
  stroke-dasharray: 5 4;
}

.hockey-board .hb-shot {
  fill: none;
  stroke: var(--chart-2);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hockey-board .hb-arrowhead-pass {
  fill: var(--chart-1);
  stroke: none;
}

.hockey-board .hb-arrowhead-skate {
  fill: var(--chart-3);
  stroke: none;
}

.hockey-board .hb-arrowhead-shot {
  fill: var(--chart-2);
  stroke: none;
}

.hockey-board .hb-anno {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  fill: var(--chart-2);
}

.hockey-board .hb-o circle {
  fill: var(--bg-surface);
  stroke: var(--chart-1);
  stroke-width: 2;
}

.hockey-board .hb-o text {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  fill: var(--chart-1);
  text-anchor: middle;
}

.hockey-board .hb-x line {
  stroke: var(--chart-2);
  stroke-width: 2.25;
  stroke-linecap: square;
}

.hockey-board .hb-puck {
  fill: var(--text-primary);
  stroke: var(--bg-surface);
  stroke-width: 1;
}

.hockey-board .hb-legend text {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--text-muted);
}

.hockey-board .hb-legend-o {
  fill: var(--bg-surface);
  stroke: var(--chart-1);
  stroke-width: 1.5;
}

.hockey-board .hb-legend-x {
  stroke: var(--chart-2);
  stroke-width: 1.75;
}

.hockey-board .hb-legend-skate {
  stroke: var(--chart-1);
  stroke-width: 2;
}

.hockey-board .hb-legend-pass {
  stroke: var(--chart-1);
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
}

.hockey-board .hb-legend-shot {
  fill: none;
  stroke: var(--chart-2);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.spec {
  margin: var(--space-2) 0 0;
  display: grid;
  gap: var(--space-4);
}

.spec > div {
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}

.spec dt {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.spec dd {
  margin: var(--space-1) 0 0;
  color: var(--text-primary);
}

/* Archive */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

.chip {
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.chip.is-active,
.chip:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.archive-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.archive-table th,
.archive-table td {
  padding: var(--space-4);
  text-align: start;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.archive-table thead th {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-subtle);
}

.archive-table tbody th {
  font-weight: 500;
  white-space: nowrap;
}

.archive-table tbody tr:last-child th,
.archive-table tbody tr:last-child td {
  border-bottom: none;
}

.state {
  margin-top: var(--space-5);
  padding: var(--space-6);
  border: 1px dashed var(--border-strong);
  background: var(--bg-subtle);
  text-align: center;
}

.state p {
  margin: 0 0 var(--space-4);
  color: var(--text-secondary);
}

.state-error {
  border-color: var(--status-negative);
}

/* Close */
.close {
  max-width: var(--content);
  margin: 0 auto;
  padding: var(--space-8) var(--pad-x) var(--space-9);
  border-top: 1px solid var(--border-subtle);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--pad-x);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

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