/* =========================================================
   SB 79 Palo Alto — civic broadside × Caltrain wayfinding
   ========================================================= */

:root {
  /* Paper & ink */
  --paper:      #f3eada;
  --paper-2:    #ebe0c7;
  --paper-3:    #e3d5b3;
  --ink:        #181613;
  --ink-2:      #4f4837;
  --ink-3:      #7a715b;
  --rule:       #c7b890;
  --rule-soft:  #ddd0ad;

  /* Civic accents */
  --red:        #b8392c;     /* Caltrain / civic red — primary accent */
  --red-deep:   #8a2a20;
  --red-soft:   #f1d3cd;
  --navy:       #1d3756;     /* depth, secondary emphasis */
  --navy-soft:  #d8e1ee;
  --sage:       #4a7155;     /* "into law" / map zones */
  --sage-soft:  #d8e4ce;
  --amber:      #c98a2b;

  /* Type system */
  --font-display: "Fraunces", "Times New Roman", Georgia, serif;
  --font-body:    "Newsreader", "Iowan Old Style", "Charter", Georgia, serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Layout */
  --max:        66rem;
  --max-wide:   80rem;
  --radius:     6px;
  --radius-lg:  14px;
  --shadow:     0 1px 0 rgba(24,22,19,0.06), 0 14px 28px -16px rgba(24,22,19,0.18);
  --shadow-lift: 0 1px 0 rgba(24,22,19,0.08), 0 22px 36px -18px rgba(24,22,19,0.24);

  /* Motion */
  --ease:       cubic-bezier(.22,.61,.36,1);

  /* Aliases for legacy var names referenced by inline styles in some HTML */
  --bg:         var(--paper);
  --bg-alt:     var(--paper-2);
  --ink-soft:   var(--ink-2);
  --accent:     var(--red);
  --accent-soft:var(--red-soft);
  --accent-ink: var(--red-deep);
  --warn:       var(--amber);
  --link:       var(--navy);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:    #15181f;
    --paper-2:  #1c2028;
    --paper-3:  #242935;
    --ink:      #ece4d0;
    --ink-2:    #b8b09a;
    --ink-3:    #847d6c;
    --rule:     #383d4a;
    --rule-soft:#2a2f3a;
    --red:      #d96b5a;
    --red-deep: #f0907f;
    --red-soft: #3a1c17;
    --navy:     #93b3df;
    --navy-soft:#1c2740;
    --sage:     #87b196;
    --sage-soft:#1f3128;
    --amber:    #e8b462;
    --shadow:   0 1px 0 rgba(0,0,0,0.4), 0 14px 28px -16px rgba(0,0,0,0.6);
    --shadow-lift: 0 1px 0 rgba(0,0,0,0.5), 0 22px 36px -18px rgba(0,0,0,0.8);
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-optical-sizing: auto;
  font-size: 18px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(1200px 480px at 90% -10%, color-mix(in oklab, var(--red) 9%, transparent) 0%, transparent 60%),
    radial-gradient(900px 540px at -10% 110%, color-mix(in oklab, var(--navy) 8%, transparent) 0%, transparent 55%);
  background-attachment: fixed;
}

/* Subtle paper grain — keeps backgrounds from looking flat */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.09  0 0 0 0 0.085  0 0 0 0 0.075  0 0 0 0.4 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
@media (prefers-color-scheme: dark) {
  body::before { mix-blend-mode: screen; opacity: 0.18; }
}

a {
  color: var(--navy);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.18s var(--ease);
}
a:hover {
  color: var(--red);
  text-decoration-thickness: 2px;
}

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 0;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.08;
  color: var(--ink);
  margin: 1.8em 0 0.5em;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  font-variation-settings: "opsz" 144, "SOFT" 50, "WONK" 1;
  letter-spacing: -0.025em;
  margin-top: 0.3em;
}
h2 {
  font-size: clamp(1.45rem, 2.4vw, 1.8rem);
  font-variation-settings: "opsz" 60, "SOFT" 40, "WONK" 0;
  margin-top: 2em;
  position: relative;
  padding-top: 0.45em;
}
h2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 2.4rem;
  height: 3px;
  background: var(--red);
  border-radius: 2px;
}
h3 {
  font-size: 1.18rem;
  font-variation-settings: "opsz" 36, "SOFT" 30, "WONK" 0;
  font-weight: 600;
}

