/* Reset, typography, shared primitives (buttons, pills, focus) */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, canvas, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 500; letter-spacing: -0.025em; text-wrap: balance; }
::selection { background: var(--mint-300); color: var(--ink-900); }

h1 { font-size: var(--fs-hero); line-height: 1.02; letter-spacing: -0.035em; }
h2 { font-size: var(--fs-h2); line-height: 1.08; }
h3 { font-size: var(--fs-h3); line-height: 1.25; letter-spacing: -0.015em; }

.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--text-soft); max-width: 36em; text-wrap: pretty; }
.small { font-size: var(--fs-small); color: var(--text-soft); }
.num { font-variant-numeric: tabular-nums; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--teal-500); outline-offset: 3px; border-radius: 6px; }
.on-night :focus-visible { outline-color: var(--mint-300); }

/* Buttons */
.btn {
  --btn-bg: var(--ink-900);
  --btn-fg: #fff;
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 48px; padding: 0 1.4rem;
  border: 0; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg);
  font-family: var(--font-display); font-weight: 500; font-size: 1rem; letter-spacing: -0.005em;
  white-space: nowrap;
  transition: transform 160ms var(--ease-out), background-color var(--t-fast), box-shadow 240ms var(--ease-out);
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 6px 16px rgba(6, 47, 43, 0.22);
}
/* Soft light sweep, behind the label */
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 32%, rgba(255,255,255,.2) 50%, transparent 68%);
  transform: translateX(-120%); transition: transform 700ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover { --btn-bg: var(--ink-700); transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 10px 24px rgba(6, 47, 43, 0.26); }
  .btn:hover::after { transform: translateX(120%); }
}
.btn:active, .btn:hover:active { transform: scale(0.97); transition-duration: 100ms; }
.btn[disabled] { opacity: 0.65; cursor: progress; transform: none; }
.btn--sm { min-height: 40px; padding: 0 1.1rem; font-size: 0.95rem; }
.btn--light { --btn-bg: var(--mint-200); --btn-fg: var(--ink-900); box-shadow: 0 6px 16px rgba(0,0,0,.18); }
@media (hover: hover) and (pointer: fine) { .btn--light:hover { --btn-bg: #fff; } }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink-900); box-shadow: inset 0 0 0 1px var(--line-strong); }
@media (hover: hover) and (pointer: fine) { .btn--ghost:hover { --btn-bg: var(--surface); box-shadow: inset 0 0 0 1px var(--ink-900); } }

/* Pills and small status chips */
.pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.38rem 0.8rem 0.38rem 0.65rem;
  border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255,255,255,.7); backdrop-filter: blur(8px);
  font-size: var(--fs-small); color: var(--ink-800); font-weight: 500;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal-500); flex: none; }
.dot--live { background: var(--alert); box-shadow: 0 0 0 0 rgba(232,105,74,.5); animation: ping 1.8s infinite; }
.dot--ok { background: var(--teal-500); }
@keyframes ping { 70% { box-shadow: 0 0 0 7px rgba(232,105,74,0); } 100% { box-shadow: 0 0 0 0 rgba(232,105,74,0); } }

.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .18rem .6rem; border-radius: 999px;
  font-size: var(--fs-micro); font-weight: 600; letter-spacing: .01em;
  background: var(--mint-100); color: var(--teal-600);
}
.chip--alert { background: var(--alert-soft); color: var(--alert-ink); }
.chip--quiet { background: var(--page-deep); color: var(--text-soft); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
