/* ═══════════════════════════════════════════════════════════════════
   citystate.capital — civic coordination & capital
   Aesthetic: a municipal charter / public prospectus. Stone paper,
   ink serif, monospaced civic data, a single deep-civic accent.
   The name is the argument: city-state (polity) × capital (seat + finance).
   No JavaScript. System fonts only. CSS gradients/SVG only.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* light — stone paper, ink, civic teal */
  --paper:      #faf9f6;
  --paper-2:    #f1efe8;
  --panel:      #ffffff;
  --ink:        #1c1a17;
  --ink-soft:   #4a463f;
  --ink-faint:  #6f6a60;
  --rule:       #d9d4c8;
  --rule-soft:  #e7e3d8;
  --civic:      #1d5a5e;   /* deep municipal teal-blue */
  --civic-deep: #123d40;
  --civic-soft: #2f7b80;
  --brass:      #9a7b3f;   /* the "capital" accent — restrained gold */
  --max:        72rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #141312;
    --paper-2:    #1b1917;
    --panel:      #1f1d1a;
    --ink:        #f2efe8;
    --ink-soft:   #c9c3b6;
    --ink-faint:  #948f83;
    --rule:       #34302a;
    --rule-soft:  #2a2723;
    --civic:      #6fc4c6;
    --civic-deep: #9fdadb;
    --civic-soft: #4ba0a3;
    --brass:      #cda85f;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, ui-serif, serif;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* faint civic-grid wash — like grid paper on a planning desk */
  background-image:
    linear-gradient(var(--rule-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule-soft) 1px, transparent 1px);
  background-size: 2.5rem 2.5rem, 2.5rem 2.5rem;
  background-position: -1px -1px;
}

/* shared mono register for civic data, overlines, tags */
.overline, .register, .article-no, .office-no, .tag,
.office-tag, dl.defn dt, .ledger dt, .ledger dd, .foot-locale {
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

/* ── links & focus ─────────────────────────────────────────── */
a { color: var(--civic); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--civic-deep); }
:focus-visible { outline: 2px solid var(--civic); outline-offset: 3px; border-radius: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem; font-family: ui-monospace, monospace;
  font-size: 0.85rem; letter-spacing: 0.04em; text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ── layout frame ──────────────────────────────────────────── */
.frame {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 4rem);
}

section { padding-block: clamp(3.5rem, 8vw, 7rem); }

/* shared type tokens */
.overline {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--civic-soft);
  font-weight: 500;
}
.overline.light { color: rgba(255,255,255,0.72); }

