/* CiggyStats — a scroll-told report.
   One fixed backdrop crossfades from slide to slide, so the colour of the page
   changes with the chapter: dusk, night blue, violet, money green, wine red,
   dawn gold, storm. Slides sit on top of it and are transparent. */
:root {
  --cream: #F4F4F2;
  --cream-dim: rgba(244, 244, 242, 0.66);
  --cream-faint: rgba(244, 244, 242, 0.15);
  --ink: #0B0B10;
  --bg: #08080A;
  --accent: #FF4B2B;
  --cig-paper: #F2F1EC;
  --filter: #C98A4B;
  --filter-deep: #8B5A21;

  --font-display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: 0.9rem;
  --step-0: 1.0625rem;
  --step-1: clamp(1.15rem, 1rem + 0.7vw, 1.45rem);
  --step-2: clamp(2rem, 1.3rem + 2.6vw, 3.4rem);
  --step-3: clamp(2.7rem, 1.4rem + 5vw, 5.4rem);
  --step-4: clamp(4.2rem, 1.5rem + 11vw, 11rem);
  --space: clamp(1rem, 0.6rem + 1.4vw, 1.75rem);
  --wrap: 1120px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-snap-type: y mandatory; }
body {
  margin: 0; background: #08080A; color: var(--cream);
  font: 400 var(--step-0)/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
.skip-link { position: absolute; left: -999px; top: 0.5rem; background: var(--cream); color: var(--ink); padding: 0.5rem 1rem; z-index: 40; }
.skip-link:focus { left: 0.5rem; }

/* Slides */
/* The backdrop everything sits on. JS hands it the colour of the slide in view. */
.stage {
  position: fixed; inset: 0; z-index: -2; background: var(--stage, #08080A);
  transition: background-color 900ms cubic-bezier(0.4, 0, 0.2, 1);
}
.stage::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(75% 65% at 72% 8%, var(--stage-glow, rgba(255, 75, 43, 0.16)), transparent 74%);
  transition: background 900ms cubic-bezier(0.4, 0, 0.2, 1);
}
.progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 35; background: var(--accent, #FF4B2B); transition: width 120ms linear, background-color 600ms; }

.slide {
  --bg: #08080A; --accent: #FF4B2B;
  position: relative; background: transparent; color: var(--cream);
  min-height: 100svh; display: grid; align-items: center;
  scroll-snap-align: start; scroll-snap-stop: always;
  padding: clamp(5rem, 11vh, 8rem) var(--space) clamp(3rem, 8vh, 5rem);
  overflow: hidden;
}

.slide__inner { position: relative; width: min(var(--wrap), 100%); margin-inline: auto; }
.slide[data-tone="calc"] { --bg: #0F1014; --accent: #FF6A3D; }
.slide[data-tone="distance"] { --bg: #07222E; --accent: #2DD4E4; }
.slide[data-tone="height"] { --bg: #150F2E; --accent: #A78BFA; }
.slide[data-tone="money"] { --bg: #052018; --accent: #34D399; }
.slide[data-tone="co2"] { --bg: #17120B; --accent: #E0A23C; }
.slide[data-tone="time"] { --bg: #1A0508; --accent: #FF3B47; }
.slide[data-tone="ahead"] { --bg: #071A2B; --accent: #FBBF24; }
.slide[data-tone="forecast"] { --bg: #16161B; --accent: #FB923C; }
.slide--light { --bg: #F3F2EE; --accent: #D93A1E; color: var(--ink); background: var(--bg); }
.slide--light .slide__lede { color: rgba(11, 11, 16, 0.66); }
.slide--hero { align-items: center; }

.slide__title { font-size: var(--step-2); font-stretch: 84%; line-height: 1.02; max-width: 18ch; text-wrap: balance; }
.slide__lede { margin-top: 1.1rem; font-size: var(--step-1); line-height: 1.5; color: var(--cream-dim); max-width: 52ch; }
.note { margin-top: 1.5rem; font-size: var(--step--1); color: var(--cream-dim); max-width: 68ch; }

/* Header, dots */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem var(--space); mix-blend-mode: difference;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font: 700 1.2rem/1 var(--font-display); text-decoration: none; color: #fff; }
.brand__mark { width: 32px; height: 8px; }
.mark-filter { fill: var(--filter); } .mark-paper { fill: #fff; } .mark-ember { fill: #FF4B2B; }
.site-nav { display: flex; gap: 1.25rem; font-size: var(--step--1); }
.site-nav a { color: #fff; text-decoration: none; opacity: 0.75; }
.site-nav a:hover { opacity: 1; text-decoration: underline; }

.dots { position: fixed; right: clamp(0.5rem, 1.6vw, 1.4rem); top: 50%; transform: translateY(-50%); z-index: 30; display: grid; gap: 0.7rem; }
.dots button {
  width: 11px; height: 11px; padding: 0; border-radius: 50%; cursor: pointer;
  background: transparent; border: 1.5px solid currentColor; color: rgba(255, 243, 228, 0.55);
  transition: background-color 0.2s, transform 0.2s, color 0.2s;
}
.dots button:hover { transform: scale(1.25); color: var(--cream); }
.dots button[aria-current="true"] { background: currentColor; color: var(--cream); }
@media (max-width: 700px) { .dots { display: none; } }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero__title { font-size: var(--step-3); font-stretch: 76%; font-weight: 750; line-height: 0.94; letter-spacing: -0.035em; max-width: 12ch; text-wrap: balance; }
.hero__lede { margin-top: 1.4rem; font-size: var(--step-1); color: var(--cream-dim); max-width: 40ch; }
.hero .cig { margin-top: clamp(2rem, 5vw, 3.5rem); }
.hero__scale { display: flex; justify-content: space-between; margin-top: 0.6rem; font-size: var(--step--1); color: var(--cream-dim); font-variant-numeric: tabular-nums; }

/* Opening: black, one line of explanation, and the cigarette burning to the stone */
.opening { display: grid; justify-items: center; text-align: center; gap: 0; }
.opening__title {
  font-size: clamp(3.4rem, 1rem + 11vw, 9.5rem); font-stretch: 78%; font-weight: 700;
  line-height: 0.9; letter-spacing: -0.04em;
}
.opening__tag {
  margin-top: 1.7rem; font-size: var(--step-1); line-height: 1.45; color: var(--cream-dim);
  max-width: 34ch; text-wrap: balance;
}
.opening__cta { margin-top: 1.8rem; }
.scene { margin: clamp(0.5rem, 2vw, 1.5rem) 0 0; width: min(960px, 100%); }
.scene svg { width: 100%; height: auto; overflow: visible; }
.scene__stone path:first-child, .scene__stone rect { fill: color-mix(in oklab, var(--cream) 22%, transparent); }
.scene__engrave { stroke: color-mix(in oklab, var(--cream) 34%, transparent); stroke-width: 3; fill: none; stroke-linecap: round; }
.scene__ground { stroke: var(--cream-faint); stroke-width: 2; }
.scene__ash { fill: #5B5B5E; }
.scene__paper { fill: var(--cig-paper); transform-box: fill-box; transform-origin: right center; animation: scene-burn 13s cubic-bezier(0.55, 0, 0.7, 1) infinite; }
.scene__filter { fill: var(--filter); }
.scene__ember { fill: #FF4B2B; filter: drop-shadow(0 0 14px rgba(255, 75, 43, 0.95)); }
.scene__flame { animation: scene-travel 13s cubic-bezier(0.55, 0, 0.7, 1) infinite; }
.scene__smoke path { fill: none; stroke: rgba(244, 244, 242, 0.42); stroke-width: 2.5; stroke-linecap: round;
  stroke-dasharray: 90; animation: scene-smoke 3.6s ease-in-out infinite; }
.scene__smoke path:last-child { animation-delay: 1.3s; opacity: 0.6; }
@keyframes scene-burn { 0% { transform: scaleX(1); } 88%, 100% { transform: scaleX(0.02); } }
@keyframes scene-travel { 0% { transform: translateX(0); } 88%, 100% { transform: translateX(672px); } }
@keyframes scene-smoke { 0% { stroke-dashoffset: 90; opacity: 0; } 30% { opacity: 0.75; } 100% { stroke-dashoffset: -60; opacity: 0; } }

/* The cigarette */
.cig { --h: clamp(22px, 3.2vw, 38px); display: flex; height: var(--h); width: 100%; }
.cig__filter {
  flex: 0 0 26%; border-radius: 3px 0 0 3px; background-color: var(--filter);
  background-image: radial-gradient(circle at 30% 35%, var(--filter-deep) 0.9px, transparent 1.5px),
                    radial-gradient(circle at 70% 70%, var(--filter-deep) 0.7px, transparent 1.3px);
  background-size: 7px 6px, 9px 8px;
  box-shadow: inset -3px 0 0 rgba(255, 255, 255, 0.3), inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}
.cig__body { flex: 1; display: flex; min-width: 0; }
.cig__paper { width: 100%; background: var(--cig-paper); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.09); }
.cig__ember { flex: 0 0 calc(var(--h) * 0.4); background: linear-gradient(90deg, #5B1B06, #FF4B2B 35%, #FFB066 62%, #6E6E71 100%); border-radius: 0 2px 2px 0; }
.cig__ash { flex: 1; min-width: 0; background: repeating-linear-gradient(90deg, #5E5E62 0 3px, #86868B 3px 6px, #4F4F53 6px 9px);
  -webkit-mask-image: linear-gradient(90deg, #000 30%, transparent 100%); mask-image: linear-gradient(90deg, #000 30%, transparent 100%); }
.cig--unlit .cig__ember { background: var(--cig-paper); flex-basis: 0; }
.cig--unlit .cig__paper { border-radius: 0 3px 3px 0; }
.burn { margin-top: 2rem; }
.burn .cig__paper { transition: width 2.4s cubic-bezier(0.35, 0.05, 0.25, 1); }
.burn.is-burning .cig__paper { width: 10%; }
.burn.is-burning .cig__ember { animation: glow 0.9s ease-in-out infinite alternate; }
@keyframes glow { to { filter: brightness(1.3) saturate(1.2); } }
.ruler { height: 10px; margin-top: 0.7rem; background: repeating-linear-gradient(90deg, var(--cream-faint) 0 1px, transparent 1px 10%); border-top: 1px solid var(--cream-faint); }

/* Big numbers */
.figure { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 0.9rem; margin-top: 1rem; }
.figure__value { font: 800 var(--step-4)/0.86 var(--font-display); font-stretch: 74%; letter-spacing: -0.045em; font-variant-numeric: tabular-nums lining-nums; color: var(--accent); }
.figure__unit { font: 600 var(--step-1)/1.2 var(--font-display); color: var(--cream-dim); }
.headline-stat { margin-top: 1.2rem; font: 750 var(--step-3)/0.98 var(--font-display); font-stretch: 78%; letter-spacing: -0.035em; max-width: 20ch; }
.headline-stat b { color: var(--accent); font-weight: 800; }

/* Landmark icons */
.icon-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.35rem; color: var(--accent); }
.icon { width: 100%; height: 100%; }
.icon-unit { display: block; width: var(--size, 34px); height: calc(var(--size, 34px) * 1.34); opacity: var(--fade, 1); }
.icon-unit--part { position: relative; }
.icon-unit--part .icon--ghost { opacity: 0.25; }
.icon-clip { position: absolute; inset: 0; display: block; clip-path: inset(calc((1 - var(--fill)) * 100%) 0 0 0); }
.icon-more { align-self: center; font: 700 1.1rem/1 var(--font-display); color: var(--cream-dim); padding-left: 0.3rem; }
.icon-hero { margin-top: 1.6rem; }
.icon-hero .icon-unit { --size: clamp(48px, 7vw, 86px); }
.icon-hero .icon-row { gap: 0.6rem; }
.icon-hero .icon-more { font-size: 1.8rem; }

/* Comparison rows */
.compare { list-style: none; margin: 2.2rem 0 0; padding: 0; display: grid; gap: 0.55rem; }
.compare li {
  display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center;
  padding: 0.85rem 1.1rem; border-radius: 12px;
  background: color-mix(in oklab, var(--cream) 8%, transparent);
  border: 1px solid color-mix(in oklab, var(--cream) 12%, transparent);
}
.slide--light .compare li { background: rgba(11, 11, 16, 0.04); border-color: rgba(11, 11, 16, 0.1); }
.compare__text { font-size: var(--step-1); line-height: 1.3; }
.compare__ratio { font: 800 1.35em/1 var(--font-display); color: var(--accent); font-variant-numeric: tabular-nums; margin-right: 0.35rem; }
.compare__meta { display: block; margin-top: 0.2rem; font-size: var(--step--1); color: var(--cream-dim); }
.compare--tight li { padding: 0.7rem 1rem; }
.compare--tight .icon-unit { --size: 22px; }

/* Stats */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.25rem, 4vw, 3rem); margin-top: 1.5rem; }
.stat { border-top: 3px solid var(--cream-faint); padding-top: 1rem; }
.stat--growth, .stat--loss { border-top-color: var(--accent); }
.stat__label { font-size: var(--step--1); font-weight: 600; color: var(--cream-dim); }
.stat__value { margin-top: 0.4rem; font: 800 clamp(2.3rem, 1rem + 4.4vw, 4.6rem)/1 var(--font-display); font-stretch: 76%; letter-spacing: -0.035em; font-variant-numeric: tabular-nums lining-nums; overflow-wrap: anywhere; }
.stat--growth .stat__value, .stat--loss .stat__value { color: var(--accent); }
.stat__unit { font-size: 0.42em; font-weight: 600; letter-spacing: 0; color: var(--cream-dim); }
.stat__unit--strong { font-size: 0.55em; font-weight: 700; color: inherit; }
.stat__detail { margin-top: 0.5rem; font-size: var(--step--1); color: var(--cream-dim); }

/* Charts */
.chart, .skyline { margin: 1.8rem 0 0; }
.chart { max-width: 520px; }
.skyline { max-width: 560px; }
.split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.split__side .compare { margin-top: 0; }
.split__main .headline-stat { font-size: clamp(1.9rem, 1rem + 2.7vw, 3.2rem); max-width: 15ch; }
.split__main .icon-hero { margin-top: 1.4rem; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } .split__main .headline-stat { font-size: var(--step-2); } }
.chart svg, .skyline svg { width: 100%; height: auto; }
.chart text, .skyline text { font-family: var(--font-body); font-size: 14px; fill: var(--cream-dim); }
.chart .axis { stroke: var(--cream-faint); }
.chart .line-spent { fill: none; stroke: var(--cream-dim); stroke-width: 2; stroke-dasharray: 5 4; }
.chart .line-growth { fill: none; stroke: var(--accent); stroke-width: 3.5; }
.chart .area-gap { fill: var(--accent); opacity: 0.16; }
.chart .dot-growth { fill: var(--accent); }
.chart .dot-spent { fill: var(--cream-dim); }
.chart .label-strong { font-weight: 600; fill: var(--cream); }
.chart figcaption, .skyline figcaption { margin-top: 0.7rem; font-size: var(--step--1); color: var(--cream-dim); }
.skyline .baseline { stroke: var(--cream-faint); }
.skyline .bar { fill: var(--cream); opacity: 0.3; }
.skyline .bar-paper { fill: var(--cig-paper); }
.skyline .bar-filter { fill: var(--filter); }
.skyline .label-name { fill: var(--cream); font-weight: 600; }
@media (max-width: 620px) { .chart text, .skyline text { font-size: 17px; } }

.quit { margin-top: 2rem; padding: 1.25rem 1.5rem; border-radius: 14px; background: color-mix(in oklab, var(--accent) 14%, transparent); border-left: 4px solid var(--accent); max-width: 62ch; }
.quit__text { font-size: var(--step-1); line-height: 1.4; }
.quit__links { margin-top: 0.6rem; font-size: var(--step--1); color: var(--cream-dim); }

/* Support */
.support {
  margin-top: 2rem; max-width: 560px; padding: 1.25rem 1.5rem; border-radius: 16px;
  background: color-mix(in oklab, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
}
.support__title { font: 700 var(--step-1)/1.2 var(--font-display); }
.support__text { margin: 0.4rem 0 1rem; font-size: var(--step--1); color: inherit; opacity: 0.8; }
.support .btn { min-height: 2.9rem; gap: 0.55rem; text-decoration: none; }
.btn__icon { width: 1.05em; height: 1.4em; flex: none; }
.support__note { margin-top: 0.7rem; font-size: 0.8rem; opacity: 0.65; }
.support__note:empty { display: none; }
.support[data-state="placeholder"] { border-style: dashed; }
.support[data-state="placeholder"] .btn { opacity: 0.75; pointer-events: none; }
.site-footer nav a, .site-footer nav button { white-space: nowrap; }

/* Header language picker */
.lang { display: inline-flex; align-items: center; }
.lang select {
  height: 2.1rem; padding: 0 1.6rem 0 0.6rem; font: 500 var(--step--1)/1 var(--font-body);
  color: #fff; background-color: transparent; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 999px;
  background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
.lang select option { color: #0B0B10; background: #fff; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Carbon: lungs filling with smoke */
.slide[data-tone="co2"] .headline-stat { font-size: var(--step-2); max-width: 20ch; }
.headline-sub { display: block; margin-top: 0.3rem; font: 400 var(--step--1)/1.4 var(--font-body); color: var(--cream-dim); letter-spacing: 0; }
.slide[data-tone="co2"] .slide__lede { max-width: 60ch; }
.slide[data-tone="co2"] .compare { margin-top: 1rem; }
.slide[data-tone="co2"] .pair--time { margin-top: 1.2rem; }
.co2-layout { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: center; margin-top: 1.2rem; }
.lungs { margin: 0; color: var(--accent); }
.lungs svg { width: 100%; height: auto; max-height: 38vh; overflow: visible; }
.lung-outline { fill: color-mix(in oklab, var(--cream) 8%, transparent); stroke: color-mix(in oklab, var(--cream) 55%, transparent); stroke-width: 2.5; }
.lung-pipe { fill: none; stroke: color-mix(in oklab, var(--cream) 55%, transparent); stroke-width: 7; stroke-linecap: round; }
.smoke-stop { stop-color: var(--accent); }
.lung-fill { transform-box: fill-box; transform-origin: center; transform: translateY(100%); }
.wisp { fill: none; stroke: color-mix(in oklab, var(--cream) 45%, transparent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 70; stroke-dashoffset: 70; opacity: 0; }
@media (max-width: 860px) { .co2-layout { grid-template-columns: 1fr; } .lungs svg { max-height: 30vh; } }

/* Forecast horizons *//* Forecast horizons */
.horizons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9rem; margin-top: 1.8rem; }
.horizon {
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.3, 1), border-color 0.25s;
  padding: 1.1rem 1.15rem 1.25rem; border-radius: 16px;
  background: color-mix(in oklab, var(--cream) 8%, transparent);
  border: 1px solid color-mix(in oklab, var(--cream) 14%, transparent);
}
.horizon:hover { transform: translateY(-4px); border-color: color-mix(in oklab, var(--accent) 50%, transparent); }
.horizon__when { font: 750 1.5rem/1 var(--font-display); color: var(--accent); }
.horizon__bar { height: 5px; border-radius: 3px; margin: 0.9rem 0 1rem; background: color-mix(in oklab, var(--cream) 16%, transparent); overflow: hidden; }
.horizon__bar span { display: block; height: 100%; width: var(--w, 10%); background: var(--accent); border-radius: 3px; transform-origin: left; }
.horizon dl { display: grid; gap: 0.55rem; margin: 0; }
.horizon dt { font-size: var(--step--1); color: var(--cream-dim); }
.horizon dd { margin: 0; font: 650 1.25rem/1.15 var(--font-display); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.horizon dd small { display: block; font: 400 var(--step--1)/1.3 var(--font-body); color: var(--cream-dim); }
.horizon--beyond { opacity: 0.72; }
.horizon__flag { margin-top: 0.9rem; font-size: var(--step--1); color: var(--accent); }
@media (max-width: 900px) { .horizons { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .horizons { grid-template-columns: 1fr; } }

/* Life bar: the same years, with and without cigarettes */
.lifebar { margin: 0; display: grid; gap: 0.9rem; }
.lifebar__row { display: grid; gap: 0.35rem; }
.lifebar__label { font-size: var(--step--1); color: var(--cream-dim); display: flex; justify-content: space-between; gap: 1rem; }
.lifebar__track { height: 16px; border-radius: 8px; background: color-mix(in oklab, var(--cream) 12%, transparent); overflow: hidden; }
.lifebar__fill { height: 100%; border-radius: 8px; background: color-mix(in oklab, var(--cream) 55%, transparent); }
.lifebar__fill--smoking { background: var(--accent); }
.facts { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; gap: 0.7rem; }
.facts li { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--cream-faint); font-size: var(--step--1); color: var(--cream-dim); }
.facts b { font: 700 1.15rem/1 var(--font-display); color: var(--cream); font-variant-numeric: tabular-nums; }
.facts__note { border-bottom: 0; font-size: 0.82rem; line-height: 1.45; opacity: 0.75; }

/* Calculator slide */
.calc-slide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, 520px); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.calc-slide__copy .slide__title { font-size: var(--step-3); font-stretch: 78%; line-height: 0.98; max-width: 14ch; }
@media (max-width: 900px) { .calc-slide { grid-template-columns: 1fr; } }

/* One square per year, two paths */
.lifecompare { margin: 2rem 0 0; }
.lifecompare svg { width: 100%; height: auto; }
.lifecompare .year-lived { fill: var(--cream); opacity: 0.22; }
.lifecompare .year-kept { fill: var(--cream); opacity: 0.9; }
.lifecompare .year-kept--smoking { fill: var(--cream); opacity: 0.9; }
.lifecompare .year-lost { fill: var(--accent); }
.lifecompare .year-past { fill: #C2410C; }
.lifecompare .row-title { fill: var(--cream); font: 600 20px var(--font-body); }
.lifecompare .row-value { fill: var(--cream-dim); font: 400 19px var(--font-body); }
.lifecompare .row-end { stroke: var(--cream); opacity: 0.5; stroke-width: 2; }
.lifecompare .now-line { stroke: var(--cream); opacity: 0.35; stroke-width: 2; stroke-dasharray: 5 5; }
.lifecompare .now-label { fill: var(--cream-dim); font: 400 18px var(--font-body); }
.lifebars { display: none; gap: 1.4rem; }
.lifebars .lifebar__track { display: flex; height: 22px; border-radius: 11px; background: color-mix(in oklab, var(--cream) 8%, transparent); overflow: hidden; }
.lifebars .seg { display: block; height: 100%; }
.lifebars .seg--lived { background: color-mix(in oklab, var(--cream) 22%, transparent); }
.lifebars .seg--kept { background: var(--cream); }
.lifebars .seg--lost { background: var(--accent); }
.lifebars .seg--past { background: #C2410C; }
@media (max-width: 760px) {
  .lifecompare svg { display: none; }
  .lifebars { display: grid; }
}
.pair--time { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 2rem; }
.pair--time .stat__value { font-size: clamp(2rem, 0.9rem + 3vw, 3.2rem); }
@media (max-width: 760px) { .pair--time { grid-template-columns: 1fr; } }
.legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; margin-top: 1rem; font-size: var(--step--1); color: var(--cream-dim); }
.legend__item { display: inline-flex; align-items: center; gap: 0.45rem; }
.swatch { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }
.swatch--lived { background: color-mix(in oklab, var(--cream) 28%, transparent); }
.swatch--left { background: var(--cream); }
.swatch--taken { background: var(--accent); }
.swatch--past { background: #C2410C; }
@media (max-width: 900px) { .time-layout { grid-template-columns: 1fr; } }

/* Form */
.calc { background: rgba(255, 243, 228, 0.07); border: 1px solid var(--cream-faint); border-radius: 18px; padding: clamp(1.25rem, 3vw, 2rem); backdrop-filter: blur(6px); }
.calc__title { font-size: var(--step-1); margin-bottom: 1.1rem; }
.calc__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.field { display: grid; gap: 0.3rem; align-content: start; }
.field--wide { grid-column: 1 / -1; }
label { font-size: var(--step--1); font-weight: 600; }
input[type="number"], input[type="email"], input[type="text"], select {
  width: 100%; height: 3rem; padding: 0 0.85rem; font: 500 1.1rem/1 var(--font-body); color: var(--cream);
  background: rgba(16, 12, 30, 0.35); border: 1px solid var(--cream-faint); border-radius: 10px;
  appearance: none; font-variant-numeric: tabular-nums;
}
.slide--light input[type="email"], .slide--light input[type="text"] { color: var(--ink); background: #fff; border-color: rgba(11, 11, 16, 0.18); }
input::placeholder { color: rgba(255, 243, 228, 0.35); }
.slide--light input::placeholder { color: rgba(11, 11, 16, 0.35); }
select option { color: #0B0B10; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--cream-dim) 50%), linear-gradient(135deg, var(--cream-dim) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2.2rem; }
input:hover, select:hover { border-color: color-mix(in oklab, var(--cream) 40%, transparent); }
input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[aria-invalid="true"] { border-color: #FF3B47; }
.input-affix { position: relative; }
.input-affix input { padding-right: 3.5rem; }
.input-affix__unit { position: absolute; right: 0.85rem; top: 50%; transform: translateY(-50%); font-size: var(--step--1); color: var(--cream-dim); pointer-events: none; }
.field__hint { font-size: var(--step--1); color: var(--cream-dim); }
.field__error { font-size: var(--step--1); color: #FF6A55; }
.field__error:empty { display: none; }
.slide--light .field__error { color: #C0341A; }
.calc__advanced { margin-block: 1.1rem; border-top: 1px solid var(--cream-faint); padding-top: 0.9rem; }
.calc__advanced summary { cursor: pointer; font-size: var(--step--1); font-weight: 600; color: var(--cream-dim); }
.calc__advanced[open] summary { margin-bottom: 0.9rem; }
.calc__footnote { margin-top: 0.75rem; font-size: var(--step--1); color: var(--cream-dim); text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 3.25rem; padding: 0 1.6rem;
  border-radius: 999px; border: 1px solid transparent; font: 650 1.05rem/1 var(--font-display); cursor: pointer;
  transition: transform 0.15s, background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn--primary { background: var(--accent); color: #08080A; }
.calc .btn--primary { width: 100%; }
.btn--primary:hover { transform: translateY(-2px); }
.btn--quiet { background: transparent; color: inherit; border-color: color-mix(in oklab, currentColor 35%, transparent); }
.btn--quiet:hover { border-color: currentColor; }
.btn[disabled] { opacity: 0.6; cursor: progress; transform: none; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }

.report-form { display: grid; gap: 1rem; max-width: 560px; margin-top: 1.5rem; }
.check { display: grid; grid-template-columns: auto 1fr; gap: 0.7rem; align-items: start; font-weight: 400; font-size: var(--step--1); color: rgba(11, 11, 16, 0.68); }
.check input { width: 1.2rem; height: 1.2rem; margin-top: 0.15rem; accent-color: var(--accent); }
.report-form__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.status { font-size: var(--step--1); min-height: 1.4em; }
.status[data-tone="error"] { color: #C0341A; }
.status[data-tone="ok"] { color: #0F6A4E; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Light bands: ads and method, so ad units sit on a light surface as advertisers expect */
.band { background: #F3F2EE; color: var(--ink); }
.band__inner { width: min(var(--wrap), 100%); margin-inline: auto; padding: 1.5rem var(--space); }
.band--method { background: #0C0C10; color: var(--cream); }
.method h2 { font-size: var(--step-2); font-stretch: 84%; margin-bottom: 1.2rem; }
.method .prose { columns: 2; column-gap: 3rem; color: var(--cream-dim); }
.method .prose p { break-inside: avoid; margin-bottom: 1rem; max-width: 60ch; }
@media (max-width: 760px) { .method .prose { columns: 1; } }
.band--method .band__inner { padding-block: clamp(3rem, 7vw, 5rem); }

.legal { width: min(760px, 100% - 2 * var(--space)); margin-inline: auto; padding-block: 6rem 5rem; }
.legal h1 { font-size: var(--step-3); font-stretch: 80%; margin-bottom: 1rem; }
.legal h2 { font-size: var(--step-1); margin: 2rem 0 0.5rem; }
.prose p + p { margin-top: 1rem; }

/* Ads */
.ad-slot { display: grid; place-items: center; min-height: 120px; width: 100%; }
.ad-slot--footer { min-height: 100px; }
.ad-slot[data-state="placeholder"] { border: 1px dashed rgba(244, 244, 242, 0.2); border-radius: 12px; color: var(--cream-dim); font-size: var(--step--1); }
.ad-slot[data-state="off"] { display: none; }
.band:has(.ad-slot[data-state="off"]) { display: none; }

.site-footer { background: #0C0C10; color: var(--cream-dim); padding-bottom: 2.5rem; font-size: var(--step--1); }
.site-footer .ad-slot[data-state="placeholder"] { border-color: var(--cream-faint); color: var(--cream-dim); }
.site-footer__inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: 1.5rem; border-top: 1px solid var(--cream-faint); }
.site-footer nav { display: flex; gap: 1.25rem; }

.consent { position: fixed; left: var(--space); bottom: var(--space); z-index: 40; max-width: 420px; background: #141419; color: var(--cream);
  border: 1px solid var(--cream-faint); border-radius: 16px; padding: 1.25rem; box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45); font-size: var(--step--1); }
.consent__actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; }
.consent .btn { min-height: 2.6rem; font-size: 0.95rem; }

/* Entrance: one staggered sequence per slide, triggered when the slide arrives */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); transition-delay: calc(var(--i, 0) * 110ms); }
.is-visible .reveal, .no-motion .reveal { opacity: 1; transform: none; }

/* Motion that explains something: icons arrive one by one so you count them,
   bars grow from zero so you feel the size, the invested line draws itself so
   the gap opens in front of you. Everything plays once, when its slide arrives. */
@media (prefers-reduced-motion: no-preference) {
  .is-visible .icon-unit {
    animation: icon-pop 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) backwards;
    animation-delay: calc(220ms + var(--n, 0) * 55ms);
  }
  @keyframes icon-pop { from { opacity: 0; transform: translateY(10px) scale(0.86); } }

  .is-visible .skyline .bar, .is-visible .skyline .bar-stack {
    transform-box: fill-box; transform-origin: bottom;
    animation: grow-up 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
    animation-delay: calc(260ms + var(--n, 0) * 110ms);
  }
  @keyframes grow-up { from { transform: scaleY(0.02); } }

  .chart .line-growth { stroke-dasharray: 1; }
  .is-visible .chart .line-growth { animation: draw-line 1.7s cubic-bezier(0.3, 0.1, 0.2, 1) backwards; animation-delay: 250ms; }
  @keyframes draw-line { from { stroke-dashoffset: 1; } }
  .is-visible .chart .area-gap, .is-visible .chart .dot-growth, .is-visible .chart .dot-spent,
  .is-visible .chart .label-strong, .is-visible .chart text { animation: soft-in 0.7s ease backwards; animation-delay: 1.2s; }
  @keyframes soft-in { from { opacity: 0; } }

  .is-visible .lifecompare rect {
    transform-box: fill-box; transform-origin: center;
    animation: square-in 0.4s ease backwards;
    animation-delay: calc(200ms + var(--n, 0) * 11ms);
  }
  @keyframes square-in { from { opacity: 0; transform: scale(0.4); } }

  .is-visible .horizon__bar span, .is-visible .lifebars .seg, .is-visible .lifebar__fill {
    transform-origin: left; animation: bar-grow 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; animation-delay: 300ms;
  }
  @keyframes bar-grow { from { transform: scaleX(0); } }

  .is-visible .co2-car { animation: drive 5s cubic-bezier(0.4, 0, 0.5, 1) 0.2s both; }
  @keyframes drive { from { transform: translateX(-100px); } to { transform: translateX(560px); } }
  .is-visible .co2-road .road-dashes { animation: road-move 1.1s linear infinite; }
  @keyframes road-move { to { stroke-dashoffset: -48; } }
  .is-visible .puff { animation: puff 1.5s ease-out infinite; animation-delay: calc(var(--n, 0) * 0.5s); }
  @keyframes puff {
    0% { opacity: 0.5; transform: translate(0, 0) scale(0.4); }
    100% { opacity: 0; transform: translate(-55px, -26px) scale(1.8); }
  }
  .is-visible .lung-fill { animation: lung-fill 2.8s cubic-bezier(0.35, 0.05, 0.3, 1) 0.35s forwards; }
  @keyframes lung-fill { to { transform: translateY(0); } }
  .is-visible .wisp { animation: wisp 3.6s ease-out infinite; animation-delay: calc(1.4s + var(--n, 0) * 0.9s); }
  @keyframes wisp {
    0% { opacity: 0; stroke-dashoffset: 70; transform: translateY(8px); }
    25% { opacity: 0.75; }
    100% { opacity: 0; stroke-dashoffset: -20; transform: translateY(-18px); }
  }

  .btn--primary { transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.3, 1), filter 0.18s; }
  .btn--primary:hover { filter: brightness(1.08); }
  .compare li { transition: transform 0.22s, border-color 0.22s; }
  .compare li:hover { transform: translateX(4px); border-color: color-mix(in oklab, var(--accent) 45%, transparent); }
}

/* Where scroll-driven animation exists, the story is tied to the scrollbar:
   content rises as a slide enters and settles back as it leaves. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .slide:not(.slide--hero) .slide__inner {
      animation: chapter linear both;
      animation-timeline: view();
    }
    /* The timeline runs from the slide entering the viewport to leaving it,
       so a slide at rest sits at the midpoint: fully present, fully still. */
    @keyframes chapter {
      0% { opacity: 0; transform: translateY(42px) scale(0.985); }
      20%, 78% { opacity: 1; transform: none; }
      100% { opacity: 0; transform: translateY(-26px) scale(0.99); }
    }
  }
}

/* Short laptop screens: shrink the type and padding so a slide still fits in one view. */
@media (min-width: 900px) and (max-height: 880px) {
  :root { --step-4: clamp(3rem, 7vw, 6.4rem); --step-3: clamp(2rem, 4vw, 3.6rem); --step-2: clamp(1.6rem, 2.6vw, 2.5rem); }
  .slide { padding-block: 4.5rem 2rem; }
  .compare li { padding-block: 0.6rem; }
  .compare { margin-top: 1.4rem; }
  .chart { max-width: 460px; }
  .burn { margin-top: 1.2rem; }
  .buy { padding: 1rem 1rem 1.1rem; }
}

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; }
  .slide--hero { align-items: start; }
}
@media (max-width: 560px) {
  .calc__grid, .pair { grid-template-columns: 1fr; }
  .site-nav a:first-child { display: none; }
  .compare li { grid-template-columns: 1fr; }
}
/* A slide taller than the window opts out of snapping, so nothing can trap a scroll. */
.slide[data-snap="off"] { scroll-snap-align: none; }
.band, .site-footer { scroll-snap-align: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; scroll-snap-type: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .burn .cig__paper { transition: none; }
  .burn.is-burning .cig__ember { animation: none; }
}
