/* Brea 3 — theme tokens + shared styles (Home Screen & Visual Design spec, mockup v4).
   Black · Gold is the default; Cream · Gold is chosen in Settings > Appearance (data-theme on <html>).
   The dark look is WARM (Dee, 2026-10-20, DECISION_LOG "warm dark look — Dee's pick"): the backdrop matches the Aurora's
   measured backdrop (#14100F, top centre #1D1714, top-left glow #2B231D), the gold is a touch warmer and yellower
   (rich, warm, shiny, never mustard or olive), and the glass is near-black, not brown. */

/* Fonts are bundled with the app (web/static/fonts, SIL Open Font License), so the phone never waits on Google. */
@font-face { font-family: 'Cinzel'; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(/static/fonts/cinzel-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cinzel'; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(/static/fonts/cinzel-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Tenor Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/static/fonts/tenor-sans-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Tenor Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/static/fonts/tenor-sans-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root,
:root[data-theme="black_gold"] {
  --metal: linear-gradient(115deg, #E2BC50 0%, #C4951F 24%, #94700F 45%, #E8C65C 59%, #C4951F 75%, #E2BC50 100%);
  --gold: #C99A1E;
  --gold-hi: #EBC95A;
  --gold-core: #A57818;
  --gold-deep: #74540F;
  --glow: rgba(201, 154, 30, 0.34);
  --bg: #14100F;
  --bg-2: #1D1714;
  --text: #fff;
  --muted: rgba(255, 255, 255, 0.52);
  --glass: rgba(10, 9, 9, 0.82);      /* near-black with a whisper of warmth: not brown, not blue */
  --hairline: rgba(201, 154, 30, 0.24);
  --card: rgba(255, 238, 214, 0.05);
  --bubble-brea: rgba(255, 238, 214, 0.07);
  --on-gold: #1a1206;
  --ok: #EBC95A;
  --off: rgba(255, 255, 255, 0.35);
  color-scheme: dark;
}

:root[data-theme="cream_gold"] {
  --metal: linear-gradient(115deg, #D2A23E 0%, #B07A16 24%, #84590F 45%, #D8AE4C 59%, #B07A16 75%, #D2A23E 100%);
  --gold: #C98F1E;
  --gold-hi: #E0B44E;
  --gold-core: #A0700F;
  --gold-deep: #6E4E12;
  --glow: rgba(201, 143, 30, 0.30);
  --bg: #F4EEE1;
  --bg-2: #E7DCC6;
  --text: #2a2620;
  --muted: rgba(42, 38, 32, 0.62);
  --glass: rgba(255, 255, 255, 0.74);
  --hairline: rgba(201, 143, 30, 0.30);
  --card: #fff;
  --bubble-brea: #fff;
  --on-gold: #fff;
  --ok: #A0700F;
  --off: rgba(42, 38, 32, 0.38);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Tenor Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
body {
  background: radial-gradient(120% 80% at 50% 25%, var(--bg-2) 0%, var(--bg) 70%);
  overflow-x: hidden;
}
/* the dark look adds the Aurora's lighter top-left, at low strength */
:root:not([data-theme="cream_gold"]) body {
  background:
    radial-gradient(75% 45% at 0% 0%, rgba(43, 35, 29, 0.55) 0%, rgba(43, 35, 29, 0) 70%),
    radial-gradient(120% 80% at 50% 25%, var(--bg-2) 0%, var(--bg) 70%);
}
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea { font-family: inherit; font-size: 16px; /* 16px stops iPhone zoom */ }

/* ── Shiny gold: the metal gradient with a slow moving sheen, and gentle breathing ── */
.gold-text {
  background: var(--metal);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: sheen 7s ease-in-out infinite;
}
.gold-fill {
  background: var(--metal);
  background-size: 220% 100%;
  animation: sheen 7s ease-in-out infinite;
  color: var(--on-gold);
}
.breathe { animation: sheen 7s ease-in-out infinite, breathe 5s ease-in-out infinite; }
@keyframes sheen { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes breathe { 0%, 100% { opacity: 0.86; } 50% { opacity: 1; } }

/* ── Luminous "Brea" name: old Brea's breathing title (BREA_WEBAPP index.html .brea-name, breaShin + breaBreathe),
   stops nudged warmer (Dee, 2026-10-20; the olive-leaning #c0a43a became #CDA43A). Light beams from behind the name: a
   white-hot metal sweep plus a breathing gold glow. ── */
.luminous {
  background: linear-gradient(160deg, #4E3500 0%, #D29A0E 18%, #FDEBA0 32%, #ffffff 47%, #FDEBA0 52%,
    #D29A0E 68%, #946A00 80%, #CDA43A 92%, #4E3500 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 0 8px rgba(205, 164, 58, 0.55)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
  animation: breaBreathe 4s ease-in-out infinite, breaShin 3s ease-in-out infinite;
}
:root[data-theme="cream_gold"] .luminous {
  /* Old Brea had no cream look. On cream any light is pale champagne, never darker than the background, and it
     comes from a drop-shadow behind the letters (text-shadow paints over clipped text and blurs the edges). */
  background-image: linear-gradient(160deg, #4a3500 0%, #a87a08 18%, #e8c45a 32%, #fff6d0 47%, #e8c45a 52%,
    #a87a08 68%, #6e4e00 80%, #a8871e 92%, #4a3500 100%);
  filter: drop-shadow(0 0 3px rgba(255, 246, 218, 0.95));
  animation: breaBreatheCream 4s ease-in-out infinite, breaShin 3s ease-in-out infinite;
}
:root[data-theme="cream_gold"] .topbar .luminous { filter: none; animation: breaShin 3s ease-in-out infinite; }
@keyframes breaBreatheCream {
  /* a faint warm halo hugging the letter edges; it never spreads into the background */
  0%, 100% { opacity: 0.92; filter: drop-shadow(0 0 2px rgba(255, 246, 218, 0.85)); }
  50% { opacity: 1; filter: drop-shadow(0 0 4px rgba(255, 244, 212, 1)); }
}
@keyframes breaShin { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes breaBreathe {
  0%, 100% { opacity: 0.62; text-shadow: 0 0 18px rgba(205, 164, 58, 0.35), 0 0 56px rgba(205, 164, 58, 0.15); }
  50% { opacity: 1; text-shadow: 0 0 40px #CDA43A, 0 0 100px rgba(205, 164, 58, 0.35); }
}

.brand-name { font-family: 'Cinzel', 'Times New Roman', serif; font-weight: 600; letter-spacing: 0.08em; }

/* ── Top bar ── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px 10px;
}
.topbar .who { display: flex; align-items: baseline; gap: 10px; }
.topbar .who .brand-name { font-size: 26px; }
.status { font-size: 12px; letter-spacing: 0.06em; color: var(--muted); }
.status .dot { color: var(--ok); }
.status.offline .dot { color: var(--off); }
.env-chip {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  border: 1px solid var(--hairline); border-radius: 999px; padding: 3px 8px; color: var(--muted);
}
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--hairline); background: var(--glass);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.icon-btn img { width: 26px; height: 26px; object-fit: contain; }
.icon-btn svg { width: 22px; height: 22px; stroke: var(--gold-hi); fill: none; stroke-width: 1.6; }

/* ── Toast (server messages, already through the truth gate) ── */
.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 112px); z-index: 90;
  transform: translateX(-50%);
  pointer-events: none;   /* a message never blocks the mic or the composer (C2) */
  max-width: min(92vw, 420px);
  background: var(--glass); border: 1px solid var(--hairline); border-radius: 18px;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  padding: 12px 16px; font-size: 14px; line-height: 1.45; text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

/* ── Sheets (dashboard, confirm) ── */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  max-height: 78vh; overflow-y: auto;
  background: var(--glass); border-top: 1px solid var(--hairline);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  border-radius: 28px 28px 0 0;
  padding: 10px 16px calc(env(safe-area-inset-bottom, 0px) + 20px);
  transform: translateY(105%); transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.sheet.open { transform: translateY(0); }
.sheet-bar { width: 40px; height: 4px; border-radius: 2px; background: var(--hairline); margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-title { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, 0.35); }

.btn {
  min-height: 44px; padding: 10px 20px; border-radius: 22px; font-size: 15px;
  border: 1px solid var(--hairline); background: var(--card);
}
.btn.gold {
  border: none; color: var(--on-gold);
  background: var(--metal); background-size: 220% 100%;
  animation: sheen 7s ease-in-out infinite;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.topbar.solid {
  background: var(--glass); border-bottom: 1px solid var(--hairline);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}

@media (prefers-reduced-motion: reduce) {
  .gold-text, .gold-fill, .breathe, .luminous, .aura, .hero-name, .mic, .ring { animation: none !important; }
}