p, ul, ol { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; }
li + li { margin-top: 0.35em; }

p strong, li strong { color: var(--ink); font-weight: 600; }

em {
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 50, "WONK" 1;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.6em 0;
  position: relative;
}

code, kbd, samp {
  font-family: var(--font-mono);
  background: color-mix(in oklab, var(--paper-2) 80%, var(--rule) 20%);
  padding: 0.05em 0.4em;
  border-radius: 3px;
  font-size: 0.86em;
  letter-spacing: -0.01em;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

/* ---- Layout ---- */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.4rem;
  position: relative;
  z-index: 2;
}
.wide { max-width: var(--max-wide); }
main { padding: 2.5rem 0 5rem; position: relative; z-index: 2; }

/* ---- Top nav ---- */
.site-nav {
  border-bottom: 1px solid var(--rule);
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
}
.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}
.brand {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 60, "SOFT" 30, "WONK" 1;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--red) 18%, transparent);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.brand:hover .brand-mark {
  transform: rotate(-12deg) scale(1.05);
  box-shadow: 0 0 0 5px color-mix(in oklab, var(--red) 22%, transparent);
}
.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.2rem;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 14, "SOFT" 20, "WONK" 0;
  font-size: 0.96rem;
  font-weight: 500;
}
.nav-links a {
  color: var(--ink-2);
  text-decoration: none;
  position: relative;
  padding: 0.15em 0.05em;
  transition: color 0.18s var(--ease);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav-links a:hover, .nav-links a.is-active {
  color: var(--ink);
}
.nav-links a:hover::after, .nav-links a.is-active::after {
  transform: scaleX(1);
}

@media (max-width: 720px) {
  .nav-links { gap: 0.85rem; font-size: 0.88rem; flex-wrap: wrap; justify-content: flex-end; }
  .brand { font-size: 0.95rem; }
  .brand-mark { width: 24px; height: 24px; font-size: 0.65rem; }
}

/* ---- Hero ---- */
.hero {
  position: relative;
  padding: 3.5rem 0 2.6rem;
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 420px at 92% 18%, color-mix(in oklab, var(--red) 14%, transparent) 0%, transparent 60%),
    radial-gradient(700px 380px at 4% 98%, color-mix(in oklab, var(--sage) 14%, transparent) 0%, transparent 60%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr);
  gap: 2rem;
  align-items: start;
}

.hero-numeral {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  user-select: none;
}
.hero-79 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  font-weight: 600;
  font-size: clamp(8rem, 22vw, 17rem);
  line-height: 0.82;
  letter-spacing: -0.06em;
  color: var(--red);
  text-shadow:
    0 1px 0 color-mix(in oklab, var(--red-deep) 60%, transparent),
    0 0 60px color-mix(in oklab, var(--red) 30%, transparent);
  display: inline-block;
  transform-origin: bottom left;
  animation: heroNumeralIn 0.9s var(--ease) both;
}
.hero-stamp {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
  border-top: 1px solid var(--rule);
  padding: 0.5rem 0 0;
  align-self: stretch;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  animation: fadeUp 0.9s var(--ease) 0.3s both;
}
.hero-stamp span:last-child { color: var(--red); }

.hero-text { animation: fadeUp 0.9s var(--ease) 0.15s both; }
.hero h1 {
  font-size: clamp(2.2rem, 4.6vw, 3.6rem);
  margin-top: 0.3em;
  margin-bottom: 0.5em;
  max-width: 22ch;
}
.hero h1 em {
  color: var(--red-deep);
  display: block;
}
@media (prefers-color-scheme: dark) {
  .hero h1 em { color: var(--red); }
}

