:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.1vw, 2.125rem);
  --text-2xl: clamp(2rem, 1.3rem + 2.4vw, 3.25rem);

  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem;
  --space-12: 3rem; --space-16: 4rem; --space-20: 5rem; --space-24: 6rem;

  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 10px;
  --wrap: 1140px;
  /* Brand colors sampled from the supplied HB 1374 community information PDF. */
  --brand-blue: #10355e;
  --brand-gold: #f2c230;
  --shadow: 0 1px 2px rgba(16, 53, 94, .05), 0 8px 24px -12px rgba(16, 53, 94, .18);
}

:root, [data-theme="light"] {
  --bg: #fafaf8;
  --bg-alt: #f0f3f7;
  --surface: #ffffff;
  --ink: #10355e;
  --ink-soft: #42536a;
  --ink-faint: #59677b;
  --line: #d8dce3;
  --line-strong: #9aaabe;
  --accent: #10355e;
  --accent-soft: #fdf7e4;
  --accent-ink: #10355e;
  --alert: #745300;
  --alert-soft: #fdf7e4;
  --law: #24558a;
  --law-soft: #e8f0fa;
  --hero-bg: #edf2f8;
}

[data-theme="dark"] {
  --bg: #0b192a;
  --bg-alt: #102139;
  --surface: #152b46;
  --ink: #f5f7fb;
  --ink-soft: #c8d3e2;
  --ink-faint: #aabbd1;
  --line: #314863;
  --line-strong: #6e86a3;
  --accent: #f2c230;
  --accent-soft: #34301e;
  --accent-ink: #f6d775;
  --alert: #f6d775;
  --alert-soft: #34301e;
  --law: #aacdf5;
  --law-soft: #1b3657;
  --hero-bg: #142f50;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: var(--space-5); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--bg); padding: var(--space-3) var(--space-4);
}
.skip:focus { left: var(--space-4); top: var(--space-2); }

a { color: var(--accent-ink); text-decoration-color: color-mix(in oklab, var(--accent-ink) 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.18; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); margin-bottom: var(--space-4); }
h3 { font-size: var(--text-lg); }
p { margin: 0 0 var(--space-4); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--brand-blue);
  backdrop-filter: blur(10px);
  border-bottom: 4px solid var(--brand-gold);
}
.header-inner { display: flex; align-items: center; gap: var(--space-6); min-height: 72px; }
.brand { display: flex; align-items: center; gap: var(--space-3); color: #ffffff; text-decoration: none; flex: 0 0 auto; }
.brand .mark { width: 30px; height: 30px; color: var(--brand-gold); flex: 0 0 auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-family: var(--serif); font-size: var(--text-sm); font-weight: 600; }
.brand-text span { font-size: var(--text-xs); color: #d8e3f0; letter-spacing: .06em; text-transform: uppercase; }
.site-nav { margin-left: auto; display: flex; gap: var(--space-5); flex-wrap: wrap; }
.site-nav a { font-size: var(--text-sm); color: #e6edf6; text-decoration: none; padding-block: var(--space-2); border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a.is-active { color: #ffffff; border-bottom-color: var(--brand-gold); }
.site-header :focus-visible { outline-color: var(--brand-gold); }
.theme-toggle {
  flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center;
  background: transparent; border: 1px solid #8ca4c1; border-radius: 50%;
  color: #ffffff; cursor: pointer;
}
.theme-toggle:hover { color: var(--brand-gold); border-color: var(--brand-gold); }
.theme-toggle svg { width: 19px; height: 19px; }
[data-theme="light"] .icon-moon, [data-theme="dark"] .icon-sun { display: none; }

/* Hero */
.hero { position: relative; padding-block: clamp(var(--space-16), 9vw, var(--space-24)) 0; background: linear-gradient(180deg, var(--hero-bg), var(--bg) 78%); }
.hero-inner { max-width: 900px; }
.eyebrow, .section-eyebrow {
  font-size: var(--text-xs); letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-ink); font-weight: 600; margin-bottom: var(--space-3);
}
.lede { font-size: var(--text-lg); color: var(--ink-soft); max-width: 68ch; margin-top: var(--space-5); line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-block: var(--space-8); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--text-sm); font-weight: 600; padding: var(--space-3) var(--space-5);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); text-decoration: none;
  transition: transform .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.btn-primary { background: var(--brand-blue); border-color: var(--brand-blue); color: #ffffff; box-shadow: inset 0 -3px 0 var(--brand-gold); }
[data-theme="dark"] .btn-primary { background: var(--brand-gold); border-color: var(--brand-gold); color: var(--brand-blue); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--space-5); margin: 0; padding-top: var(--space-6); border-top: 2px solid var(--brand-gold); }
.stat-row dt { font-size: var(--text-xs); color: var(--ink-faint); line-height: 1.4; }
.stat-row dd { margin: var(--space-1) 0 0; font-family: var(--serif); font-size: var(--text-xl); font-weight: 600; color: var(--accent-ink); }
.hero-note { font-size: var(--text-xs); color: var(--ink-faint); margin-top: var(--space-5); }
.ridge { margin-top: var(--space-10); line-height: 0; color: var(--accent); }
.ridge svg { width: 100%; height: clamp(60px, 8vw, 110px); display: block; fill: color-mix(in oklab, var(--accent) 12%, transparent); }

/* Bands */
.band { padding-block: clamp(var(--space-12), 7vw, var(--space-24)); }
.band-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.prose { max-width: 68ch; color: var(--ink-soft); }
.prose-source, .callout-source, .tl-src, .qa-src, .footnote { font-size: var(--text-xs); color: var(--ink-faint); }
.sub { margin-top: var(--space-10); margin-bottom: var(--space-3); }

.callout { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand-gold); border-radius: var(--radius); padding: var(--space-6); box-shadow: var(--shadow); max-width: 78ch; }
.callout h3 { margin-bottom: var(--space-3); }
.callout p:last-child { margin-bottom: 0; }
.callout-key { margin-top: var(--space-5); }