h2 {
  font-weight: 600;
  font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -0.012em;
}
h3 {
  font-weight: 600;
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.4rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* article numbers — like clauses in a charter */
.article-no {
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-bottom: 0.9rem;
  margin-bottom: 2.4rem;
  border-bottom: 1px solid var(--rule);
  display: block;
}

/* ── masthead ──────────────────────────────────────────────── */
.masthead {
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 50;
}
.masthead .frame {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.1rem;
}
.wordmark {
  font-family: "Iowan Old Style", Palatino, Georgia, ui-serif, serif;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark .dot { color: var(--brass); }
.wordmark .seg:last-of-type { font-style: italic; }
.register {
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
@media (max-width: 36rem) { .register { display: none; } }

/* ── hero ──────────────────────────────────────────────────── */
.hero { padding-block: clamp(4rem, 11vw, 9rem) clamp(3.5rem, 8vw, 7rem); }
.hero .overline { margin-bottom: 1.6rem; }
.hero h1 {
  font-weight: 600;
  font-size: clamp(2.4rem, 1.4rem + 5vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  max-width: 16ch;
}
.hero h1 br + * { display: inline; }
.hero .lede {
  margin-top: 1.8rem;
  max-width: 46ch;
  font-size: clamp(1.1rem, 1rem + 0.55vw, 1.4rem);
  line-height: 1.55;
  color: var(--ink-soft);
}
.hero .lede strong { color: var(--ink); font-weight: 600; }
.hero .lede em { font-style: italic; color: var(--civic); }

.hero-meta {
  margin-top: 2.6rem;
  display: flex; flex-wrap: wrap; gap: 0.6rem;
}
.tag {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  background: var(--panel);
}

/* ── thesis ────────────────────────────────────────────────── */
.thesis { border-top: 1px solid var(--rule); background: var(--paper-2); }
.thesis-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 4vw, 3.5rem);
}
@media (min-width: 52rem) {
  .thesis-grid { grid-template-columns: 0.85fr 1.15fr; }
}
.thesis-head h2 { margin-top: 1rem; max-width: 14ch; }
.thesis-body p { margin-bottom: 1.1rem; max-width: 56ch; color: var(--ink-soft); }
.thesis-body strong { color: var(--ink); font-weight: 600; }

.defn {
  margin-top: 2rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.4rem;
}
.defn > div { padding-block: 0.7rem; border-bottom: 1px dotted var(--rule); }
.defn dt {
  font-size: 0.82rem;
  color: var(--brass);
  letter-spacing: 0.02em;
  margin-bottom: 0.2rem;
}
.defn dd { color: var(--ink-soft); font-size: 0.96rem; line-height: 1.5; }

/* ── how it works / offices ────────────────────────────────── */
.works { border-top: 1px solid var(--rule); }
.section-head { max-width: 50ch; margin-bottom: clamp(2.4rem, 5vw, 3.6rem); }
.section-head h2 { margin-top: 0.9rem; }
.section-sub { margin-top: 1.1rem; color: var(--ink-soft); }

.offices {
  list-style: none;
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
@media (min-width: 48rem) {
  .offices { grid-template-columns: repeat(3, 1fr); }
}
.office {
  background: var(--panel);
  padding: clamp(1.6rem, 3vw, 2.2rem);
  display: flex; flex-direction: column;
}
.office-no {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--civic-soft);
  margin-bottom: 1.6rem;
}
.office h3 { margin-bottom: 0.8rem; }
.office p { color: var(--ink-soft); font-size: 0.98rem; }
.office-tag {
  margin-top: auto;
  padding-top: 1.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brass);
}

/* ── Camden pilot — full-bleed civic band ──────────────────── */
.pilot {
  position: relative;
  color: #f3f1ea;
  overflow: hidden;
  isolation: isolate;
}
.pilot-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 140% at 85% -10%, rgba(154,123,63,0.32) 0%, transparent 55%),
    linear-gradient(160deg, var(--civic-deep) 0%, #0d2d30 55%, #0a2123 100%);
}
/* contour-line motif evoking a city map / planning survey */
.pilot-bg::after {
  content: "";
  position: absolute; inset: 0;
  opacity: 0.5;
  background-image:
    repeating-linear-gradient(56deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(-34deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 70px),
    radial-gradient(60% 80% at 20% 110%, rgba(111,196,198,0.18) 0%, transparent 60%);
}
.pilot-inner { max-width: 56rem; }
.pilot h2 {
  margin-top: 0.9rem;
  font-size: clamp(2.6rem, 1.6rem + 5vw, 5rem);
  letter-spacing: -0.03em;
}
.pilot-lede {
  margin-top: 1.4rem;
  max-width: 48ch;
  font-size: clamp(1.08rem, 1rem + 0.5vw, 1.35rem);
  color: rgba(243,241,234,0.82);
}

.ledger {
  margin-top: 2.6rem;
  border-top: 1px solid rgba(255,255,255,0.18);
}
.ledger .row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.15rem;
  padding-block: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
@media (min-width: 40rem) {
  .ledger .row {
    grid-template-columns: 12rem 1fr;
    align-items: baseline;
    gap: 1.5rem;
  }
}
.ledger dt {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(207,168,95,0.95);
}
.ledger dd {
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  color: rgba(243,241,234,0.92);
}

/* ── audience ──────────────────────────────────────────────── */
.audience { border-top: 1px solid var(--rule); background: var(--paper-2); }
.aud-grid {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  grid-template-columns: 1fr;
}
@media (min-width: 46rem) {
  .aud-grid { grid-template-columns: repeat(3, 1fr); }
}
.aud {
  padding-top: 1.4rem;
  border-top: 2px solid var(--civic);
}
.aud h3 { margin-bottom: 0.7rem; }
.aud p { color: var(--ink-soft); font-size: 0.98rem; }

/* ── principle / pull quote ────────────────────────────────── */
.principle {
  border-top: 1px solid var(--rule);
  text-align: center;
}
.principle blockquote {
  max-width: 30ch;
  margin-inline: auto;
}
.principle blockquote p {
  font-size: clamp(1.5rem, 1.1rem + 2.2vw, 2.6rem);
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.principle em { font-style: italic; color: var(--civic); }
.principle .attr {
  margin-top: 1.6rem;
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ── footer / colophon ─────────────────────────────────────── */
.colophon {
  background: var(--ink);
  color: #d9d4c8;
  padding-block: clamp(3rem, 6vw, 5rem);
}
@media (prefers-color-scheme: dark) {
  .colophon { background: #0d0c0b; }
}
.colophon .frame { max-width: var(--max); }
.foot-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 4vw, 3rem);
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
@media (min-width: 48rem) {
  .foot-top { grid-template-columns: 2fr 1fr 1fr; }
}
.foot-mark { color: #f3f1ea; font-size: 1.2rem; }
.foot-mark .dot { color: var(--brass); }
.foot-mark .seg:last-of-type { font-style: italic; }
.foot-brand p {
  margin-top: 1rem;
  max-width: 42ch;
  font-size: 0.92rem;
  line-height: 1.6;
  color: rgba(217,212,200,0.72);
}
.foot-col h2 {
  font-family: ui-monospace, monospace;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(217,212,200,0.55);
  margin-bottom: 1rem;
}
.foot-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.foot-col a {
  color: #e6e1d6;
  text-decoration: none;
  font-size: 0.95rem;
}
.foot-col a:hover { color: #fff; text-decoration: underline; text-underline-offset: 0.2em; }
.foot-col li:has(a[href^="https://"]) a {
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}

.foot-bottom {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  align-items: center;
  font-size: 0.78rem;
  color: rgba(217,212,200,0.5);
}
.foot-bottom a { color: rgba(217,212,200,0.78); }
.foot-bottom a:hover { color: #fff; }
.foot-locale { font-size: 0.72rem; letter-spacing: 0.08em; }

/* ═══ reveals — CSS scroll-driven, visible by default ═══ */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: reveal-in linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 42%;
    }
    @keyframes reveal-in {
      from { opacity: 0; transform: translateY(1.1rem); }
      to   { opacity: 1; transform: none; }
    }
  }
}
