/* ==========================================================================
   Statehouse design system: "Ink on paper".
   Software for agents, drawn by hand, shown as it is.

   Every component is on /dev/kit. Rules that are not obvious from the CSS:
   - Teal is the only action colour and the only hachure fill.
   - One full-bleed ink band per page. Everything else sits on paper.
   - One italic phrase per heading (the <em>), one hand-drawn mark per screen.
   - Sections open with a 2px ink rule. Plans, jobs and state rows are ruled
     lists, never tiles. Cards are white with a hairline and no shadow.
   - No gradients, glows, blurs, glass or grain. Nothing here uses them, and
     nothing added here should.
   ========================================================================== */

:root {
  --ink: #0C2B2B;
  --ink-2: #082020;
  --teal: #0B6463;
  --teal-light: #7FD6D2;
  --wash: #E2F0F0;
  --paper: #F6F4EE;
  --cream: #EEEBE3;
  --rule: #DAD6CA;
  --text: #122322;
  --muted: #4B5A58;
  --white: #FFFFFF;

  --display: 'Archivo', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --hand: 'Caveat', 'Bradley Hand', cursive;

  --radius: 10px;
  --radius-card: 16px;
  --wrap: 1180px;
  --gutter: 24px;
}
@media (max-width: 640px) { :root { --gutter: 16px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font-family: var(--sans); font-size: 19px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
@media (max-width: 640px) { body { font-size: 16.5px; } }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.wrap { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding-top: clamp(64px, 9vw, 120px); padding-bottom: clamp(64px, 9vw, 120px); }

/* ---- Type ---------------------------------------------------------------- */

.display, h1, h2, h3 {
  font-family: var(--display); font-weight: 800; color: var(--ink);
  letter-spacing: -0.035em; line-height: .95; margin: 0;
  text-wrap: balance;
}
.display { font-size: clamp(46px, 7.4vw, 96px); }
h1 { font-size: clamp(42px, 6.2vw, 80px); }
h2 { font-size: clamp(34px, 4.6vw, 58px); }
h3 { font-size: clamp(22px, 2.2vw, 28px); letter-spacing: -0.02em; line-height: 1.1; }
/* The one italic phrase per heading. */
.display em, h1 em, h2 em, h3 em {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  color: var(--teal); letter-spacing: -0.01em;
}
p { margin: 0 0 1em; }
.lede { font-size: clamp(18px, 1.7vw, 21px); color: var(--text); max-width: 62ch; }
.body { max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: 15px; }

/* Eyebrow: mono, teal, with a short rule in front. */
.eyebrow {
  display: flex; align-items: center; gap: 12px; margin: 0 0 18px;
  font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--teal);
}
.eyebrow::before { content: ""; width: 24px; height: 2px; background: currentColor; flex: none; }

/* Mono labels, figures and state codes. */
.mono { font-family: var(--mono); font-size: .82em; letter-spacing: .02em; }
.label {
  display: block; margin: 0 0 8px; font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}

/* ---- Rules --------------------------------------------------------------- */

.rule-top { border-top: 2px solid var(--ink); }
.hairline { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* ---- Buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px; border-radius: var(--radius);
  border: 2px solid var(--ink); background: var(--ink); color: var(--paper);
  font-family: var(--sans); font-size: 16.5px; font-weight: 600; line-height: 1.1;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn .arrow { transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(3px); }
.btn-teal { background: var(--teal); border-color: var(--teal); color: var(--white); }
.btn-teal:hover { background: #09524F; border-color: #09524F; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--white); border-color: var(--ink); }
.btn-block { display: flex; width: 100%; }
/* A label carrying a state's name can be long ("District of Columbia"), so
   on a phone it may wrap to two lines rather than run off the screen. The
   arrow stays on the last line with the words. */
@media (max-width: 640px) {
  .btn { white-space: normal; text-align: center; padding-top: 12px; padding-bottom: 12px; max-width: 100%; }
  .btn .arrow { flex: none; }
}
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
/* On the ink band. */
.band .btn { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.band .btn:hover { background: var(--white); border-color: var(--white); }
.band .btn-ghost { background: transparent; border-color: var(--paper); color: var(--paper); }
.band .btn-ghost:hover { background: rgba(246, 244, 238, .08); color: var(--paper); }

/* ---- Chips --------------------------------------------------------------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 15px;
  border-radius: var(--radius); border: 1.5px solid var(--ink); background: transparent;
  color: var(--ink); font-family: var(--sans); font-size: 15px; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.chip:hover { background: var(--white); }
.chip[aria-pressed="true"], .chip.is-on { background: var(--ink); color: var(--paper); }
.chip .code { font-family: var(--mono); font-size: 12px; font-weight: 500; margin-left: 6px; opacity: .7; }

/* ---- Fields -------------------------------------------------------------- */

.field { display: block; margin: 0 0 18px; }
.input {
  display: block; width: 100%; min-height: 54px; padding: 0 16px;
  border: 1.5px solid var(--rule); border-radius: var(--radius); background: var(--white);
  color: var(--text); font-family: var(--sans); font-size: 17px;
}
.input::placeholder { color: #8A938F; }
.input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--wash); }
.hint { margin: 6px 0 0; font-size: 14px; color: var(--muted); }

/* ---- Cards --------------------------------------------------------------- */

.card { background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius-card); padding: clamp(20px, 2.6vw, 30px); }
.card h3 { font-size: 24px; }
.wash { background: var(--wash); border-radius: var(--radius); padding: 16px 18px; }

/* ---- Ruled rows: state rows, plan lines, any "label: value" list --------- */

.rows { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.rows > li, .rows .row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 13px 0; border-bottom: 1px solid var(--rule);
}
.rows .k { color: var(--text); }
.rows .v { font-family: var(--mono); font-size: 14px; color: var(--teal); text-align: right; }
.rows.rule-top { border-top: 2px solid var(--ink); }
.disclaimer { margin: 14px 0 0; font-size: 14px; color: var(--muted); }

/* ---- Numbered jobs list -------------------------------------------------- */

.jobs { display: grid; grid-template-columns: 1fr 1fr; column-gap: 56px; margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--ink); }
.jobs li { display: grid; grid-template-columns: 52px 1fr 92px; gap: 12px; align-items: center; padding: 26px 0; border-bottom: 1px solid var(--rule); }
.jobs .n { font-family: var(--mono); font-size: 13px; color: var(--teal); }
.jobs h3 { margin: 0 0 4px; }
.jobs p { margin: 0; color: var(--muted); font-size: 16.5px; line-height: 1.45; }
.jobs .drawing { width: 92px; height: 92px; }
@media (max-width: 860px) {
  .jobs { grid-template-columns: 1fr; }
  .jobs li { grid-template-columns: 40px 1fr 72px; }
  .jobs .drawing { width: 72px; height: 72px; }
}

/* ---- Stats strip: real figures only -------------------------------------- */

.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); }
.stat { padding: 22px 22px 24px; border-left: 1px solid var(--rule); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat b { display: block; font-family: var(--display); font-weight: 800; font-size: clamp(34px, 3.6vw, 46px); letter-spacing: -0.035em; line-height: 1; color: var(--ink); }
.stat span { display: block; margin-top: 10px; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

/* ---- Figures: real screenshots, pasted flat ------------------------------ */

.fig { margin: 0; }
.fig-frame { border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.fig-bar { display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: var(--cream); border-bottom: 1px solid var(--rule); font-family: var(--mono); font-size: 12px; color: var(--muted); }
.fig-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--rule); }
.fig-bar span { margin-left: 8px; }
.fig img { width: 100%; height: auto; }
.fig figcaption { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
/* Three phone screens side by side, flat: no bezel, just a hairline. */
.phones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.phones img { border: 1px solid var(--rule); border-radius: 18px; background: var(--white); }

/* ---- Comparison table: what changes by state ----------------------------- */

.compare { width: 100%; border-collapse: collapse; border-top: 2px solid var(--ink); font-size: 16px; }
.compare th { padding: 12px 12px 12px 0; text-align: left; font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--rule); }
.compare td { padding: 13px 12px 13px 0; vertical-align: top; border-bottom: 1px solid var(--rule); }
.compare td:first-child { color: var(--muted); }
.table-scroll { overflow-x: auto; }

/* ---- Plans: ruled columns, not tiles ------------------------------------- */

.plans { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 2px solid var(--ink); }
.plan { padding: 30px 26px 34px; border-left: 1px solid var(--rule); }
.plan:first-child { border-left: 0; }
.plan.is-featured { background: var(--white); border-left-color: var(--rule); border-right: 1px solid var(--rule); }
.plan h3 { font-size: 26px; }
.plan .who { margin: 6px 0 18px; color: var(--muted); font-size: 16px; }
.price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price s { font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--muted); }
.price b { font-family: var(--display); font-weight: 800; font-size: clamp(40px, 4vw, 52px); letter-spacing: -0.035em; line-height: 1; color: var(--ink); }
.price span { color: var(--muted); font-size: 16px; }
.price-note { margin: 8px 0 22px; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--teal); }
.plan .rows { margin-bottom: 26px; }
.plan .rows li { justify-content: flex-start; font-size: 16px; }
@media (max-width: 860px) {
  .plans { grid-template-columns: 1fr; }
  .plan { border-left: 0; border-bottom: 1px solid var(--rule); padding-left: 0; padding-right: 0; }
  .plan.is-featured { padding-left: 20px; padding-right: 20px; border-right: 0; }
}