.hero .lede {
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 1.5vw, 1.22rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 56ch;
  margin-bottom: 1.6rem;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--ink-2);
  font-weight: 500;
  margin: 0 0 1rem;
}
.kicker::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--red);
  display: inline-block;
}

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; gap: 0.6rem; }
  .hero-numeral { order: 2; flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 1rem; }
  .hero-79 { font-size: clamp(6rem, 28vw, 11rem); }
  .hero-stamp { border-top: 0; padding: 0; align-self: flex-end; flex: 1; flex-direction: column; gap: 0.2rem; align-items: flex-end; }
}

/* ---- Station strip (recurring transit-line motif) ---- */
.station-strip {
  position: relative;
  padding: 1.4rem 0 0.4rem;
  margin-top: 1.6rem;
}
.station-strip .container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}
.station-strip-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.station-strip-label .right { color: var(--red); }
.station-line {
  position: relative;
  margin-top: 0.4rem;
  margin-bottom: 0.2rem;
}
.station-line::before {
  content: "";
  position: absolute;
  left: 12%; right: 12%;
  top: 7px;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--red) 8%,
    var(--red) 92%,
    transparent 100%);
  z-index: 0;
}
.station-line-stops {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  position: relative;
  z-index: 1;
}
.station-stop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  position: relative;
}
.station-stop .dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--red);
  box-shadow: 0 0 0 5px var(--paper);
  transition: transform 0.35s var(--ease), background 0.35s var(--ease);
}
.station-stop:hover .dot {
  transform: scale(1.2);
  background: var(--red);
}
.station-stop .name {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 14, "SOFT" 20, "WONK" 0;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.station-stop .meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.station-stop .meta strong { color: var(--red); font-weight: 600; }

@media (max-width: 540px) {
  .station-stop .name { font-size: 0.82rem; }
  .station-stop .meta { font-size: 0.62rem; letter-spacing: 0.06em; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.3rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
  font-variation-settings: "opsz" 14, "SOFT" 20, "WONK" 0;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.005em;
  text-decoration: none;
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease), color 0.25s var(--ease);
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: "→";
  font-family: var(--font-mono);
  font-weight: 400;
  transition: transform 0.3s var(--ease);
}
.btn:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -12px color-mix(in oklab, var(--red) 60%, transparent);
}
.btn:hover::after { transform: translateX(3px); }
.btn:active { transform: translateY(0); }

.btn.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
}
.btn.btn-ghost::after { content: ""; }
.btn.btn-ghost:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.btn-row {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ---- Cards (ticket-stub aesthetic) ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  gap: 1.1rem;
  margin: 2rem 0 2.5rem;
  counter-reset: card;
}
.card {
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.6rem 1.4rem 1.3rem;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease), background 0.35s var(--ease);
  overflow: hidden;
  isolation: isolate;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 8px,
      color-mix(in oklab, var(--rule) 30%, transparent) 8px,
      color-mix(in oklab, var(--rule) 30%, transparent) 9px
    );
  opacity: 0;
  pointer-events: none;
  z-index: -1;
  transition: opacity 0.4s var(--ease);
}
a.card::after {
  counter-increment: card;
  content: counter(card, decimal-leading-zero);
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  font-weight: 500;
  z-index: 1;
  transition: color 0.3s var(--ease);
}
a.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--ink);
  text-decoration: none;
  background: var(--paper);
}
a.card:hover::after { color: var(--red); }
a.card:hover::before { opacity: 0.6; }
.card h3 {
  margin: 0.3rem 0 0.4em;
  font-size: 1.25rem;
  font-variation-settings: "opsz" 36, "SOFT" 40, "WONK" 1;
}
.card p {
  color: var(--ink-2);
  margin: 0 0 0.5em;
  font-size: 0.97rem;
  line-height: 1.55;
}
.card p:last-child { margin-bottom: 0; }
.card .arrow { color: var(--red); font-weight: 700; }

