/* ============================================================================
   chrome.css — the unified site header, the Wire ticker, and the tip jar.
   Shared by every page (homepage + interior) via the _AppBar partial. Styles
   are namespaced (.sb-*) and self-contained (literal OKLCH + named fonts) so
   they render identically regardless of v1.css / site.css. Loaded LAST.
   ========================================================================== */

:root {
  --sb-ink:    oklch(93% 0.030 84);   /* candlelight cream */
  --sb-ink-2:  oklch(82% 0.030 84);
  --sb-ink-3:  oklch(70% 0.032 84);
  --sb-gold:   oklch(84% 0.130 86);
  --sb-gold-d: oklch(75% 0.130 84);
  --sb-gold-ink: oklch(24% 0.045 78);
  --sb-panel:  oklch(27% 0.050 279);
  --sb-line:   oklch(42% 0.050 280);
  --sb-display: "Bricolage Grotesque", system-ui, -apple-system, sans-serif;
  --sb-ui:      "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  /* z: bar 100 · drop 120 · jar 130 · scrim 140 · menu 150 */
}

/* ---------------------------------------------------------------- App bar */
.sb-bar {
  position: sticky; top: 0; z-index: 100;
  background: oklch(20% 0.044 280 / 0.82);
  backdrop-filter: saturate(1.3) blur(12px);
  border-bottom: 1px solid var(--sb-line);
}
.sb-in {
  max-width: 1240px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px);
  display: flex; align-items: center; gap: 16px; height: 60px;
}
.sb-brand {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  font-family: var(--sb-display); font-weight: 800; font-size: 20px; letter-spacing: -0.03em;
  color: var(--sb-ink); text-decoration: none;
}
.sb-brand:hover { color: var(--sb-ink); text-decoration: none; }
.sb-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sb-gold); box-shadow: 0 0 8px 1px oklch(84% 0.13 86 / 0.7); }

.sb-nav { display: flex; align-items: center; gap: 1px; margin-left: auto; }
.sb-link {
  font-family: var(--sb-ui); font-weight: 600; font-size: 14px; color: var(--sb-ink-2);
  background: none; border: 0; cursor: pointer; padding: 8px 9px; border-radius: 9px;
  text-decoration: none; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  transition: color .15s, background .15s;
}
.sb-link:hover { color: var(--sb-ink); background: oklch(100% 0 0 / 0.06); text-decoration: none; }
.sb-link.is-current { color: var(--sb-gold); }
.sb-caret { font-size: 9px; opacity: .7; }

.sb-item { position: relative; }
.sb-drop {
  position: absolute; top: calc(100% + 7px); left: 0; min-width: 232px;
  background: var(--sb-panel); border: 1px solid var(--sb-line); border-radius: 13px;
  box-shadow: 0 20px 48px oklch(8% 0.03 280 / 0.6); padding: 8px;
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
  z-index: 120;
}
.sb-item:hover > .sb-drop, .sb-item:focus-within > .sb-drop,
.sb-drop-t[aria-expanded="true"] + .sb-drop { opacity: 1; visibility: visible; transform: none; }
.sb-drop a {
  font-family: var(--sb-ui); font-weight: 600; font-size: 14px; color: oklch(90% 0.025 84);
  text-decoration: none; padding: 8px 10px; border-radius: 8px; white-space: nowrap;
}
.sb-drop a:hover { background: oklch(100% 0 0 / 0.06); color: var(--sb-gold); }
.sb-group { font-family: var(--sb-ui); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--sb-ink-3); padding: 9px 10px 4px; }
.sb-group:first-child { padding-top: 4px; }
.sb-drop-all { margin-top: 5px; padding-top: 11px !important; border-top: 1px solid var(--sb-line); color: var(--sb-gold) !important; }

.sb-pill {
  font-family: var(--sb-ui); font-weight: 700; font-size: 14px; color: var(--sb-gold-ink);
  background: var(--sb-gold); padding: 8px 16px; border-radius: 999px; text-decoration: none;
  white-space: nowrap; margin-left: 8px; box-shadow: 0 0 24px oklch(70% 0.13 84 / 0.22); transition: background .15s;
}
.sb-pill:hover { background: var(--sb-gold-d); color: var(--sb-gold-ink); text-decoration: none; }

.sb-menu-btn {
  display: none; margin-left: auto; align-items: center; gap: 8px;
  background: oklch(100% 0 0 / 0.05); border: 1px solid var(--sb-line); color: var(--sb-ink);
  border-radius: 9px; padding: 8px 14px; font-family: var(--sb-ui); font-weight: 700; font-size: 14px; cursor: pointer;
}

