/* The developer-facing home page, a preview at /?preview=dev. Every rule is under .dev
   or a loop- class, so the live page is untouched. */
.dev { --surface: #FFFDF8; --go: #3E8E5A; --claude: #D97757; }
/* The headline is two lines, and each should stay one line for as long as it can. A line
   is about 12.9 times the type size wide, and the room for it is the window less the
   page's side padding (146px each side while the town is drawn, 24px below 961px). So
   the size follows the window, up to 68px. */
.dev h1 { font-size: min(68px, calc((100vw - 292px) / 13.2)); }
.dev .sub { max-width: 54ch; }

.loop-tabs { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.loop-tabs button { font: 500 14px Inter, system-ui, sans-serif; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; min-height: 36px; cursor: pointer; }
.loop-tabs button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 600; }

.dev .sees { padding-top: 48px; padding-bottom: 24px; }
.dev .h2 { margin: 0 0 8px; font-size: 34px; line-height: 1.05; letter-spacing: -0.02em; }
.dev .lede { margin: 0 0 24px; color: var(--muted); max-width: 60ch; }
.dev .pair { display: flex; flex-wrap: wrap; align-items: stretch; gap: 24px; }
.dev .api { flex: 1.4 1 460px; box-shadow: 0 24px 48px -24px rgba(22,21,15,0.35); }
.dev .api .bar { padding: 12px 18px; font-size: 13px; font-weight: 600; color: var(--muted); background: var(--raised); border-bottom: 1px solid var(--rule); }
.dev .api .fns { margin: 0; padding: 4px 18px; list-style: none; flex: 1 1 auto; }
.dev .api .fns li { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 11px 0; border-bottom: 1px solid #EDE9DD; font-size: 14px; }
.dev .api .fns li:last-child { border-bottom: 0; }
.dev .api code { flex: 0 0 150px; font: 600 13px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--accent); }
.dev .api .fns span { flex: 1 1 220px; color: var(--muted); }
.dev .api .foot { padding: 12px 18px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--rule); }

.dev .blocks { padding-top: 48px; padding-bottom: 48px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 44px; }
.dev .block h2 { margin: 0 0 8px; font-weight: 700; font-size: 23px; letter-spacing: -0.02em; }
.dev .block p { margin: 0; color: var(--muted); font-size: 16px; }

/* The diagram gallery, a preview at /?preview=diagrams. */
.dg-main { padding-top: 24px; padding-bottom: 72px; }
.dg-main > h1 { margin-top: 12px; }
.dg-main > .sub { margin: 16px 0 0; max-width: 58ch; }
.dg-opt { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--rule); }
.dg-tag { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin: 0 0 10px; border-radius: 50%; background: var(--ink); color: var(--paper); font-weight: 700; font-size: 15px; }
.dg-says { margin: 0 0 6px; max-width: 62ch; font-size: 19px; }
.dg-for { margin: 0 0 24px; color: var(--muted); font-size: 15px; max-width: 62ch; }
.dg-stage { position: relative; width: 100%; max-width: 720px; margin: 0 auto; }
.dg-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.dg-stage svg text { font-family: Inter, system-ui, sans-serif; fill: var(--ink); }
.dg-stage svg .d { font-family: 'Bricolage Grotesque', system-ui, sans-serif; font-weight: 800; letter-spacing: -0.02em; }
.dg-stage svg .m { fill: var(--muted); }
.dg-stage svg .a { fill: var(--accent); }
.dg-stage svg .w { fill: var(--paper); font-weight: 700; }
.dg-stage svg .mid { text-anchor: middle; }
.dg-stage svg .end { text-anchor: end; }
.dg-stage svg .cap { letter-spacing: 0.1em; font-weight: 600; }
.dg-stage svg .halo { paint-order: stroke; stroke: var(--paper); stroke-width: 5px; stroke-linejoin: round; }
.dg-stage svg .b { font-weight: 600; }
.dg-part { width: 100%; }
.dg-part + .dg-part { margin-top: 44px; }
.dg-part h3 { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 16px; font-size: 24px; line-height: 1.15; letter-spacing: -0.02em; text-align: left; }
.dg-part h3 b { flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--paper); font: 700 15px Inter, system-ui, sans-serif; letter-spacing: 0; display: inline-flex; align-items: center; justify-content: center; }
.dev .sub b { color: var(--ink); font-weight: 600; }
.dev .parts { padding-top: 24px; padding-bottom: 64px; }
/* The invite form's status line is always in the page and empty until there is something
   to say. Empty, it gives back the gap the hero would otherwise leave above it. */
.dev .hero .note:empty { margin-top: -24px; }
.dg-legend { margin: 20px auto 0; padding: 0; max-width: 720px; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 28px; text-align: left; }
.dg-legend li { display: flex; gap: 10px; font-size: 15px; line-height: 1.4; color: var(--muted); }
.dg-legend b { flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }

@media (max-width: 960px) {
  .dg-legend { grid-template-columns: 1fr; }
  .dev h1 { font-size: min(56px, calc((100vw - 48px) / 13.2)); }
  .dev .h2 { font-size: 28px; }
  .dev .blocks { grid-template-columns: 1fr; }
}
/* Phones: too narrow for a line of headline at a size worth reading, so each of its two
   lines breaks once, evenly, into four. The three lines under it shrink a little to stay
   one line each, and break evenly where even that will not fit. */
@media (max-width: 480px) {
  .dev h1 { font-size: min(44px, calc((100vw - 48px) / 7.9)); text-wrap: balance; }
  .dev .hero .sub { font-size: clamp(13.5px, calc((100vw - 48px) / 21.2), 18px); text-wrap: balance; }
  .dev .eyebrow { font-size: 12px; letter-spacing: 0.08em; }
}