/* ---- Tier table (station boarding sign) ---- */
.table-wrap {
  overflow-x: auto;
  margin: 1.6em 0 2em;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-2);
}
table.tiers {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 14, "SOFT" 30, "WONK" 0;
  font-size: 0.96rem;
}
table.tiers th, table.tiers td {
  text-align: left;
  padding: 0.95em 1.05em;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}
table.tiers th {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 0;
}
table.tiers tr:last-child td { border-bottom: 0; }
table.tiers tr:nth-child(even) td { background: color-mix(in oklab, var(--paper-2) 50%, var(--paper) 50%); }
table.tiers tr:hover td {
  background: color-mix(in oklab, var(--red) 8%, var(--paper-2) 92%);
}
table.tiers td.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 0.94rem;
  color: var(--ink);
  font-weight: 500;
}
table.tiers th.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---- Callout (manila pull-quote) ---- */
.callout {
  position: relative;
  background: var(--paper-2);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--red);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.2rem 1.4rem 1.2rem 1.5rem;
  margin: 1.8em 0;
  font-size: 1.02rem;
  line-height: 1.55;
}
.callout::before {
  content: "“";
  position: absolute;
  top: -0.4rem;
  left: 1rem;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  font-size: 4rem;
  color: var(--red);
  line-height: 1;
  opacity: 0.18;
  pointer-events: none;
}
.callout strong { color: var(--ink); font-weight: 600; }
.callout a { color: var(--red); }

.warning {
  background: color-mix(in oklab, var(--amber) 14%, var(--paper-2) 86%);
  color: var(--ink);
  border: 1px solid color-mix(in oklab, var(--amber) 50%, var(--rule) 50%);
  border-left: 4px solid var(--amber);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.2rem;
  margin: 1.6em 0;
  font-size: 0.97rem;
}

/* ---- Ring diagram ---- */
.ring-figure {
  display: flex;
  justify-content: center;
  margin: 2em 0;
  padding: 1.2rem;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.ring-figure svg { max-width: 100%; height: auto; }

/* ---- Timeline (transit track) ---- */
.timeline {
  list-style: none;
  padding: 0 0 0 0.4rem;
  margin: 1.8em 0;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0.6em;
  bottom: 0.6em;
  width: 2px;
  background:
    linear-gradient(var(--rule) 50%, transparent 0)
    0 0 / 2px 8px repeat-y;
}
.timeline li {
  padding: 0.55em 0 0.55em 1.6em;
  position: relative;
  margin: 0;
  line-height: 1.55;
}
.timeline li::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--red);
  position: absolute;
  left: -1px;
  top: 0.85em;
  z-index: 1;
  transition: transform 0.35s var(--ease), background 0.35s var(--ease);
}
.timeline li:hover::before {
  background: var(--red);
  transform: scale(1.18);
}
.timeline .when {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--red);
  display: block;
  margin-bottom: 0.15em;
}

/* ---- Q&A ---- */
.qa { margin: 1.8em 0; }
.qa details {
  border-bottom: 1px solid var(--rule);
  padding: 1em 0;
  transition: padding 0.25s var(--ease);
}
.qa summary {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 24, "SOFT" 30, "WONK" 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  font-size: 1.08rem;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  letter-spacing: -0.005em;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::before {
  content: "+";
  flex: 0 0 1.4em;
  width: 1.4em;
  height: 1.4em;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--rule);
  color: var(--red);
  font-family: var(--font-mono);
  font-weight: 500;
  text-align: center;
  line-height: 1.25em;
  font-size: 0.95rem;
  margin-top: 0.05em;
  transition: transform 0.35s var(--ease), background 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.qa details[open] summary::before {
  content: "–";
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  transform: rotate(180deg);
}
.qa details > *:not(summary) { margin-top: 0.7em; color: var(--ink-2); padding-left: 2.1em; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2.4rem 0;
  font-size: 0.92rem;
  color: var(--ink-2);
  background:
    linear-gradient(180deg, transparent 0%, color-mix(in oklab, var(--paper-2) 70%, transparent) 100%);
  margin-top: 2rem;
}
.site-footer a { color: var(--ink-2); }
.site-footer a:hover { color: var(--red); }
.site-footer .row {
  display: flex; flex-wrap: wrap; gap: 1.2rem; justify-content: space-between; align-items: center;
}
.site-footer .row > div:first-child {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---- Skip link & focus ---- */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: 0.5em 0.9em; border-radius: 0 0 8px 0;
  z-index: 100;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.skip:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Source list ---- */
.sources { font-size: 0.92rem; color: var(--ink-2); }
.sources li { margin-bottom: 0.45em; }
.sources a { color: var(--ink-2); }
.sources a:hover { color: var(--red); }

.sources-grouped {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.6rem;
  margin: 1.5em 0 2em;
}
.sources-grouped .source-group h3 {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  margin: 0 0 0.6em;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--red);
  font-weight: 500;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--rule);
}
.sources-grouped ul { padding-left: 0; list-style: none; margin: 0; }
.sources-grouped li { margin-bottom: 0.5em; line-height: 1.4; }

