/* ============================================================
   PageWeight — base styles
   Depends on css/tokens.css (loaded first).
   Reset → fonts → base → utilities → components (buttons, frames).
   ============================================================ */

/* ---- Fonts (self-hosted, OFL; weights verified 400/600/800) ---- */
@font-face {
  font-family: 'Geist';
  src: url('../fonts/Geist-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('../fonts/Geist-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('../fonts/Geist-Black.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* ---- Reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  color: var(--color-ink);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
}

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

input,
button,
textarea,
select {
  font: inherit;
}

/* ---- Headings ---- */
h1,
h2,
h3,
h4 {
  font-weight: var(--weight-black);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

h1 { font-size: var(--text-hero); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p {
  text-wrap: pretty;
}

/* ---- Muted text ---- */
.text-muted {
  color: var(--color-ink-soft);
}

/* ---- Yellow highlight, Wynter-style ---- */
mark {
  background: var(--color-yellow);
  color: var(--color-ink);
  padding: 0 0.15em;
}

/* ---- Links ---- */
a {
  color: inherit;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

/* ---- Focus: visible everywhere, yellow on ink backgrounds ---- */
:focus-visible {
  outline: 3px solid var(--color-ink);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.on-ink :focus-visible,
.btn-ink:focus-visible {
  outline-color: var(--color-yellow);
}

/* ---- Accessibility helper ---- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---- Layout containers ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--space-3xl);
}

.section--gray {
  background: var(--color-gray-bg);
}

/* Dark surface (nav, footer): set .on-ink so children adapt */
.on-ink {
  background: var(--color-ink);
  color: var(--color-white);
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 0.8em 1.6em;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  border: var(--border-bold);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition),
    background-color var(--transition), color var(--transition);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

/* Primary: yellow fill, hard offset shadow */
.btn-primary {
  background: var(--color-yellow);
  color: var(--color-ink);
  box-shadow: var(--shadow-hard);
}

.btn-primary:hover {
  background: var(--color-ink);
  color: var(--color-yellow);
}

/* Secondary: white with ink outline */
.btn-outline {
  background: var(--color-white);
  color: var(--color-ink);
  box-shadow: var(--shadow-hard);
}

.btn-outline:hover {
  background: var(--color-ink);
  color: var(--color-white);
}

/* On dark surfaces: ink fill, yellow text, yellow shadow */
.btn-ink {
  background: var(--color-ink);
  color: var(--color-yellow);
  box-shadow: 4px 4px 0 var(--color-yellow);
}

.btn-ink:hover {
  background: var(--color-yellow);
  color: var(--color-ink);
  box-shadow: 4px 4px 0 var(--color-white);
}

/* ---- Card ---- */
.card {
  background: var(--color-white);
  border: var(--border);
  border-radius: var(--radius);
  padding: var(--space-m);
}

.card--framed {
  border: var(--border-bold);
  box-shadow: var(--shadow-hard-lg);
}

/* ---- Tag / label chip ---- */
.chip {
  display: inline-block;
  padding: 0.2em 0.7em;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: var(--border);
  border-radius: var(--radius-sm);
  background: var(--color-white);
}

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

/* ============================================================
   Nav
   ============================================================ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  min-height: var(--nav-height);
  /* when the JS menu opens it becomes a third flex item: without wrap it is
     squeezed into the leftover row space (~150px) instead of taking its own
     full-width row under the wordmark */
  flex-wrap: wrap;
}

.nav-wordmark {
  font-size: var(--text-lg);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-tight);
  text-decoration: none;
}

.nav-wordmark span {
  color: var(--color-yellow);
}

/* Mobile-first, no-JS default: menu is a visible stacked list of links */
.nav-menu {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-s);
  padding-block: var(--space-m);
  border-top: 1px solid var(--color-white);
}

/* JS enhancement: collapse the stack behind the hamburger */
.js .nav-menu {
  display: none;
}

.js .nav-menu.is-open {
  display: flex;
}

.nav-menu a {
  text-decoration: none;
  font-weight: var(--weight-semibold);
}

.nav-menu a:hover {
  color: var(--color-yellow);
}

.nav-cta {
  display: inline-block;
  text-align: center;
}

/* Hamburger: hidden without JS (stacked menu already visible), shown when JS is active */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: 0;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-white);
}

.js .nav-toggle {
  display: flex;
}

@media (min-width: 820px) {
  .nav-toggle {
    display: none !important;
  }

  .nav-menu,
  .js .nav-menu {
    display: flex;
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: var(--space-m);
    padding-block: 0;
    border-top: 0;
  }

  .nav-cta {
    margin-inline-start: var(--space-xs);
  }
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  left: var(--space-s);
  top: -100%;
  z-index: 20;
  padding: 0.6em 1em;
  background: var(--color-yellow);
  color: var(--color-ink);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  border: var(--border-bold);
  border-radius: var(--radius);
}

.skip-link:focus {
  top: var(--space-s);
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  background: var(--color-yellow);
  border-bottom: var(--border-bold);
  padding-block: var(--space-2xl) var(--space-3xl);
}

.hero-grid {
  display: grid;
  gap: var(--space-2xl);
  align-items: center;
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  }
}

