/* ==========================================================================
   The Eternal Turnover - Main Stylesheet
   ========================================================================== */

/* ==========================================================================
   Design Tokens (CSS Custom Properties)
   ========================================================================== */

:root {
  /* Colors - Primary Palette */
  --color-blood-red: #cc0000;
  --color-dark-red: #8b0000;
  --color-pitch-black: #000;
  --color-bone-white: #fff;
  --color-gold: #ffcc00;

  /* Colors - Grays */
  --color-gray-100: #f5f5f5;
  --color-gray-200: #d0d0d0;
  --color-gray-300: #aaa;
  --color-gray-400: #999;
  --color-gray-500: #888;
  --color-gray-600: #666;
  --color-gray-700: #333;
  --color-gray-800: #222;
  --color-gray-900: #111;

  /* Colors - Backgrounds */
  --color-bg-primary: #000;
  --color-bg-secondary: #0a0a0a;
  --color-bg-tertiary: #050505;
  --color-bg-dark-red: #1a0000;
  --color-bg-dark-gold: #1a1400;
  --color-bg-darker-gold: #0f0c00;

  /* Typography - Font Families */
  --font-display: 'Road Rage', 'Bebas Neue', Impact, sans-serif;
  --font-heading: 'Bebas Neue', Impact, sans-serif;
  --font-accent: 'Teko', sans-serif;
  --font-body: 'Roboto Condensed', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: monospace;

  /* Typography - Font Weights */
  --weight-normal: 400;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Typography - Font Sizes */
  --text-xs: 0.65rem;
  --text-sm: 0.75rem;
  --text-base: 0.85rem;
  --text-md: 0.95rem;
  --text-lg: 1rem;
  --text-xl: 1.1rem;
  --text-2xl: 1.2rem;
  --text-3xl: 1.8rem;

  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.2rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Layout */
  --max-width-prose: 800px;
  --max-width-content: 1200px;

  /* Borders */
  --border-thin: 1px;
  --border-medium: 2px;
  --border-thick: 4px;
  --border-ultra: 6px;

  /* Shadows */
  --shadow-text: 2px 2px 4px rgba(0, 0, 0, 0.8);
  --shadow-text-strong: 3px 3px 0 var(--color-blood-red), 6px 6px 10px rgba(0, 0, 0, 0.8);
  --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.9), 0 0 60px rgba(204, 0, 0, 0.4);
  --shadow-nav: 0 6px 20px rgba(0, 0, 0, 0.9), 0 0 40px rgba(204, 0, 0, 0.3);

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;

  /* Breakpoints (for reference in media queries) */
  --bp-xs: 480px;
  --bp-sm: 640px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;
  --bp-2xl: 1440px;

  /* Patterns - Checkered */
  --pattern-checkered-nav: repeating-linear-gradient(
    90deg,
    var(--color-pitch-black) 0px,
    var(--color-pitch-black) 20px,
    var(--color-bone-white) 20px,
    var(--color-bone-white) 40px
  );
  --pattern-checkered-diagonal: repeating-linear-gradient(
    45deg,
    var(--color-pitch-black) 0px,
    var(--color-pitch-black) 10px,
    var(--color-bone-white) 10px,
    var(--color-bone-white) 20px
  );
  --pattern-checkered-gold: repeating-linear-gradient(
    90deg,
    var(--color-gold) 0px,
    var(--color-gold) 40px,
    var(--color-pitch-black) 40px,
    var(--color-pitch-black) 80px
  );
  --pattern-reversion: repeating-linear-gradient(
    45deg,
    var(--color-bg-dark-gold) 0px,
    var(--color-bg-dark-gold) 10px,
    var(--color-bg-darker-gold) 10px,
    var(--color-bg-darker-gold) 20px
  );
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--color-pitch-black);
  background-image: url('/assets/bg.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--color-gray-200);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: -1;
  pointer-events: none;
}

/* Fallback for browsers without backdrop-filter support */
@supports not (backdrop-filter: blur(2px)) {
  body::before {
    background-color: rgba(0, 0, 0, 0.8);
  }
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-normal);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-bone-white);
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.8);
}

