/* The landing page at /{locale}/ (app/landing.py, app/landing_copy.py, static/landing.html).
   The look of letterhead.melasistema.com, the engine's own site: a violet
   accent on cool, slightly violet greys, Fraunces over Inter. Plain CSS with
   nothing to build; the Studio keeps its Tailwind sheet. */

:root {
  --accent: #4a3f8a;
  --accent-soft: #6a5fc0;
  --accent-wash: #efedf8;
  --accent-ink: #fff;
  --accent-deep: #3f3578;
  --teal: #16706a;
  --teal-wash: #e9f3f2;
  --teal-ink: #11564f;
  --paper: #fbfbfd;
  --paper-2: #f4f4f8;
  --band: #f5f5f7;
  --rule: #e6e3ec;
  --ink: #16151c;
  --ink-2: #3b3945;
  --muted: #6f6b7a;
  --card: #fff;
  --night: #15131f;
  --night-2: #1d1a2b;
  --shadow-1: 0 1px 2px rgba(22, 21, 28, .05), 0 4px 14px rgba(22, 21, 28, .05);
  --shadow-2: 0 2px 6px rgba(22, 21, 28, .06), 0 18px 48px rgba(22, 21, 28, .10);
  --shadow-3: 0 30px 90px rgba(28, 24, 60, .22);
  --stage-glow: #fff;
  --dot: #d9d5e2;
  color-scheme: light;

  --wrap: 1180px;
  --radius: 16px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --step--1: clamp(.82rem, .79rem + .14vw, .9rem);
  --step-0: clamp(1rem, .96rem + .2vw, 1.075rem);
  --step-1: clamp(1.15rem, 1.08rem + .35vw, 1.35rem);
  --step-2: clamp(1.45rem, 1.3rem + .7vw, 1.9rem);
  --step-3: clamp(1.85rem, 1.55rem + 1.4vw, 2.85rem);
  --step-4: clamp(2.2rem, 1.6rem + 2.7vw, 4.1rem);
}

/* Dark: chosen (static/theme.js sets <html data-theme="dark">), or asked for
   by the system when light was not chosen. The two blocks hold the same
   values; keep them in step. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #a99ef0; --accent-soft: #c0b8f6; --accent-wash: #2a2640; --accent-ink: #16131f; --accent-deep: #c0b8f6;
    --teal: #63c9bd; --teal-wash: #102624; --teal-ink: #8adacf;
    --paper: #131218; --paper-2: #18171e; --band: #1d1c25; --rule: #2e2c38;
    --ink: #f2f1f6; --ink-2: #cecad8; --muted: #9b97a9; --card: #1d1c25;
    --night: #0b0a10; --night-2: #14121d;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 14px rgba(0, 0, 0, .25);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, .4), 0 18px 48px rgba(0, 0, 0, .5);
    --shadow-3: 0 30px 90px rgba(0, 0, 0, .6);
    --stage-glow: #2a2738; --dot: #3e3b4a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent: #a99ef0; --accent-soft: #c0b8f6; --accent-wash: #2a2640; --accent-ink: #16131f; --accent-deep: #c0b8f6;
  --teal: #63c9bd; --teal-wash: #102624; --teal-ink: #8adacf;
  --paper: #131218; --paper-2: #18171e; --band: #1d1c25; --rule: #2e2c38;
  --ink: #f2f1f6; --ink-2: #cecad8; --muted: #9b97a9; --card: #1d1c25;
  --night: #0b0a10; --night-2: #14121d;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 14px rgba(0, 0, 0, .25);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .4), 0 18px 48px rgba(0, 0, 0, .5);
  --shadow-3: 0 30px 90px rgba(0, 0, 0, .6);
  --stage-glow: #2a2738; --dot: #3e3b4a;
  color-scheme: dark;
}

/* Paper stays paper, and the call to action keeps its violet, in either theme. */
.sheet, .letter {
  --ink: #16151c; --ink-2: #3b3945; --muted: #6f6b7a; --rule: #e6e3ec;
  --accent: #4a3f8a; --accent-wash: #efedf8;
  color-scheme: light;
}
.cta { --accent: #4a3f8a; --accent-ink: #fff; }

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
html:not(.lenis) { scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-stopped { overflow: clip; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: var(--step-4); font-weight: 500; letter-spacing: -.03em; line-height: 1.06; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); letter-spacing: -.01em; }
h1 em, h2 em { font-style: italic; font-weight: 400; color: var(--accent); }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration-color: color-mix(in oklab, var(--accent) 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
code { font-family: var(--mono); font-size: .86em; background: var(--accent-wash); color: var(--accent); border-radius: 6px; padding: .06em .36em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.wrap--narrow { width: min(100% - 2rem, 820px); }
.small { font-size: var(--step--1); color: var(--muted); }
.center { text-align: center; }
.icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 16px; height: 16px; }

.skip { position: absolute; left: -999px; }
.skip:focus { position: fixed; left: .75rem; top: .75rem; z-index: 200; padding: .6rem 1rem; background: var(--accent); color: var(--accent-ink); border-radius: 8px; }

.eyebrow, .kicker {
  font-size: var(--step--1); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 1rem;
}
.eyebrow { display: inline-flex; align-items: center; gap: .55rem; padding: .35rem .8rem; border: 1px solid var(--rule);
  border-radius: 999px; background: color-mix(in oklab, var(--card) 80%, transparent); letter-spacing: .08em; font-size: .74rem; }
.dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px color-mix(in oklab, var(--teal) 18%, transparent); }
.kicker { color: var(--accent); }

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.25rem; border: 1px solid var(--rule); border-radius: 999px;
  background: var(--card); color: var(--ink); font: 600 var(--step--1)/1.2 var(--sans);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-1); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  box-shadow: 0 6px 20px color-mix(in oklab, var(--accent) 28%, transparent); }
