/* =====================================================================
   Healthspan landing page — page-specific styles.
   Inherits foundations from /ds/foundations.css.
   ===================================================================== */

@import url("./ds/foundations.css");

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg1);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: var(--fs-body-md);
  line-height: var(--lh-normal);
  min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }

/* Accessibility: visible-on-focus skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--slate-900);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  z-index: 100;
}
.skip-link:focus { left: 16px; outline: 2px solid var(--brand); }

/* Universal focus ring */
:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}

/* ----------- Nav ----------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  height: 64px;
  display: flex; align-items: center;
  padding: 0 24px;
  background: rgba(250, 250, 250, 0.78);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-base) var(--ease-out);
}
.nav.scrolled { border-bottom-color: var(--border-soft); }
.nav__inner {
  max-width: 1200px; margin: 0 auto; width: 100%;
  display: flex; align-items: center; gap: 24px;
}
.nav__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg1); }
.nav__brand-mark {
  width: 28px; height: 28px;
  display: inline-grid; place-items: center;
  background: var(--brand);
  border-radius: 9px;
  color: #fff;
}
.nav__brand-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.nav__links { display: flex; gap: 24px; flex: 1; margin-left: 12px; }
.nav__link {
  font-size: 14px; font-weight: 500; color: var(--fg2);
  text-decoration: none;
  transition: color var(--dur-fast);
}
.nav__link:hover { color: var(--fg1); }
.nav__actions { display: flex; gap: 8px; align-items: center; }

@media (max-width: 720px) {
  .nav { padding: 0 16px; }
  .nav__links { display: none; }
}

/* ----------- Buttons ----------- */
.btn {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  user-select: none;
}
.btn:focus-visible { box-shadow: var(--shadow-focus); }
.btn--primary { background: var(--brand); color: var(--fg-onbrand); }
.btn--primary:hover { background: var(--brand-hover); }
.btn--primary:active { background: var(--brand-press); }
.btn--secondary { background: #fff; color: var(--fg1); border-color: var(--border); }
.btn--secondary:hover { background: var(--surface-soft); border-color: var(--border-strong); }
.btn--ghost { background: transparent; color: var(--brand-hover); }
.btn--ghost:hover { background: var(--brand-tint); }
.btn--sm { font-size: 12px; padding: 7px 12px; border-radius: var(--radius-sm); }
.btn--lg { font-size: 16px; padding: 14px 22px; }
.btn .lucide { width: 16px; height: 16px; }
.btn--lg .lucide { width: 18px; height: 18px; }

/* ----------- Eyebrow / badge ----------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  color: var(--indigo-600);
}
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--slate-700);
}
.badge--brand { background: var(--brand-soft); color: var(--indigo-800); }
.badge--soft { background: var(--bg-elevated); border: 1px solid var(--border-soft); color: var(--fg2); }
.badge .dot { width: 6px; height: 6px; border-radius: 9999px; background: currentColor; }

/* ----------- Hero ----------- */
.hero {
  position: relative;
  padding: 64px 24px 24px;
  overflow: hidden;
  isolation: isolate;
}
.hero__bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 50% 0%, rgba(99,102,241,0.18) 0%, rgba(99,102,241,0) 50%),
    radial-gradient(circle at 80% 30%, rgba(165,180,252,0.20) 0%, rgba(165,180,252,0) 40%);
  pointer-events: none;
}
.hero__dots {
  position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(circle at 1px 1px, rgba(17,24,39,0.06) 1px, transparent 0);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 80%);
  pointer-events: none;
}
.hero__inner {
  max-width: 1200px; margin: 0 auto;
  text-align: center;
  padding: 24px 0 40px;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(36px, 6.4vw, 64px);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--fg1);
  margin: 16px auto 0;
  max-width: 18ch;
  text-wrap: balance;
}
.hero__title em {
  font-style: normal;
  color: var(--brand);
  font-weight: 500;
}
.hero__sub {
  font-size: var(--fs-body-lg);
  color: var(--fg2);
  margin: 20px auto 0;
  max-width: 56ch;
  line-height: var(--lh-relaxed);
  text-wrap: pretty;
}
.hero__meta {
  display: flex; align-items: center; justify-content: center;
  gap: 16px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.hero__meta-item {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--fg2);
}
.hero__meta-item .lucide { width: 16px; height: 16px; color: var(--brand); }