/* ==========================================================================
   Navigation
   ========================================================================== */

nav {
  background:
    var(--pattern-checkered-nav),
    linear-gradient(180deg, var(--color-bg-dark-red) 0%, var(--color-pitch-black) 100%);
  background-blend-mode: overlay;
  border-bottom: var(--border-thick) solid var(--color-blood-red);
  border-top: var(--border-medium) solid var(--color-bone-white);
  padding: var(--space-4) 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-nav);
}

.nav-container {
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: 0 var(--space-8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  position: relative;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: var(--weight-normal);
  color: var(--color-bone-white);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow:
    2px 2px 0 var(--color-blood-red),
    4px 4px 0 var(--color-pitch-black),
    -1px -1px 0 rgba(204, 0, 0, 0.3),
    0 0 15px rgba(0, 0, 0, 0.7);
  transition: all var(--transition-normal);
  filter: contrast(1.2) drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.5));
  position: relative;
}

.brand:hover,
.brand:focus {
  color: var(--color-blood-red);
  text-shadow:
    2px 2px 0 var(--color-bone-white),
    4px 4px 0 var(--color-pitch-black),
    -1px -1px 0 rgba(255, 255, 255, 0.3),
    0 0 20px rgba(204, 0, 0, 0.8);
  transform: translateY(-1px);
  filter: contrast(1.3) drop-shadow(3px 3px 5px rgba(204, 0, 0, 0.6));
  outline: none;
}

.nav-links {
  display: flex;
  gap: var(--space-8);
  list-style: none;
}

.nav-links a {
  color: var(--color-bone-white);
  text-decoration: none;
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  font-size: var(--text-lg);
  letter-spacing: 0.08em;
  padding: var(--space-2) var(--space-5);
  border-radius: 0;
  transition: all var(--transition-fast);
  border: var(--border-medium) solid transparent;
  background: rgba(0, 0, 0, 0.5);
}

.nav-links a:hover,
.nav-links a:focus {
  color: var(--color-pitch-black);
  border-color: var(--color-bone-white);
  background: var(--color-blood-red);
  box-shadow: 0 0 10px rgba(204, 0, 0, 0.8);
  outline: none;
}

.nav-links a:focus-visible {
  outline: 2px solid var(--color-bone-white);
  outline-offset: 2px;
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: var(--space-2);
  background: rgba(0, 0, 0, 0.5);
  border: var(--border-medium) solid var(--color-blood-red);
  gap: 0.3rem;
}

.hamburger:focus-visible {
  outline: 2px solid var(--color-bone-white);
  outline-offset: 2px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--color-bone-white);
  transition: all var(--transition-normal);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* ==========================================================================
   Main Content
   ========================================================================== */

main {
  flex: 1;
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: var(--space-8);
  width: 100%;
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
  background:
    var(--pattern-checkered-nav),
    linear-gradient(0deg, var(--color-bg-dark-red) 0%, var(--color-pitch-black) 100%);
  background-blend-mode: overlay;
  border-top: var(--border-thick) solid var(--color-blood-red);
  border-bottom: var(--border-medium) solid var(--color-bone-white);
  padding: var(--space-8);
  text-align: center;
  margin-top: auto;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.9);
}

.tagline {
  color: var(--color-blood-red);
  font-family: var(--font-accent);
  font-style: normal;
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-2);
  text-shadow: var(--shadow-text);
}

.footer-text {
  color: var(--color-gray-500);
  font-size: 0.8rem;
  font-weight: var(--weight-bold);
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Home Page
   ========================================================================== */

.hero {
  text-align: center;
  padding: var(--space-12) 0 var(--space-20);
}

.hero-title {
  margin-bottom: var(--space-2);
}

.hero-logo {
  max-width: 100%;
  height: auto;
  width: clamp(150px, 40vw, 450px);
  filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 8px rgba(0, 0, 0, 0.9));
}

.hero-subtitle {
  font-size: clamp(1rem, 3vw, 1.8rem);
  color: var(--color-gray-500);
  font-weight: var(--weight-bold);
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-12);
  font-family: var(--font-accent);
}