.btn--primary:hover { background: var(--accent-deep); box-shadow: 0 10px 30px color-mix(in oklab, var(--accent) 38%, transparent); }
.btn--light { background: #fff; border-color: #fff; color: var(--accent); }
.btn--lg { padding: .95rem 1.6rem; font-size: var(--step-0); }
.btn--sm { padding: .5rem 1rem; }

/* ------------------------------------------------------------------- nav */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--paper) 84%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid color-mix(in oklab, var(--rule) 70%, transparent);
}
.nav__inner { display: flex; align-items: center; gap: 1.5rem; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); text-decoration: none;
  font: 600 1.08rem/1 var(--serif); letter-spacing: -.015em; }
.brand em { font-weight: 500; color: var(--accent); }
.nav__links { display: flex; gap: 1.1rem; margin-left: .5rem; }
.nav__links a { color: var(--ink-2); text-decoration: none; font-size: var(--step--1); font-weight: 500; white-space: nowrap; }
.nav__links a:hover { color: var(--accent); }
.nav__actions { margin-left: auto; display: flex; align-items: center; gap: .8rem; }
.langs { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--rule); border-radius: 999px; background: var(--card); }
.langs a { padding: .22rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 600; text-transform: uppercase;
  color: var(--muted); text-decoration: none; }
.langs a[aria-current] { background: var(--accent-wash); color: var(--accent); }
.theme-switch { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--rule); border-radius: 999px; background: var(--card); }
.theme-switch button { display: grid; place-items: center; width: 28px; height: 24px; padding: 0; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); cursor: pointer; }
.theme-switch button:hover { color: var(--ink); }
.theme-switch [aria-checked="true"] { background: var(--accent-wash); color: var(--accent); }
.theme-switch svg { width: 14px; height: 14px; }
.nav__progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; transform-origin: 0 50%;
  transform: scaleX(var(--progress, 0)); background: linear-gradient(90deg, var(--accent), var(--accent-soft)); }
.nav__mobile { display: none; margin-left: auto; }
.nav__mobile summary { list-style: none; cursor: pointer; display: grid; gap: 4px; padding: 10px; border: 1px solid var(--rule);
  border-radius: 10px; background: var(--card); }
.nav__mobile summary::-webkit-details-marker { display: none; }
.nav__mobile summary span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); }
.nav__sheet { position: absolute; left: 0; right: 0; top: 64px; display: grid; gap: .25rem; padding: 1rem;
  background: var(--paper); border-bottom: 1px solid var(--rule); box-shadow: var(--shadow-2); }
.nav__sheet > a { padding: .65rem .5rem; color: var(--ink); text-decoration: none; font-weight: 500; border-radius: 8px; }
.nav__sheet > a:hover { background: var(--accent-wash); }
.nav__sheet .langs { justify-self: start; margin-top: .5rem; }
.nav__sheet__row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: .5rem; }
.nav__sheet__row .langs { margin-top: 0; }

/* ------------------------------------------------------------------ hero */

.hero { position: relative; padding: clamp(3rem, 7vw, 6rem) 0 clamp(3rem, 6vw, 5rem); overflow: hidden; }
.hero__bg { position: absolute; inset: -20% -10% auto -10%; height: 120%; pointer-events: none;
  background:
    radial-gradient(48rem 28rem at 80% 6%, color-mix(in oklab, var(--accent) 16%, transparent), transparent 62%),
    radial-gradient(38rem 26rem at 6% 40%, color-mix(in oklab, var(--teal) 11%, transparent), transparent 60%); }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .28;
  background-image: linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(70% 60% at 50% 20%, #000, transparent 78%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 20%, #000, transparent 78%); }
/* One column: the words centred above, the Studio wide enough to read below, the proof under it.
   A longer claim in one language only adds a line; nothing beside it has to match its height. */
.hero__inner { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr);
  justify-items: center; gap: clamp(2.25rem, 5vw, 3.5rem); }
.hero__copy { max-width: 62rem; text-align: center; }
.hero h1 { font-size: min(var(--step-4), 3.4rem); text-wrap: balance; }
.hero h1 em { display: block; text-wrap: balance; }
.hero .lede { max-width: 42rem; margin-inline: auto; text-wrap: pretty; }
.lede { font-size: var(--step-1); line-height: 1.55; color: var(--ink-2); }
.lede strong { color: var(--ink); }
.hero__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin: 1.75rem 0 .75rem; }
.hero__note { font-size: var(--step--1); color: var(--muted); }
/* Four equal columns as wide as the picture above: a longer fact in one language wraps inside its own column. */
.hero .facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; max-width: 70rem;
  margin: 0; padding: 0; border: 0; gap: 1.25rem clamp(1.5rem, 3vw, 2.5rem); }
.hero .facts li { text-align: center; align-content: start; }
.hero .facts span { text-wrap: balance; }
.facts { list-style: none; display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; margin: 1.75rem 0 0; padding: 1.25rem 0 0;
  border-top: 1px solid var(--rule); }