/* ---- Update stamp ---- */
.update-stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--paper);
  background: var(--ink);
  border: 0;
  padding: 0.25em 0.6em;
  border-radius: 999px;
  margin-left: 0.6em;
  vertical-align: middle;
}

/* ---- Tier-1 badge (used inline in cards / callouts) ---- */
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--red);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 0.25em 0.6em;
  border-radius: 999px;
  white-space: nowrap;
}
.tier-badge::before {
  content: "";
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
}

/* ---- Station map (palo-alto.html) ---- */
.station-map {
  margin: 1.8em 0 2em;
  padding: 1.1rem 1.1rem 0.9rem;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.station-map figcaption {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 24, "SOFT" 30, "WONK" 0;
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink-2);
  margin: 0 0 0.6em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.station-map figcaption strong { color: var(--ink); }
.station-map svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 320px;
}
.station-map .map-caption {
  margin: 0.6em 0 0;
  font-size: 0.92rem;
  color: var(--ink-2);
  line-height: 1.5;
}

/* ---- FAQ table of contents ---- */
.faq-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.6em 0 2em;
  padding: 1em 1.1em;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}
.faq-toc a {
  color: var(--ink-2);
  text-decoration: none;
  padding: 0.35em 0.85em;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: all 0.25s var(--ease);
}
.faq-toc a:hover {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
}

/* ---- FAQ section divider ---- */
.faq-section {
  margin-top: 3em;
  padding-top: 1.4em;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 5rem;
}
.faq-section:first-of-type { border-top: 0; padding-top: 0; }
.faq-section h2 { margin-top: 0.4em; }
.faq-section .section-intro {
  color: var(--ink-2);
  font-style: italic;
  margin-top: 0;
  font-size: 1rem;
}

/* ---- Q&A: TL;DR + sources lines ---- */
.qa details > .tldr {
  background: color-mix(in oklab, var(--red) 6%, var(--paper-2) 94%);
  border-left: 3px solid var(--red);
  padding: 0.75em 1em;
  border-radius: 0 8px 8px 0;
  font-size: 0.98rem;
  color: var(--ink);
  margin-top: 0.9em;
  margin-left: 2.1em;
  padding-left: 1em;
  line-height: 1.55;
}
.qa details > .tldr strong { color: var(--red-deep); }
@media (prefers-color-scheme: dark) {
  .qa details > .tldr strong { color: var(--red); }
}
.qa details > .more {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-3);
  border-top: 1px dashed var(--rule);
  padding-top: 0.7em;
  margin-top: 0.9em;
  letter-spacing: 0.02em;
}
.qa details > .more strong {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  color: var(--red);
  display: inline-block;
  margin-right: 0.5em;
  font-weight: 500;
}
.qa details > .more a { color: var(--ink-2); }
.qa details > .more a:hover { color: var(--red); }
.qa details[open] { padding-bottom: 1.4em; }
.qa details[id] { scroll-margin-top: 5rem; }

