/* UCI NVC Archive - classic academic styling */

:root {
  --paper:        #fbfaf7;
  --paper-edge:   #f1eee7;
  --ink:          #1a1a1a;
  --ink-soft:     #3a3a3a;
  --ink-muted:    #6a6a6a;
  --rule:         #d9d3c5;
  --navy:         #002855;
  --navy-soft:    #1d4ea0;
  --gold:         #b8860b;
  --gold-soft:    #d4a64a;
  --accent-bg:    #f5efde;
  --max-width:    980px;
  --measure:      68ch;
  --serif:        "Cormorant Garamond", "EB Garamond", Georgia, "Times New Roman", serif;
  --sans:         "Inter", "Source Sans 3", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:         "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Typography */
h1, h2, h3, h4, h5 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
  line-height: 1.2;
  margin: 0 0 0.5em;
}
h1 { font-size: 2.7rem; font-weight: 600; letter-spacing: -0.015em; }
h2 { font-size: 1.95rem; margin-top: 2.2em; }
h3 { font-size: 1.4rem; margin-top: 1.8em; }
h4 { font-size: 1.15rem; margin-top: 1.4em; }

p { margin: 0 0 1em; max-width: var(--measure); }
a {
  color: var(--navy);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 120ms ease;
}
a:hover { color: var(--gold); }

strong { font-weight: 600; color: var(--ink); }
em { color: var(--ink-soft); }

code, kbd, samp, pre { font-family: var(--mono); font-size: 0.92em; }
code { background: var(--accent-bg); padding: 0.08em 0.32em; border-radius: 3px; }

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.6em 0;
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  padding: 1.5rem 0 1.4rem;
}
.site-header .container {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.site-title {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  border: 0;
}
.site-title small {
  display: block;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 0.18rem;
}
.site-nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.site-nav a {
  font-size: 0.92rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 120ms ease, color 120ms ease;
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--navy);
  border-bottom-color: var(--gold);
}

main { padding: 3rem 0 4rem; }

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 0;
  color: var(--ink-muted);
  font-size: 0.88rem;
}
.site-footer p { max-width: none; margin: 0 0 0.4em; }

/* Hero */
.hero {
  padding: 1rem 0 2.4rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.6rem;
}
.hero .eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.6rem;
}
.hero h1 {
  font-size: 3.2rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.hero .lede {
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 32em;
  margin: 0;
}

/* Stat row */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 2rem;
  margin: 2.4rem 0;
  padding: 1.6rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.stat .num {
  font-family: var(--serif);
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1;
  display: block;
  margin-bottom: 0.3rem;
}
.stat .label {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* Section */
section.section { margin: 3rem 0; }
section.section > h2:first-child { margin-top: 0; }

/* Cards / list rows */
.year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.6rem 0;
}
.year-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 1.1rem 1.2rem;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 150ms ease, transform 150ms ease, background 150ms ease;
}
.year-card:hover {
  border-color: var(--navy);
  background: #fffefb;
  color: var(--ink);
  transform: translateY(-1px);
}
.year-card .yr {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--navy);
  display: block;
  margin-bottom: 0.2rem;
}
.year-card .gp {
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.35;
}
.year-card .gp strong { color: var(--ink); }