/* ----------- Calculator section ----------- */
.calc-section {
  padding: 32px 24px 24px;
  position: relative;
}
.calc-section__inner {
  max-width: 1200px; margin: 0 auto;
}
.calc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 980px) {
  .calc-grid { grid-template-columns: 1fr; }
}

/* Calculator card */
.calc {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
@media (max-width: 540px) { .calc { padding: 20px; } }

.calc__header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
  gap: 12px;
  flex-wrap: wrap;
}
.calc__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg1);
  margin: 0;
}

.calc__progress {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--fg3);
  text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 8px;
}
.calc__progress-bar {
  width: 80px; height: 4px; border-radius: 9999px;
  background: var(--surface);
  overflow: hidden;
}
.calc__progress-bar > span {
  display: block; height: 100%;
  background: var(--brand);
  transition: width var(--dur-base) var(--ease-out);
}

.calc__group {
  padding: 24px 0;
  border-top: 1px solid var(--border-soft);
}
.calc__group:first-of-type { padding-top: 20px; }
.calc__group:last-of-type { padding-bottom: 4px; }

.calc__group-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
}
.calc__group-icon {
  width: 32px; height: 32px;
  display: inline-grid; place-items: center;
  background: var(--brand-tint);
  color: var(--indigo-700);
  border-radius: var(--radius-md);
}
.calc__group-icon .lucide { width: 18px; height: 18px; }
.calc__group-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--fg1);
}
.calc__group-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg3);
  margin-left: auto;
}

/* Field row */
.field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 16px;
  align-items: baseline;
  margin-bottom: 20px;
}
.field:last-child { margin-bottom: 0; }
.field__label {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg1);
  grid-column: 1;
}
.field__value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--indigo-700);
  letter-spacing: 0.01em;
  grid-column: 2;
  text-align: right;
}
.field__value small {
  color: var(--fg3);
  font-weight: 400;
  margin-left: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 10px;
}
.field__control { grid-column: 1 / -1; }
.field__hint {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--fg3);
  margin-top: 4px;
}

/* Slider */
.slider {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 24px;
  background: transparent;
  cursor: pointer;
  outline: none;
  padding: 0;
}
.slider:focus-visible { box-shadow: none; }
.slider:focus-visible::-webkit-slider-thumb { box-shadow: var(--shadow-focus); }
.slider:focus-visible::-moz-range-thumb { box-shadow: var(--shadow-focus); }

.slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 9999px;
  background: linear-gradient(to right,
    var(--brand) 0%, var(--brand) var(--fill, 50%),
    var(--surface) var(--fill, 50%), var(--surface) 100%);
}
.slider::-moz-range-track {
  height: 6px;
  border-radius: 9999px;
  background: var(--surface);
}
.slider::-moz-range-progress {
  height: 6px;
  border-radius: 9999px;
  background: var(--brand);
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 9999px;
  background: #fff;
  border: 2px solid var(--brand);
  margin-top: -6px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.slider::-webkit-slider-thumb:hover { transform: scale(1.08); box-shadow: var(--shadow-md); }
.slider::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 9999px;
  background: #fff;
  border: 2px solid var(--brand);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-out);
}
.slider::-moz-range-thumb:hover { transform: scale(1.08); }

/* Segmented control (sex, smoking, diet) */
.seg {
  display: inline-flex;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
  width: 100%;
  flex-wrap: wrap;
}
.seg__btn {
  flex: 1 1 auto;
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg2);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast);
  white-space: nowrap;
  text-align: center;
  min-width: 0;
}
.seg__btn:hover { color: var(--fg1); }
.seg__btn[aria-pressed="true"] {
  background: #fff;
  color: var(--fg1);
  box-shadow: var(--shadow-xs), 0 0 0 1px var(--border-soft);
}
.seg__btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* Diet scale labels */
.scale-labels {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg3);
  margin-top: 6px;
  padding: 0 4px;
}

