@font-face {
  font-family: "Inter";
  src: url("assets/inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --page: #201e19;
  --surface: #161411;
  --ink: #e2e2e0;
  --ink-2: #aba9a4;
  --muted: #7d7b75;
  --hair: #302e26;
  --axis: #4b473d;
  --rule: #e2e2e0;
  --accent: #ed8264;
  --blue: #5687d5;
  --context: #545147;
  --good: #18ee18;
  --critical: #e18181;
  --warning: #ffb421;
  --col-gap: 24px;
  --margin: clamp(20px, 4vw, 56px);
  --font: "Inter", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }

.page { max-width: 1440px; margin: 0 auto; padding: 0 var(--margin) 64px; }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); }
.c-2 { grid-column: span 2; } .c-4 { grid-column: span 4; } .c-6 { grid-column: span 6; }
.c-8 { grid-column: span 8; } .c-12 { grid-column: span 12; }
.right { text-align: right; }

.label, .eyebrow, dt, .spec-title, th {
  font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}

/* masthead */
.masthead { padding: 22px 0 20px; border-bottom: 1px solid var(--rule); align-items: center; }
.eyebrow { color: var(--ink); }
.eyebrow .sep { color: var(--muted); margin: 0 6px; }
.status-line { display: flex; justify-content: flex-end; gap: 20px; align-items: center; font-size: 12px; color: var(--ink-2); }
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status[data-state="training"] .status-dot { background: var(--good); box-shadow: 0 0 0 0 rgba(24,238,24,.45); animation: pulse 2.4s infinite; }
.status[data-state="finished"] .status-dot { background: var(--ink); }
.status[data-state="stale"] .status-dot { background: var(--warning); }
.status[data-state="interrupted"] .status-dot { background: var(--critical); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(24,238,24,.45); } 70% { box-shadow: 0 0 0 7px rgba(24,238,24,0); } 100% { box-shadow: 0 0 0 0 rgba(24,238,24,0); } }
@media (prefers-reduced-motion: reduce) { .status-dot { animation: none !important; } }
.updated { font-variant-numeric: tabular-nums; }

/* hero */
.hero { padding: 56px 0 48px; align-items: end; }
h1 {
  margin: 0; font-size: clamp(44px, 6.6vw, 96px); line-height: 0.92; letter-spacing: -0.045em; font-weight: 600;
}
.lede { margin: 28px 0 0; max-width: 34em; font-size: clamp(16px, 1.45vw, 20px); line-height: 1.4; color: var(--ink-2); letter-spacing: -0.01em; }
.facts { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--rule); }
.facts > div { display: grid; grid-template-columns: 88px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--hair); }
.facts dt { padding-top: 2px; }
.facts dd { margin: 0; font-size: 14px; color: var(--ink); }

