/* handdrawn-map-kit site — CSS only positions text over the kit-rendered map. */
@font-face { font-family: "Kevin Serif"; src: url("fonts/KevinSerif-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Kevin Serif"; src: url("fonts/KevinSerif-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Kevin Sans"; src: url("fonts/KevinSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Kevin Sans"; src: url("fonts/KevinSans-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --ink: #26201c;
  --muted: #5b4e43;
  --crimson: #a8301f;
  --navy: #2f4a61;
  --code-bg: #231f1b;
  --code-fg: #f3e8cf;
  --code-dim: #c9b994;
  --ocean: #cde0e6;
  --serif: "Kevin Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Kevin Sans", "Trebuchet MS", Verdana, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ocean); color: var(--ink); font-family: var(--sans); -webkit-text-size-adjust: 100%; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ── the chart: one kit-rendered map, text blocks placed in millimetres ── */
.chart {
  --u: calc(100vw / 300);            /* 1 mm of the 300 mm wide desktop map */
  position: relative;
  width: 100%;
  aspect-ratio: 300 / 999;
  font-size: calc(3.5 * var(--u));   /* 16.8 px at 1440 */
  line-height: 1.5;
  overflow: hidden;
}
.chart__map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.b {
  position: absolute;
  left: calc(var(--dx) * var(--u));
  top: calc(var(--dy) * var(--u));
  width: calc(var(--dw) * var(--u));
  margin: 0;
}

/* ── type ── */
h2, h3 { font-family: var(--serif); font-weight: 700; margin: 0 0 .45em; line-height: 1.12; letter-spacing: .005em; }
h2 { font-size: 1.9em; }
h3 { font-size: 1.45em; }
p { margin: 0 0 .65em; }
p:last-child, pre:last-child, ul:last-child { margin-bottom: 0; }
b, strong { font-weight: 700; }
code { font-family: var(--mono); font-size: .86em; }
p code, li code { background: rgba(38, 32, 28, .08); padding: .05em .3em; border-radius: .2em; }
a { color: var(--navy); text-underline-offset: .15em; }

.lede { font-size: 1.1em; line-height: 1.55; }
.meta { font-weight: 700; font-size: .78em; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }

pre {
  margin: 0 0 .7em;
  padding: .7em .85em;
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: .3em;
  box-shadow: .12em .12em 0 rgba(38, 32, 28, .28);
  font: 400 .8em/1.5 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 2;
}
pre code { font-size: inherit; }
pre.diag { background: #f7f0df; color: var(--ink); box-shadow: inset 0 0 0 1px rgba(38, 32, 28, .35); }

/* ── buttons ── */
.copy, .chip {
  font: 700 .8em/1 var(--sans);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff6e4;
  background: var(--crimson);
  border: 0;
  border-radius: .3em;
  padding: .6em 1em;
  cursor: pointer;
  box-shadow: .14em .14em 0 rgba(38, 32, 28, .35);
}
.copy:hover, .chip:hover { background: #8f2718; }
.copy:focus-visible, .chip:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.copy.is-done, .chip.is-done { background: #2f6a4b; }
.chip { font-size: .74em; padding: .5em .8em; vertical-align: baseline; }

/* ── hero plate ── */
.plate img { display: block; width: 100%; height: auto; }
.plate figcaption { margin-top: .6em; font-size: .82em; line-height: 1.45; color: var(--muted); }
.plate figcaption b { color: var(--ink); letter-spacing: .04em; }

/* ── copy for your agent ── */
.agent { display: grid; grid-template-columns: 30% 1fr; gap: 0 1.6em; align-items: start; }
.agent h2 { margin-bottom: .35em; }
.agent__intro p { font-size: .95em; }
.agent__intro .copy { margin: .2em 0 .9em; }
.agent__alt { line-height: 2; }
.agent__prompt { margin: 0; font-size: .78em; line-height: 1.55; }

/* ── loop steps ── */
.step p { font-size: .93em; }
.step pre { font-size: .74em; }

/* ── facts ── */
.fact p { font-size: .95em; }
.counts { list-style: none; margin: 0; padding: 0; font-size: .93em; }
.counts li { padding: .28em 0; border-top: 1px solid rgba(38, 32, 28, .22); }
.counts li:first-child { border-top: 0; padding-top: 0; }
.counts b { font-family: var(--serif); font-size: 1.15em; }
.sheet { display: block; width: 100%; height: auto; margin-top: .7em; }
.thumbs { display: grid; grid-template-columns: repeat(6, 1fr); gap: .7em; margin: .6em 0 .8em; }
.thumbs figure { margin: 0; }
.thumbs img { display: block; width: 100%; height: auto; border: 1px solid rgba(38, 32, 28, .55); }
.thumbs figcaption { font: 700 .68em/1.3 var(--mono); margin-top: .35em; color: var(--muted); text-align: center; }
.fact.small p { font-size: .9em; }

/* ── showcase cards ── */
.card img { display: block; width: 100%; height: auto; border: 1px solid rgba(38, 32, 28, .55); margin-bottom: .7em; }
.card .ask { font-family: var(--serif); font-weight: 700; font-size: 1.08em; line-height: 1.3; margin-bottom: .5em; }
.card .chip { margin-bottom: .7em; }
.card pre { font-size: .7em; }

/* ── quick start / colophon ── */
.quick pre { font-size: .76em; }
.quick p, .made p { font-size: .93em; }
.made pre { font-size: .9em; }
.made pre code { color: #ffd98a; }
.colophon p { font-size: .82em; color: var(--muted); text-align: center; }

/* ── portrait chart (phones, narrow tablets): second kit-rendered map ── */
@media (max-width: 1079px) {
  .chart {
    --u: calc(100vw / 100);           /* 1 mm of the 100 mm wide portrait map */
    aspect-ratio: 100 / 2096;
    font-size: min(calc(4.1 * var(--u)), 21px);   /* 16 px at 390 */
  }
  .b {
    left: calc(var(--mx) * var(--u));
    top: calc(var(--my) * var(--u));
    width: calc(var(--mw) * var(--u));
  }
  .agent { grid-template-columns: 1fr; gap: .8em; }
  .agent__prompt { font-size: .7em; }
  .plate figcaption { margin-top: 1.5em; }
  .thumbs { grid-template-columns: repeat(3, 1fr); }
  .colophon p { text-align: left; }
}