/* Disclosure */
.disclosure {
  margin-top: 4px;
}
.disclosure__summary {
  list-style: none;
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg1);
  transition: background var(--dur-fast);
}
.disclosure__summary:hover { background: var(--surface); }
.disclosure__summary::-webkit-details-marker { display: none; }
.disclosure__summary .chev { transition: transform var(--dur-base) var(--ease-out); margin-left: auto; }
.disclosure[open] .disclosure__summary .chev { transform: rotate(90deg); }
.disclosure__body {
  padding: 8px 4px 4px;
  animation: fadeIn 240ms var(--ease-out);
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* ----------- Result card ----------- */
.result {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 88px;
}
@media (max-width: 980px) {
  .result { position: static; }
}

.result__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--indigo-600);
  margin-bottom: 8px;
}

.score {
  display: flex; align-items: flex-end; gap: 14px;
  margin-top: 8px;
}
.score__num {
  font-family: var(--font-display);
  font-size: 76px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--fg1);
  font-variant-numeric: tabular-nums;
  transition: color var(--dur-base);
}
.score__suffix {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-bottom: 16px;
}
.score__band {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--brand-soft);
  color: var(--indigo-800);
  transition: background var(--dur-base), color var(--dur-base);
}

/* Score arc visualization */
.arc {
  position: relative;
  margin: 16px auto 4px;
  max-width: 280px;
}
.arc svg { width: 100%; height: auto; display: block; }
.arc__track { stroke: var(--surface); }
.arc__fill {
  stroke: var(--brand);
  transition: stroke-dashoffset var(--dur-slow) var(--ease-out),
              stroke var(--dur-base);
}

/* Healthspan readout */
.span-readout {
  margin: 20px 0 8px;
  padding: 16px;
  background: var(--brand-tint);
  border: 1px solid var(--indigo-100);
  border-radius: var(--radius-md);
}
.span-readout--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 20px;
}
.span-readout--split .span-readout__col + .span-readout__col {
  padding-left: 20px;
  border-left: 1px solid var(--indigo-200);
}
.span-readout__col { min-width: 0; }
.span-readout__label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--indigo-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.span-readout__value {
  display: flex; align-items: baseline; gap: 6px;
  margin-top: 4px;
}
.span-readout__years {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--fg1);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.span-readout__unit {
  font-size: 12px;
  color: var(--fg2);
  white-space: nowrap;
}
.span-readout__delta {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--indigo-700);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--indigo-200);
  letter-spacing: 0.02em;
  line-height: 1.5;
}

/* Recommendations teaser inside result card */
.recs-teaser {
  margin-top: 20px;
  padding: 14px 14px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
}
.recs-teaser__link {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-hover);
  text-decoration: none;
  margin-bottom: 10px;
  transition: color var(--dur-fast);
}
.recs-teaser__link:hover { color: var(--brand-press); }
.recs-teaser__link .lucide { width: 12px; height: 12px; }
.recs-teaser__list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.recs-teaser__list li {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  color: var(--fg1);
  line-height: 1.4;
}
.recs-teaser__dot {
  width: 6px; height: 6px;
  border-radius: 9999px;
  flex-shrink: 0;
}
.recs-teaser__title {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.recs-teaser__gain {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--fg3);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

/* Full recommendations section */
.section--recs {
  background:
    linear-gradient(to bottom, var(--bg) 0%, #FFFFFF 60%, #FFFFFF 100%);
  padding-top: 56px;
  padding-bottom: 56px;
}
.section--recs .section__head { max-width: 720px; margin-bottom: 32px; }

.rec-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 900px;
}
.rec-card {
  display: grid;
  grid-template-columns: 56px 56px 1fr;
  gap: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  align-items: start;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.rec-card:hover { border-color: var(--border); box-shadow: var(--shadow-sm); }

.rec-card__rank {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--fg3);
  padding-top: 6px;
}
.rec-card__icon {
  width: 44px; height: 44px;
  background: var(--brand-tint);
  color: var(--indigo-700);
  border-radius: var(--radius-md);
  display: inline-grid; place-items: center;
}
.rec-card__icon .lucide { width: 22px; height: 22px; }

.rec-card__main { min-width: 0; }

.rec-card__head {
  display: flex; align-items: baseline;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.rec-card__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg1);
  margin: 0;
  line-height: 1.2;
}
.rec-card__gain {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--success-100);
  color: #065F46;
}
.rec-card__gain .lucide { width: 12px; height: 12px; }

