/* Graphite night with a lime signal and a violet glow. One dark look on purpose. */
:root {
  color-scheme: dark;
  --bg: #101014;
  --panel: #18181f;
  --line: #2a2933;
  --ink: #f5f2ea;
  --muted: #9a97a6;
  --lime: #c8ff5a;
  --violet: #9b8cff;
  --display: "Bricolage Grotesque", "Arial Black", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(155, 140, 255, 0.22), transparent 70%),
    var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--mono);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  font: 500 15px var(--mono);
  cursor: pointer;
  transition-property: transform, border-color, filter;
  transition-duration: 150ms;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.35; cursor: default; }
.btn-hot { background: var(--lime); border-color: var(--lime); color: #12140c; font-weight: 600; }
.btn-hot:hover { filter: brightness(1.06); border-color: var(--lime); }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 13px; }

/* ---- landing ---- */
.landing {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding-inline: 20px;
  padding-block: 0 32px;
}
.top { display: flex; justify-content: space-between; align-items: center; padding-block: 18px; }
.brand { margin: 0; font: 800 22px var(--display); }
.brand span { color: var(--lime); }
.lang-toggle {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: 500 13px var(--mono);
  cursor: pointer;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 48px;
  align-items: start;
  padding-block: 6vh 4vh;
}
.hero-copy { min-width: 0; }
h1 {
  margin: 0;
  font: 800 clamp(44px, 7vw, 88px)/0.92 var(--display);
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.tagline { margin: 14px 0 0; color: var(--lime); font-size: 16px; }
.lead { max-width: 52ch; margin: 14px 0 20px; color: var(--muted); font: 16px/1.55 var(--sans); text-wrap: pretty; }
.demo-row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 0 0 26px; color: var(--muted); font: 13px var(--sans); }
.cli-box p, .drop-hint, .privacy, .hidden-help p, .period-row label, .preview-wrap figcaption { font-family: var(--sans); }
.cli-box .cmd-row, .hidden-help .cmd-row { font-family: var(--mono); }

.drop {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 20px;
  border: 1.5px dashed var(--line);
  border-radius: 16px;
  transition: border-color 150ms, background-color 150ms;
}
.drop.is-over { border-color: var(--lime); background: rgba(200, 255, 90, 0.06); }
.pick-files { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; padding-block: 6px; }
.drop-hint { margin: 0; color: var(--muted); font-size: 13px; }
.pick-error { margin: 0; color: #ff9d8a; font-size: 13px; min-height: 0; }
.pick-error:empty { display: none; }
.progress { margin: 0; color: var(--lime); font-variant-numeric: tabular-nums; }

.cli-box { margin: 0 0 18px; padding: 14px 16px; border-radius: 14px; background: var(--panel); color: var(--muted); font-size: 13px; }
.cli-box p { margin: 0 0 8px; }
.cli-box .cmd-row { margin: 0; }
.cli-box .status:not(:empty) { margin-top: 8px; }
.cli-box .status { margin: 0; }
.cli-box .cmd { background: var(--bg); color: var(--lime); }

.period-row label { display: inline-flex; align-items: center; min-height: 44px; }
.period-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0 0; color: var(--muted); font-size: 13px; }
.period {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  font: 500 14px var(--mono);
}
.period-small { min-height: 36px; font-size: 12px; max-width: 46vw; }

.privacy { margin: 20px 0 6px; color: var(--muted); font-size: 13px; }
.privacy span[aria-hidden] { color: var(--lime); }
.hidden-help { color: var(--muted); font-size: 13px; }
.hidden-help p { margin: 6px 0; }
.cmd-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cmd {
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
}
.status { min-height: 1.2em; margin: 0; color: var(--lime); font-size: 13px; }
.cli-box .status:empty, .hidden-help .status:empty { min-height: 0; }

