/* Agent Code Map: site styles. Dark ground, white text, one blue, General Sans for everything.
   Plain CSS, no build. Tokens first; everything below references them. */

@font-face { font-family: 'General Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('assets/fonts/general-sans-400.woff2') format('woff2'); }
@font-face { font-family: 'General Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('assets/fonts/general-sans-500.woff2') format('woff2'); }
@font-face { font-family: 'General Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('assets/fonts/general-sans-700.woff2') format('woff2'); }

/* ---------- tokens ---------- */
:root {
  --paper: #0b1014;
  --paper-deep: #10171d;
  --card: #141c23;
  --ink: #f2f5f7;
  --ink-soft: #d5dde3;
  --muted: #9aa7b3;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.26);
  --accent: #2a5fe0;
  --accent-strong: #3f73f5;
  --accent-soft: rgba(42, 95, 224, 0.18);
  --accent-ink: #ffffff;
  --grep: #3b4753;
  --good: #8db0ff;

  --font-display: 'General Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-body: 'General Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --text-small: 0.9375rem;
  --text-body: 1.125rem;
  --text-lead: clamp(1.1875rem, 1.05rem + 0.6vw, 1.4375rem);
  --text-h3: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --text-h2: clamp(2rem, 1.35rem + 2.6vw, 3.5rem);
  --text-h1: clamp(2.625rem, 1.6rem + 4.6vw, 5.5rem);
  --text-figure: clamp(2.75rem, 2rem + 3.4vw, 4.75rem);

  --wrap: 72rem;
  --margin: clamp(1.25rem, 4vw, 3rem);
  --section: clamp(5rem, 10vw, 9rem);
  --radius: 14px;
  --radius-small: 8px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-reveal: 700ms;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  background: var(--paper);
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: var(--text-h1); letter-spacing: -0.03em; }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); line-height: 1.15; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-color: var(--good); }
code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.08em 0.38em;
  border-radius: 5px;
}
q { quotes: '\201C' '\201D'; font-style: italic; }
strong { font-weight: 600; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nums { font-variant-numeric: tabular-nums; }
html:not(.js) .js-only { display: none; }
.js .no-js-only { display: none; }

.wrap { width: min(100% - 2 * var(--margin), var(--wrap)); margin-inline: auto; }
.section { padding-block: var(--section); }
.section__head { max-width: 42rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section__lead { font-size: var(--text-lead); color: var(--ink-soft); line-height: 1.5; margin-top: 1rem; max-width: 36em; }

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.25rem; padding: 0.8rem 1.5rem;
  background: var(--accent); color: var(--accent-ink);
  border: 1.5px solid var(--accent); border-radius: 999px;
  font-weight: 600; font-size: 1.0625rem; text-decoration: none; cursor: pointer;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, border-color var(--t-hover) ease;
}
.button:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .button:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
  .button--ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--ink); }
}
.button--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.link-button {
  background: none; border: 0; padding: 0.7rem 0.2rem; cursor: pointer;
  color: var(--good); text-decoration: underline; text-underline-offset: 0.18em;
}