.rec-card__why {
  font-size: 14px;
  line-height: var(--lh-relaxed);
  color: var(--fg2);
  margin: 8px 0 16px;
  max-width: 62ch;
}

.rec-card__steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.rec-card__steps li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  font-size: 14px;
  line-height: var(--lh-relaxed);
  color: var(--fg1);
  align-items: baseline;
}
.rec-card__step-num {
  display: inline-grid; place-items: center;
  width: 20px; height: 20px;
  border-radius: 9999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--fg2);
  align-self: start;
  margin-top: 1px;
}

.rec-card__source {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-soft);
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--fg3);
  letter-spacing: 0.02em;
}
.rec-card__source .lucide { width: 12px; height: 12px; }

@media (max-width: 720px) {
  .rec-card {
    grid-template-columns: 44px 1fr;
    grid-template-rows: auto auto;
    padding: 20px;
    gap: 12px 16px;
  }
  .rec-card__rank {
    grid-column: 1 / -1;
    padding-top: 0;
    order: -1;
  }
  .rec-card__icon { width: 40px; height: 40px; }
  .rec-card__title { font-size: 18px; }
}

/* Result actions */
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}
.actions .btn { width: 100%; padding: 10px 8px; font-size: 13px; }

/* ----------- Ad slot ----------- */
.ad-slot-wrap {
  padding: 32px 24px;
  background: var(--bg);
}
.ad-slot {
  max-width: 970px;
  margin: 0 auto;
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  min-height: 120px;
  justify-content: center;
}
.ad-slot__label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg3);
}
.ad-slot__inner {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  color: var(--fg3);
  font-size: 12px;
  font-family: var(--font-mono);
}
.ad-slot__ins {
  width: 100%;
  min-height: 90px;
  max-width: 970px;
}
/* Preview fallback: until AdSense loads (or in staging without a real
   publisher ID), the empty <ins> would collapse. Show a dashed
   placeholder behind it so the slot is visible. */
.ad-slot__ins:empty::before {
  content: "Advertisement · 728 × 90 leaderboard · responsive";
  display: grid;
  place-items: center;
  min-height: 90px;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  color: var(--fg3);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* ----------- Methodology ----------- */
.section { padding: 64px 24px; }
.section__inner { max-width: 1200px; margin: 0 auto; }
.section__head { max-width: 720px; margin-bottom: 40px; }
.section__title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 500;
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-snug);
  color: var(--fg1);
  margin: 12px 0 0;
}
.section__sub {
  font-size: var(--fs-body-lg);
  color: var(--fg2);
  margin: 16px 0 0;
  line-height: var(--lh-relaxed);
}

/* Methodology grid */
.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 900px) { .method-grid { grid-template-columns: 1fr; } }

.method {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 24px;
}
.method__num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--fg3);
}
.method__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--fg1);
  margin: 8px 0 0;
}
.method__body {
  font-size: 14px;
  color: var(--fg2);
  line-height: var(--lh-relaxed);
  margin: 12px 0 0;
}

/* Factor weights table */
.weights {
  margin-top: 40px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 24px;
  overflow-x: auto;
}
.weights__title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--fg1);
  margin: 0 0 16px;
}
.weights table { width: 100%; border-collapse: collapse; font-size: 14px; }
.weights th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg3);
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-soft);
}
.weights th:last-child, .weights td:last-child { text-align: right; }
.weights td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--fg1);
  vertical-align: middle;
}
.weights tr:last-child td { border-bottom: none; }
.weights td.weight-bar { width: 200px; }
.bar {
  width: 100%; height: 6px; background: var(--surface);
  border-radius: 9999px; overflow: hidden;
}
.bar span { display: block; height: 100%; background: var(--brand); border-radius: 9999px; }

/* ----------- Science ----------- */
.science-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 900px) { .science-grid { grid-template-columns: 1fr; } }

