/* ═══════════════════════════════════════════════════════════════════════
   Rapunzel's Coffee and Books — "Letterboard & Lantern"
   Token contract: docs/design-system.md (contrast ratios computed there).
   Two registers: Storefront (light, default) and .listening-room (dark,
   scoped — hero band + music surfaces). Every color traces to the
   harvested photography of the building: barn-red siding, cream trim,
   espresso beams, stair/wingback green, string-light amber, letterboard.
   Signature moves: 1px cream inset keylines ("painted trim"), ribbed
   letterboard event rows, italic chapter eyebrows with a ❧ fleuron.
   Banned here (sibling-owned): offset block shadows, radius-0, pills,
   glows, marquee dots, double rules, kraft texture, condensed caps.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* Storefront register */
  --bg: #FAF5EA;
  --surface: #FFFCF2;
  --ink: #2B1A12;
  --muted: #6B5544;
  --accent: #8C2F24;        /* barn red — reserved for Donate/primary ask */
  --accent-hover: #6E241B;
  --accent-2: #3F5C41;      /* stair green — Volunteer/secondary */
  --accent-2-hover: #324A34;
  --link: #8C2F24;
  --amber-text: #8F5D14;    /* darkened string-light amber, small accents */
  --border: #E4D6BD;
  --border-strong: #6B5544;
  --cream: #F7EFDF;

  /* Listening-room register (consumed inside .listening-room) */
  --lr-bg: #241310;
  --lr-surface: #3A1E16;
  --lr-ink: #F7EFDF;
  --lr-muted: #C8B39B;
  --lr-accent: #F0B054;     /* string-light amber — the dark band's CTA */
  --lr-accent-hover: #F6C67E;

  /* Letterboard */
  --lb-ground: #F3EBDA;
  --lb-letter: #1E1712;
  --lb-groove: rgba(43, 26, 18, 0.08);

  --display: Literata, Georgia, "Iowan Old Style", serif;
  --body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", Verdana,
    "Segoe UI", sans-serif;

  --radius-card: 8px;
  --radius-btn: 6px;
  --shadow-soft: 0 2px 10px rgba(43, 26, 18, 0.08);
  --maxw: 1080px;
}

/* ── Base ─────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3, h4 {
  font-family: var(--display);
  font-optical-sizing: auto;
  line-height: 1.18;
  margin: 0 0 0.5em;
  font-weight: 600;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.lede {
  font-size: 1.16rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 42em;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.skip {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--cream); padding: 8px 16px;
}
.skip:focus { left: 8px; }

/* ── Chapter eyebrow — italic Literata + amber fleuron ────────────── */
.eyebrow {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
  color: var(--muted);
  margin: 0 0 0.6em;
}
.eyebrow::before { content: "\2767\2002"; color: var(--amber-text); font-style: normal; }
.listening-room .eyebrow { color: var(--lr-muted); }
.listening-room .eyebrow::before { color: var(--lr-accent); }

/* ── Fleuron divider — SINGLE rule (double rules are a sibling's) ── */
.fleuron-rule {
  border: 0; height: 0;
  border-top: 1px solid var(--border-strong);
  margin: 3rem auto; max-width: 420px;
  position: relative; overflow: visible;
}
.fleuron-rule::after {
  content: "\2767";
  position: absolute; left: 50%; top: -0.85em; transform: translateX(-50%);
  background: var(--bg); padding: 0 0.6em; color: var(--amber-text);
}

/* ── Painted-sign buttons: solid fill + 1px cream INSET keyline ───── */
.btn {
  display: inline-block;
  font-family: var(--body);
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 22px;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(247, 239, 223, 0.55);
  background: var(--accent-2);
  color: var(--cream);
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
}
.btn:hover { background: var(--accent-2-hover); color: var(--cream); }
.btn--donate { background: var(--accent); }
.btn--donate:hover { background: var(--accent-hover); }
.btn--ghost {
  background: transparent; color: var(--ink);
  border-color: var(--border-strong); box-shadow: none;
}
.btn--ghost:hover { background: var(--surface); color: var(--ink); }
.btn--sm { padding: 8px 14px; font-size: 0.92rem; min-height: 38px; }
.listening-room .btn,
.btn--lantern {
  background: var(--lr-accent); color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(36, 19, 16, 0.35);
}
.listening-room .btn:hover,
.btn--lantern:hover { background: var(--lr-accent-hover); color: var(--ink); }
.listening-room .btn--ghost {
  background: transparent; color: var(--lr-ink);
  border-color: var(--lr-muted); box-shadow: none;
}