/* ---------- top bar ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: 1.25rem;
  position: relative; z-index: 2;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.4rem 0;
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; text-decoration: none;
}
.wordmark__mark { width: 1.5rem; height: 1.5rem; fill: none; stroke: var(--good); stroke-width: 1.8; stroke-linejoin: round; }
.top__nav { display: flex; gap: clamp(1rem, 2.5vw, 1.75rem); align-items: center; font-size: var(--text-small); font-weight: 500; }
.top__nav a { text-decoration: none; padding: 0.8rem 0; display: inline-block; }
.top__nav a:hover { color: var(--good); }
.top__github { border: 1.5px solid var(--line-strong); border-radius: 999px; padding: 0.6rem 1rem !important; }
@media (max-width: 40em) { .top__nav a:not(.top__github) { display: none; } }

/* ---------- hero: the words over the night streets ---------- */
.hero { position: relative; overflow: clip; min-height: 86svh; display: grid; align-items: center; align-content: center; background: var(--paper); }
.hero__bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: url('assets/hero-bg.webp?v=2') center / cover no-repeat;
  filter: grayscale(1) contrast(1.1);
  opacity: 0.55;
}
.hero__bg::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(11, 16, 20, 0.9) 0.8px, transparent 1px);
  background-size: 4px 4px;
}
.hero__bg::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(70% 70% at 22% 45%, rgba(11, 16, 20, 0.96) 0%, rgba(11, 16, 20, 0.7) 45%, rgba(11, 16, 20, 0) 80%),
    linear-gradient(to bottom, rgba(11, 16, 20, 0.7) 0%, rgba(11, 16, 20, 0.08) 30%, rgba(11, 16, 20, 0.12) 70%, var(--paper) 100%);
}
@media (max-width: 1000px) { .hero__bg { background-image: url('assets/hero-bg-small.webp?v=2'); } }
/* three points of the map, pinned on the streets to the right of the words */
.co-layer { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.co {
  position: absolute; left: var(--x); top: var(--y); transform: translate(0, -50%);
  display: flex; align-items: center; gap: 0.55rem; margin: 0;
}
.co--1 { --x: 66%; --y: 32%; }
.co--2 { --x: 74%; --y: 51%; }
.co--3 { --x: 62%; --y: 70%; }
.co span {
  background: var(--accent); color: #ffffff; border-radius: 999px;
  padding: 0.45rem 0.95rem; font-weight: 500; font-size: var(--text-small); white-space: nowrap;
}
.co::before {
  content: ''; flex: none; width: 0.65rem; height: 0.65rem; border-radius: 999px; background: #ffffff;
  box-shadow: 0 0 0 4px rgba(11, 16, 20, 0.85), 0 0 0 5px rgba(255, 255, 255, 0.35);
}
@media (prefers-reduced-motion: no-preference) {
  .co::before { animation: co-pulse 3600ms ease-out infinite; animation-delay: var(--d, 0ms); }
  .co--2::before { animation-delay: 1200ms; }
  .co--3::before { animation-delay: 2400ms; }
}
@keyframes co-pulse {
  0%, 60%, 100% { box-shadow: 0 0 0 4px rgba(11, 16, 20, 0.85), 0 0 0 5px rgba(255, 255, 255, 0.35); }
  75% { box-shadow: 0 0 0 4px rgba(11, 16, 20, 0.85), 0 0 0 14px rgba(255, 255, 255, 0); }
}
/* narrow screens: the points become a row under the words */
@media (max-width: 64em) {
  .co-layer { position: static; display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; width: min(100% - 2 * var(--margin), var(--wrap)); margin: 0 auto; padding-bottom: clamp(2rem, 6vh, 3.5rem); }
  .co { position: static; transform: none; }
}
.hero__inner { position: relative; z-index: 1; padding-block: clamp(3.5rem, 9vh, 7rem); }
.hero__words { max-width: 36rem; }
.eyebrow { font-size: var(--text-small); font-weight: 500; color: var(--ink-soft); margin-bottom: 1.25rem; }
.hero__title { max-width: 11em; font-size: clamp(2.5rem, 1.4rem + 4vw, 5rem); }
.hero__lead { font-size: var(--text-lead); line-height: 1.45; color: var(--ink-soft); margin-top: 1.25rem; max-width: 30em; }
.hero__words .actions { margin-top: 1.75rem; }
@media (max-width: 64em) { .hero__inner { padding-bottom: 1.5rem; } }
@media (max-width: 56em) {
  .hero { min-height: 0; }
  .hero__bg::after {
    background: linear-gradient(to bottom, rgba(11, 16, 20, 0.85) 0%, rgba(11, 16, 20, 0.6) 60%, var(--paper) 100%);
  }
  .hero__title { font-size: clamp(2.25rem, 1.2rem + 5.5vw, 3.5rem); }
  .hero__lead { font-size: 1.0625rem; }
}

/* ---------- steps ---------- */
.steps__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 2rem); counter-reset: step; }
.step {
  position: relative;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.25rem, 2.5vw, 2rem);
  display: flex; flex-direction: column; gap: 0.75rem;
}
.step__art { background: var(--paper); border-radius: var(--radius-small); padding: 1rem; margin-bottom: 0.5rem; }
.step__art svg { width: 100%; height: auto; max-height: 150px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; margin-inline: auto; }
.s-file, .s-term, .s-map { fill: var(--paper-deep); }
.s-arrow, .s-prompt, .s-cursor { stroke: var(--good); stroke-width: 3; }
.s-spark { fill: var(--good); stroke: none; }
.step__num {
  position: absolute; top: -0.9rem; left: 1.25rem;
  width: 2.25rem; height: 2.25rem; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
}
.step__text { color: var(--ink-soft); }
.cmd {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  background: #060a0d; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-small);
  padding: 0.7rem 0.75rem 0.7rem 1rem;
}
.cmd code { background: none; padding: 0; font-size: 1.05rem; color: inherit; }
.cmd__copy {
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.2); color: inherit;
  border-radius: 6px; padding: 0.35rem 0.8rem; font-size: 0.875rem; font-weight: 500; cursor: pointer; min-height: 2.75rem;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease;
}
.cmd__copy:active { transform: scale(0.96); }
.cmd__copy:hover { background: rgba(255, 255, 255, 0.2); }
.cmd__copy.is-done { background: var(--good); border-color: transparent; }
@media (max-width: 56em) { .steps__list { grid-template-columns: 1fr; gap: 1.75rem; } }