.hero h1 {
  margin-block-end: var(--space-m);
}

.hero-sub {
  font-size: var(--text-md);
  max-width: 34em;
  margin-block-end: var(--space-l);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s);
  margin-block-end: var(--space-m);
}

.hero-trust {
  font-size: var(--text-sm);
  /* muted gray on the yellow field washes out; trust line reads as ink */
  color: var(--color-ink);
}

/* Full SHA-256 checksum: own line, monospace, never truncated */
.sha256 {
  display: block;
  font-family: ui-monospace, 'Cascadia Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

/* ---- Editions compare table (Light vs Pro) ---- */
.compare-scroll { overflow-x: auto; }

.compare {
  width: 100%;
  border-collapse: collapse;
  border: var(--border-bold);
  background: var(--color-white);
  font-size: var(--text-sm);
  margin-block-start: var(--space-l);
}

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

.compare th,
.compare td {
  border: var(--border);
  padding: var(--space-xs) var(--space-s);
  text-align: left;
  vertical-align: top;
}

/* The two value columns (Light, Pro) are centred — short values read as a
   deliberate column rather than as text that fell to the left edge; the
   capability column stays left-aligned because it reads as a row label. */
.compare thead th:not(:first-child),
.compare tbody td {
  text-align: center;
}

.compare thead th {
  background: var(--color-ink);
  color: var(--color-white);
  font-weight: 800;
}

.compare tbody th {
  font-weight: 600;
  min-width: 14em;
}

/* Pro column: quiet gray tint so the eye lands on it (body cells only —
   the ink header row keeps its own background) */
.compare tbody td:nth-child(3) {
  background: var(--color-gray-bg);
}

.compare td { min-width: 7em; }

.compare .yes::before {
  content: "✓";
  font-weight: 800;
}

.compare .no::before {
  content: "—";
  color: var(--color-ink-soft);
}

/* screen-reader text inside ✓ / — cells (table scope) */
.compare .sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .compare { font-size: var(--text-xs); }
  .compare th, .compare td { padding: var(--space-2xs) var(--space-xs); }
  .compare tbody th { min-width: 0; }
  .compare td { min-width: 0; }
}

/* Screenshot frame: bordered card on the yellow field */
.hero-shot {
  padding: var(--space-s);
  background: var(--color-white);
}

.hero-shot img {
  width: 100%;
  height: auto;
  border: 1px solid var(--color-gray-line);
}

/* Yellow sections need a yellow-adapted focus ring */
.hero :focus-visible,
.pricing :focus-visible {
  outline-color: var(--color-ink);
}

/* ============================================================
   Placeholder sections (replaced as real sections land)
   ============================================================ */
.proof {
  padding-block: var(--space-xl);
}

.proof-line {
  font-size: var(--text-lg);
  line-height: var(--leading-body);
  text-align: center;
}

.proof-line strong {
  color: var(--color-yellow);
  font-weight: var(--weight-black);
}

.pricing {
  background: var(--color-yellow);
  border-block: var(--border-bold);
}

.site-footer {
  padding-block: var(--space-2xl);
  font-size: var(--text-sm);
}

/* ============================================================
   FAQ — native details/summary, zero JS
   ============================================================ */
.container--narrow {
  max-width: 760px;
}

.faq {
  margin-block-start: var(--space-l);
}

.faq details {
  background: var(--color-white);
  border: var(--border);
  border-radius: var(--radius);
}