.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: var(--space-4); margin-top: var(--space-6); }
.pillar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); }
.pillar-num { display: block; font-family: var(--serif); font-size: var(--text-sm); color: var(--accent); font-weight: 700; letter-spacing: .05em; }
.pillar h4 { font-size: var(--text-base); margin-block: var(--space-2); }
.pillar p { font-size: var(--text-sm); color: var(--ink-soft); margin: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-8); margin-top: var(--space-6); }

/* Timeline */
.filters { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-block: var(--space-6); }
.chip {
  font-family: var(--sans); font-size: var(--text-xs); font-weight: 600; letter-spacing: .04em;
  padding: var(--space-2) var(--space-4); border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft);
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.is-active { background: var(--brand-gold); border-color: var(--brand-blue); color: var(--brand-blue); }
[data-theme="dark"] .chip.is-active { color: var(--brand-blue); border-color: var(--brand-gold); }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-item { position: relative; display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: var(--space-6); padding: 0 0 var(--space-8) var(--space-8); }
.tl-item::before {
  content: ""; position: absolute; left: 0; top: 7px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg-alt); border: 3px solid var(--line-strong);
}
.tl-item[hidden] { display: none; }
.tl-item.is-pivot::before { border-color: var(--alert); }
.tl-item.is-law::before { border-color: var(--law); }
.tl-item.is-current::before { border-color: var(--accent); background: var(--brand-gold); }
.tl-meta { display: flex; flex-direction: column; gap: var(--space-2); align-items: flex-start; }
.tl-meta time { font-family: var(--serif); font-size: var(--text-base); font-weight: 600; color: var(--ink); }
.tag {
  font-size: var(--text-xs); font-weight: 600; letter-spacing: .04em;
  padding: 2px var(--space-3); border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink-faint);
}
.tag-vote { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.tag-pivot { background: var(--alert-soft); border-color: transparent; color: var(--alert); }
.tag-law { background: var(--law-soft); border-color: transparent; color: var(--law); }
.tag-current { background: var(--accent); border-color: transparent; color: oklch(98% 0.01 95); }
[data-theme="dark"] .tag-current { color: var(--brand-blue); }
.tl-body h3 { margin-bottom: var(--space-2); }
.tl-body p { color: var(--ink-soft); max-width: 66ch; }
.tl-body p:last-child { margin-bottom: 0; }
.motions { margin: var(--space-4) 0; padding-left: var(--space-5); display: grid; gap: var(--space-3); }
.motions li { color: var(--ink-soft); max-width: 64ch; }
.motions strong { color: var(--ink); }
.tally { display: inline-block; margin-top: var(--space-1); font-size: var(--text-xs); font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); padding: 1px var(--space-2); border-radius: 4px; }

