/* ═══════════════════════════════════════════════════════════
   March Madness 2026 — Clean Modern Editorial Theme
   Portfolio-quality interactive bracket visualization
   ═══════════════════════════════════════════════════════════ */

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

:root {
  --east: #2563eb;
  --east-light: #dbeafe;
  --east-border: #93bbfd;
  --south: #d97706;
  --south-light: #fef3c7;
  --south-border: #fbbf24;
  --midwest: #059669;
  --midwest-light: #d1fae5;
  --midwest-border: #6ee7b7;
  --west: #dc2626;
  --west-light: #fee2e2;
  --west-border: #fca5a5;

  --bg: #f8f9fc;
  --bg-alt: #ffffff;
  --bg-hero: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4338ca 100%);
  --text: #1e1b4b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --accent: #4f46e5;
  --accent-light: #e0e7ff;
  --gold: #f59e0b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
  --radius: 12px;
  --radius-sm: 8px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Hero ────────────────────────────────────────────── */
.hero {
  position: relative;
  background: var(--bg-hero);
  color: #fff;
  padding: 80px 24px 60px;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 30% 50%,
      rgba(99, 102, 241, 0.3) 0%,
      transparent 60%
    ),
    radial-gradient(
      circle at 70% 30%,
      rgba(168, 85, 247, 0.2) 0%,
      transparent 50%
    );
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 20px;
  color: rgba(255, 255, 255, 0.9);
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.hero h1 .accent {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.75);
  max-width: 540px;
  margin: 0 auto 28px;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 28px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-stat .num {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fbbf24;
}

.hero-stat .label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.cta-btn {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 50px;
  background: #fff;
  color: #312e81;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* ─── Methodology ─────────────────────────────────────── */
.methodology {
  padding: 64px 0;
  background: var(--bg);
}

.methodology h2,
.ratings-section h2,
.justification h2 {
  font-size: 1.8rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
  color: var(--text);
}

.formula-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px auto 32px;
  max-width: 700px;
  text-align: center;
  box-shadow: var(--shadow);
}

.formula-display code {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-light);
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.method-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}
.method-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.method-icon {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.method-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.method-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.method-range {
  margin-top: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
}

.upset-section {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 24px 28px;
  max-width: 800px;
  margin: 0 auto;
  box-shadow: var(--shadow);
}

.upset-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.upset-section p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ─── Champion Banner ─────────────────────────────────── */
.champion-banner {
  background: linear-gradient(135deg, #312e81, #4338ca);
  color: #fff;
  padding: 48px 24px;
  text-align: center;
}

.champion-banner .trophy {
  font-size: 3rem;
  margin-bottom: 8px;
}

.champion-banner h2 {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 12px;
}

.champion-name {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  color: #fbbf24;
  margin-bottom: 8px;
}

.champion-details {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
}

/* ─── Bracket Section ─────────────────────────────────── */
.bracket-section {
  padding: 48px 0 32px;
  background: var(--bg);
}

.bracket-section h2 {
  font-size: 1.8rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 4px;
}

.bracket-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 24px;
}

.bracket-wrapper {
  overflow-x: auto;
  padding: 0 16px 24px;
  -webkit-overflow-scrolling: touch;
}

.bracket-container {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 12px;
  min-width: 1100px;
  padding: 0 8px;
}

.bracket-side {
  display: flex;
  flex-direction: column;
  gap: 32px;
  flex: 1;
}

.bracket-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-width: 180px;
}

/* ─── Region ──────────────────────────────────────────── */
.region-bracket {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.region-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 6px 14px;
  border-radius: 6px;
  margin-bottom: 12px;
  display: inline-block;
}

.region-label.East {
  background: var(--east-light);
  color: var(--east);
}
.region-label.South {
  background: var(--south-light);
  color: var(--south);
}
.region-label.Midwest {
  background: var(--midwest-light);
  color: var(--midwest);
}
.region-label.West {
  background: var(--west-light);
  color: var(--west);
}

.region-rounds {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.round-column {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  min-width: 120px;
}

.round-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 4px 0;
  text-align: center;
}

/* ─── Matchup & Team Slots ────────────────────────────── */
.matchup {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 3px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--border);
}