.champion-card {
  max-width: 700px;
  margin: 0 auto;
  background:
    var(--pattern-checkered-diagonal),
    linear-gradient(135deg, var(--color-bg-dark-red) 0%, var(--color-pitch-black) 100%);
  background-blend-mode: overlay;
  border: var(--border-ultra) solid var(--color-bone-white);
  border-radius: 0;
  padding: 0;
  box-shadow:
    0 0 0 var(--border-ultra) var(--color-blood-red),
    0 0 0 12px var(--color-pitch-black),
    var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.champion-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: var(--pattern-checkered-gold);
  z-index: 1;
}

.champion-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: var(--pattern-checkered-gold);
  z-index: 1;
}

.champion-card-inner {
  background: var(--color-pitch-black);
  padding: var(--space-12) var(--space-8);
  position: relative;
}

.champion-label {
  font-size: var(--text-lg);
  color: var(--color-blood-red);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  margin-bottom: var(--space-6);
  font-weight: var(--weight-bold);
  font-family: var(--font-accent);
}

.champion-name {
  font-size: clamp(2.5rem, 7vw, 5rem);
  color: var(--color-bone-white);
  margin-bottom: 0;
  line-height: 1;
  text-shadow: var(--shadow-text-strong);
}

.champion-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0;
  margin-top: var(--space-12);
  padding-top: 0;
  border-top: var(--border-thick) solid var(--color-blood-red);
}

.stat {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  background: var(--color-bg-secondary);
  border: var(--border-medium) solid var(--color-gray-700);
  border-top: none;
  position: relative;
}

.stat:nth-child(odd) {
  background: var(--color-bg-tertiary);
}

.stat-value {
  font-size: 3rem;
  font-weight: var(--weight-bold);
  color: var(--color-blood-red);
  display: block;
  line-height: 1;
  font-family: var(--font-heading);
  text-shadow: var(--shadow-text);
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--color-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: var(--space-2);
  font-weight: var(--weight-bold);
}

.cta {
  text-align: center;
  margin-top: var(--space-16);
}

.cta-button {
  display: inline-block;
  padding: var(--space-5) 3.5rem;
  background: var(--color-blood-red);
  color: var(--color-pitch-black);
  text-decoration: none;
  text-transform: uppercase;
  font-weight: var(--weight-bold);
  letter-spacing: 0.15em;
  border-radius: 0;
  transition: all var(--transition-fast);
  border: var(--border-thick) solid var(--color-bone-white);
  box-shadow:
    0 0 0 var(--border-thick) var(--color-blood-red),
    0 0 0 8px var(--color-pitch-black),
    0 8px 20px rgba(0, 0, 0, 0.8);
  font-size: var(--text-xl);
  font-family: var(--font-heading);
}

.cta-button:hover,
.cta-button:focus {
  background: var(--color-bone-white);
  color: var(--color-blood-red);
  transform: translateY(-2px);
  box-shadow:
    0 0 0 var(--border-thick) var(--color-bone-white),
    0 0 0 8px var(--color-blood-red),
    0 12px 30px rgba(204, 0, 0, 0.6);
  outline: none;
}

.cta-button:focus-visible {
  outline: 2px solid var(--color-bone-white);
  outline-offset: 4px;
}

/* ==========================================================================
   Lineage Page
   ========================================================================== */

.lineage-header {
  text-align: center;
  padding: var(--space-6) 0 var(--space-4);
}

.lineage-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  color: var(--color-bone-white);
  margin-bottom: var(--space-2);
  text-shadow:
    2px 2px 0 var(--color-blood-red),
    4px 4px 0 var(--color-pitch-black),
    -1px -1px 0 rgba(204, 0, 0, 0.4),
    0 0 25px rgba(0, 0, 0, 0.9);
  position: relative;
  font-family: var(--font-display);
  filter: contrast(1.3) drop-shadow(3px 3px 5px rgba(0, 0, 0, 0.7));
  transform: rotate(-1deg);
}