/* progress */
.progress-block { padding: 8px 0 40px; }
.progress-head { align-items: baseline; margin-bottom: 12px; }
.progress-count, .progress-eta { font-size: 15px; font-weight: 500; margin-left: 10px; font-variant-numeric: tabular-nums; }
.track { position: relative; height: 10px; background: var(--hair); }
.fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); transition: width .8s cubic-bezier(.2,.7,.2,1); }
.ticks { position: absolute; inset: 0; }
.ticks i { position: absolute; top: -4px; bottom: -4px; width: 1px; background: var(--ink); opacity: .9; }
.track-scale { position: relative; height: 18px; margin-top: 8px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.track-scale span { position: absolute; transform: translateX(-50%); }
.track-scale span:first-child { transform: none; }
.track-scale span:last-child { transform: translateX(-100%); }

/* kpis */
.kpis { border-top: 1px solid var(--rule); }
.kpi { padding: 18px 0 22px; border-right: 1px solid var(--hair); padding-right: 16px; min-width: 0; }
.kpi:last-child { border-right: 0; }
.kpi-value { font-size: clamp(26px, 2.7vw, 38px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; margin-top: 10px; white-space: nowrap; }
.kpi-value .unit { font-size: 0.45em; letter-spacing: 0; color: var(--ink-2); margin-left: 4px; font-weight: 400; }
.kpi-sub { margin-top: 6px; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub .down { color: #00ba00; }
.kpi-sub .up { color: var(--critical); }

/* controls */
.controls {
  position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px;
  padding: 14px 0; margin-top: 8px; background: rgba(32,30,25,.94); backdrop-filter: blur(6px);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--hair);
}
.control { display: flex; align-items: center; gap: 10px; }
.control.hint { font-size: 12px; color: var(--muted); }
.control.push { margin-left: auto; }
.seg { display: inline-flex; border: 1px solid var(--axis); }
.seg button { border: 0; background: transparent; padding: 5px 11px; font-size: 12px; cursor: pointer; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.seg button + button { border-left: 1px solid var(--axis); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.seg button:hover:not([aria-pressed="true"]) { background: rgba(226,226,224,.05); }
.seg.small button { padding: 3px 8px; font-size: 11px; }
.btn { border: 1px solid var(--ink); background: transparent; padding: 5px 12px; font-size: 12px; cursor: pointer; }
.btn:hover { background: var(--ink); color: var(--surface); }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.btn.ghost { border-color: transparent; color: var(--ink-2); padding: 3px 7px; font-size: 11px; letter-spacing: 0.02em; }
.btn.ghost:hover { background: rgba(226,226,224,.06); color: var(--ink); }
.btn.ghost[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* sections */
.section { padding-top: 56px; }
.section-head { border-top: 1px solid var(--rule); padding-top: 14px; margin-bottom: 24px; }
.section-head .c-12 { display: flex; align-items: baseline; gap: 18px; }
.section-no { font-size: 12px; font-weight: 500; color: var(--accent); font-variant-numeric: tabular-nums; }
h2 { margin: 0; font-size: 26px; font-weight: 500; letter-spacing: -0.025em; }

.cards { row-gap: var(--col-gap); }
.card { background: var(--surface); border: 1px solid rgba(226,226,224,.08); padding: 20px 22px 16px; min-width: 0; display: flex; flex-direction: column; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.sub { margin: 3px 0 0; font-size: 12px; color: var(--ink-2); }
.actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.actions .seg { margin-right: 6px; }
.chart { height: 300px; margin-top: 10px; }
.chart.tall { height: 420px; }
.chart.short { height: 220px; }
.card-foot { margin-top: 6px; font-size: 11px; color: var(--muted); }

.table-view { height: 300px; overflow: auto; margin-top: 10px; border-top: 1px solid var(--hair); }
.card[data-chart="loss"] .table-view { height: 420px; }
.table-view.short { height: 220px; }

.notes { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.note { padding: 16px 0 18px; border-bottom: 1px solid var(--hair); flex: 1; }
.note-value { font-size: 32px; font-weight: 500; letter-spacing: -0.03em; margin-top: 8px; line-height: 1.05; }

/* tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid rgba(226,226,224,.08); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.data th { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--rule); position: sticky; top: 0; background: var(--surface); }
table.data td { padding: 11px 16px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; }
table.data td.empty { color: var(--muted); padding: 22px 16px; }
table.data tbody tr:hover td { background: rgba(226,226,224,.025); }
.avail { display: inline-flex; align-items: center; gap: 8px; }
.avail i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.avail.local i { background: var(--axis); }
.best-tag { margin-left: 8px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 600; }

/* config */
.spec { margin: 0; border-top: 1px solid var(--rule); }
.spec-title { color: var(--ink); padding: 12px 0; border-bottom: 1px solid var(--hair); }
.spec > div:not(.spec-title) { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--hair); }
.spec dt { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink-2); font-weight: 400; }
.spec dd { margin: 0; font-size: 13px; text-align: right; color: var(--ink); }

.colophon { margin-top: 72px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 12px; color: var(--muted); }

/* presentation view: chrome removed, ready to capture */
body.present .controls, body.present .actions, body.present .card-foot { display: none; }
body.present .section { padding-top: 44px; }
body.present .present-exit { display: inline-flex; }
.present-exit { display: none; position: fixed; right: 16px; bottom: 16px; z-index: 10; background: var(--surface); opacity: 0; transition: opacity .25s; }
.present-exit.visible, .present-exit:focus-visible { opacity: 1; }

@media (max-width: 1100px) {
  .c-2 { grid-column: span 4; }
  .kpi:nth-child(3n) { border-right: 0; }
  .c-8, .c-4.notes { grid-column: span 12; }
  .notes { flex-direction: row; flex-wrap: wrap; }
  .note { flex: 1 1 50%; padding-right: 16px; }
}
@media (max-width: 760px) {
  .c-2 { grid-column: span 6; }
  .kpi:nth-child(3n) { border-right: 1px solid var(--hair); }
  .kpi:nth-child(2n) { border-right: 0; }
  .c-4, .c-6, .c-8 { grid-column: span 12; }
  .masthead .c-6, .progress-head .c-6, .colophon .c-6 { grid-column: span 12; text-align: left; justify-content: flex-start; }
  .hero { padding: 36px 0 32px; }
  .facts { margin-top: 28px; }
  .control.hint { display: none; }
  .controls { position: static; }
  .card-head { flex-direction: column; }
}

/* training-session selector / archive */
.sessions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--hair); align-items: center; }
.sessions::before { content: "Sessions"; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 8px; }
.sessions button { border: 1px solid var(--axis); background: transparent; padding: 5px 14px; font-size: 13px; cursor: pointer; color: var(--ink-2); border-radius: 999px; font-variant-numeric: tabular-nums; }
.sessions button.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.sessions button:hover:not(.on) { border-color: var(--ink); color: var(--ink); }
.sessions .live { color: var(--good); margin-left: 4px; }
.sessions .done { color: var(--muted); margin-left: 4px; }