/* ---- The one ink band per page ------------------------------------------- */

.band { background: var(--ink); color: var(--paper); }
.band h2, .band h3, .band .display { color: var(--paper); }
.band em { color: var(--teal-light) !important; }
.band .eyebrow { color: var(--teal-light); }
.band .lede, .band p { color: #C9D6D3; }

/* ---- Drawings and hand marks --------------------------------------------- */

.drawing { display: block; height: auto; }
.drawing svg { width: 100%; height: auto; }
.mark { display: inline-block; vertical-align: middle; }
/* A margin note in the hand: drawings and notes only, never interface text. */
.note { font-family: var(--hand); font-weight: 500; font-size: 23px; line-height: 1.15; color: var(--teal); transform: rotate(-2deg); display: inline-block; }

/* ---- Progress steps (the state → trial flow) ----------------------------- */

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 14px 0 26px; }
.steps i { height: 4px; border-radius: 2px; background: var(--rule); }
.steps i.on { background: var(--teal); }

/* ---- Sticky bar, phones only --------------------------------------------- */

.stickybar { display: none; }
@media (max-width: 760px) {
  .stickybar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px;
    padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
    background: var(--paper); border-top: 1px solid var(--rule);
  }
  .stickybar .btn { min-height: 48px; padding: 0 12px; font-size: 15.5px; }
}