.lineage-title::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grunge'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='2.5' numOctaves='4'/%3E%3CfeColorMatrix values='0 0 0 0 0, 0 0 0 0 0, 0 0 0 0 0, 0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grunge)'/%3E%3C/svg%3E");
  opacity: 0.6;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.lineage-subtitle {
  color: var(--color-gray-500);
  font-size: var(--text-xl);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: var(--weight-bold);
  font-family: var(--font-accent);
}

.last-updated {
  color: var(--color-gray-600);
  font-size: var(--text-base);
  text-align: center;
  margin-top: var(--space-2);
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
}

.timeline {
  max-width: var(--max-width-prose);
  margin: var(--space-8) auto;
  padding: 0 var(--space-4);
}

.timeline-entry {
  position: relative;
  margin-bottom: 0;
  border-left: var(--border-thick) solid var(--color-gray-700);
  padding-left: 0;
}

.timeline-entry.direct {
  border-left: var(--border-thick) solid var(--color-blood-red);
}

.timeline-entry.title-change {
  border-left: none;
}

.timeline-entry.title-change.has-defense-after::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  bottom: 0;
  width: var(--border-thick);
  background: var(--color-blood-red);
}

.timeline-entry.last-defense {
  border-left: none;
}

.timeline-entry.last-defense::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 50%;
  width: var(--border-thick);
  background: var(--color-blood-red);
}

.entry-card {
  background: var(--color-bg-secondary);
  padding: var(--space-4) var(--space-6);
  transition: all var(--transition-fast);
  border-radius: 0;
  border-bottom: var(--border-medium) solid var(--color-gray-800);
  margin-left: var(--space-8);
  position: relative;
}

.entry-card::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-8));
  top: 50%;
  transform: translateY(-50%);
  width: var(--space-4);
  height: var(--border-thick);
  background: var(--color-blood-red);
}

.entry-card:hover,
.entry-card:focus-within {
  background: rgba(204, 0, 0, 0.15);
  border-bottom-color: var(--color-blood-red);
}

.timeline-entry.inaugural .entry-card {
  background: var(--color-gray-900);
}

.timeline-entry.inaugural {
  border-left: none;
}

.timeline-entry.inaugural.has-defense-after::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  bottom: 0;
  width: var(--border-thick);
  background: var(--color-bone-white);
}

.timeline-entry.inaugural .entry-card::before {
  background: var(--color-bone-white);
}

.timeline-entry.reversion .entry-card {
  background: var(--pattern-reversion);
}

.timeline-entry.inaugural .entry-card:hover,
.timeline-entry.reversion .entry-card:hover {
  background: rgba(255, 204, 0, 0.15);
}

.entry-top {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.entry-date-marker {
  font-size: var(--text-2xl);
  color: var(--color-blood-red);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin: var(--space-8) 0 var(--space-4) 0;
  padding: var(--space-2) var(--space-4);
  background: var(--color-pitch-black);
  border: var(--border-medium) solid var(--color-blood-red);
  border-left: none;
  border-right: none;
  font-weight: var(--weight-bold);
  font-family: var(--font-heading);
}

.transition-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 0;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: var(--border-medium) solid;
  font-family: var(--font-accent);
}

.transition-direct {
  background: var(--color-blood-red);
  color: var(--color-bone-white);
  border-color: var(--color-bone-white);
}

.transition-reversion {
  background: var(--color-gold);
  color: var(--color-pitch-black);
  border-color: var(--color-pitch-black);
}

.transition-inaugural {
  background: var(--color-bone-white);
  color: var(--color-pitch-black);
  border-color: var(--color-pitch-black);
}

.timeline-champion-name {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-bone-white);
  letter-spacing: 0.02em;
}

.champion-number {
  font-size: var(--text-lg);
  opacity: 0.7;
  font-weight: var(--weight-bold);
  font-family: var(--font-heading);
}

.timeline-entry.reversion .timeline-champion-name {
  color: var(--color-gold);
}

.timeline-entry.inaugural .timeline-champion-name {
  color: var(--color-bone-white);
}