.team-slot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--bg-alt);
  font-size: 0.72rem;
  cursor: default;
  transition: background 0.15s;
  min-height: 26px;
}

.team-slot:hover {
  background: #f1f5f9;
}

.team-slot.winner {
  background: #f0fdf4;
  font-weight: 600;
}

.team-slot.loser {
  opacity: 0.45;
}

.team-seed {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.65rem;
  min-width: 16px;
  text-align: center;
}

.team-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.72rem;
}

.team-rating {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 500;
}

.team-slot.winner .team-seed {
  color: #16a34a;
}
.team-slot.winner .team-name {
  color: #15803d;
}

/* Region-specific winner highlights */
.region-East .team-slot.winner {
  background: #eff6ff;
}
.region-East .team-slot.winner .team-seed,
.region-East .team-slot.winner .team-name {
  color: var(--east);
}

.region-South .team-slot.winner {
  background: #fffbeb;
}
.region-South .team-slot.winner .team-seed,
.region-South .team-slot.winner .team-name {
  color: var(--south);
}

.region-Midwest .team-slot.winner {
  background: #ecfdf5;
}
.region-Midwest .team-slot.winner .team-seed,
.region-Midwest .team-slot.winner .team-name {
  color: var(--midwest);
}

.region-West .team-slot.winner {
  background: #fef2f2;
}
.region-West .team-slot.winner .team-seed,
.region-West .team-slot.winner .team-name {
  color: var(--west);
}

/* ─── Final Four ──────────────────────────────────────── */
.final-four,
.championship {
  width: 180px;
}

.ff-label,
.champ-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 6px;
}

.champ-label {
  color: var(--gold);
}

.championship .matchup {
  border-color: var(--gold);
}

.championship .team-slot.winner {
  background: #fffbeb;
}
.championship .team-slot.winner .team-seed,
.championship .team-slot.winner .team-name {
  color: #b45309;
}

/* ─── Ratings Table ───────────────────────────────────── */
.ratings-section {
  padding: 48px 0;
  background: var(--bg);
}

.ratings-section > .container > p {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.ratings-table-wrapper {
  background: var(--bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.ratings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.ratings-table thead {
  background: #f8fafc;
}

.ratings-table th {
  padding: 12px 14px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}

.ratings-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
}

.ratings-table tbody tr:hover {
  background: #f8fafc;
}

.region-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

.region-tag.East {
  background: var(--east-light);
  color: var(--east);
}
.region-tag.South {
  background: var(--south-light);
  color: var(--south);
}
.region-tag.Midwest {
  background: var(--midwest-light);
  color: var(--midwest);
}
.region-tag.West {
  background: var(--west-light);
  color: var(--west);
}

.net-positive {
  color: #16a34a;
  font-weight: 600;
}
.net-negative {
  color: #dc2626;
  font-weight: 600;
}

.rating-val {
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  color: var(--accent);
}

/* ─── Justification ───────────────────────────────────── */
.justification {
  padding: 48px 0 64px;
  background: #f1f5f9;
}

.justify-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 28px;
}

.justify-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.justify-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.justify-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ─── Footer ──────────────────────────────────────────── */
.footer {
  background: #1e1b4b;
  color: rgba(255, 255, 255, 0.7);
  padding: 32px 24px;
  text-align: center;
  font-size: 0.85rem;
}

.footer p {
  margin-bottom: 4px;
}
.footer-sub {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
}

/* ─── Tooltip ─────────────────────────────────────────── */
.tooltip {
  display: none;
  position: fixed;
  background: #1e1b4b;
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  z-index: 1000;
  max-width: 280px;
}

.tt-name {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.tt-detail {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.75rem;
}

.tt-rating {
  margin-top: 6px;
  font-weight: 700;
  color: #fbbf24;
  font-size: 0.85rem;
}

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .hero {
    padding: 48px 16px 40px;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero-stats {
    gap: 20px;
  }
  .method-grid {
    grid-template-columns: 1fr;
  }
  .justify-grid {
    grid-template-columns: 1fr;
  }
  .bracket-container {
    min-width: 900px;
  }
}