/* ---- The flow's own frame: logo, sign in, and nothing to wander off to --- */

.flow-head { border-bottom: 1px solid var(--rule); }
.flow-head .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 68px; }
.flow-head .brandmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.flow-head .brandmark svg { width: 30px; height: 30px; }
.flow-head .brandmark .word { font-family: var(--display); font-weight: 800; font-size: 17px; letter-spacing: .08em; }
.flow-head nav { display: flex; gap: 22px; font-size: 15.5px; font-weight: 600; }
.flow-head nav a { color: var(--ink); text-decoration: none; }
.flow-head nav a:hover { text-decoration: underline; }
.flow-foot { border-top: 1px solid var(--rule); padding: 28px 0 40px; font-size: 14.5px; color: var(--muted); }
.flow-foot .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }
.flow-foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.flow-foot a { color: var(--muted); }
.flow-main { padding: clamp(36px, 6vw, 72px) 0 clamp(56px, 8vw, 104px); }
.flow-narrow { max-width: 640px; }
.steps-label { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.steps-label + .steps { margin-top: 8px; }

/* ---- State picker ------------------------------------------------------- */

.picker-search { position: relative; margin-top: 10px; }
.state-index { margin-top: 30px; columns: 4 180px; column-gap: 32px; }
.state-index section { break-inside: avoid; margin: 0 0 22px; }
.state-index h3 { font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); margin: 0 0 6px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.state-index ul { margin: 0; padding: 0; list-style: none; }
.state-index li a { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--rule); color: var(--text); text-decoration: none; font-size: 16px; }
.state-index li a:hover { color: var(--teal); }
.state-index li a span { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.no-match { margin-top: 18px; color: var(--muted); }

/* ---- The state page / screen 2 ------------------------------------------ */

.state-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); grid-template-areas: "head card" "more card"; column-gap: clamp(32px, 5vw, 72px); row-gap: 18px; align-items: start; }
.state-hero .hero-head { grid-area: head; }
.state-hero .hero-card { grid-area: card; }
.state-hero .hero-more { grid-area: more; }
.state-hero .outline { max-width: 260px; margin-top: 28px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.card-head h2 { font-size: clamp(24px, 2.6vw, 30px); }
.card-head .mono { color: var(--teal); }
.rows .v { overflow-wrap: anywhere; }
.state-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); margin-top: clamp(56px, 8vw, 96px); }
.state-detail h2 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 18px; }
.plain { margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--ink); }
.plain li { padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 16.5px; }
.state-notes { margin-top: 22px; font-size: 16.5px; color: var(--muted); }
@media (max-width: 860px) {
  .state-hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "card" "more"; row-gap: 24px; }
  .state-detail { grid-template-columns: minmax(0, 1fr); }
  .state-hero .outline { max-width: 180px; }
  .rows > li { flex-direction: column; gap: 2px; align-items: flex-start; }
  .rows .v { text-align: left; }
}

/* ---- Screen 3: the sign-up ---------------------------------------------- */

.field > span { display: block; margin-bottom: 7px; font-size: 15px; font-weight: 600; color: var(--ink); }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; font-size: 15px; line-height: 1.5; margin: 6px 0 22px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--teal); }
.check a { color: var(--ink); }
.form-error { margin: 0 0 18px; padding: 12px 14px; border-radius: var(--radius); background: #FBEDEA; color: #7A2318; font-size: 15px; }
.form-error[hidden] { display: none; }
.state-pill { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius); background: var(--wash); font-size: 15.5px; margin: 0 0 24px; }
.state-pill a { color: var(--teal); font-size: 14px; }