/* Tables */
.archive-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4rem 0 2rem;
  font-size: 0.95rem;
}
.archive-table th,
.archive-table td {
  text-align: left;
  padding: 0.7rem 0.9rem 0.7rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.archive-table th {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 0.6rem;
}
.archive-table td.prize { font-variant-numeric: tabular-nums; color: var(--navy); font-weight: 500; }
.archive-table td.team strong { font-family: var(--serif); font-weight: 600; }
.archive-table tr:last-child td { border-bottom: 0; }

/* Outcome badges */
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  border: 1px solid;
  white-space: nowrap;
}
.badge.operating  { color: #0d633a; border-color: #0d633a; background: #eaf5ee; }
.badge.acquired   { color: var(--navy); border-color: var(--navy); background: #e7eef9; }
.badge.pivoted    { color: #8a5a00; border-color: #8a5a00; background: #fbf2dc; }
.badge.shutdown   { color: #8a1f1f; border-color: #8a1f1f; background: #f7e3e3; }
.badge.dormant    { color: var(--ink-muted); border-color: var(--ink-muted); background: var(--paper-edge); }
.badge.nofound    { color: var(--ink-muted); border-color: var(--rule); background: transparent; }
.badge.finalist   { color: var(--gold); border-color: var(--gold-soft); background: var(--accent-bg); }

/* Quote / callout */
.callout {
  border-left: 3px solid var(--gold);
  background: var(--accent-bg);
  padding: 1rem 1.2rem;
  margin: 1.6rem 0;
  font-family: var(--serif);
  font-size: 1.08rem;
  color: var(--ink-soft);
}
.callout p { margin: 0; max-width: none; }

/* Year page header */
.year-head {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}
.year-head .yr-num {
  font-family: var(--serif);
  font-size: 4.5rem;
  line-height: 1;
  color: var(--navy);
  display: block;
}
.year-head .yr-sub {
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 0.4rem;
}
.year-head h1 {
  font-size: 1.7rem;
  margin-top: 0.6rem;
}

/* Team directory */
.team-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  margin: 1.4rem 0 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.team-controls input[type="search"] {
  flex: 1 1 240px;
  padding: 0.5rem 0.7rem;
  font: inherit;
  font-size: 0.95rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
}
.team-controls input[type="search"]:focus {
  outline: 0;
  border-color: var(--navy);
}
.team-controls select {
  padding: 0.5rem 0.7rem;
  font: inherit;
  font-size: 0.95rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
}
.team-list { list-style: none; padding: 0; margin: 0; }
.team-list li {
  border-bottom: 1px solid var(--rule);
  padding: 0.7rem 0;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.team-list .name { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; }
.team-list .meta { color: var(--ink-muted); font-size: 0.88rem; }

.team-list li.alpha-marker {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--gold);
  border-bottom: 1px solid var(--ink);
  padding: 1.6rem 0 0.4rem;
  letter-spacing: 0.04em;
}

.alpha-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0.7rem 0;
  margin: 0.4rem 0 1rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.alpha-jump a {
  display: inline-block;
  min-width: 1.9rem;
  text-align: center;
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.15rem 0.35rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.alpha-jump a:hover {
  color: var(--paper);
  background: var(--navy);
  border-color: var(--navy);
}

/* Inline labels */
.label-eyebrow {
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin: 0 0 0.6rem;
  display: block;
}

/* Donut layout */
@media (max-width: 720px) {
  .donut-row { grid-template-columns: 1fr !important; }
}

/* Charts */
.chart-card {
  border: 1px solid var(--rule);
  padding: 1.4rem;
  margin: 1.4rem 0;
  background: var(--paper);
}
.chart-card h3 { margin-top: 0; }

/* Feature grid (landing) */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.4rem;
  margin: 1.6rem 0;
}
.feature {
  padding: 1.4rem 1.6rem;
  border-top: 3px solid var(--navy);
  background: #fffefb;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
.feature h3 {
  margin: 0.2rem 0 0.6rem;
  font-size: 1.25rem;
  letter-spacing: -0.005em;
}
.feature p { margin: 0 0 0.6rem; max-width: none; font-size: 0.95rem; }
.feature .label-eyebrow { color: var(--gold); font-size: 0.7rem; }

/* Timeline */
.timeline {
  list-style: none;
  padding: 0;
  margin: 1.4rem 0;
  border-left: 2px solid var(--rule);
}
.timeline li {
  padding: 0.4rem 0 0.6rem 1.4rem;
  position: relative;
  max-width: 38em;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 0.95rem;
  width: 10px;
  height: 10px;
  background: var(--gold);
  border: 2px solid var(--paper);
  border-radius: 50%;
}

/* Year nav (prev / next) */
.year-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--rule);
  margin-top: 3rem;
  padding-top: 1.4rem;
  gap: 1rem;
}
.year-nav a {
  text-decoration: none;
  border-bottom: 0;
  color: var(--navy);
  font-family: var(--serif);
  font-size: 1.05rem;
}
.year-nav a:hover { color: var(--gold); }
.year-nav .yn-label {
  display: block;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.1rem;
}

/* Improved analytics bars */
.bar-cell { width: 200px; }
.bar {
  display: inline-block;
  height: 14px;
  background: var(--navy);
  vertical-align: middle;
  border-radius: 1px;
}
.bar.muted { background: var(--ink-soft); }
.bar.gold { background: var(--gold); }

/* Responsive */
@media (max-width: 640px) {
  body { font-size: 16px; }
  h1 { font-size: 2rem; }
  .hero h1 { font-size: 2.2rem; }
  .hero .lede { font-size: 1.1rem; }
  .archive-table { font-size: 0.88rem; }
  .archive-table th, .archive-table td { padding-right: 0.5rem; }
  .site-header .container { gap: 0.6rem; }
  .site-nav { gap: 0.9rem; row-gap: 0.5rem; font-size: 0.95rem; }
}

.site-secondary-nav {
  margin-top: 0.8rem !important;
  font-size: 0.85rem;
}
.site-secondary-nav a {
  color: var(--ink-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}
.site-secondary-nav a:hover { color: var(--navy); border-bottom-color: var(--gold); }

/* Print */
@media print {
  :root { --paper: #fff; --paper-edge: #fff; }
  body { font-size: 11pt; color: #000; }
  .site-nav, .team-controls, .year-nav, .site-footer a { display: none; }
  a { color: #000; text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
  .hero { padding-bottom: 1rem; margin-bottom: 1.5rem; }
  .stat-row { page-break-inside: avoid; }
  .feature, .year-card, .chart-card { break-inside: avoid; }
  .archive-table { font-size: 9pt; }
  h2 { page-break-after: avoid; }
  .badge { border: 1px solid #000; color: #000; background: #fff; }
}