/* ---- Band-stats pills under each station map ---- */
.band-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  list-style: none;
  margin: 0.7em 0 0.5em;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}
.band-stats li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2em 0.7em 0.2em 0.2em;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 999px;
  margin: 0;
}
.band-stats .band {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 0.25em 0.65em;
  border-radius: 999px;
  color: #fff;
}
.band-stats .band-adj { background: #8a2a20; }
.band-stats .band-quarter { background: var(--red); }
.band-stats .band-half { background: color-mix(in oklab, var(--red) 60%, var(--paper) 40%); color: var(--ink); }
.band-stats .band-count { color: var(--ink); font-weight: 500; }
.band-stats .band-floor { color: var(--ink-3); }

/* ---- Parcel lookup widget ---- */
.parcel-lookup {
  margin: 2.4em 0 2em;
  padding: 1.5rem 1.4rem 1.4rem;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.parcel-lookup::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: var(--red);
}
.parcel-lookup h3 {
  margin: 0 0 0.3em;
  font-size: 1.2rem;
  font-variation-settings: "opsz" 36, "SOFT" 40, "WONK" 1;
}
.parcel-lookup-help {
  font-size: 0.93rem;
  color: var(--ink-2);
  margin: 0 0 1em;
}
.parcel-lookup-input {
  display: flex;
  align-items: center;
  margin-bottom: 0.6em;
}
.parcel-lookup-input input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 1rem;
  padding: 0.7em 0.95em;
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--rule);
  border-radius: 6px;
  letter-spacing: -0.005em;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.parcel-lookup-input input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--red) 22%, transparent);
}
.parcel-result {
  margin: 0.4em 0 0.6em;
  min-height: 0;
}
.parcel-status {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-3);
  margin: 0.6em 0;
}
.parcel-miss {
  font-size: 0.95rem;
  color: var(--ink-2);
  background: var(--paper);
  border: 1px dashed var(--rule);
  border-radius: 6px;
  padding: 0.7em 0.95em;
  margin: 0.6em 0;
}
.parcel-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--red);
  border-radius: 0 6px 6px 0;
  padding: 0.95em 1.1em 1em;
  margin: 0.6em 0;
}
.parcel-card .parcel-apn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 0.2em;
  font-weight: 600;
}
.parcel-card .parcel-address {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 36, "SOFT" 40, "WONK" 1;
  font-weight: 600;
  font-size: 1.18rem;
  margin: 0 0 0.5em;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.parcel-card .parcel-band {
  font-size: 0.95rem;
  margin: 0.2em 0;
  color: var(--ink);
}
.parcel-card .parcel-band strong { color: var(--red); }
.parcel-card .parcel-zone,
.parcel-card .parcel-height,
.parcel-card .parcel-meta {
  font-size: 0.92rem;
  margin: 0.3em 0;
  color: var(--ink-2);
}
.parcel-card .parcel-height strong { color: var(--ink); }
.parcel-card .parcel-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  border-top: 1px dashed var(--rule);
  padding-top: 0.6em;
  margin-top: 0.7em;
}
.parcel-lookup-meta {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  margin: 0.8em 0 0;
}
.parcel-lookup-meta a { color: var(--ink-2); }
.parcel-lookup-meta a:hover { color: var(--red); }

/* ---- Tier analysis page ---- */
table.tier-verdict-table { font-size: 1rem; }
table.tier-verdict-table td:nth-child(2) {
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.script-output {
  background: #0e0d0b;
  color: #e8e3d0;
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.55;
  overflow-x: auto;
  margin: 1.3em 0 1.7em;
  white-space: pre;
  border: 1px solid #2a2823;
  position: relative;
}
.script-output::before {
  content: "$";
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  opacity: 0.6;
}

/* ---- Scroll-reveal (used by site.js) ---- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Animations ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes heroNumeralIn {
  0%   { opacity: 0; transform: translateY(20px) skewY(2deg); letter-spacing: -0.02em; }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) skewY(0); letter-spacing: -0.06em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
