/* ============================================================================
   joie — design system
   The brand non-negotiables (PRD §11) encoded as tokens:
   deep twilight-indigo base · five resonance lights as the system color ·
   brand orange as the single active/brand accent · warm humanist display +
   clean grotesque body · voice transcripts feel *spoken* (lighter / italic).
   Deliberately NOT the AI-default looks (no cream+terracotta serif, no
   near-black+acid, no broadsheet hairlines).
   ============================================================================ */

:root {
  /* — The five resonance lights (these ARE the system color, PRD §5/§8) —
       fixed hexes from the design handoff. Render as LIGHT, never a score. — */
  --flow:        #56E1D6;  /* cyan   — deep, uninterrupted absorption */
  --belonging:   #FFB454;  /* amber  — community, warmth, people */
  --inspiration: #B98CFF;  /* violet — beauty, novelty, the unexpected */
  --impact:      #5FD08A;  /* green  — supports something you care about */
  --joy:         #FF7E6B;  /* coral  — simply feels good, delight, ease */

  /* — Brand orange: active / brand accent ONLY. Never a resonance light. — */
  --brand: #FF6B11;
  --brand-ink: #23120A;   /* near-black text on orange */

  /* — Type roles — display / body / spoken — */
  --font-display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-spoken: "Newsreader", Georgia, "Times New Roman", serif;

  /* — Space & material — generous negative space, premium cues — */
  --r-lg: 28px; --r-md: 18px; --r-sm: 12px; --r-pill: 999px;
  --pad: 22px;
  --shadow-soft: 0 18px 50px -20px rgba(0,0,0,.7);
  --ease: cubic-bezier(.22,.61,.36,1);
  --maxw: 432px;

  /* ===== DARK THEME — the base "twilight indigo" world (default) ===== */
  --bg-0: #05071a;   /* page backdrop / deepest */
  --bg-1: #0c1031;   /* base surface */
  --bg-2: #161d44;   /* raised surface */
  --bg-3: rgba(255,255,255,.10); /* hairline / chip border */
  --ink-0: #ECEAF6;  /* primary text */
  --ink-1: #c4c6e0;  /* secondary */
  --ink-2: #7E84AE;  /* tertiary / captions */
  --card: rgba(255,255,255,.045);
  --card-border: rgba(255,255,255,.10);
  --hairline: rgba(255,255,255,.08);
  --page-bg: radial-gradient(120% 60% at 50% 0%, #161d44 0%, #0c1031 52%, #06081f 100%);
  --listen-bg: radial-gradient(125% 95% at 50% 36%, #1b2350 0%, #0e1336 42%, #080b22 78%, #05071a 100%);
  --card-shadow: 0 18px 50px -20px rgba(0,0,0,.7);
}

/* ===== LIGHT THEME — "daybreak" (cool, never warm/beige) ===== */
[data-theme="light"] {
  --bg-0: #E2E5F1;
  --bg-1: #EEF0F7;
  --bg-2: #FCFBF9;
  --bg-3: rgba(28,34,80,.12);
  --ink-0: #1A1F3D;  /* deep navy, ~13:1 */
  --ink-1: #3a4068;
  --ink-2: #565C80;
  --card: rgba(255,255,255,.72);
  --card-border: rgba(28,34,80,.11);
  --hairline: rgba(28,34,80,.11);
  --page-bg: radial-gradient(120% 60% at 50% 0%, #FCFBF9 0%, #EEF0F7 52%, #E2E5F1 100%);
  --listen-bg: radial-gradient(125% 95% at 50% 40%, #FCFBF9 0%, #EEF0F7 50%, #E2E5F1 100%);
  --card-shadow: 0 8px 24px rgba(30,40,90,.08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg-0);
  color: var(--ink-0);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  display: grid; place-items: center;
  min-height: 100dvh;
}

/* Device frame — keeps the mobile composition honest on a desktop preview. */
#device {
  width: 100%;
  max-width: var(--maxw);
  height: 100dvh;
  max-height: 940px;
  position: relative;
  overflow: hidden;
  background: var(--page-bg);
  color: var(--ink-0);
  isolation: isolate;
  transition: background .5s var(--ease), color .35s var(--ease);
}
@media (min-width: 480px) {
  #device {
    border-radius: 40px;
    box-shadow: var(--shadow-soft), 0 0 0 1px rgba(255,255,255,.05) inset;
    margin: 18px;
  }
}
#app { height: 100%; position: relative; }

/* — Screen scaffold: every screen is a column with its own scroll — */
.screen { height: 100%; display: flex; flex-direction: column; position: relative;
  animation: rise .5s var(--ease) both; }
.screen__scroll { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.screen__pad { padding: 0 var(--pad); }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

/* — Type roles — */
h1,h2,h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; margin: 0; }
.display { font-family: var(--font-display); }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.caption { font-size: 13px; color: var(--ink-2); }

/* The voice transcript: spoken-feeling — Newsreader italic (it must feel
   spoken, not typed). Used wherever the user's words or a narrative appear. */
.spoken { font-family: var(--font-spoken); font-style: italic; font-weight: 300;
  color: var(--ink-0); line-height: 1.3; }

/* — The one brand action — */
.btn {
  font-family: var(--font-body); font-size: 16px; font-weight: 600;
  border: none; border-radius: var(--r-pill); padding: 17px 26px; width: 100%;
  cursor: pointer; transition: transform .15s var(--ease), filter .2s var(--ease);
}
.btn:active { transform: scale(.975); }
.btn--brand { background: var(--brand); color: var(--brand-ink); box-shadow: 0 10px 30px -8px rgba(255,107,17,.55); }
.btn--ghost { background: var(--card); color: var(--ink-1); box-shadow: 0 0 0 1px var(--card-border) inset; }

/* — Chips (suggested feelings, steer chips) — */
.chip {
  font-family: var(--font-body); font-size: 14px; color: var(--ink-0);
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--r-pill); padding: 11px 16px; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 9px;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .12s var(--ease);
}
.chip:active { transform: scale(.96); }
.chip:hover { border-color: var(--ink-2); }
.chip__dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 8px currentColor; flex: 0 0 auto; }

/* — Access pill (payment-agnostic facet) — */
.pill { font-size: 12.5px; font-weight: 600; padding: 7px 13px; border-radius: var(--r-pill);
  background: rgba(10,12,30,.55); color: #ECEAF6; display: inline-flex; gap: 7px; align-items: center;
  backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.12); }
.pill__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }

.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; }

/* tiny scrollbar hush */
.screen__scroll::-webkit-scrollbar, .steer::-webkit-scrollbar { height: 0; width: 0; }

a, button { color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
.orb:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255,107,17,.7), 0 0 0 7px rgba(255,107,17,.18); border-radius: 50%; }

/* Quality floor: honor reduced-motion — turn animations off. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; }
}