.preview-wrap { position: relative; isolation: isolate; margin: 4vh 0 0; min-width: 0; }
/* Illustration behind the demo card; faded at the edges so it never competes with the card. */
.preview-wrap::before {
  content: "";
  position: absolute;
  inset: -30% -8%;
  z-index: -1;
  background: url("../img/landing-hero.webp") center / cover no-repeat;
  opacity: 0.6;
  -webkit-mask-image: radial-gradient(farthest-side, #000 45%, transparent 100%);
  mask-image: radial-gradient(farthest-side, #000 45%, transparent 100%);
  pointer-events: none;
}
.preview {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  rotate: 2deg;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.preview-wrap figcaption { margin-top: 12px; color: var(--muted); font-size: 12px; text-align: right; }

.foot { padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-block: 3vh; }
  .preview { rotate: 0deg; }
  .preview-wrap::before { inset: -18% 0; }
}

/* ---- story ---- */
.story {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
  width: min(760px, 100%);
  margin: 0 auto;
  padding-inline: 20px;
  padding-block: 14px 18px;
}
.bars-top { display: flex; gap: 4px; }
.bars-top > span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.bars-top > span > span { display: block; height: 100%; background: var(--lime); scale: 0 1; transform-origin: left; transition: scale 300ms ease-out; }
.bars-top > span.is-done > span { scale: 1 1; }
.story-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 10px 0 0; }
.story-meta .restart { margin-left: auto; }
.demo-tag { padding: 3px 10px; border: 1px dashed var(--lime); border-radius: 999px; color: var(--lime); font-size: 12px; }

.slide {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding-block: 4vh;
  cursor: pointer;
  position: relative;
  isolation: isolate;
}
/* Illustration behind the slide: faint, darkened at the top where the text sits, never animated. */
.slide[data-bg]::before {
  content: "";
  position: absolute;
  inset: 0 -20px;
  z-index: -1;
  background:
    linear-gradient(to bottom, var(--bg) 0%, rgba(16, 16, 20, 0.7) 45%, rgba(16, 16, 20, 0) 80%),
    var(--slide-bg, none) center bottom / cover no-repeat;
  opacity: 0.35;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
  pointer-events: none;
}
.slide[data-bg="intro"] { --slide-bg: url("../img/story/intro.webp"); }
.slide[data-bg="time"] { --slide-bg: url("../img/story/time.webp"); }
.slide[data-bg="talk"] { --slide-bg: url("../img/story/talk.webp"); }
.slide[data-bg="tokens"] { --slide-bg: url("../img/story/tokens.webp"); }
.slide[data-bg="hands"] { --slide-bg: url("../img/story/hands.webp"); }
.slide[data-bg="code"] { --slide-bg: url("../img/story/code.webp"); }
.slide[data-bg="final"] { --slide-bg: url("../img/story/final.webp"); }
/* go() focuses the heading for screen readers; that programmatic focus needs no ring. */
.slide [tabindex="-1"]:focus { outline: none; }
.slide.is-in > * { animation: rise 520ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.slide.is-in > *:nth-child(2) { animation-delay: 70ms; }
.slide.is-in > *:nth-child(3) { animation-delay: 140ms; }
.slide.is-in > *:nth-child(n + 4) { animation-delay: 210ms; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.kicker { margin: 0 0 10px; color: var(--lime); font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; }
.display { margin: 0; font: 800 clamp(40px, 8vw, 76px)/0.95 var(--display); letter-spacing: -0.03em; text-wrap: balance; }
.big {
  margin: 0;
  font: 800 clamp(64px, 16vw, 148px)/0.9 var(--display);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.big .unit { font: 500 clamp(18px, 3vw, 26px) var(--mono); letter-spacing: 0; color: var(--muted); }
.stamp { color: var(--lime); }
.line { max-width: 40ch; margin: 18px 0 0; font-size: clamp(17px, 2.4vw, 21px); text-wrap: pretty; }
.sub { max-width: 60ch; margin: 12px 0 0; color: var(--muted); font-size: 14px; text-wrap: pretty; }

.bars { margin: 26px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.bars li { display: grid; grid-template-columns: minmax(0, 9em) 1fr auto; gap: 12px; align-items: center; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 12px; border-radius: 6px; background: var(--panel); overflow: hidden; }
.bar-fill {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--violet), var(--lime));
  scale: var(--k) 1;
  transform-origin: left;
  animation: grow 800ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes grow { from { scale: 0 1; } }
.bar-value { color: var(--muted); font-variant-numeric: tabular-nums; }

.heat { display: block; width: 100%; aspect-ratio: 24 / 8; max-height: 300px; }
.heat-days { display: none; }

/* Project names stay blurred until the person chooses to show them. */
body:not(.show-names) .project { color: transparent; text-shadow: 0 0 9px var(--ink); user-select: none; }
.toggle { display: inline-flex; gap: 10px; align-items: center; margin-top: 18px; min-height: 44px; cursor: pointer; }
.toggle input { width: 24px; height: 24px; accent-color: var(--lime); }

.portrait { display: block; width: min(200px, 46vw); height: auto; aspect-ratio: 1; margin: 18px 0 4px; border: 1px solid var(--line); border-radius: 18px; }
.card { display: block; width: 100%; height: auto; margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; }
.card.is-story { align-self: flex-start; width: auto; max-width: 100%; max-height: 52vh; max-height: 52dvh; }
.formats { display: flex; gap: 8px; margin-top: 18px; }
.fmt[aria-pressed="true"] { border-color: var(--lime); color: var(--lime); }

.odds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 18px; margin: 22px 0 0; }
.odds div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 4px; min-width: 0; }
.odds dt { color: var(--muted); font-size: 13px; }
.odds dd { margin: 0; font: 800 clamp(34px, 7vw, 56px)/1 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.share-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
a.btn { text-decoration: none; }

.story-nav { display: flex; justify-content: space-between; gap: 10px; }
.story-nav .next { min-width: 140px; }

.fallback-text {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  padding: 12px;
  border: 1px solid var(--lime);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  font: 13px/1.5 var(--mono);
}

/* ---- checkup ---- */
.report {
  width: min(980px, 100%);
  margin: 0 auto;
  padding-inline: 20px;
  padding-block: 14px 48px;
}
.report-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.report-bar .period { max-width: 44vw; }
.report-bar .demo-tag { margin-right: auto; }
.report-bar .demo-tag[hidden] + .period { margin-right: auto; }
.view-status { margin: 8px 0 0; color: #ff9d8a; font-size: 13px; }
.view-status:empty { display: none; }
.report-head { position: relative; isolation: isolate; padding-block: 5vh 3vh; }
/* Illustration to the right of the title, dissolving toward the text. */
.report-head::after {
  content: "";
  position: absolute;
  inset: -12% -4% -12% 38%;
  z-index: -1;
  background: url("../img/checkup-hero.webp") center / cover no-repeat;
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 45%), radial-gradient(farthest-side, #000 55%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 45%), radial-gradient(farthest-side, #000 55%, transparent 100%);
  mask-composite: intersect;
  pointer-events: none;
}
.report-head .line { max-width: 52ch; color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.kpi.is-hot { border-color: var(--lime); }
.kpi-label { margin: 0; color: var(--muted); font-size: 13px; }
.kpi-value { margin: 6px 0 0; font: 800 clamp(30px, 4vw, 44px)/1 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi.is-hot .kpi-value { color: var(--lime); }
.kpi-sub { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.spend-bar { display: flex; height: 8px; margin: 12px 0 0; border-radius: 4px; overflow: hidden; background: var(--line); }
.spend-bar span { display: block; min-width: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.legend span { white-space: nowrap; }
.legend i { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 2px; vertical-align: 0; }

.week { margin-top: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; }
.week .kicker { margin: 0; }
.week .muted { color: var(--muted); letter-spacing: 0; text-transform: none; }
.week dl { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 10px 0 0; }
.week dt { color: var(--muted); font-size: 12px; }
.week dd { margin: 2px 0 0; font: 800 24px var(--display); font-variant-numeric: tabular-nums; }
.week .delta { color: var(--muted); font: 500 13px var(--mono); }
.week .sub { margin-top: 8px; }

.section-title { margin: 40px 0 14px; font: 800 26px var(--display); letter-spacing: -0.01em; }

.plan { margin-top: 12px; padding: 18px; border: 1px solid var(--lime); border-radius: 16px; background: rgba(200, 255, 90, 0.04); }
.plan .kicker { margin: 0; }
.plan ol { margin: 12px 0 0; padding-left: 22px; display: grid; gap: 10px; }
.plan li { padding-left: 4px; }
.plan li::marker { color: var(--lime); font-weight: 600; }
.plan a { display: inline-block; padding-block: 2px; color: var(--ink); font: 800 clamp(17px, 2vw, 20px)/1.3 var(--display); text-decoration: none; }
.plan a:hover { text-decoration: underline; text-underline-offset: 4px; }
.plan-gain { display: inline-block; margin-left: 10px; color: var(--lime); font-weight: 600; }
.plan-effort { display: block; color: var(--muted); font-size: 12px; }
.plan .sub { margin-top: 12px; }

.minor { margin-top: 28px; }
.minor summary { cursor: pointer; list-style-position: outside; }
.minor summary .section-title { display: inline; margin: 0; font-size: 20px; }
.minor .findings { margin-top: 12px; opacity: 0.85; }
.muted { color: var(--muted); }

.fix { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.fix-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; background: var(--bg); }
.fix-label { flex: 1 1 14em; min-width: 0; color: var(--muted); font-size: 12px; }
.fix-status { font-size: 12px; }
.fix pre { margin: 0; padding: 12px 14px; overflow-x: auto; background: #0b0b0e; color: var(--ink); font: 12.5px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.fix pre code { padding: 0; border-radius: 0; background: none; color: inherit; font-size: inherit; }
.all-md .fix { margin-top: 14px; }

/* Finding cards: what to do and what it's worth up front; the why, where and snippets fold away. */
.findings { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.finding {
  position: relative;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  scroll-margin-top: 16px;
}
.finding::before {
  content: "";
  position: absolute;
  inset: 18px auto 18px 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--line);
}
.finding.is-high::before { background: #ff9d8a; }
.finding.is-medium::before { background: #ffd27a; }
.finding-top { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px 16px; align-items: center; }
.finding-art {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  outline: 1px solid rgba(255, 255, 255, 0.1);
  outline-offset: -1px;
  object-fit: cover;
  outline: 1px solid rgba(255, 255, 255, 0.1);
  outline-offset: -1px;
}
.finding-title { min-width: 0; }
.finding h3 { margin: 0; font: 800 clamp(19px, 2.3vw, 22px)/1.2 var(--display); text-wrap: balance; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--muted); font: 500 11.5px/1.4 var(--mono); }
.pill-level::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.is-high .pill-level { color: #ff9d8a; }
.is-medium .pill-level { color: #ffd27a; }
.finding-stat { display: flex; flex-direction: column; align-items: flex-end; margin: 0; text-align: right; }
.finding-stat strong { font: 800 clamp(26px, 3vw, 32px)/1 var(--display); color: var(--lime); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.finding-stat span { margin-top: 4px; color: var(--muted); font: 12px/1.3 var(--mono); }
.finding-line { margin: 14px 0 0; max-width: 68ch; color: var(--muted); font: 15px/1.55 var(--sans); text-wrap: pretty; }

.steps { display: grid; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; counter-reset: step; }
.steps[start="4"] { counter-reset: step 3; }
.steps li { position: relative; padding-left: 36px; counter-increment: step; font: 15px/1.5 var(--sans); text-wrap: pretty; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(200, 255, 90, 0.12);
  color: var(--lime);
  font: 600 12px/24px var(--mono);
  text-align: center;
}
.steps strong { display: block; font-weight: 600; color: var(--ink); }
.steps span { display: block; margin-top: 2px; color: var(--muted); font-size: 14px; }
.steps code, .more-note code { padding: 1px 6px; border-radius: 6px; background: var(--bg); color: var(--lime); font: 0.88em var(--mono); }

.more { margin-top: 16px; border-top: 1px solid var(--line); }
.more > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding-top: 12px;
  color: var(--lime);
  font: 500 13px var(--mono);
  cursor: pointer;
  list-style: none;
}
.more > summary::-webkit-details-marker { display: none; }
.more > summary::after { content: "▾"; transition-property: transform; transition-duration: 150ms; transition-timing-function: ease-out; }
.more[open] > summary::after { transform: rotate(180deg); }
.more > summary:hover span { text-decoration: underline; text-underline-offset: 4px; }
.more-note { margin: 12px 0 0; color: var(--muted); font: 14px/1.5 var(--sans); }
.where { margin: 12px 0 0; color: var(--ink); font-size: 13px; }
.muted { color: var(--muted); }
.more .fix { margin-top: 12px; }
/* Prose reads in a proportional face; labels, numbers and code stay mono. */
.report-head .line, .report .note, .healthy li, .all-md .sub, .plan .sub, .minor .sub, .week .sub { font-family: var(--sans); }

.healthy { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.healthy li::before { content: "✓"; margin-right: 10px; color: var(--lime); }
.note { margin-top: 24px; }
.report-cta { margin-top: 28px; padding: 22px; border: 1px dashed var(--lime); border-radius: 16px; text-align: center; }

@media (max-width: 760px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 14px; }
  .finding { padding: 16px; }
  .finding-top { grid-template-columns: 48px minmax(0, 1fr); }
  .finding-art { width: 48px; height: 48px; border-radius: 10px; }
  .finding-stat { grid-column: 1 / -1; flex-direction: row; align-items: baseline; gap: 10px; text-align: left; }
  .report-head::after { inset: -6% -20px 20% 30%; opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .slide.is-in > *,
  .bar-fill { animation: none; }
  .btn,
  .bars-top > span > span { transition: none; }
  .btn:active { transform: none; }
}
