/* ═══════════════════════════════════════════════════
   /health — Page integrity receipt
   Portfolio v3 · 2026
   A standalone page that publishes the site's operational state.
   ═══════════════════════════════════════════════════ */

body.health-page {
  background: var(--surface-statement);
  color: var(--text-primary);
  min-height: 100svh;
}

/* ═══ Minimal top nav ═══ */
.health-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem clamp(1.5rem, 5vw, 4rem);
  background: color-mix(in oklch, var(--surface-statement) 75%, transparent);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--border-faint);
}

.health-nav__home {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.25s ease;
}

.health-nav__home:hover,
.health-nav__home:focus-visible {
  color: var(--accent);
}

.health-nav__arrow {
  display: inline-block;
  transition: transform 0.3s var(--ease-out);
}

.health-nav__home:hover .health-nav__arrow {
  transform: translateX(-3px);
}

.health-nav__path {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ═══ Content shell ═══ */
.health {
  padding: clamp(4rem, 10vh, 7rem) clamp(1.5rem, 5vw, 5rem) clamp(4rem, 8vh, 6rem);
}

.health__inner {
  max-width: 760px;
  margin: 0 auto;
}

/* ═══ Header ═══ */
.health__header {
  margin-bottom: clamp(4rem, 8vh, 6rem);
}

.health__eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-faint);
}

.health__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  margin: 0 0 clamp(1.5rem, 3vh, 2rem);
}

.health__lede {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 1.1rem;
  max-width: 58ch;
}

.health__lede em {
  font-style: italic;
  color: var(--text-primary);
}

.health__lede-coda {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
  max-width: 56ch;
}

/* ═══ Groups ═══ */
.health__group {
  margin-bottom: clamp(3rem, 6vh, 4.5rem);
  padding-bottom: clamp(2rem, 4vh, 3rem);
  border-bottom: 1px solid var(--border-faint);
}

.health__group:last-of-type {
  border-bottom: none;
}

.health__group-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  font-weight: 500;
}

/* ═══ Metrics list ═══ */
.health__metrics {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
}

.health__metric {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid color-mix(in oklch, var(--border-faint) 45%, transparent);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.health__metric:last-child {
  border-bottom: none;
}

.health__metric dt {
  color: var(--text-secondary);
  flex: 1;
  min-width: 0;
}

.health__metric dt small {
  color: var(--text-faint);
  font-size: 0.78em;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  margin-left: 0.4em;
}

.health__metric dd {
  color: var(--text-primary);
  margin: 0;
  text-align: right;
  font-weight: 500;
  flex-shrink: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 0.7em;
}

.health__metric dd small {
  color: var(--text-muted);
  font-size: 0.85em;
  font-weight: 400;
  margin-left: 0.4em;
}

/* Total row — slightly emphasized */
.health__metric--total dt,
.health__metric--total dd {
  color: var(--accent);
  font-weight: 600;
}

/* ═══ Perf metric value + verdict ═══
   Value stays prominent; verdict is a tiny mono tag that names the
   metric's status against Google's Core Web Vitals thresholds.
   Auto-computed by update-health.js; never hardcoded. */
.health__value {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1em;
  color: var(--text-primary);
}

.health__verdict {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 0.18em 0.55em;
  border-radius: 2px;
  white-space: nowrap;
  line-height: 1.2;
}

/* Hide the verdict slot when empty (unmeasured metrics) */
.health__verdict:empty { display: none; }

/* Good — muted, barely there, "nothing to see here" */
.health__verdict[data-verdict="good"] {
  color: var(--text-muted);
  background: color-mix(in oklch, var(--text-primary) 5%, transparent);
}

/* Needs work — rust, attention but not alarm */
.health__verdict[data-verdict="needs work"] {
  color: var(--accent);
  background: color-mix(in oklch, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in oklch, var(--accent) 22%, transparent);
}

/* Poor — rust with more weight */
.health__verdict[data-verdict="poor"] {
  color: var(--accent-hover, var(--accent));
  background: color-mix(in oklch, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in oklch, var(--accent) 40%, transparent);
  font-weight: 600;
}

/* Note below a metrics block */
.health__note {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 1.25rem 0 0;
  max-width: 58ch;
}

.health__note code,
.health__verify code {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.85em;
  letter-spacing: 0;
  color: var(--text-secondary);
  background: color-mix(in oklch, var(--text-primary) 6%, transparent);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

/* Verify block — slightly more prominent than a note */
.health__verify {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 1.1rem;
  max-width: 60ch;
}

.health__verify em {
  font-style: italic;
  color: var(--text-primary);
}

.health__verify:last-child {
  margin-bottom: 0;
}

/* ═══ Footer ═══ */
.health__footer {
  margin-top: clamp(4rem, 8vh, 6rem);
  padding-top: clamp(2rem, 4vh, 3rem);
  border-top: 1px solid var(--border-faint);
}

.health__footer p {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.health__footer em {
  color: var(--text-faint);
  margin-right: 0.3em;
  font-style: normal;
}

.health__writeme {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklch, var(--accent) 40%, transparent);
  padding-bottom: 1px;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.health__writeme:hover,
.health__writeme:focus-visible {
  color: var(--accent-hover);
  border-bottom-color: var(--accent);
}

.health__back {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 1rem 0 0;
}

.health__back a {
  color: inherit;
  text-decoration: none;
  transition: color 0.25s ease;
}

.health__back a:hover,
.health__back a:focus-visible {
  color: var(--accent);
}

/* ═══ Responsive ═══ */
@media (max-width: 600px) {
  .health {
    padding: 3rem 1.25rem 3rem;
  }
  .health__title {
    font-size: clamp(2rem, 10vw, 3rem);
  }
  .health__metric {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  .health__metric dd {
    text-align: left;
  }
}