/* ── Demo ribbon ──────────────────────────────────────────────────── */
.demo-ribbon {
  background: var(--ink); color: var(--cream);
  text-align: center; font-size: 0.85rem; padding: 6px 12px;
  letter-spacing: 0.04em;
}

/* ── Header / nav ─────────────────────────────────────────────────── */
.site-top { position: sticky; top: 0; z-index: 40; }
.site-header {
  display: flex; align-items: center; gap: 18px;
  padding: 14px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.brand { text-decoration: none; color: var(--ink); line-height: 1.1; }
.brand-word {
  font-family: var(--display); font-weight: 700;
  font-size: 1.32rem; letter-spacing: 0.01em; display: block;
}
.brand-sub {
  font-family: var(--body); font-size: 0.78rem; font-weight: 400;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  display: block;
}
.nav { margin-left: auto; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.nav a {
  text-decoration: none; color: var(--ink);
  font-weight: 500; font-size: 1rem; padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.nav a:hover { border-bottom-color: var(--amber-text); }
.nav a[aria-current="page"] { border-bottom-color: var(--accent); }
.nav .nav-cta {
  background: var(--accent); color: var(--cream);
  padding: 9px 16px; border-radius: var(--radius-btn);
  box-shadow: inset 0 0 0 1px rgba(247, 239, 223, 0.55);
  border-bottom: 0; font-weight: 700;
}
.nav .nav-cta:hover { background: var(--accent-hover); }
.nav-toggle { display: none; }
.nav-burger { display: none; }

@media (max-width: 820px) {
  .nav-burger {
    display: flex; flex-direction: column; gap: 5px;
    margin-left: auto; cursor: pointer; padding: 8px;
  }
  .nav-burger span { width: 24px; height: 2.5px; background: var(--ink); border-radius: 2px; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: flex-start;
    padding: 12px 20px 18px; gap: 12px;
  }
  .nav-toggle:checked ~ .nav { display: flex; }
  .site-header { position: relative; }
}

/* ── Hero — the listening-room band ───────────────────────────────── */
.listening-room {
  background: var(--lr-bg); color: var(--lr-ink);
}
.listening-room a { color: var(--lr-accent); }
.listening-room a:hover { color: var(--lr-accent-hover); }
.listening-room .muted { color: var(--lr-muted); }
.listening-room .lede { color: var(--lr-muted); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 0;
  align-items: stretch;
}
.hero-copy { padding: clamp(28px, 6vw, 72px); align-self: center; }
.hero-photo { position: relative; min-height: 380px; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.hero-photo figcaption {
  position: absolute; bottom: 0; right: 0;
  font-size: 0.72rem; color: var(--lr-muted);
  background: rgba(36, 19, 16, 0.72); padding: 3px 10px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 1.4rem; }
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero-photo { min-height: 300px; order: -1; position: relative; }
  .hero-photo img { position: relative; }
}

/* ── Letterboard — THE signature. Ribbed track, changeable tiles. ── */
.letterboard {
  background: var(--lb-ground);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0, transparent 9px,
    var(--lb-groove) 9px, var(--lb-groove) 10px
  );
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.lb-caption {
  font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); padding: 8px 16px 0; margin: 0;
}
.lb-row {
  display: flex; align-items: center; gap: 18px;
  padding: 14px 16px; min-height: 44px;
  border-top: 1px solid var(--border);
  color: inherit; text-decoration: none;
}
.lb-row:first-child { border-top: 0; }
a.lb-row:hover .lb-title { color: var(--accent); }
.lb-date {
  flex: 0 0 auto;
  background: var(--accent); color: var(--cream);
  font-family: var(--body); font-weight: 700; text-align: center;
  border-radius: 4px; padding: 6px 10px; line-height: 1.15;
  box-shadow: inset 0 0 0 1px rgba(247, 239, 223, 0.45);
  min-width: 58px;
}
.lb-date .lb-mon { display: block; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; }
.lb-date .lb-day { display: block; font-size: 1.25rem; }
.lb-title {
  font-family: var(--body); font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--lb-letter); font-size: 1rem;
}
.lb-meta { margin-left: auto; color: var(--muted); font-size: 0.9rem; text-align: right; }
.lb-empty { padding: 22px 18px; }
.lb-empty p { margin: 0; }
@media (max-width: 640px) {
  .lb-row { flex-wrap: wrap; row-gap: 4px; }
  .lb-meta { margin-left: 72px; flex-basis: 100%; text-align: left; }
}

/* ── Cards & panels ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: 22px;
}
.listening-room .card {
  background: var(--lr-surface);
  border-color: rgba(200, 179, 155, 0.35);
}
.card h3 { margin-top: 0; }
.card-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin: 1.6rem 0;
}

/* ── Sections ─────────────────────────────────────────────────────── */
.section { padding: clamp(36px, 7vw, 72px) 0; }
.section--tight { padding: clamp(24px, 4vw, 44px) 0; }
.section-head { max-width: 46em; margin-bottom: 1.6rem; }

.photo-band { position: relative; }
.photo-band img { width: 100%; max-height: 460px; object-fit: cover; }
.photo-band figcaption {
  font-size: 0.78rem; color: var(--muted); padding: 6px 20px;
  text-align: right;
}

/* ── Table-of-contents progress (campaign chapters) ───────────────── */
.toc-progress { list-style: none; margin: 1.4rem 0; padding: 0; max-width: 46em; }
.toc-progress li {
  display: flex; align-items: baseline; gap: 12px;
  padding: 10px 2px; border-bottom: 1px solid var(--border);
}
.toc-progress .toc-chapter {
  font-family: var(--display); font-style: italic; white-space: nowrap;
}
.toc-progress .toc-dots {
  flex: 1; border-bottom: 2px dotted var(--border-strong);
  transform: translateY(-4px); opacity: 0.45; min-width: 30px;
}
.toc-progress .toc-state { color: var(--muted); white-space: nowrap; }
.toc-progress .toc-state--done { color: var(--accent-2); font-weight: 700; }
.toc-progress .toc-state--now { color: var(--accent); font-weight: 700; }

/* ── Quotes ───────────────────────────────────────────────────────── */
blockquote.pull {
  font-family: var(--display); font-style: italic;
  font-size: 1.28rem; line-height: 1.5;
  margin: 2rem 0; padding: 0 0 0 20px;
  border-left: 3px solid var(--amber-text);
}
blockquote.pull cite {
  display: block; font-family: var(--body); font-style: normal;
  font-size: 0.9rem; color: var(--muted); margin-top: 0.6em;
}
.listening-room blockquote.pull { border-left-color: var(--lr-accent); }
.listening-room blockquote.pull cite { color: var(--lr-muted); }

/* ── Forms ────────────────────────────────────────────────────────── */
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select,
.field textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-btn);
  padding: 11px 12px;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid var(--accent-2); outline-offset: 1px;
}
.field-help { font-size: 0.88rem; color: var(--muted); margin-top: 4px; }
.field-error { color: var(--accent); font-size: 0.92rem; margin-top: 4px; }
.opt { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; font-weight: 400; }
.opt input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--accent-2); }
.booking-form { max-width: 640px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Antibot decoy — off-screen, invisible to people and AT */
.trap-field {
  position: absolute !important; left: -9999px !important;
  width: 1px; height: 1px; overflow: hidden;
}

.messages { list-style: none; margin: 0; padding: 12px 20px 0; }
.msg { padding: 12px 16px; border-radius: var(--radius-btn); margin-bottom: 8px; }
.msg--success { background: #E8EFE4; color: #2E4630; border: 1px solid var(--accent-2); }
.msg--error { background: #F6E4E1; color: #6E241B; border: 1px solid var(--accent); }

/* ── Announcement bar ─────────────────────────────────────────────── */
.navbar { background: var(--accent-2); color: var(--cream); }
.navbar-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; gap: 8px; padding: 8px 20px;
}
.navbar-link { color: var(--cream); text-decoration: none; display: flex; gap: 10px; align-items: baseline; flex: 1; min-width: 0; }
.navbar-tag { font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.78rem; }
.navbar-msg { font-size: 0.95rem; }
.navbar-close { background: none; border: 0; color: var(--cream); font-size: 1.3rem; cursor: pointer; padding: 2px 8px; }

/* ── Footer ───────────────────────────────────────────────────────── */
.site-footer {
  margin-top: 3rem;
  background: var(--lr-bg); color: var(--lr-ink);
  border-top: 4px solid var(--accent);
}
.site-footer a { color: var(--lr-accent); }
.site-footer a:hover { color: var(--lr-accent-hover); }
.footer-grid {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  padding: 44px 20px 24px;
}
.footer-col h3 {
  font-family: var(--body); font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--lr-muted); margin: 0 0 0.7em;
}
.footer-lockup { font-family: var(--display); font-weight: 700; font-size: 1.25rem; margin: 0 0 0.2em; }
.footer-tagline { font-family: var(--display); font-style: italic; color: var(--lr-muted); margin: 0 0 1em; }
.footer-meta { margin: 0 0 0.5em; color: var(--lr-ink); }
.footer-foundation { font-size: 0.9rem; color: var(--lr-muted); }
.footer-social-icons { display: flex; gap: 14px; margin: 0.4em 0 0; }
.footer-social-icons a { color: var(--lr-accent); }
.footer-col nav, nav.footer-col { display: block; }
nav.footer-col a { display: block; text-decoration: none; padding: 3px 0; color: var(--lr-ink); }
nav.footer-col a:hover { color: var(--lr-accent); }
.footer-subscribe label { display: block; font-weight: 700; margin-bottom: 6px; }
.subscribe-row { display: flex; gap: 8px; }
.subscribe-row input {
  flex: 1; min-width: 0; font: inherit;
  background: var(--lr-surface); color: var(--lr-ink);
  border: 1px solid var(--lr-muted); border-radius: var(--radius-btn);
  padding: 10px 12px;
}
.subscribe-row input::placeholder { color: var(--lr-muted); }
.footer-subscribed { color: var(--lr-accent); font-weight: 700; }
.footer-suberr { color: #F6C67E; font-size: 0.9rem; }
.footer-bottom {
  border-top: 1px solid rgba(200, 179, 155, 0.25);
  max-width: var(--maxw); margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  padding: 16px 20px 28px; font-size: 0.88rem; color: var(--lr-muted);
}
.footer-bottom p { margin: 0; }
.footer-sublinks { display: flex; gap: 16px; }

/* ── Age gate overlay (config-gated, OFF — skeleton convention) ───── */
.age-locked { overflow: hidden; }
.age-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(36, 19, 16, 0.92);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.age-overlay-card {
  background: var(--surface); border-radius: var(--radius-card);
  padding: 32px; max-width: 420px; text-align: center;
}
.age-overlay-card button { margin: 6px; }

/* ── Back-office (analytics tiles, feature panel) — quiet styling ── */
.an-card, .feature-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 20px; margin-bottom: 16px;
}
.an-tile { display: inline-block; padding: 12px 18px; }
.an-tile-value { font-family: var(--display); font-size: 1.7rem; font-weight: 700; display: block; }
.an-tile-label { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.an-tile-note, .an-sub { color: var(--muted); font-size: 0.88rem; }
.an-stamp { font-size: 0.8rem; color: var(--muted); }

/* ── Pitch page ───────────────────────────────────────────────────── */
.pitch-receipt { border-left: 3px solid var(--accent); padding-left: 16px; margin: 1.4rem 0; }
.pitch-receipt h3 { margin-bottom: 0.3em; }
.pitch-receipt .muted { font-size: 0.92rem; }

/* ── Utility ──────────────────────────────────────────────────────── */
.center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
