/* === Chicago Sky Blunder Tracker === */
/* Palette: Sky Blue #418FDE, Sky Yellow #FFCD00, Dark Navy #041E42 */

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

:root {
  --sky-blue: #418FDE;
  --sky-yellow: #FFCD00;
  --sky-navy: #041E42;
  --sky-navy-light: #0a2a52;
  --text-primary: #0d0d0d;
  --text-secondary: rgba(0, 0, 0, 0.45);
  --bg: #ffffff;
  --surface: rgba(65, 143, 222, 0.04);
  --border: rgba(0, 0, 0, 0.08);
}

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden; /* prevent table overflow from widening the page */
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.08em;
  background: var(--sky-yellow);
  color: var(--sky-navy);
  padding: 2px 7px;
  border-radius: 4px;
}

.nav-subtitle {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

/* Hero */
main {
  flex: 1;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  padding: 80px 24px 60px;
  text-align: center;
}

.hero-label {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sky-blue);
  margin-bottom: 24px;
}

.hero-number {
  font-size: clamp(96px, 20vw, 200px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--sky-yellow);
  -webkit-text-stroke: 2px var(--sky-blue);
}

.hero-blunder {
  margin-top: 28px;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.47;
  letter-spacing: -0.02em;
  color: var(--text-secondary);
  max-width: 520px;
}

/* Table Section */
.table-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 6px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--sky-yellow);
  display: inline-block;
}

.section-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  position: relative;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

thead th {
  text-align: left;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sky-blue);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(65, 143, 222, 0.04);
}

td:nth-child(1) {
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

td:nth-child(3) {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Severity Labels */
.severity-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.severity-label.tier-1 {
  background: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.45);
}

.severity-label.tier-2 {
  background: var(--sky-yellow);
  color: var(--sky-navy);
}

.severity-label.tier-3 {
  background: var(--sky-navy);
  color: #ffffff;
}

/* Win verdict pill */
.verdict-label.win {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  background: rgba(34, 197, 94, 0.15);
  color: #166534;
}

/* Win row */
tr.win-row {
  border-left: 3px solid rgba(34, 197, 94, 0.5);
}

tr.win-row td:first-child {
  padding-left: 17px;
}

tr.win-row:hover {
  background: rgba(34, 197, 94, 0.04);
}

/* Group Selector */
.nav-spacer {
  flex: 1;
}

.group-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.group-tab {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 5px 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.group-tab:hover {
  border-color: var(--sky-blue);
  color: var(--text-primary);
}

.group-tab.active {
  background: var(--sky-yellow);
  border-color: var(--sky-yellow);
  color: var(--sky-navy);
  font-weight: 600;
}

.group-tab:focus {
  outline: 2px solid var(--sky-blue);
  outline-offset: 2px;
}

/* Highlighted permalink row */
tr.highlight {
  background: rgba(65, 143, 222, 0.08);
  animation: highlight-fade 3s ease-out forwards;
}

@keyframes highlight-fade {
  0% { background: rgba(65, 143, 222, 0.15); }
  100% { background: transparent; }
}

/* Permalink copy button */
.permalink-btn {
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  opacity: 0;
  padding: 2px 4px;
  vertical-align: middle;
  transition: opacity 0.15s;
}

tr:hover .permalink-btn {
  opacity: 0.5;
}

.permalink-btn:hover {
  opacity: 1 !important;
}

.permalink-btn:focus {
  outline: 2px solid var(--sky-blue);
  outline-offset: 2px;
  opacity: 1;
}

/* Source link in table */
.source-link {
  color: var(--sky-blue);
  text-decoration: none;
  font-size: 12px;
  opacity: 0.7;
  margin-left: 4px;
  vertical-align: middle;
}

.source-link:hover {
  opacity: 1;
}

/* Footer */
.footer {
  padding: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

/* Responsive */

/* Tablet (601px – 900px) */
@media (min-width: 601px) and (max-width: 900px) {
  .hero {
    min-height: 60vh;
    padding: 60px 24px 44px;
  }

  .table-section {
    padding: 0 20px 64px;
  }

  .section-title {
    font-size: 24px;
  }

  .group-tabs {
    max-width: 200px;
  }
}

/* Mobile (≤600px) */
@media (max-width: 600px) {
  .hero {
    min-height: 55vh;
    padding: 60px 20px 40px;
  }

  .hero-blunder {
    font-size: 15px;
  }

  .table-section {
    padding: 0 16px 60px;
  }

  .section-title {
    font-size: 22px;
  }

  thead th,
  tbody td {
    padding: 10px 10px;
  }

  table {
    font-size: 14px;
  }

  /* Hide Responsible column on mobile so Severity is visible */
  th:nth-child(3),
  td:nth-child(3) {
    display: none;
  }

  /* Compact severity pill — allow wrapping on narrow screens */
  .severity-label {
    font-size: 10px;
    padding: 2px 7px;
    white-space: normal;
  }

  /* Fade hint at right edge of table to signal horizontal scroll */
  .table-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 28px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.75));
    pointer-events: none;
    border-radius: 0 12px 12px 0;
  }

}

/* Very small mobile (≤380px): drop nav subtitle to protect group selector space */
@media (max-width: 380px) {
  .nav-subtitle {
    display: none;
  }
}
