:root {
  color-scheme: dark;
  --bg: #0d0f0c;
  --surface: #141714;
  --surface-2: #1a1e19;
  --surface-3: #20251f;
  --line: #2b3229;
  --line-soft: #20261f;
  --text: #f2f4ed;
  --muted: #929b8e;
  --muted-2: #6d7669;
  --lime: #b8dc45;
  --lime-bright: #d0f15a;
  --cyan: #5fc4b5;
  --orange: #e89a50;
  --blue: #6f9ed6;
  --danger: #ee786d;
  --radius: 12px;
  --shadow: 0 12px 36px rgb(0 0 0 / 24%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 75% -10%, rgb(184 220 69 / 8%), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-size: 14px;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.skip-link {
  position: fixed;
  z-index: 100;
  left: 12px;
  top: -80px;
  padding: 10px 14px;
  background: var(--lime);
  color: #111;
  border-radius: 6px;
}
.skip-link:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 66px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 0 max(22px, calc((100vw - 1480px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgb(13 15 12 / 92%);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; width: fit-content; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--lime);
  border-radius: 8px;
  color: var(--lime-bright);
  font-weight: 850;
  letter-spacing: -0.05em;
}
.brand strong { display: block; font-size: 14px; letter-spacing: .02em; }
.brand small { display: block; margin-top: 1px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .14em; }
.desktop-nav { display: flex; align-items: center; gap: 4px; }
.desktop-nav a {
  padding: 9px 13px;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 650;
}
.desktop-nav a:hover, .desktop-nav a.active { background: var(--surface-2); color: var(--text); }
.desktop-nav a.active::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto -5px;
  border-radius: 2px;
  background: var(--lime);
}
.live-stamp { justify-self: end; color: var(--muted-2); font-size: 11px; font-variant-numeric: tabular-nums; }

main { width: min(1480px, 100%); min-height: calc(100vh - 126px); margin: 0 auto; padding: 26px 22px 56px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.eyebrow { margin: 0 0 6px; color: var(--lime); font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: clamp(25px, 3vw, 38px); line-height: 1; letter-spacing: -.045em; }
h2 { margin-bottom: 2px; font-size: 17px; letter-spacing: -.02em; }
h3 { margin-bottom: 4px; font-size: 14px; }
.subhead { margin: 0; color: var(--muted); max-width: 760px; }
.page-actions { display: flex; gap: 8px; align-items: center; }

.year-pill, .metric-tabs, .button, .select, .search-input {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
}
.year-pill { padding: 8px 10px; color: var(--muted); font-size: 12px; }
.button { cursor: pointer; padding: 9px 12px; font-weight: 700; }
.button:hover, .button:focus-visible { border-color: var(--lime); }
.button.primary { background: var(--lime); color: #11150c; border-color: var(--lime); }
.button.quiet { color: var(--muted); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.metric-card, .panel {
  border: 1px solid var(--line-soft);
  background: linear-gradient(145deg, rgb(255 255 255 / 1.5%), transparent 55%), var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.metric-card { min-height: 94px; padding: 15px 16px; }
.metric-label { display: block; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.metric-value { display: block; margin-top: 8px; font-size: clamp(23px, 3vw, 34px); font-weight: 780; line-height: 1; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.metric-unit { margin-left: 4px; color: var(--muted); font-size: 12px; font-weight: 550; letter-spacing: normal; }
.metric-note { display: block; margin-top: 7px; color: var(--muted-2); font-size: 10px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(310px, .85fr); gap: 12px; }
.panel { min-width: 0; padding: 16px; }
.panel + .panel { margin-top: 12px; }
.dashboard-grid .panel + .panel { margin-top: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.panel-head p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.metric-tabs { display: inline-flex; padding: 3px; }
.metric-tabs button { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 5px 8px; border-radius: 5px; font-size: 11px; }
.metric-tabs button.active { background: var(--surface-3); color: var(--lime-bright); }
.chart-wrap { position: relative; height: 246px; }
canvas { width: 100%; height: 100%; }
.chart-summary { color: var(--muted-2); font-size: 10px; margin: 8px 0 0; }

.activity-list { display: grid; gap: 2px; }
.activity-row {
  display: grid;
  grid-template-columns: 42px minmax(150px, 1fr) repeat(3, minmax(70px, .35fr)) 20px;
  align-items: center;
  gap: 12px;
  min-height: 55px;
  padding: 8px 4px;
  border-top: 1px solid var(--line-soft);
}
.activity-row:first-child { border-top: 0; }
.activity-row:hover { background: rgb(255 255 255 / 1.5%); }
.sport-dot { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; background: var(--surface-3); color: var(--lime); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.activity-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 680; }
.activity-date { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 500; }
.activity-stat { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.activity-stat strong { display: block; color: var(--text); font-size: 12px; font-weight: 650; }
.row-arrow { color: var(--muted-2); font-size: 18px; }

.sport-bars { display: grid; gap: 13px; }
.sport-line-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; font-size: 11px; }
.sport-line-head span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-track { height: 5px; overflow: hidden; border-radius: 9px; background: var(--surface-3); }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--lime), var(--cyan)); }

.record-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.record-card { padding: 12px; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--line-soft); }
.record-card span { display: block; color: var(--muted); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.record-card strong { display: block; margin-top: 7px; font-size: 20px; letter-spacing: -.03em; }
.record-card small { display: block; margin-top: 4px; overflow: hidden; color: var(--muted-2); white-space: nowrap; text-overflow: ellipsis; }

.filters { display: grid; grid-template-columns: minmax(220px, 1fr) 170px 130px auto; gap: 8px; margin-bottom: 12px; }
.search-input, .select { width: 100%; min-height: 40px; padding: 8px 11px; outline: none; }
.search-input:focus, .select:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgb(184 220 69 / 10%); }
.result-count { align-self: center; color: var(--muted); font-size: 11px; text-align: right; }

.table-shell { overflow-x: auto; }
.archive-table { width: 100%; border-collapse: collapse; min-width: 800px; }
.archive-table th { padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; letter-spacing: .12em; text-align: left; text-transform: uppercase; }
.archive-table th.number, .archive-table td.number { text-align: right; }
.archive-table td { padding: 11px 10px; border-bottom: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
.archive-table tr { cursor: pointer; }
.archive-table tbody tr:hover { background: var(--surface-2); }
.archive-table .title-cell { min-width: 210px; font-weight: 650; }
.modality-chip { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.load-more { display: flex; justify-content: center; padding-top: 14px; }

.year-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: 12px; }
.year-table { width: 100%; border-collapse: collapse; }
.year-table th, .year-table td { padding: 9px 7px; border-bottom: 1px solid var(--line-soft); text-align: right; font-variant-numeric: tabular-nums; }
.year-table th:first-child, .year-table td:first-child { text-align: left; }
.year-table th { color: var(--muted); font-size: 9px; letter-spacing: .09em; text-transform: uppercase; }
.year-table tr[data-year] { cursor: pointer; }
.year-table tr[data-year]:hover, .year-table tr.active { background: var(--surface-2); }

.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 9px); grid-auto-columns: 9px; gap: 3px; overflow-x: auto; padding: 4px 0 8px; }
.heat-cell { width: 9px; height: 9px; border-radius: 2px; background: var(--surface-3); }
.heat-cell[data-level="1"] { background: #405027; }
.heat-cell[data-level="2"] { background: #617c2e; }
.heat-cell[data-level="3"] { background: #8caf38; }
.heat-cell[data-level="4"] { background: var(--lime-bright); }
.heat-legend { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted-2); font-size: 9px; }

.activity-detail { max-width: 1040px; margin: 0 auto; }
.back-link { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 18px; color: var(--muted); font-weight: 650; }
.back-link:hover { color: var(--lime); }
.detail-head { display: flex; align-items: start; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.detail-head h1 { margin-bottom: 8px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.detail-note { padding: 13px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--muted); font-size: 11px; }
.detail-metrics { grid-template-columns: repeat(3, 1fr); }

.empty, .error-panel { padding: 46px 20px; text-align: center; color: var(--muted); }
.error-panel strong { display: block; color: var(--danger); font-size: 18px; margin-bottom: 8px; }
.loading-panel { padding-top: 40px; }
.loading-line, .loading-grid span { display: block; background: linear-gradient(100deg, var(--surface) 20%, var(--surface-2) 45%, var(--surface) 70%); background-size: 300% 100%; animation: shimmer 1.5s infinite; border-radius: 9px; }
.loading-line { width: 42%; height: 34px; margin-bottom: 20px; }
.loading-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.loading-grid span { height: 96px; }
@keyframes shimmer { to { background-position-x: -300%; } }

footer { display: flex; justify-content: space-between; gap: 20px; width: min(1480px, 100%); margin: 0 auto; padding: 20px 22px 85px; border-top: 1px solid var(--line-soft); color: var(--muted-2); font-size: 10px; }
.mobile-nav { display: none; }

@media (max-width: 960px) {
  .site-header { grid-template-columns: 1fr auto; padding-inline: 16px; }
  .desktop-nav { display: none; }
  .dashboard-grid, .year-layout { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .live-stamp { grid-column: 2; }
  .mobile-nav {
    position: fixed;
    z-index: 30;
    left: 10px;
    right: 10px;
    bottom: 9px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgb(20 23 20 / 96%);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
  }
  .mobile-nav a { display: grid; place-items: center; gap: 2px; min-height: 47px; border-radius: 9px; color: var(--muted); font-size: 9px; font-weight: 700; }
  .mobile-nav a span { font-size: 16px; line-height: 1; }
  .mobile-nav a.active { background: var(--surface-3); color: var(--lime-bright); }
}

@media (max-width: 680px) {
  body { font-size: 13px; }
  .site-header { height: 60px; }
  .brand-mark { width: 31px; height: 31px; }
  .live-stamp { display: none; }
  main { padding: 20px 12px 92px; }
  .page-head, .detail-head { align-items: start; flex-direction: column; }
  .page-head { gap: 11px; }
  h1 { font-size: 28px; }
  .metric-grid { gap: 7px; }
  .metric-card { min-height: 83px; padding: 12px; }
  .metric-value { font-size: 25px; }
  .panel { padding: 13px; border-radius: 10px; }
  .panel-head { align-items: start; }
  .chart-wrap { height: 210px; }
  .activity-row { grid-template-columns: 36px minmax(120px, 1fr) 68px 18px; gap: 8px; }
  .activity-row .activity-stat:nth-of-type(2), .activity-row .activity-stat:nth-of-type(3) { display: none; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .search-input { grid-column: 1 / -1; }
  .result-count { text-align: left; }
  .record-grid { grid-template-columns: 1fr 1fr; }
  .detail-metrics { grid-template-columns: repeat(2, 1fr); }
  footer { flex-direction: column; padding-inline: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; }
}
