/* Stand — shared chrome styles (Quiet mode, scaffold chip, safe-area, util-btn).
   Added 2026-04-22.
   2026-04-28 modernization pass — see /stand/_audits/2026-04-28-ux-modernization-plan.md */

/* ─── 2026-04-28: explicit color-scheme so OS form controls behave on dark-OS users.
   This is the single cheapest "premium" cue — autofill backgrounds stop fighting the bg. */
:root { color-scheme: light; }

/* ─── 2026-04-28: shared design tokens for radii + press-card shadow. ─── */
:root {
  --r-sm: 4px;
  --r-md: 10px;
  --r-lg: 18px;
  --press-shadow: 4px 4px 0 0 var(--accent, #1c2b3a);
  --press-shadow-active: 1px 1px 0 0 var(--accent, #1c2b3a);
}

/* ─── 2026-04-28: modern type defaults — opt the whole subtree into optical sizing
   (Fraunces opsz now actually does something) and enable Inter's stylistic alternates
   so single-story 'a', 'g' and tabular nums break the "default Inter" feel. ─── */
html {
  font-optical-sizing: auto;
  font-feature-settings: "ss01", "cv11", "cv09";
}
.serif {
  font-variation-settings: "opsz" 144;
}
.quote-box .q, .testimonial .q, blockquote.serif, p.serif {
  font-variation-settings: "opsz" 40;
}

/* Tabular nums everywhere a digit is *compared* to another digit. */
.countdown-unit .n,
.stat-val,
.timer,
[data-numeric],
#streak-count,
#momentum-count,
#quiz-gallons {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "ss01";
}

/* Body text gets pretty wrap (paragraphs) on top of the existing balance (headings). */
p, li { text-wrap: pretty; }

/* ─── 2026-04-28: civic-branded selection + focus-visible.
   Outline color is brick terracotta, NOT browser-default blue. ─── */
::selection {
  background: var(--brick, #b34a35);
  color: var(--paper, #f4ead5);
}
:focus-visible {
  outline: 2px solid var(--brick, #b34a35);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(179, 74, 53, 0.18);
  border-radius: 4px;
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline-offset: 0;
  box-shadow: 0 0 0 4px rgba(179, 74, 53, 0.18);
}

/* ─── 2026-04-28: "press-card" hover.
   Replaces the generic translateY(-2px) tell with a printed-card lift —
   the card moves up-and-left, leaving a hard navy "shadow rule" behind it.
   Looks like a real card off a desk, not a Tailwind default. ─── */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .feat, .learn-card, .testimonial, .phase, .quiz-card, .stat, .rsvp-card, .track, .art {
    transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
                box-shadow 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
                border-color 0.18s ease;
    will-change: transform;
  }
  .feat:hover, .learn-card:hover, .phase:hover, .track:hover, .art:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--press-shadow);
  }
}
/* Tap feedback for everyone — keeps the existing 1px feel, but adds a sharp shadow. */
.feat:active, .tile:active, .card:active, .learn-card:active, .testimonial:active, .phase:active, .track:active, .art:active {
  transform: translate(0, 0);
  box-shadow: var(--press-shadow-active);
  transition-duration: 0.06s;
}

/* Buttons — universal active scale (Vercel-grade press feedback). */
button:active, .rsvp-btn:active, .quiz-share:active, .signup-box button:active {
  transform: scale(0.97);
  filter: brightness(0.96);
  transition: transform 0.08s ease-out, filter 0.08s ease-out;
}

/* 2026-04-28 — cross-page view transitions DISABLED.
   Was: navigation: auto. Caused iOS Safari 17.4-18.x to leave ::view-transition
   root overlay stuck after same-origin nav, blocking page scroll until reload.
   Re-enable only after we have a working iOS workaround (e.g. nav-end cleanup hook). */
@view-transition { navigation: none; }

/* Balanced line breaks on headings — Fraunces looks hand-set. */
h1, h2, h3 { text-wrap: balance; }

/* Accent color on native form controls — matches brick CTA. */
input[type="checkbox"], input[type="radio"], input[type="range"], progress { accent-color: #b34a35; }

/* 2026-04-28: native textarea grow-to-content (Chrome 123+, Firefox 132+). Graceful no-op elsewhere. */
textarea { field-sizing: content; }

/* Quiet mode — suppress ticker scroll, parallax transforms, and decorative animation.
   Keeps copy + structure so organizers with sensory sensitivity can still use the site. */
body.quiet * {
  animation-duration: 0s !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0s !important;
}
body.quiet [data-ticker], body.quiet .ticker-wrap, body.quiet .parallax-footprint, body.quiet .paper-grain {
  display: none !important;
}

/* Reusable util-btn for topbar toggles. Matches stand.html. */
.util-btn {
  appearance: none; background: transparent;
  border: 1px solid var(--border, #d4c7a3); border-radius: 7px;
  padding: 8px 12px; min-height: 36px; min-width: 44px;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--text-dim, #4a5a6b); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.util-btn:hover, .util-btn:focus-visible {
  background: var(--surface-2, #faf3e1);
  color: var(--text, #1c2b3a);
}
.util-btn[aria-pressed="true"] {
  background: var(--accent, #1c2b3a);
  color: var(--paper, #f4ead5);
  border-color: var(--accent, #1c2b3a);
}

/* Scaffold/demo chip — visible "this is a preview" signal in topbar on every scaffold page. */
.scaffold-chip-global {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(200,154,26,0.15);
  border: 1px solid rgba(200,154,26,0.45);
  border-radius: 999px;
  color: #6a4f0a;
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase;
  vertical-align: middle;
  margin-left: 8px;
}

/* ─── 2026-04-28: paper grain overlay.
   Drop one <div class="paper-grain"></div> at the top of <body>.
   Inline SVG (feTurbulence fractal noise) baked into a data-URI background — no extra HTTP. ─── */
.paper-grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.11 0 0 0 0 0.17 0 0 0 0 0.23 0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.32'/></svg>");
  background-size: 240px 240px;
  opacity: 0.18;
  mix-blend-mode: multiply;
}
@media (prefers-reduced-motion: reduce) { .paper-grain { opacity: 0.12; } }

/* ─── 2026-04-28: civic "filing rule" divider.
   Renders a 1px navy hairline with a small-caps mono label centered.
   <div class="filing-rule"><span>§ 03 · The problem</span></div> ─── */
.filing-rule {
  display: flex; align-items: center; gap: 14px;
  margin: 56px 0 28px;
  font-family: ui-monospace, 'SF Mono', 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--text-mute, #5f6b7c);
}
.filing-rule::before, .filing-rule::after {
  content: ''; flex: 1; height: 1px; background: var(--border, #d4c7a3);
}
.filing-rule span { white-space: nowrap; }

/* ─── 2026-04-28: section watermark numerals.
   <span class="section-numeral" aria-hidden="true">03</span>
   Parent section needs position:relative + overflow:hidden ─── */
.section-numeral {
  position: absolute; top: -28px; right: -12px;
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 144;
  font-weight: 900;
  font-size: clamp(120px, 18vw, 240px);
  line-height: 0.9;
  color: var(--accent, #1c2b3a);
  opacity: 0.055;
  pointer-events: none;
  user-select: none;
  letter-spacing: -0.04em;
  z-index: 0;
}

/* ─── 2026-04-28: drop-cap for editorial paragraphs. Suppressed on narrow phones. ─── */
.dropcap::first-letter {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 144;
  font-weight: 900;
  font-size: 4.6em;
  line-height: 0.85;
  float: left;
  margin: 0.06em 0.12em 0 -0.03em;
  color: var(--accent, #1c2b3a);
  letter-spacing: -0.04em;
}
@media (max-width: 480px) {
  .dropcap::first-letter { float: none; font-size: 1em; margin: 0; }
}

/* ─── 2026-04-28: FAQ tints when any details is open. Declarative parent state, no JS. ─── */
.faq:has(details[open]) {
  background: var(--surface-2, #faf3e1);
  transition: background 250ms ease-out;
  border-radius: var(--r-lg, 18px);
  padding: 6px 14px;
  margin-left: -14px; margin-right: -14px;
}
@media (prefers-reduced-motion: reduce) { .faq:has(details[open]) { transition: none; } }

/* ─── 2026-04-28: numbered step stamp — for "What happens after you sign up". ─── */
.step-stamp {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 5px;
  background: var(--accent, #1c2b3a);
  color: var(--paper, #f4ead5);
  border-radius: 4px 14px 4px 14px;
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  margin-bottom: 14px;
}
.step-stamp .num {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 144;
  font-size: 18px; font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  background: var(--brick, #b34a35);
  color: var(--paper, #f4ead5);
  padding: 2px 8px 3px;
  border-radius: 2px;
}

/* ─── 2026-04-28: small inline civic glyph — replaces the generic ● bullet on .feat .icon. ─── */
.feat .icon svg, .icon-glyph {
  display: inline-block;
  width: 22px; height: 22px;
  color: var(--accent, #1c2b3a);
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