/* Milestones table */
.table-scroll { overflow-x: auto; margin-top: var(--space-6); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.milestones { width: 100%; border-collapse: collapse; min-width: 620px; font-size: var(--text-sm); }
.milestones th, .milestones td { text-align: left; padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--line); vertical-align: top; }
.milestones thead th { font-family: var(--sans); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); background: var(--bg-alt); }
.milestones tbody tr:last-child td { border-bottom: 0; }
.milestones td:first-child { font-weight: 600; white-space: nowrap; }
.milestones td:nth-child(2) { color: var(--ink-soft); }
.pill { display: inline-block; font-size: var(--text-xs); font-weight: 600; padding: 2px var(--space-3); border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--line); color: var(--ink-faint); white-space: nowrap; }
.pill-ok { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.pill-req { background: var(--alert-soft); border-color: transparent; color: var(--alert); }

/* Documents */
.doc-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); margin-block: var(--space-6); }
.search { display: flex; align-items: center; gap: var(--space-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-3) var(--space-4); flex: 1 1 320px; max-width: 460px; }
.search svg { width: 18px; height: 18px; color: var(--ink-faint); flex: 0 0 auto; }
.search input { border: 0; background: transparent; color: var(--ink); font: inherit; font-size: var(--text-sm); width: 100%; }
.search input:focus { outline: none; }
.doc-count { font-size: var(--text-xs); color: var(--ink-faint); margin: 0; }
.doc-group[hidden] { display: none; }
.docs { list-style: none; margin: 0 0 var(--space-6); padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(305px, 1fr)); gap: var(--space-4); }
.doc > a {
  display: grid; gap: var(--space-2); height: 100%; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--space-5); transition: border-color .15s ease, transform .15s ease;
}
.doc > a:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.doc-type { justify-self: start; font-size: var(--text-xs); font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent-soft); padding: 2px var(--space-2); border-radius: 4px; }
.doc-name { font-family: var(--serif); font-size: var(--text-base); font-weight: 600; line-height: 1.3; }
.doc-desc { font-size: var(--text-sm); color: var(--ink-soft); }
.doc[hidden] { display: none; }
.doc.is-pending > a { border-style: dashed; }
.doc.is-pending > a:hover { transform: none; }
.doc.is-pending .doc-type { background: var(--bg-alt); color: var(--ink-faint); }
.doc.is-pending .doc-name { color: var(--ink-soft); }