/* ---------------------------------------------------------------- Mobile menu */
.sb-scrim { position: fixed; inset: 0; z-index: 140; background: oklch(10% 0.03 280 / 0.6); backdrop-filter: blur(2px); }
.sb-scrim[hidden] { display: none; }
.sb-menu {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(330px, 86vw); z-index: 150;
  background: oklch(22% 0.048 279); border-left: 1px solid var(--sb-line);
  padding: 16px 16px 44px; overflow-y: auto; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .28s cubic-bezier(.2,.7,.2,1);
}
.sb-menu.show { transform: none; }
.sb-menu-head { display: flex; align-items: center; justify-content: space-between; font-family: var(--sb-ui); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; font-size: 12px; color: var(--sb-ink-3); padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid var(--sb-line); }
.sb-close { background: none; border: 0; color: var(--sb-ink); font-size: 18px; cursor: pointer; }
.sb-menu a { font-family: var(--sb-ui); font-weight: 600; font-size: 16px; color: oklch(91% 0.025 84); text-decoration: none; padding: 12px 6px; border-bottom: 1px solid oklch(34% 0.05 278); }
.sb-menu a.sb-msub { font-size: 14.5px; padding-left: 18px; color: var(--sb-ink-2); }
.sb-menu a:hover, .sb-menu a.is-current { color: var(--sb-gold); }
.sb-mgroup { font-family: var(--sb-ui); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--sb-gold); padding: 14px 6px 4px; }

@media (prefers-reduced-motion: reduce) { .sb-menu { transition: none; } .sb-drop { transition: none; } }

@media (max-width: 1080px) {
  .sb-nav { display: none; }
  .sb-menu-btn { display: inline-flex; }
}

/* ---------------------------------------------------------------- The Wire ticker (unified) */
.ticker { display: flex; align-items: stretch; border-bottom: 1px solid var(--sb-line); background: oklch(23% 0.048 281 / 0.92); overflow: hidden; }
.ticker-flag { flex: 0 0 auto; display: flex; align-items: center; background: var(--sb-gold); color: var(--sb-gold-ink); font-family: var(--sb-ui); font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; padding: 8px 16px; white-space: nowrap; }
.ticker-viewport { flex: 1 1 auto; overflow: hidden; position: relative; }
.ticker-track { display: inline-flex; align-items: center; white-space: nowrap; will-change: transform; animation: sb-ticker var(--ticker-dur, 60s) linear infinite; }
@keyframes sb-ticker { to { transform: translateX(-50%); } }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track, .ticker.is-paused .ticker-track { animation-play-state: paused; }
.ticker-item { font-family: var(--sb-ui); font-size: 14px; font-weight: 500; color: var(--sb-ink-2); text-decoration: none; padding: 8px 0; display: inline-block; }
.ticker-item:hover { color: var(--sb-ink); }
.ticker-src { font-family: var(--sb-ui); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; font-size: 11px; color: var(--sb-ink-3); margin-right: 7px; }
.ticker-sep { color: var(--sb-gold); font-size: 9px; padding: 0 16px; opacity: 0.6; }
.ticker-pause { flex: 0 0 auto; background: none; border: 0; border-left: 1px solid var(--sb-line); color: var(--sb-ink-3); font-size: 12px; padding: 0 14px; cursor: pointer; }
.ticker-pause:hover { color: var(--sb-gold); }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } .ticker-viewport { overflow-x: auto; } }

/* ---------------------------------------------------------------- Buy Me a Treat (unified) */
.churro-jar { position: fixed; right: clamp(12px, 3vw, 24px); bottom: clamp(12px, 3vw, 24px); z-index: 130; }
.churro-link { display: flex; align-items: center; gap: 9px; text-decoration: none; background: var(--sb-panel); border: 1px solid var(--sb-gold); border-radius: 999px; padding: 7px 12px 7px 16px; box-shadow: 0 8px 22px oklch(8% 0.03 280 / 0.5); transition: transform .18s ease, box-shadow .18s ease; }
.churro-link:hover, .churro-link:focus-visible { transform: translateY(-2px); box-shadow: 0 12px 28px oklch(8% 0.03 280 / 0.6); }
.churro-bubble { font-family: var(--sb-ui); font-weight: 600; font-size: 13px; color: var(--sb-ink); white-space: nowrap; }
.churro-icon { display: inline-flex; flex: none; }
.churro-icon svg { display: block; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.3)); }
.churro-icon .treat { display: inline-flex; align-items: center; justify-content: center; }
.churro-icon .treat[hidden] { display: none; }
.churro-icon .treat--emoji { width: 32px; height: 32px; font-size: 25px; line-height: 1; }
@media (max-width: 520px) { .churro-bubble { display: none; } .churro-link { padding: 9px; } }
@media (prefers-reduced-motion: reduce) { .churro-link { transition: none; } }