.citations {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 8px 0;
}
.citation {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-soft);
  align-items: baseline;
}
.citation:last-child { border-bottom: none; }
.citation__idx {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--fg3);
}
.citation__body strong { color: var(--fg1); font-weight: 600; }
.citation__body { color: var(--fg2); font-size: 14px; line-height: var(--lh-normal); }
.citation__body em { font-style: normal; color: var(--fg3); }
.citation__link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--brand-hover);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
  white-space: nowrap;
}
.citation__link:hover { color: var(--brand-press); }
.citation__link .lucide { width: 12px; height: 12px; }

@media (max-width: 640px) {
  .citation { grid-template-columns: 1fr; }
  .citation__idx { color: var(--brand); }
}

/* Disclosure aside */
.aside-card {
  background: var(--slate-900);
  color: var(--slate-200);
  border-radius: var(--radius-md);
  padding: 24px;
}
.aside-card h4 {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 600;
  margin: 0 0 12px; color: #fff;
  letter-spacing: -0.005em;
}
.aside-card p { font-size: 13px; line-height: var(--lh-relaxed); color: var(--slate-300); margin: 0 0 12px; }
.aside-card p:last-child { margin-bottom: 0; }
.aside-card a { color: var(--indigo-300); text-decoration: none; }
.aside-card a:hover { color: #fff; }

/* ----------- Footer ----------- */
.footer {
  background: var(--slate-900);
  color: var(--slate-300);
  padding: 56px 24px 32px;
  margin-top: 32px;
}
.footer__inner {
  max-width: 1200px; margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}
@media (max-width: 760px) { .footer__inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer__inner { grid-template-columns: 1fr; } }

.footer__brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
}
.footer__brand-tagline { font-size: 13px; color: var(--slate-400); margin-top: 8px; max-width: 30ch; line-height: var(--lh-relaxed); }
.footer h5 {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--slate-400);
  margin: 0 0 16px;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer a { color: var(--slate-300); text-decoration: none; font-size: 14px; transition: color var(--dur-fast); }
.footer a:hover { color: #fff; }
.footer__bottom {
  max-width: 1200px; margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--slate-500); flex-wrap: wrap; gap: 12px;
}
.footer__bottom-links { display: flex; gap: 16px; }

/* ----------- Toast ----------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--slate-900);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base), transform var(--dur-base) var(--ease-out);
  z-index: 50;
}
.toast--visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .lucide { width: 16px; height: 16px; color: var(--success-500); }

/* ----------- Entrance ----------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise var(--dur-slow) var(--ease-out) both; }
.rise.d1 { animation-delay: 60ms; }
.rise.d2 { animation-delay: 120ms; }
.rise.d3 { animation-delay: 180ms; }
.rise.d4 { animation-delay: 240ms; }
.rise.d5 { animation-delay: 300ms; }

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

/* ----------- Print Report (hidden on screen, full layout on print) ----------- */
#print-report-mount { display: none; }
.pr { color: var(--fg1); font-family: var(--font-sans); }

/* Explicit print-mode class (toggled by JS) — mirrors @media print
   rules so iframe quirks can't strand the page in a partial state. */