/* ---------- book vs map ---------- */
.book { background: var(--paper-deep); border-block: 1px solid var(--line); }
.book__question { font-size: var(--text-lead); max-width: 40em; }
.book__detail { color: var(--muted); font-size: var(--text-body); }
.book__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 2rem); margin-top: 1.75rem; }
.book__card {
  position: relative;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.25rem, 2.5vw, 2rem);
  display: flex; flex-direction: column; gap: 0.6rem;
}
.book__card--light { border-color: var(--accent-strong); box-shadow: 0 0 0 3px var(--accent-soft); }
.book__art svg { width: 100%; max-width: 15rem; height: auto; margin-inline: auto; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.b-stack rect { fill: var(--grep); stroke: var(--ink); }
.b-sheet { fill: var(--paper-deep); }
.book__how { font-family: var(--font-body); font-weight: 600; font-size: var(--text-small); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-top: 0.5rem; }
.book__text { color: var(--ink-soft); }
.book__fig { margin-top: auto; padding-top: 0.75rem; display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.book__num { font-family: var(--font-display); font-weight: 700; font-size: var(--text-figure); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.book__num--good { color: var(--good); }
.book__unit { color: var(--muted); }
.book__badge {
  position: absolute; top: 1rem; right: 1rem;
  background: var(--accent); color: var(--accent-ink); border-radius: 999px;
  padding: 0.3rem 0.8rem; font-weight: 600; font-size: var(--text-small);
}
.book__more { margin-top: 2.25rem; max-width: 40em; font-size: var(--text-lead); line-height: 1.5; color: var(--ink-soft); }
@media (max-width: 40em) { .book__pair { grid-template-columns: 1fr; } }

/* ---------- four projects ---------- */
.bars__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem; }
.bar { display: grid; gap: 0.4rem; }
.bar__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.bar__name { font-weight: 600; }
.bar__name small { font-weight: 400; color: var(--muted); margin-left: 0.4rem; font-size: var(--text-small); }
.bar__pct { font-family: var(--font-display); font-size: 1.5rem; color: var(--good); font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.bar__track { position: relative; height: 1.75rem; display: flex; align-items: center; gap: 0.6rem; }
.bar__fill {
  display: block; height: 100%; border-radius: 4px; flex: none;
  width: calc(var(--w) * 100%); min-width: 4px; position: relative;
}
.bar__fill--grep { background: var(--grep); }
.bar__fill--map { background: var(--accent); }
.bar__label { font-size: var(--text-small); white-space: nowrap; }
.bar__fill .bar__label { position: absolute; left: 0.6rem; top: 50%; transform: translateY(-50%); color: var(--ink); font-weight: 500; }
.bar__label--out { color: var(--ink-soft); }
@media (prefers-reduced-motion: no-preference) {
  .js .bar .bar__fill { transform-origin: left center; transform: scaleX(0); transition: transform 900ms var(--ease-out); }
  .js .bar .bar__fill .bar__label { opacity: 0; transition: opacity 300ms ease 700ms; }
  .js .bar.is-in .bar__fill { transform: scaleX(1); }
  .js .bar.is-in .bar__fill .bar__label { opacity: 1; }
}
.bars__legend { display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; margin-top: 1.5rem; font-size: var(--text-small); color: var(--muted); }
.sw { display: inline-block; width: 0.9em; height: 0.9em; border-radius: 3px; vertical-align: -0.1em; margin-right: 0.4em; }
.sw--grep { background: var(--grep); }
.sw--map { background: var(--accent); }
.bars__fine { margin-top: 1.5rem; max-width: 42em; color: var(--ink-soft); }
@media (max-width: 40em) {
  .bar__pct { font-size: 1.25rem; }
  .bar__fill .bar__label { display: none; }
}

/* ---------- your bill ---------- */
.bill { background: var(--paper-deep); border-block: 1px solid var(--line); }
.bill__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.bill__fine { margin-top: 1.5rem; font-size: var(--text-small); color: var(--muted); max-width: 36em; }
.calc {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.calc__bar { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 1.5rem; border-bottom: 1px solid var(--line); background: var(--paper); font-size: var(--text-small); }
.calc__bar strong { font-weight: 600; font-size: 1rem; white-space: nowrap; }
.calc__bar span { color: var(--muted); text-align: right; }
.calc__form { display: grid; grid-template-columns: 1fr 1.3fr; gap: 1rem; padding: 1.5rem; }
.field { display: grid; gap: 0.4rem; }
.field label { font-size: var(--text-small); font-weight: 500; color: var(--ink-soft); }
.field input, .field select {
  width: 100%; min-height: 3rem; padding: 0.6rem 0.85rem;
  font: inherit; font-size: 1.0625rem; color: var(--ink); background: #0b1014; color-scheme: dark;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-small);
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.calc__out { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.calc__out > div { padding: 1.25rem 1.5rem; display: grid; gap: 0.25rem; }
.calc__out > div + div { border-left: 1px solid var(--line); }
.calc__out .k { font-size: var(--text-small); color: var(--muted); }
.calc__out .v { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem); line-height: 1.1; letter-spacing: -0.03em; }
.calc__out .keep { background: var(--accent-soft); }
.calc__out .keep .v { color: var(--good); }
.calc__nojs { padding: 1.5rem; }
@media (max-width: 56em) { .bill__grid { grid-template-columns: 1fr; } }
@media (max-width: 40em) {
  .calc__form { grid-template-columns: 1fr; }
  .calc__out { grid-template-columns: 1fr; }
  .calc__out > div + div { border-left: 0; border-top: 1px solid var(--line); }
}

/* ---------- faq ---------- */
.faq__list { max-width: 46rem; border-top: 1px solid var(--line); }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.1rem 0; min-height: 3rem; font-family: var(--font-display); font-weight: 500; font-size: var(--text-h3); line-height: 1.25; letter-spacing: -0.01em;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: ''; flex: none; width: 0.75rem; height: 0.75rem;
  border-right: 2px solid var(--good); border-bottom: 2px solid var(--good);
  transform: rotate(45deg); transition: transform 200ms var(--ease-out); margin-right: 0.3rem;
}
.faq__item[open] summary::after { transform: rotate(-135deg); }
.faq__body { padding: 0 0 1.4rem; color: var(--ink-soft); max-width: 40em; }

/* ---------- cta ---------- */
.cta { position: relative; overflow: clip; padding-block: var(--section); text-align: center; background: var(--accent); color: var(--accent-ink); }
.cta__photo { display: none; }
.cta__inner { position: relative; display: grid; justify-items: center; gap: 1.25rem; }
.cta__text { max-width: 32em; font-size: var(--text-lead); color: var(--accent-ink); line-height: 1.5; }
.cta .button { background: var(--accent-ink); color: var(--accent); border-color: var(--accent-ink); }
.cta .button--ghost { background: transparent; color: var(--accent-ink); border-color: rgba(255, 255, 255, 0.6); }
@media (hover: hover) and (pointer: fine) {
  .cta .button:hover { background: #e8eefc; border-color: #e8eefc; }
  .cta .button--ghost:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--accent-ink); }
}
.cta .actions { justify-content: center; margin-top: 0.5rem; }

/* ---------- footer ---------- */
.foot { padding-block: 2rem 3rem; display: grid; gap: 0.75rem; font-size: var(--text-small); color: var(--muted); }
.foot__links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.foot__links a { text-decoration: none; color: var(--ink-soft); font-weight: 500; display: inline-block; padding: 0.7rem 0; }
.foot__links a:hover { color: var(--good); }

/* ---------- reveal and load motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-load] { opacity: 0; transform: translateY(14px); animation: load-in 700ms var(--ease-out) forwards; animation-delay: var(--d, 0ms); }
  .js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity var(--t-reveal) var(--ease-out), transform var(--t-reveal) var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
}
@keyframes load-in { to { opacity: 1; transform: none; } }