.timeline-entry.direct .timeline-champion-name {
  color: var(--color-blood-red);
}

.entry-details {
  font-size: var(--text-sm);
  color: var(--color-gray-400);
  line-height: 1.4;
}

.entry-meta {
  color: var(--color-gray-500);
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
}

.defense-line {
  color: var(--color-gray-300);
  font-weight: var(--weight-semibold);
  font-size: var(--text-md);
}

.challenger-name {
  color: var(--color-blood-red);
  font-weight: var(--weight-bold);
}

.timeline-entry.reversion .challenger-name {
  color: var(--color-gold);
}

/* ==========================================================================
   Champions List Page
   ========================================================================== */

.compact-header {
  text-align: center;
  padding: var(--space-8) 0 var(--space-6);
}

.compact-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  color: var(--color-bone-white);
  margin-bottom: var(--space-2);
  text-shadow:
    2px 2px 0 var(--color-blood-red),
    4px 4px 0 var(--color-pitch-black),
    -1px -1px 0 rgba(204, 0, 0, 0.5),
    0 0 20px rgba(0, 0, 0, 0.8);
  position: relative;
  font-family: var(--font-display);
  filter: contrast(1.25) brightness(1.05) drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.6));
  transform: skewY(-0.5deg);
}

.compact-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='dirt'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='3' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0, 0 0 0 0 0, 0 0 0 0 0, 0 0 0 0.3 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23dirt)'/%3E%3C/svg%3E");
  opacity: 0.5;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.compact-container {
  max-width: var(--max-width-content);
  margin: var(--space-8) auto;
  padding: 0 var(--space-4);
}

.lineage-grid {
  display: grid;
  gap: 0;
  background: var(--color-pitch-black);
  border: var(--border-thick) solid var(--color-bone-white);
  box-shadow:
    0 0 0 8px var(--color-blood-red),
    0 10px 30px rgba(0, 0, 0, 0.8);
}

.grid-header {
  display: grid;
  grid-template-columns: 40px 60px 1fr 110px 110px 80px 80px;
  background:
    var(--pattern-checkered-gold),
    var(--color-blood-red);
  background-blend-mode: overlay;
  font-weight: var(--weight-bold);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-bone-white);
  border-bottom: var(--border-thick) solid var(--color-bone-white);
}

.grid-header-cell {
  padding: var(--space-4) var(--space-3);
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  border-right: var(--border-medium) solid rgba(0, 0, 0, 0.3);
}

.grid-header-cell:last-child {
  border-right: none;
}