/* FAQ */
.faq { margin-top: var(--space-6); display: grid; gap: var(--space-3); max-width: 900px; }
.qa { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.qa[open] { border-color: var(--line-strong); box-shadow: var(--shadow); }
.qa summary {
  display: flex; align-items: flex-start; gap: var(--space-4); cursor: pointer;
  padding: var(--space-5); list-style: none; font-family: var(--serif); font-size: var(--text-lg); font-weight: 600;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: ""; margin-left: auto; flex: 0 0 auto; width: 11px; height: 11px; margin-top: 8px;
  border-right: 2px solid var(--ink-faint); border-bottom: 2px solid var(--ink-faint);
  transform: rotate(45deg); transition: transform .2s ease;
}
.qa[open] summary::after { transform: rotate(-135deg); }
.qa summary:hover { color: var(--accent-ink); }
.q-num { flex: 0 0 auto; width: 26px; height: 26px; margin-top: 3px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-family: var(--sans); font-size: var(--text-xs); font-weight: 700; }
.q-text { flex: 1 1 auto; }
.qa-body { padding: 0 var(--space-5) var(--space-5) calc(var(--space-5) + 26px + var(--space-4)); }
.qa-body p { color: var(--ink-soft); max-width: 68ch; }
.qa-body strong { color: var(--ink); }
.tick { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: grid; gap: var(--space-3); max-width: 68ch; }
.tick li { position: relative; padding-left: var(--space-6); color: var(--ink-soft); }
.tick li::before { content: ""; position: absolute; left: 0; top: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.tick strong { color: var(--ink); }

/* Tax-savings scenario, isolated from document and timeline controls. */
.tax-notice { border-left: 4px solid var(--brand-gold); background: var(--accent-soft); padding: var(--space-5); margin-block: var(--space-6); font-size: var(--text-sm); }
.tax-notice strong { display: block; margin-bottom: var(--space-2); }
.tax-layout { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.65fr); gap: var(--space-8); align-items: start; }
.tax-layout > * { min-width: 0; }
.tax-controls { padding: var(--space-6); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.tax-controls label { display: block; font-weight: 600; font-size: var(--text-sm); margin-bottom: var(--space-2); }
.tax-controls input, .tax-controls select { width: 100%; min-height: 48px; padding: var(--space-3); border: 1px solid var(--line-strong); border-radius: 4px; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: var(--text-base); font-variant-numeric: tabular-nums; }
.tax-help { font-size: var(--text-xs); color: var(--ink-soft); line-height: 1.6; margin-block: var(--space-2) var(--space-4); }
.tax-presets { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-6); }
.tax-presets button { min-height: 44px; padding: var(--space-2) var(--space-3); border: 1px solid var(--line-strong); border-radius: 4px; color: var(--ink); background: var(--bg); font: inherit; font-size: var(--text-xs); cursor: pointer; }
.tax-presets button:hover { border-color: var(--accent); }
.tax-presets button[aria-pressed="true"] { background: var(--brand-gold); color: var(--brand-blue); border-color: var(--brand-gold); }
.tax-privacy { margin-top: var(--space-5); margin-bottom: 0; }
.tax-error { padding: var(--space-3); border: 2px solid var(--alert); background: var(--alert-soft); font-size: var(--text-sm); margin-top: var(--space-4); }
.tax-controls [aria-invalid="true"] { border: 2px solid var(--alert); }
.tax-spotlight { padding: var(--space-6); border-top: 4px solid var(--brand-gold); background: var(--brand-blue); color: #fff; margin-bottom: var(--space-6); border-radius: var(--radius); }
.tax-spotlight p { font-size: var(--text-sm); margin-bottom: var(--space-2); }
.tax-spotlight strong { display: block; font-size: var(--text-xl); font-variant-numeric: tabular-nums; line-height: 1.3; margin-bottom: var(--space-3); color: var(--brand-gold); }
.tax-spotlight p:last-child { margin-bottom: 0; color: #e6edf6; }
.tax-results h3 { font-family: var(--sans); }
.tax-table { width: 100%; border-collapse: collapse; font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.tax-table th, .tax-table td { padding: var(--space-3); border-bottom: 1px solid var(--line); text-align: right; }
.tax-table th:first-child { text-align: left; }
.tax-table td { white-space: nowrap; }
.tax-table thead th { font-weight: 600; vertical-align: bottom; color: var(--ink-soft); }
.tax-table tbody th { font-weight: 500; }
.tax-table .tax-selected { background: var(--accent-soft); }
.tax-table .tax-selected th { font-weight: 700; }
.tax-method { border-top: 1px solid var(--line); margin-top: var(--space-8); padding-top: var(--space-5); }
.tax-method summary { cursor: pointer; font-weight: 600; min-height: 44px; }
.tax-method p, .tax-method ol { font-size: var(--text-sm); color: var(--ink-soft); max-width: 85ch; }
.tax-method .table-scroll { margin-bottom: var(--space-5); }
.tax-table caption { text-align: left; font-weight: 600; padding-bottom: var(--space-3); }
#tax-results[hidden], #tax-error[hidden] { display: none; }
@media (max-width: 1000px) {
  .tax-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .tax-table { min-width: 540px; }
  .tax-controls, .tax-spotlight { padding: var(--space-5); }
}

/* CTA + footer */
.band-cta { background: var(--bg-alt); border-top: 1px solid var(--line); }
.cta-inner { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--space-10); align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-6); box-shadow: var(--shadow); }
.contact h3 { margin-bottom: var(--space-4); }
.contact p { font-size: var(--text-sm); color: var(--ink-soft); }
.contact p:last-child { margin-bottom: 0; }
.site-footer { background: var(--brand-blue); color: #ffffff; border-top: 4px solid var(--brand-gold); padding-block: var(--space-10); }
[data-theme="dark"] .site-footer { background: var(--brand-blue); color: #ffffff; }
.footer-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--space-8); }
.site-footer p { margin: 0; }
.site-footer .footnote { color: #d8e3f0; max-width: 74ch; }

@media (max-width: 860px) {
  .header-inner { flex-wrap: wrap; gap: var(--space-3); padding-block: var(--space-3); }
  .site-nav {
    order: 3; width: 100%; gap: var(--space-4); flex-wrap: nowrap;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-bottom: 2px;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { white-space: nowrap; }
  .theme-toggle { margin-left: auto; }
  .cta-inner, .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .tl-item { grid-template-columns: 1fr; gap: var(--space-3); padding-left: var(--space-6); }
  .tl-meta { flex-direction: row; align-items: center; flex-wrap: wrap; gap: var(--space-3); }
  .qa summary { font-size: var(--text-base); }
  .qa-body { padding-left: var(--space-5); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
@media print {
  .site-header, .theme-toggle, .filters, .doc-tools, .hero-actions, .ridge { display: none; }
  .qa-body { display: block !important; }
  body { background: #fff; color: #000; }
}