.facts li { display: grid; gap: .1rem; }
.facts strong { font: 600 var(--step-1)/1.2 var(--serif); }
.facts span { font-size: var(--step--1); color: var(--muted); }

.shot { margin: 0; width: 100%; max-width: 70rem; border-radius: 14px; overflow: hidden; background: var(--card);
  border: 1px solid var(--rule); box-shadow: var(--shadow-3);
  transform: perspective(2400px) rotateX(4deg); transform-origin: 50% 100%; }
.shot picture { display: block; }
.shot img { display: block; width: 100%; height: auto; }
.shot__bar { display: flex; align-items: center; gap: 6px; padding: .55rem .8rem; background: var(--band); border-bottom: 1px solid var(--rule); }
.shot__bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--dot); }
.shot__bar em { margin-left: .6rem; font: 500 .72rem/1 var(--mono); font-style: normal; color: var(--muted); }
.shot figcaption { padding: .6rem .9rem; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--rule); }

/* --------------------------------------------------------------- marquee */

.marquee { border-block: 1px solid var(--rule); background: var(--band); overflow: hidden; padding: .75rem 0;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee__track { display: flex; gap: 1.4rem; width: max-content; animation: slide 50s linear infinite;
  font-family: var(--serif); color: var(--muted); white-space: nowrap; }
.marquee__track i { color: var(--accent); font-style: normal; }
@keyframes slide { to { transform: translateX(-50%); } }

/* -------------------------------------------------------------- sections */

.section { padding: clamp(4rem, 9vw, 7.5rem) 0; }
.section--alt { background: var(--paper-2); border-block: 1px solid var(--rule); }
.sechead { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.sechead--center { margin-inline: auto; text-align: center; }
.sechead__sub { font-size: var(--step-1); line-height: 1.55; color: var(--muted); }

.pains { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.pain { position: relative; padding: 1.5rem 1.4rem 1.6rem; border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow-1); }
.pain__no { font: 500 .78rem/1 var(--mono); color: var(--accent); display: block; margin-bottom: 1.4rem; }
.pain p, .easy p, .who p, .seal p, .tpl p, .flow p { color: var(--ink-2); font-size: .95rem; margin: 0; }

/* The reversal: the same letter squeezed into a template, then dressed by the letterhead. */
.section--ruled { border-top: 1px solid var(--rule); }
.turn { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.turn__side { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr); gap: .5rem 1.75rem; align-content: start;
  padding: 1.75rem; border-radius: var(--radius); border: 1px solid var(--rule); background: var(--paper-2); }
.turn__side--after { background: var(--card); border-color: color-mix(in oklab, var(--accent) 35%, var(--rule)); box-shadow: var(--shadow-1); }
.turn__sheet { grid-row: 1 / span 3; align-self: start; padding: 12% 12% 0; transform: none; box-shadow: var(--shadow-2); }
.turn__sheet .sheet__band { height: 1.1rem; padding: 0; margin-bottom: 14%; }
.turn__sheet .sheet__band::before { content: ""; width: 24%; height: 70%; border-radius: 2px; background: var(--accent); }
.turn__sheet .sheet__band::after { content: ""; width: 38%; height: 3px; border-radius: 2px; background: var(--dot); }
.turn__sheet .sheet__lines { gap: 5px; }
.turn__sheet .sheet__lines b { height: 6px; margin-bottom: 4px; }
.turn__sheet .sheet__lines i { height: 4px; }
.turn__side--before .turn__sheet { outline: 1px dashed var(--muted); outline-offset: 4px; overflow: visible; }
.turn__side--before .sheet__band { border-bottom-color: var(--muted); }
.turn__side--before .sheet__band::before { background: var(--muted); transform: translate(-35%, -20%) rotate(-6deg); }
.turn__side--before .sheet__lines i:nth-child(2) { width: 118%; background: #e3b4b4; }
.turn__side--before .sheet__lines i:nth-child(4) { width: 112%; transform: rotate(4deg); transform-origin: left; background: #e3b4b4; }
.turn__side--before .sheet__foot { bottom: 12%; transform: rotate(-3deg); }
.turn__side--after .sheet__band { transition: transform .7s cubic-bezier(.2, .7, .2, 1) .2s; }
.js .turn__side--after:not(.is-in) .sheet__band { transform: translateY(-40%); }
.turn__label { margin: 0; font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.turn__side--after .turn__label { color: var(--accent); }
.turn__side h3 { font-size: var(--step-2); margin: 0; }
.turn__side ul { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .55rem; }
.turn__side li { position: relative; padding-left: 1.4rem; color: var(--ink-2); font-size: .95rem; }
.turn__side li::before { content: "–"; position: absolute; left: 0; color: var(--muted); }
.turn__side--after li::before { content: "✓"; color: var(--accent); font-weight: 600; }
.turn__punch { margin: clamp(2rem, 4vw, 3rem) auto 0; max-width: 40rem; text-align: center;
  font: italic 500 var(--step-2)/1.3 var(--serif); color: var(--ink); text-wrap: balance; }

.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.easy { padding: 1.5rem; border-radius: var(--radius); background: var(--paper-2); border: 1px solid var(--rule); }
.easy .icon { width: 30px; height: 30px; color: var(--accent); margin-bottom: 1rem; }
.who { padding: 1.75rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--rule); box-shadow: var(--shadow-1); }
.who h3 { font-size: var(--step-2); }
.who__uses { margin-top: 1rem !important; padding-top: .9rem; border-top: 1px dashed var(--rule); font-size: .9rem !important; }
.who__uses span { color: var(--muted); }

/* ----------------------------------------------------------------- story */

.story__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(2rem, 5vw, 4.5rem); }
.stage { position: sticky; top: 96px; height: min(78vh, 720px); border-radius: 22px; overflow: hidden;
  background: radial-gradient(70% 60% at 50% 40%, var(--stage-glow), var(--band) 75%); border: 1px solid var(--rule); box-shadow: var(--shadow-2); }
.stage__canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .6s ease; }
.has-gl .stage__canvas { opacity: 1; }
.has-gl .stage__paper { opacity: 0; }
.stage__paper { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .6s ease; }
.sheet { width: min(58%, 340px); aspect-ratio: 210 / 297; background: #fff; border-radius: 3px; box-shadow: var(--shadow-3);
  padding: 9% 9% 0; position: relative; transform: rotate(-3deg); }
.sheet__band { display: flex; align-items: center; gap: 6%; padding-bottom: 7%; border-bottom: 2px solid var(--accent); margin-bottom: 9%; }
.sheet__band img { width: 15%; height: auto; }
.sheet__band b { display: grid; font: 600 clamp(.7rem, 1.6vw, .95rem)/1.15 var(--serif); color: var(--ink); }
.sheet__band em { font-style: normal; color: var(--accent); }
.sheet__band small { font: 400 clamp(.42rem, .8vw, .55rem)/1.3 var(--sans); color: var(--muted); }
.sheet__lines { display: grid; gap: 7px; }
.sheet__lines b { height: 9px; width: 55%; border-radius: 4px; background: var(--ink); margin-bottom: 6px; }
.sheet__lines i { height: 5px; border-radius: 3px; background: #d8d4e2; }
.sheet__lines i.short { width: 62%; margin-bottom: 8px; }
.sheet__foot { position: absolute; left: 9%; right: 9%; bottom: 6%; height: 5px; border-top: 1px solid var(--rule); }
.stage__chips { position: absolute; left: 0; right: 0; bottom: 1.25rem; display: grid; place-items: center; pointer-events: none; }
.stage__chip { grid-area: 1 / 1; padding: .45rem .9rem; border-radius: 999px; background: var(--card); border: 1px solid var(--rule);
  box-shadow: var(--shadow-1); font: 600 .78rem/1.2 var(--sans); color: var(--accent); opacity: 0; transform: translateY(8px);
  transition: opacity .4s ease, transform .4s ease; }
.stage__dots { position: absolute; top: 1.1rem; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.stage__dots li { width: 22px; height: 3px; border-radius: 3px; background: var(--rule); transition: background .3s ease; }
.stage[data-step="0"] [data-chip="0"], .stage[data-step="1"] [data-chip="1"], .stage[data-step="2"] [data-chip="2"],
.stage[data-step="3"] [data-chip="3"], .stage[data-step="4"] [data-chip="4"] { opacity: 1; transform: none; }
.stage[data-step="0"] .stage__dots li:nth-child(-n+1), .stage[data-step="1"] .stage__dots li:nth-child(-n+2),
.stage[data-step="2"] .stage__dots li:nth-child(-n+3), .stage[data-step="3"] .stage__dots li:nth-child(-n+4),
.stage[data-step="4"] .stage__dots li { background: var(--accent); }

.chapters { list-style: none; margin: 0; padding: 0; }
/* Room after the last chapter, so the stage stays pinned while the sheet dissolves. */
.chapters::after { content: ""; display: block; height: 40vh; }
.no-story .chapters::after { display: none; }
.chapter { min-height: 72vh; display: flex; flex-direction: column; justify-content: center; padding: 2rem 0; opacity: .75;
  transition: opacity .45s ease; }
.chapter:first-child { min-height: 60vh; justify-content: flex-start; padding-top: 12vh; }
.chapter.is-active, .no-story .chapter { opacity: 1; }
.chapter__n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent);
  color: var(--accent-ink); font: 500 .85rem/1 var(--mono); margin-bottom: 1.1rem; }
.chapter h3 { font-size: var(--step-2); }
.chapter p { color: var(--ink-2); font-size: var(--step-1); line-height: 1.55; max-width: 30rem; }

/* ------------------------------------------------------------------ bulk */

.bulk { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.bulk .facts { border-top: 0; padding-top: 0; margin: 1.5rem 0 1rem; }
.bulk .facts strong { font-size: var(--step-2); color: var(--accent); }
.merge { display: grid; grid-template-columns: minmax(0, 1.25fr) auto minmax(0, 1fr); align-items: center; gap: 1rem; }
.merge__csv, .merge__zip { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--shadow-2); overflow: hidden; }
.merge table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.merge th { text-align: left; font: 600 .72rem/1 var(--mono); color: var(--accent); background: var(--accent-wash); padding: .7rem .7rem; }
.merge td { padding: .6rem .7rem; border-top: 1px solid var(--rule); color: var(--ink-2); white-space: nowrap; }
.merge tr.more td { color: var(--muted); font-style: italic; }
.merge__arrow { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 8px 24px color-mix(in oklab, var(--accent) 35%, transparent); }
.merge__zip { padding: 1rem; }
/* Written with AI: the Markdown as the chat gives it, and the page it becomes. */
.mdsrc { padding: 1rem; }
.mdsrc pre { margin: 0; font: .74rem/1.65 var(--mono); color: var(--ink-2); white-space: pre-wrap; }
.mdsrc .mk { color: var(--accent-soft); font-weight: 600; }
/* A printed page: white, with dark ink, in the dark theme too. */
.mdpage { --page-ink: #16151c; --page-rule: #e6e3ec; --page-band: #f5f5f7;
  background: #fff; border-color: var(--page-rule); font: .8rem/1.5 var(--serif); color: var(--page-ink); }
.mdpage__band { display: flex; align-items: center; gap: .45rem; margin: -1rem -1rem .9rem; padding: .7rem 1rem;
  background: var(--page-band); border-bottom: 2px solid var(--page-rule); font: 600 .78rem/1 var(--serif); }
.mdpage__band em { color: #4a3f8a; }
.mdpage__h { font: 650 .92rem/1.3 var(--sans); margin: 0 0 .5rem; padding-bottom: .45rem; border-bottom: 1px solid #6a5fc0; }
.mdpage p { margin: 0 0 .55rem; }
.mdpage table { width: 100%; border-collapse: collapse; margin: 0 0 .55rem; font-size: .76rem; }
.mdpage th { text-align: left; font: 700 .76rem/1.3 var(--serif); color: var(--page-ink); background: none; border-bottom: 1px solid var(--page-ink); padding: .25rem .3rem; }
.mdpage td { padding: .25rem .3rem; border-top: 0; border-bottom: 1px solid var(--page-rule); color: var(--page-ink); }
.mdpage :is(th, td):last-child { text-align: right; }
.mdpage ul li { font: .78rem/1.4 var(--serif); color: var(--page-ink); gap: .4rem; }
.mdpage ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.zip__name { font: 600 .8rem/1 var(--mono); margin: 0 0 .75rem; padding-bottom: .7rem; border-bottom: 1px solid var(--rule); }
.merge__zip ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; font: .76rem/1.2 var(--mono); color: var(--ink-2); }
.merge__zip li { display: flex; align-items: center; gap: .45rem; }
.merge__zip li .icon { color: var(--accent); }
.merge__zip li.more { color: var(--muted); padding-left: 1.5rem; }

/* ------------------------------------------------------------------ sign */

.flow { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; counter-reset: flow; }
.flow li { position: relative; padding: 1.5rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--rule); box-shadow: var(--shadow-1); }
.flow li:not(:last-child)::after { content: ""; position: absolute; right: -.85rem; top: 50%; width: .7rem; height: 2px; background: var(--accent); }
.flow__n { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--accent);
  color: var(--accent); font: 600 .8rem/1 var(--mono); margin-bottom: 1rem; }
.callout { display: flex; gap: .75rem; align-items: flex-start; max-width: 46rem; padding: 1rem 1.25rem; border-radius: 12px;
  background: var(--teal-wash); color: var(--teal-ink); border: 1px solid color-mix(in oklab, var(--teal) 25%, transparent); font-size: .95rem; }

/* ---------------------------------------------------------------- safety */

.section--ink { background: var(--night); color: #f2f1f7;
  background-image: radial-gradient(60rem 30rem at 85% 0%, rgba(106, 95, 192, .28), transparent 60%),
                    radial-gradient(40rem 26rem at 0% 100%, rgba(22, 112, 106, .22), transparent 60%); }
.section--ink h2, .section--ink h3 { color: #fff; }
.section--ink h2 em { color: #b6abff; }
.section--ink .kicker { color: #b6abff; }
.section--ink .sechead__sub { color: #b9b5c9; }
.seals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.seal { padding: 1.5rem; border-radius: var(--radius); background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .1); }
.seal p { color: #c9c5d8; }
.seal h3 { font-size: 1.12rem; }
.seal__icon { width: 44px; height: 44px; padding: 10px; border-radius: 12px; background: rgba(182, 171, 255, .14); color: #cfc7ff; margin-bottom: 1rem; }
.seals__links { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 2rem; }
.seals__links a { color: #cfc7ff; font-weight: 600; }

/* --------------------------------------------------------------- pricing */

.prices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; align-items: stretch; margin-bottom: 1.5rem; }
.price { position: relative; display: flex; flex-direction: column; padding: 1.75rem 1.5rem; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--rule); box-shadow: var(--shadow-1); }
.price--licence { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-2); }
.price--soon { background: var(--paper-2); border-style: dashed; box-shadow: none; }
.price--soon h3, .price--soon .price__amount { color: var(--muted); }
.price__interest { margin: .75rem 0 0; font-size: .88rem; color: var(--ink-2); }
.btn--off { opacity: .5; cursor: not-allowed; pointer-events: none; }
.price__amount { font: 500 var(--step-3)/1 var(--serif); letter-spacing: -.02em; margin: .25rem 0 .5rem; }
.price__meta { font-size: .88rem; color: var(--muted); }
.price ul { list-style: none; margin: .5rem 0 1.5rem; padding: 0; display: grid; gap: .55rem; font-size: .9rem; color: var(--ink-2); }
.price li { display: flex; gap: .5rem; align-items: flex-start; }
.price li .icon { color: var(--teal); margin-top: .2rem; }
.price .btn { margin-top: auto; }
.callout--center { display: block; margin: 0 auto 1.25rem; text-align: center; }
.prices--two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 52rem; margin-inline: auto; }
.flow--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ------------------------------------------------------------- templates */

.tpls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.tpl { display: flex; flex-direction: column; gap: .4rem; padding: 1.5rem; border-radius: var(--radius); background: var(--card);
  border: 1px solid var(--rule); color: var(--ink); text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.tpl:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: color-mix(in oklab, var(--accent) 35%, var(--rule)); }
.tpl > .icon { color: var(--accent); margin-bottom: .5rem; }
.tpl h3 { font-size: 1.1rem; margin: 0; }
.tpl p { flex: 1; }
.tpl__go { display: inline-flex; align-items: center; gap: .35rem; margin-top: .75rem; font-size: .88rem; font-weight: 600; color: var(--accent); }

/* ------------------------------------------------------------------- faq */

.faq { display: grid; gap: .75rem; }
.qa { border: 1px solid var(--rule); border-radius: 14px; background: var(--card); }
.qa summary { cursor: pointer; list-style: none; padding: 1.1rem 3rem 1.1rem 1.25rem; position: relative; font-weight: 600; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; position: absolute; right: 1.25rem; top: 50%; transform: translateY(-50%); font: 400 1.4rem/1 var(--sans);
  color: var(--accent); transition: transform .25s ease; }
.qa[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.qa p { padding: 0 1.25rem 1.2rem; margin: 0; color: var(--ink-2); }

/* ------------------------------------------------------------- cta, foot */

.cta { padding: clamp(4rem, 9vw, 7rem) 0; background: var(--accent); color: #fff; text-align: center;
  background-image: radial-gradient(50rem 24rem at 50% -10%, rgba(255, 255, 255, .18), transparent 60%); }
.cta h2 { color: #fff; font-size: var(--step-4); font-weight: 500; }
.cta h2 em { color: #d9d3ff; }
.cta p { color: #e4e0f8; font-size: var(--step-1); max-width: 36rem; margin: 0 auto 2rem; }
.foot { padding: 3.5rem 0 3rem; background: var(--paper-2); border-top: 1px solid var(--rule); font-size: .9rem; }
/* The last column is the widest: the contact email fits on one line. */
.foot__inner { display: grid; grid-template-columns: 1.25fr repeat(3, minmax(0, 1fr)) minmax(0, 1.3fr); gap: 2rem; }
.foot h3 { font: 600 .75rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.foot ul { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .5rem; }
.foot a { color: var(--ink-2); text-decoration: none; overflow-wrap: anywhere; hyphens: auto; }
.foot a[href^="mailto:"] { hyphens: manual; } /* a hyphen would change the address */
.foot a:hover { color: var(--accent); }
.foot__brand p { color: var(--muted); max-width: 22rem; margin-top: 1rem; }
.foot__seller { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: .8rem; }

/* -------------------------------------------- template pages and index */
/* app/template_pages.py, static/template.html: the same chrome, no script. */

.tpls__all { margin: 2rem 0 0; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; margin: 0 0 1.5rem; padding: 0; font-size: var(--step--1); color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: .35rem; color: var(--rule); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.tplhero { padding: clamp(2rem, 5vw, 4rem) 0 clamp(3rem, 6vw, 5rem); }
.tplhero--index { padding-bottom: 1rem; }
.tplhero--index .lede { max-width: 42rem; }
.tplhero__inner { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.tplhero h1 { font-size: var(--step-3); }
.tplhero__shot { margin: 0; display: grid; place-items: center; padding: clamp(1rem, 3vw, 2rem); border-radius: 22px;
  background: linear-gradient(160deg, var(--accent-wash), var(--paper-2)); border: 1px solid var(--rule); }
.tplhero__shot img { width: 100%; max-width: 420px; border-radius: 3px; box-shadow: var(--shadow-3); }
.sheet--static { position: relative; width: min(100%, 340px); }
.section--tight { padding-top: 1rem; }

.letter { position: relative; max-width: 700px; margin: 0 auto; padding: clamp(1.5rem, 6vw, 3.5rem) clamp(1.25rem, 6vw, 3.75rem) clamp(1.25rem, 4vw, 2rem);
  background: #fff; border-radius: 4px; box-shadow: var(--shadow-2); font-size: .95rem; line-height: 1.6; color: var(--ink); }
.letter__head { display: grid; gap: .35rem; padding-bottom: 1rem; border-bottom: 2px solid var(--accent); margin-bottom: 1.5rem; }
.letter__head img { width: min(240px, 70%); height: auto; }
.letter__head span { font-size: .78rem; color: var(--muted); }
.letter__meta { text-align: right; font-size: .82rem; color: var(--muted); }
.letter__body h3, .letter__body h4 { font: 600 1.05rem/1.3 var(--serif); margin: 1.5rem 0 .6rem; letter-spacing: 0; }
.letter__body h3 { font-size: 1.25rem; text-align: center; }
.letter__body ul { padding-left: 1.25rem; }
.letter__body table { width: 100%; border-collapse: collapse; margin: 0 0 1em; font-size: .9rem; }
.letter__body th, .letter__body td { padding: .45rem .5rem; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.letter__body th { font-weight: 600; border-bottom-color: var(--ink); }
.letter__foot { margin-top: 2rem; padding-top: .75rem; border-top: 1px solid var(--rule); font-size: .7rem; color: var(--muted); text-align: center; }
.letter mark { background: color-mix(in oklab, var(--accent-wash) 70%, #fff3b0); color: inherit; border-radius: 3px; padding: 0 .15em;
  box-shadow: inset 0 -2px 0 color-mix(in oklab, var(--accent) 45%, transparent); cursor: help; }
.letter .fill { border-left: 3px solid color-mix(in oklab, var(--accent) 45%, transparent); background: color-mix(in oklab, var(--accent-wash) 60%, #fff);
  padding: .1rem .75rem; margin: 0 0 1em; border-radius: 0 6px 6px 0; }
.letter .fill ul { margin: .5rem 0; }
.blank { display: inline-block; width: 12em; max-width: 60%; border-bottom: 1.5px dotted var(--muted); vertical-align: baseline; height: 1em; }
.tpltext__cta { text-align: center; margin: 2.5rem 0 0; }

.tplinfo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2.5rem, 5vw, 4rem) clamp(2rem, 5vw, 5rem); }
.tplinfo h2 { font-size: var(--step-2); }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.ticks li { position: relative; padding-left: 1.6rem; color: var(--ink-2); }
.ticks li::before { content: ""; position: absolute; left: 0; top: .55em; width: .6rem; height: .6rem; border-radius: 50%;
  background: var(--accent-wash); box-shadow: inset 0 0 0 2px var(--accent); }
.needs { display: grid; gap: 0; margin: 1rem 0 0; }
.needs > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: .25rem 1rem; padding: .6rem 0; border-bottom: 1px solid var(--rule); }
.needs dt { font-weight: 600; font-size: .92rem; }
.needs dd { margin: 0; display: grid; gap: .2rem; justify-items: start; font-size: .9rem; color: var(--ink-2); min-width: 0; }
.needs dd span { overflow-wrap: anywhere; }
.needs code { font-size: .74rem; }
.disclaimer { margin: 2rem 0 0; padding: 1rem 1.25rem; border-radius: 12px; border: 1px solid var(--rule); background: var(--card);
  font-size: var(--step--1); color: var(--muted); }

.tplgroup + .tplgroup { margin-top: clamp(2.5rem, 5vw, 4rem); }
.tplgroup h2 { font-size: var(--step-2); }
.tplcountry + .tplcountry { margin-top: clamp(3.5rem, 7vw, 5.5rem); padding-top: clamp(2.5rem, 5vw, 4rem); border-top: 1px solid var(--rule); }
.tplcountry .tplgroup h3 { font-size: var(--step-1); }
.tpl--thumb { padding: 0 0 1.5rem; overflow: hidden; }
.tpl--thumb > :not(.tpl__img) { margin-inline: 1.5rem; }
.tpl__img { display: grid; place-items: center; height: 220px; overflow: hidden; margin-bottom: .75rem;
  background: linear-gradient(160deg, var(--accent-wash), var(--paper-2)); border-bottom: 1px solid var(--rule); }
.tpl__img img { width: 62%; margin-top: 2rem; align-self: start; border-radius: 2px; box-shadow: var(--shadow-2); transition: transform .3s ease; }
.tpl__img .sheet { width: 62%; margin-top: 2rem; align-self: start; }
.tpl--thumb:hover .tpl__img img { transform: translateY(-4px); }
.tpl__cat { font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
/* The country whose law a template cites (template_pages.law_badge). */
.law { align-self: flex-start; display: inline-block; padding: .15rem .6rem; border-radius: 999px; background: var(--accent-wash);
  border: 1px solid color-mix(in oklab, var(--accent) 30%, var(--rule)); color: var(--accent); font-size: .72rem; font-weight: 600; white-space: nowrap; }
.tplhero__law { margin: -.25rem 0 1rem; font-size: var(--step--1); color: var(--muted); }
.tplhero__law .law { margin-right: .35rem; }
.tplhero__law a { margin-left: .35rem; color: var(--accent); font-weight: 600; }

/* ---------------------------------------------------------------- motion */

.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .marquee__track { animation: none; }
  .btn, .tpl, .tpl__img img { transition: none; }
  .js .turn__side--after:not(.is-in) .sheet__band { transform: none; }
}

/* ------------------------------------------------------------ responsive */

/* The bar's links fit beside the actions from 1100px, in every language. Below that the menu
   button takes their place; its sheet repeats the languages and theme only where the bar hides them. */
@media (max-width: 1100px) {
  .nav__links { display: none; }
  .nav__mobile { display: block; margin-left: 0; }
}
/* Five footer columns need 1180px: below that the brand takes a row of its own. */
@media (max-width: 1180px) {
  .foot__inner { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.3fr); }
  .foot__brand { grid-column: 1 / -1; }
}
@media (min-width: 641px) {
  .nav__sheet__row { display: none; }
}
@media (max-width: 1080px) {
  .pains, .grid4, .seals, .prices, .flow--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow--four li:nth-child(2)::after { display: none; }
  .tpls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .bulk, .tplhero__inner, .tplinfo, .turn { grid-template-columns: minmax(0, 1fr); }
  .tplhero__shot img { max-width: 320px; }
  .shot { transform: none; }
  .hero .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story__grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .stage { top: 72px; height: 42vh; z-index: 2; border-radius: 18px; }
  /* Each chapter's words wait just under the pinned stage until the next one pushes them on. */
  .chapter, .chapter:first-child { display: block; min-height: 70vh; padding: 1.25rem 0 0; }
  .chapter__body { position: sticky; top: calc(72px + 42vh + 1.25rem); }
  .chapter p { font-size: var(--step-0); }
  .foot__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot__brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .nav__actions .langs, .nav__actions .theme-switch { display: none; }
  .nav__actions { margin-left: auto; }
  .pains, .grid4, .grid2, .seals, .prices, .tpls, .flow, .flow--four { grid-template-columns: minmax(0, 1fr); }
  .flow li:not(:last-child)::after { display: none; }
  .merge { grid-template-columns: minmax(0, 1fr); }
  .merge__arrow { justify-self: center; transform: rotate(90deg); }
  .hero__cta .btn, .tpltext__cta .btn { flex: 1 1 100%; white-space: normal; text-align: center; }
  .needs > div { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: 1.95rem; }
  .turn__side { grid-template-columns: minmax(0, 5.5rem) minmax(0, 1fr); gap: .4rem 1.1rem; padding: 1.25rem; }
  .turn__sheet { grid-row: 1 / span 2; }
  .turn__side ul { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .foot__inner > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .nav__actions .btn { display: none; }
}

/* The savings calculator (guides.py, calculator.js) ----------------------------------- */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.grid3 .easy h3 { font-size: var(--step-1); }
.grid3 .easy p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.calc { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: clamp(1.5rem, 3vw, 2.25rem); align-items: start; }
.calc__card, .calc__results { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: clamp(1.35rem, 3vw, 2rem); box-shadow: var(--shadow-1); }
.calc__results { border-top: 4px solid var(--teal); box-shadow: var(--shadow-2); position: sticky; top: 90px; display: grid; gap: .9rem; }
.calc__label { font-size: var(--step--1); font-weight: 600; color: var(--muted); margin: 0 0 .65rem; }
.calc__chips { display: flex; flex-wrap: wrap; gap: .55rem; margin-bottom: 1.75rem; }
.calc__chip, .calc__pill { font: 500 .88rem/1.25 var(--sans); color: var(--ink-2); background: var(--paper-2);
  border: 1px solid var(--rule); cursor: pointer; transition: border-color .15s, background .15s; }
.calc__chip { padding: .55rem .95rem; border-radius: 999px; min-height: 44px; }
.calc__pills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; margin-bottom: .75rem; }
.calc__pill { text-align: left; border-radius: 10px; padding: .55rem .7rem; }
.calc__chip:hover, .calc__pill:hover { border-color: var(--accent); }
.calc__chip[aria-pressed="true"], .calc__pill[aria-pressed="true"] { background: var(--accent-wash); border-color: var(--accent); color: var(--accent-deep); }
.calc__chip[aria-pressed="true"] { font-weight: 600; }
.calc__pill-title { display: block; font-weight: 600; }
.calc__pill-sub { display: block; font: 500 .75rem/1.3 var(--mono); color: var(--muted); margin-top: .15rem; }
.calc__pill[aria-pressed="true"] .calc__pill-sub { color: var(--accent-deep); }
.calc__field { margin-bottom: 1.6rem; }
.calc__field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .55rem; }
.calc__field-label { font-weight: 600; color: var(--ink); }
.calc__field-val { font: 600 1rem/1.3 var(--mono); color: var(--accent-deep); background: var(--accent-wash);
  padding: .18rem .6rem; border-radius: 8px; white-space: nowrap; }
.calc__field-hint { font-size: .85rem; color: var(--muted); margin: .35rem 0 0; }
.calc input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 28px; cursor: pointer; }
.calc__toggle { display: flex; align-items: flex-start; gap: .75rem; padding-top: 1rem; border-top: 1px solid var(--rule); cursor: pointer; color: var(--ink-2); font-size: .95rem; }
.calc__toggle input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.calc__toggle small { display: block; font-size: .85rem; color: var(--muted); }
.calc__kicker { margin: 0; font: 600 .8rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--teal); }
.calc__big { margin: 0; font: 700 clamp(2.2rem, 4vw, 3.1rem)/1.05 var(--serif); letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.calc__sub { margin: 0 0 .4rem; color: var(--muted); }
.calc__sub strong { color: var(--ink); }
.calc__metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.calc__metric { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 12px; padding: .95rem 1rem; display: grid; gap: .2rem; }
.calc__metric strong { font: 700 1.3rem/1.2 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.calc__metric span { font-size: .85rem; color: var(--muted); }
.calc__compare { border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.calc__row { margin: 0; padding: .85rem 1rem; display: flex; justify-content: space-between; align-items: center; gap: .75rem;
  font-size: .9rem; background: var(--paper-2); color: var(--muted); }
.calc__row + .calc__row { border-top: 1px solid var(--rule); }
.calc__row b { font: 600 .8rem/1.2 var(--mono); padding: .2rem .55rem; border-radius: 6px; white-space: nowrap;
  color: var(--ink-2); background: color-mix(in srgb, var(--muted) 15%, transparent); }
.calc__row--after { background: var(--teal-wash); color: var(--teal-ink); font-weight: 600; }
.calc__row--after b { background: color-mix(in srgb, var(--teal) 18%, transparent); }
.calc__results .btn { justify-content: center; }
.calc__note, .calc__contact { margin: 0; font-size: .85rem; color: var(--muted); text-align: center; }
.section--slim { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.calcband { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; flex-wrap: wrap; }
.calcband .sechead { margin-bottom: 0; }
@media (max-width: 940px) {
  .calc { grid-template-columns: minmax(0, 1fr); }
  .calc__results { position: static; }
  .grid3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .calc__pills, .calc__metrics { grid-template-columns: minmax(0, 1fr); }
  .calc__row { flex-direction: column; align-items: flex-start; gap: .4rem; }
}