.grid-header-cell:hover,
.grid-header-cell:focus {
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.grid-header-cell:focus-visible {
  outline: 2px solid var(--color-bone-white);
  outline-offset: -2px;
}

.grid-row {
  display: grid;
  grid-template-columns: 40px 60px 1fr 110px 110px 80px 80px;
  background: var(--color-bg-secondary);
  transition: all var(--transition-fast);
  border-bottom: var(--border-medium) solid var(--color-gray-800);
}

.grid-row.stint-detail {
  background: repeating-linear-gradient(
    90deg,
    var(--color-pitch-black) 0px,
    var(--color-pitch-black) 10px,
    var(--color-bg-secondary) 10px,
    var(--color-bg-secondary) 20px
  );
  font-size: 0.9rem;
  padding-left: var(--space-8);
  border-bottom: var(--border-thin) solid var(--color-gray-900);
}

.grid-row.stint-detail .grid-cell {
  padding: 0.6rem;
}

.grid-row.stint-detail .cell-champion {
  color: var(--color-gray-600);
}

.grid-row.has-multiple-stints {
  cursor: pointer;
  background: var(--color-gray-900);
}

.grid-row.has-multiple-stints:hover,
.grid-row.has-multiple-stints:focus-within {
  background: var(--color-blood-red);
}

.grid-row.has-multiple-stints:hover .grid-cell,
.grid-row.has-multiple-stints:focus-within .grid-cell {
  color: var(--color-bone-white);
}

.grid-row:hover,
.grid-row:focus-within {
  background: rgba(204, 0, 0, 0.2);
  border-bottom-color: var(--color-blood-red);
}

.grid-row.reversion {
  background: var(--pattern-reversion);
}

.grid-row.reversion:hover,
.grid-row.reversion:focus-within {
  background: rgba(179, 134, 0, 0.3);
}

.grid-cell {
  padding: var(--space-4) var(--space-3);
  display: flex;
  align-items: center;
  border-right: var(--border-thin) solid var(--color-gray-800);
}

.grid-cell:last-child {
  border-right: none;
}

.cell-number {
  color: var(--color-gray-500);
  font-size: 0.9rem;
  font-weight: var(--weight-bold);
  font-family: var(--font-heading);
}

.cell-champion {
  color: var(--color-bone-white);
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
  letter-spacing: 0.02em;
}

.grid-row.reversion .cell-champion {
  color: var(--color-gold);
}

.cell-date, .cell-date-end {
  color: var(--color-gray-300);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}

.cell-badge {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  display: inline-block;
}

.badge-new {
  background: var(--color-dark-red);
  color: var(--color-bone-white);
}

.badge-defense {
  background: #330000;
  color: var(--color-gray-400);
  border: var(--border-thin) solid var(--color-dark-red);
}

.badge-retired {
  background: #b38600;
  color: var(--color-pitch-black);
}

.cell-defenses {
  color: var(--color-blood-red);
  font-weight: var(--weight-bold);
  font-size: var(--text-2xl);
  font-family: var(--font-heading);
}

.cell-expand {
  color: var(--color-blood-red);
  font-size: 1.5rem;
  font-weight: var(--weight-bold);
  cursor: pointer;
  user-select: none;
  font-family: var(--font-mono);
}

.cell-expand:hover,
.cell-expand:focus {
  color: var(--color-bone-white);
}

.hidden {
  display: none;
}

/* ==========================================================================
   About Page
   ========================================================================== */

.about-container {
  max-width: var(--max-width-prose);
  margin: 0 auto;
  padding: var(--space-8) 0 var(--space-16);
}

.about-title {
  font-size: clamp(2rem, 6vw, 3rem);
  color: var(--color-dark-red);
  margin-bottom: var(--space-4);
  text-align: center;
}

.about-section {
  margin-bottom: var(--space-12);
}

.section-title {
  font-size: var(--text-3xl);
  color: var(--color-bone-white);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: var(--border-medium) solid var(--color-dark-red);
}

.about-text {
  color: #ccc;
  margin-bottom: var(--space-4);
  line-height: 1.8;
}

.about-text strong {
  color: var(--color-dark-red);
}

.rules-list {
  list-style: none;
  padding: 0;
}

.rules-list li {
  background: linear-gradient(135deg, var(--color-bg-dark-red) 0%, var(--color-bg-secondary) 100%);
  border-left: var(--border-thick) solid var(--color-dark-red);
  padding: var(--space-4) var(--space-6);
  margin-bottom: var(--space-4);
  border-radius: 4px;
}

.rule-title {
  font-weight: var(--weight-bold);
  color: var(--color-dark-red);
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-xl);
}

.rule-description {
  color: var(--color-gray-300);
  line-height: 1.6;
}

.callout {
  background: rgba(139, 0, 0, 0.1);
  border: var(--border-medium) solid var(--color-dark-red);
  border-radius: 8px;
  padding: var(--space-6);
  margin: var(--space-8) 0;
}

.callout-title {
  font-size: var(--text-2xl);
  color: var(--color-dark-red);
  margin-bottom: var(--space-2);
  font-weight: var(--weight-bold);
}

.contact-link {
  color: var(--color-dark-red);
  text-decoration: none;
  font-weight: var(--weight-semibold);
  border-bottom: var(--border-thin) solid transparent;
  transition: border-color var(--transition-normal);
}

.contact-link:hover,
.contact-link:focus {
  border-bottom-color: var(--color-dark-red);
  outline: none;
}