.faq details + details {
  margin-block-start: var(--space-s);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
  padding: var(--space-m);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  list-style: none;
}

/* Marker column: a plus that rotates into a cross when open */
.faq summary::after {
  content: '+';
  flex: none;
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
  line-height: 1;
  color: var(--color-ink);
  transition: transform var(--transition);
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq details[open] summary {
  border-block-end: var(--border);
}

/* yellow hover strip, Wynter-style */
.faq summary:hover {
  background: var(--color-yellow);
}

.faq details p {
  padding: var(--space-m);
  color: var(--color-ink-soft);
}

/* hover strip must not fight the focus ring */
.faq summary:focus-visible {
  outline-offset: -3px;
}

/* ============================================================
   Footer
   ============================================================ */
.footer-grid {
  display: grid;
  gap: var(--space-xl);
}

@media (min-width: 820px) {
  .footer-grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  }
}

.footer-brand .nav-wordmark {
  display: inline-block;
  margin-block-end: var(--space-s);
}

.footer-note {
  max-width: 34em;
  color: rgb(255 255 255 / 0.72);
}

.footer-nav {
  display: grid;
  gap: var(--space-xs);
  align-content: start;
}

.footer-nav a {
  text-decoration: none;
  color: rgb(255 255 255 / 0.88);
}

.footer-nav a:hover {
  color: var(--color-yellow);
}

.footer-colophon {
  align-self: end;
  color: rgb(255 255 255 / 0.72);
}

/* Focus rings on dark surfaces are already yellow (.on-ink rule in tokens base) */

/* ============================================================
   Editions
   ============================================================ */
.editions-grid {
  display: grid;
  gap: var(--space-l);
  margin-block-start: var(--space-xl);
  align-items: stretch;
}

@media (min-width: 760px) {
  .editions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.edition-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-l);
}

.edition-card--pro {
  background: var(--color-yellow);
}

.edition-chip {
  align-self: flex-start;
  margin-block-end: var(--space-m);
}

.edition-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-s);
  flex-wrap: wrap;
}

.edition-price {
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-tight);
  font-variant-numeric: tabular-nums;
}

.edition-terms {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-ink-soft);
}

.edition-tag {
  margin-block: var(--space-2xs) var(--space-m);
  color: var(--color-ink-soft);
}

.edition-list {
  list-style: none;
  margin: 0 0 var(--space-l);
  padding: 0;
  display: grid;
  gap: var(--space-xs);
  flex-grow: 1;
}

.edition-list li {
  display: flex;
  gap: var(--space-xs);
  align-items: baseline;
}

.edition-list li::before {
  content: '✓';
  flex: none;
  font-weight: var(--weight-black);
}

.edition-cta {
  width: 100%;
}

.editions-note {
  margin-block-start: var(--space-m);
  font-size: var(--text-sm);
}

/* Narrow phones: the price and its qualifier stack as a unit. Left inline, the
   13px span splits mid-phrase ("once ·" / "lifetime license") and the fragment
   rides an inherited 1.6 line box, leaving an empty band under the price. */
@media (max-width: 400px) {
  .edition-price {
    line-height: 1.2;
  }

  .edition-price .edition-terms {
    display: block;
    margin-block-start: var(--space-2xs);
  }
}

/* ============================================================
   Pricing band (yellow)
   ============================================================ */
.pricing-grid {
  display: grid;
  gap: var(--space-2xl);
  align-items: center;
}

@media (min-width: 860px) {
  .pricing-grid {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }
}

.pricing-sub {
  font-size: var(--text-md);
  max-width: 30em;
  margin-block: var(--space-m) var(--space-l);
}

.price-card {
  padding: var(--space-l);
}

.price-big {
  font-size: var(--text-3xl);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-tight);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.price-terms {
  margin-block: var(--space-2xs) var(--space-m);
  font-weight: var(--weight-semibold);
}

/* ---- Intro price (Option A badge, struck anchor) ---- */
.intro-badge {
  display: inline-block;
  padding: 0.25em 0.7em;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: var(--radius-sm);
  background: var(--color-ink);
  color: var(--color-yellow);
}

.price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-s);
}

.price-was {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--color-ink-soft);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  font-variant-numeric: tabular-nums;
}