body.is-printing > *:not(#print-report-mount) { display: none !important; }
body.is-printing #print-report-mount { display: block !important; }
body.is-printing { background: #fff !important; color: #111827 !important; }

@media print {
  /* Letter portrait, tight margins. */
  @page { size: letter portrait; margin: 12mm; }

  html, body {
    background: #fff !important;
    color: #111827 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-adjust: exact;
  }

  /* Hide every direct child of body except the print mount.
     The is-printing JS class also does this, but we keep the @media
     rule for users who print via Ctrl/Cmd+P (which bypasses our JS). */
  body > *:not(#print-report-mount) { display: none !important; }

  /* Show the print mount + report. */
  #print-report-mount { display: block !important; }

  .pr {
    width: 100%;
    font-size: 10.5pt;
    line-height: 1.4;
  }

  /* Header */
  .pr__head {
    display: flex; justify-content: space-between; align-items: center;
    padding-bottom: 10px;
    border-bottom: 1.5px solid #111827;
    margin-bottom: 14px;
  }
  .pr__brand { display: flex; align-items: center; gap: 8px; }
  .pr__mark {
    width: 18px; height: 18px;
    background: var(--brand);
    color: #fff;
    border-radius: 4px;
    display: inline-grid; place-items: center;
  }
  .pr__brand-name {
    font-family: var(--font-mono);
    font-size: 11pt;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #111827;
  }
  .pr__brand-sub {
    font-family: var(--font-mono);
    font-size: 8.5pt;
    color: #64748B;
    margin-left: 6px;
    padding-left: 8px;
    border-left: 1px solid #CBD5E1;
    letter-spacing: 0.02em;
  }
  .pr__date {
    font-family: var(--font-mono);
    font-size: 9pt;
    color: #64748B;
    letter-spacing: 0.04em;
  }

  /* Summary block (score + stats) */
  .pr__summary {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 16px;
    padding: 14px 16px;
    background: #FAFAFA !important;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    margin-bottom: 14px;
    page-break-inside: avoid;
  }
  .pr__score {
    display: flex; align-items: baseline; gap: 10px;
    border-right: 1px solid #E2E8F0;
    padding-right: 16px;
  }
  .pr__score-num {
    font-size: 44pt;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
  }
  .pr__score-meta { display: flex; flex-direction: column; gap: 4px; }
  .pr__score-suffix {
    font-family: var(--font-mono);
    font-size: 9pt;
    color: #64748B;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .pr__score-band {
    font-family: var(--font-mono);
    font-size: 8.5pt;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 9999px;
    align-self: flex-start;
  }

  .pr__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    align-items: center;
  }
  .pr__stat {
    display: flex; flex-direction: column; gap: 2px;
    padding: 0 6px;
  }
  .pr__stat-label {
    font-family: var(--font-mono);
    font-size: 7.5pt;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #4338CA;
  }
  .pr__stat-value {
    display: flex; align-items: baseline; gap: 5px;
    font-size: 20pt;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: #111827;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
  }
  .pr__stat-unit {
    font-size: 8pt;
    font-weight: 400;
    color: #64748B;
    letter-spacing: 0;
  }

  /* Section headers */
  .pr__h3 {
    font-family: var(--font-mono);
    font-size: 8.5pt;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748B;
    margin: 0 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #E2E8F0;
  }

  /* Inputs grid */
  .pr__inputs { margin-bottom: 14px; page-break-inside: avoid; }
  .pr__dl {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px 16px;
    margin: 0;
  }
  .pr__dl > div {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
    align-items: baseline;
  }
  .pr__dl dt {
    font-family: var(--font-mono);
    font-size: 7.5pt;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94A3B8;
    margin: 0;
  }
  .pr__dl dd {
    font-size: 9.5pt;
    color: #111827;
    margin: 0;
    font-weight: 500;
  }

  /* Recommendations */
  .pr__recs { page-break-inside: avoid; }
  .pr__rec-list {
    list-style: none;
    padding: 0; margin: 0;
    display: flex; flex-direction: column;
    gap: 7px;
  }
  .pr__rec {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 10px;
    padding: 8px 12px;
    background: #FAFAFA !important;
    border: 1px solid #E2E8F0;
    border-radius: 5px;
    page-break-inside: avoid;
  }
  .pr__rec-rank {
    font-family: var(--font-mono);
    font-size: 11pt;
    font-weight: 600;
    color: #6366F1;
    line-height: 1.1;
  }
  .pr__rec-body { min-width: 0; }
  .pr__rec-head {
    display: flex; align-items: baseline; gap: 8px;
    margin-bottom: 2px;
  }
  .pr__rec-head strong {
    font-size: 10.5pt;
    font-weight: 600;
    color: #111827;
  }
  .pr__rec-gain {
    font-family: var(--font-mono);
    font-size: 7.5pt;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 1px 6px;
    border-radius: 9999px;
    background: #D1FAE5 !important;
    color: #065F46;
  }
  .pr__rec p {
    margin: 0;
    font-size: 9pt;
    line-height: 1.4;
    color: #4B5563;
  }

  /* Footer */
  .pr__foot {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #E2E8F0;
    display: flex; justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 7.5pt;
    color: #94A3B8;
    letter-spacing: 0.04em;
  }
}