.contact-link:focus-visible {
  outline: 2px solid var(--color-dark-red);
  outline-offset: 2px;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Small phones */
@media (max-width: 480px) {
  :root {
    --space-8: 1rem;
  }

  .hero-logo {
    width: clamp(200px, 70vw, 400px);
  }

  main {
    padding: var(--space-4);
  }

  .hero {
    padding: var(--space-6) 0 var(--space-12);
  }

  .hero-subtitle {
    font-size: clamp(0.9rem, 4vw, 1.2rem);
    margin-bottom: var(--space-8);
  }

  .champion-card {
    border: var(--border-thick) solid var(--color-bone-white);
    box-shadow:
      0 0 0 var(--border-medium) var(--color-blood-red),
      0 0 0 6px var(--color-pitch-black),
      0 10px 40px rgba(0, 0, 0, 0.9);
  }

  .champion-card-inner {
    padding: var(--space-8) var(--space-4);
  }

  .champion-label {
    font-size: var(--text-base);
    margin-bottom: var(--space-4);
  }

  .champion-stats {
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: var(--space-8);
  }

  .stat {
    padding: var(--space-4) var(--space-3);
  }

  .stat-value {
    font-size: 2.5rem;
  }

  .cta {
    margin-top: var(--space-12);
  }

  .cta-button {
    padding: var(--space-4) 2rem;
    font-size: var(--text-lg);
  }

  .nav-container {
    padding: 0 var(--space-4);
  }

  .nav-links {
    padding: var(--space-2) 0;
    gap: var(--space-2);
  }

  .nav-links a {
    padding: var(--space-5) var(--space-6);
    font-size: 1.1rem;
  }

  .hamburger {
    padding: var(--space-3);
  }
}

/* Tablets and below */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: row;
    align-items: center;
  }

  .hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background:
      var(--pattern-checkered-nav),
      linear-gradient(180deg, var(--color-bg-dark-red) 0%, var(--color-pitch-black) 100%);
    background-blend-mode: overlay;
    border-bottom: var(--border-thick) solid var(--color-blood-red);
    box-shadow: var(--shadow-nav);
    padding: var(--space-2) 0;
    gap: var(--space-2);
    z-index: 1000;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    width: 100%;
    padding: var(--space-5) var(--space-8);
    border-radius: 0;
    border: var(--border-medium) solid transparent;
    font-size: var(--text-xl);
    background: rgba(0, 0, 0, 0.7);
  }

  .brand {
    font-size: 1.2rem;
  }

  main {
    padding: var(--space-4);
  }

  .hero {
    padding: var(--space-8) 0 var(--space-16);
  }

  .champion-card-inner {
    padding: var(--space-10) var(--space-6);
  }

  .champion-stats {
    grid-template-columns: 1fr;
  }

  .timeline-entry.title-change.has-defense-after::before,
  .timeline-entry.inaugural.has-defense-after::before {
    width: var(--border-thick);
  }

  .timeline-entry.last-defense::before {
    width: var(--border-thick);
  }

  .entry-card {
    margin-left: var(--space-4);
    padding: var(--space-3) var(--space-4);
  }

  .entry-card::before {
    left: calc(-1 * var(--space-4));
    width: var(--space-2);
  }

  .timeline-entry.inaugural .entry-card::before {
    background: var(--color-bone-white);
  }

  .entry-date-marker {
    font-size: var(--text-lg);
    padding: 0.4rem var(--space-3);
  }

  .lineage-grid {
    overflow-x: auto;
  }

  .grid-header, .grid-row {
    min-width: 600px;
  }

  .grid-header-cell, .grid-cell {
    font-size: var(--text-sm);
    padding: var(--space-3) var(--space-2);
  }

  .cell-champion {
    font-size: 0.9rem;
  }
}

/* Tablets landscape and small desktops */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero-logo {
    width: clamp(200px, 35vw, 400px);
  }
}

/* Large desktops */
@media (min-width: 1440px) {
  :root {
    --max-width-content: 1400px;
  }
}

/* Accessibility: Reduced motion */
@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;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
    color: black;
  }

  nav,
  footer,
  .hamburger,
  .cta {
    display: none;
  }

  main {
    max-width: 100%;
  }
}