.price-includes {
  list-style: none;
  margin: 0 0 var(--space-m);
  padding: 0;
  display: grid;
  gap: var(--space-xs);
}

.price-includes li {
  display: flex;
  gap: var(--space-xs);
  align-items: baseline;
}

.price-includes li::before {
  content: '✓';
  flex: none;
  font-weight: var(--weight-black);
}

.price-note {
  font-size: var(--text-sm);
}

/* ============================================================
   Legal / license page
   ============================================================ */
.legal-wrap {
  max-width: 46em;
  margin-inline: auto;
  padding-block: var(--space-2xl) var(--space-4xl);
}

.legal-wrap h2 {
  margin-block: var(--space-xl) var(--space-s);
  scroll-margin-block-start: calc(var(--nav-height) + var(--space-s));
}

.legal-wrap h3 {
  font-size: var(--text-lg);
  margin-block: var(--space-l) var(--space-xs);
}

.legal-meta {
  color: var(--color-ink-soft);
  font-size: var(--text-sm);
}

.legal-toc {
  border: var(--border);
  border-radius: var(--radius);
  padding: var(--space-m);
  margin-block: var(--space-l);
  background: var(--color-gray-bg);
}

.legal-toc ol {
  margin: 0;
  padding-inline-start: 1.4em;
  columns: 2;
  column-gap: var(--space-l);
  font-size: var(--text-sm);
}

.legal-highlight {
  border: var(--border-bold);
  border-radius: var(--radius);
  padding: var(--space-m);
  margin-block: var(--space-m);
  background: var(--color-white);
}

.legal-highlight h3 {
  margin-block-start: 0;
}

.legal ol,
.legal ul {
  padding-inline-start: 1.4em;
}

.legal li + li {
  margin-block-start: var(--space-2xs);
}

/* ============================================================
   Payment result pages (success / failed)
   ============================================================ */
.result-wrap {
  max-width: 40em;
  margin-inline: auto;
  padding-block: var(--space-3xl) var(--space-4xl);
  text-align: center;
}

.result-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-inline: auto;
  margin-block-end: var(--space-m);
  font-size: 2.25rem;
  font-weight: var(--weight-black);
  border: var(--border-bold);
  border-radius: var(--radius);
}

.result-mark--success {
  background: var(--color-yellow);
}

.result-mark--fail {
  background: var(--color-white);
}

.result-wrap h1 {
  margin-block-end: var(--space-s);
}

.result-lead {
  font-size: var(--text-md);
  color: var(--color-ink-soft);
  max-width: 34em;
  margin-inline: auto;
}

.result-card {
  margin-block: var(--space-xl);
  padding: var(--space-l);
  text-align: left;
}

.result-card h2 {
  font-size: var(--text-lg);
  margin-block-end: var(--space-m);
}

.result-steps {
  list-style: none;
  counter-reset: rstep;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-m);
}

.result-steps li {
  display: flex;
  gap: var(--space-s);
  align-items: baseline;
}

.result-steps li::before {
  counter-increment: rstep;
  content: counter(rstep);
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.7em;
  height: 1.7em;
  font-size: var(--text-sm);
  font-weight: var(--weight-black);
  background: var(--color-yellow);
  border: var(--border);
  border-radius: var(--radius-sm);
}

.result-reasons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-s);
  text-align: left;
}

.result-reasons li {
  display: flex;
  gap: var(--space-xs);
  align-items: baseline;
}

.result-reasons li::before {
  content: '–';
  flex: none;
  font-weight: var(--weight-black);
}

.result-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s);
  justify-content: center;
  margin-block: var(--space-l) var(--space-m);
}

.result-fineprint {
  font-size: var(--text-sm);
}

/* ============================================================
   How it works — 3 steps
   ============================================================ */
.steps {
  display: grid;
  gap: var(--space-l);
  margin-block-start: var(--space-xl);
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  border: var(--border);
  border-radius: var(--radius);
  padding: var(--space-m);
  background: var(--color-white);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2em;
  height: 2.2em;
  margin-block-end: var(--space-s);
  font-size: var(--text-lg);
  font-weight: var(--weight-black);
  background: var(--color-yellow);
  border: var(--border-bold);
  border-radius: var(--radius);
}

.step h3 {
  margin-block-end: var(--space-xs);
}

.step p {
  color: var(--color-ink-soft);
}

@media (min-width: 760px) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ============================================================
   Features grid
   ============================================================ */
.section-sub {
  max-width: 46em;
  margin-block-start: var(--space-s);
}

.feature-grid {
  display: grid;
  gap: var(--space-l);
  margin-block-start: var(--space-xl);
}

@media (min-width: 760px) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.feature-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  padding: var(--space-s);
}

/* Zoomable feature screenshots: the anchor keeps the no-JS fallback (opens the
   full PNG in a new tab); JS upgrades it to the lightbox. The border moves from
   the inner <picture> to the anchor — the picture is always nested inside it. */
.feature-zoom {
  display: block;
  border: 1px solid var(--color-gray-line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: zoom-in;
}

/* Lightbox: native <dialog>, Esc closes natively, focus is trapped inside and
   returned on close, backdrop click closes (see js/main.js).
   margin:auto is REQUIRED: the reset (* { margin: 0 }) would override the UA
   stylesheet's dialog centering and pin the dialog top-left. */
.lightbox {
  margin: auto;
  border: var(--border-bold);
  border-radius: var(--radius);
  padding: var(--space-s);
  max-width: min(1400px, 94vw);
  background: var(--color-white);
}

.lightbox::backdrop {
  background: rgb(22 22 22 / 0.86);
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
  margin-block-end: var(--space-s);
}

.lightbox-title {
  font-weight: var(--weight-black);
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-tight);
}

.lightbox img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 78vh;
  height: auto;
  margin-inline: auto;
  border: 1px solid var(--color-gray-line);
}

/* card images still fill the card; height:auto keeps the aspect ratio when
   max-width clamps them (the width/height attributes alone would distort) */
.feature-card img {
  width: 100%;
  height: auto;
}

.feature-card h3 {
  padding-inline: var(--space-xs);
  margin-block-start: var(--space-xs);
}

.feature-card p {
  padding-inline: var(--space-xs);
  padding-block-end: var(--space-xs);
  color: var(--color-ink-soft);
}

/* ============================================================
   Weight explainer
   ============================================================ */
.weight-grid {
  display: grid;
  gap: var(--space-l);
  margin-block-start: var(--space-xl);
  align-items: start;
}

/* grid items may shrink below content size — otherwise the nowrap formula
   widens the column and everything overflows on narrow screens */
.weight-grid > * {
  min-width: 0;
}

@media (min-width: 860px) {
  .weight-grid {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }
}

/* Formula card: monospace, framed like a piece of output */
.formula-card {
  padding: var(--space-m);
}

.formula {
  font-family: ui-monospace, 'Cascadia Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: var(--text-lg);
  line-height: 1.35;
  padding: var(--space-m);
  margin-block-end: var(--space-m);
  background: var(--color-white);
  border: var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  white-space: nowrap;
}

.formula-legend {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: var(--space-m);
  row-gap: var(--space-xs);
  margin: 0;
}

.formula-legend dt {
  font-weight: var(--weight-semibold);
  font-family: ui-monospace, 'Cascadia Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  white-space: nowrap;
}

.formula-legend dd {
  margin: 0;
  color: var(--color-ink-soft);
}

/* Reading guide: the three numbers that calibrate the eye */
.reading-guide {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-s);
}

.reading-guide li {
  display: flex;
  align-items: center;
  gap: var(--space-m);
  padding: var(--space-s) var(--space-m);
  background: var(--color-white);
  border: var(--border);
  border-radius: var(--radius);
}

.read-num {
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-tight);
  font-variant-numeric: tabular-nums;
  min-width: 2.2em;
  text-align: center;
  background: var(--color-yellow);
  border: var(--border);
  border-radius: var(--radius-sm);
  padding: 0.15em 0.2em;
}

.reading-guide li span:last-child {
  color: var(--color-ink-soft);
}

/* Why it matters */
.why {
  margin-block-start: var(--space-2xl);
}

.why h3 {
  font-size: var(--text-xl);
  margin-block-end: var(--space-m);
}

.why-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-s);
}

@media (min-width: 760px) {
  .why-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.why-list li {
  padding: var(--space-m);
  background: var(--color-white);
  border: var(--border);
  border-radius: var(--radius);
}

.why-list strong {
  display: block;
  margin-block-end: var(--space-2xs);
}


