/* ============================================================================
   Wallie — chat-demo landing
   A live, typeable demo of the assistant. Casual (cream, calm) ⇄ FIRE (dark,
   ember-lit) via data-mode="fire" on <html>.
   ========================================================================== */

:root {
  --bg: #F4EBDC;
  --panel: #FFF8EC;
  --panel-2: #F3E9D8;
  --ink: #1A1410;
  --mid: #6B5849;
  --faint: rgba(26,20,16,0.45);
  --accent: #E8704A;          /* coral through-line */
  --accent-deep: #C9532E;
  --accent-soft: #F4A37E;
  --mark: #E8704A;
  --rule: rgba(26,20,16,0.10);
  --rule-soft: rgba(26,20,16,0.06);
  --bub-them: #F3E9D8;
  --bub-me: #1A1410;
  --bub-me-ink: #FFF8EC;
  --pos: #2F6A48;
  --blob-1: rgba(232,112,74,0.20);
  --blob-2: rgba(245,201,122,0.22);
  --blob-3: rgba(123,179,148,0.18);
  --panel-shadow: 0 30px 80px rgba(26,20,16,0.14);
  --ember-op: 0;

  --f-display: 'Inter Tight', system-ui, -apple-system, sans-serif;
  --f-sans: 'Inter Tight', system-ui, -apple-system, sans-serif;
  --f-mono: 'Geist Mono', ui-monospace, monospace;
}

[data-mode="fire"] {
  --bg: #100C08;
  --panel: rgba(31,24,18,0.82);
  --panel-2: #271E16;
  --ink: #F7EFE2;
  --mid: rgba(247,239,226,0.62);
  --faint: rgba(247,239,226,0.38);
  --accent: #FF7A4D;
  --accent-deep: #FF8C5E;
  --accent-soft: #FFB088;
  --mark: #FF7A4D;
  --rule: rgba(247,239,226,0.14);
  --rule-soft: rgba(247,239,226,0.08);
  --bub-them: rgba(247,239,226,0.07);
  --bub-me: #FF7A4D;
  --bub-me-ink: #140d08;
  --pos: #8FD0A8;
  --blob-1: rgba(255,122,77,0.40);
  --blob-2: rgba(245,160,70,0.30);
  --blob-3: rgba(201,83,46,0.34);
  --panel-shadow: 0 30px 90px rgba(0,0,0,0.5);
  --ember-op: 1;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background .7s ease, color .7s ease;
}
::selection { background: var(--accent); color: #fff; }
button, input { font-family: inherit; }

/* ── Animated background ─────────────────────────────────────── */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.9; transition: background .7s ease; will-change: transform; }
.blob.b1 { width: 560px; height: 560px; background: var(--blob-1); top: -160px; left: -120px; animation: drift1 24s ease-in-out infinite alternate; }
.blob.b2 { width: 520px; height: 520px; background: var(--blob-2); bottom: -180px; right: -120px; animation: drift2 28s ease-in-out infinite alternate; }
.blob.b3 { width: 460px; height: 460px; background: var(--blob-3); top: 30%; left: 45%; animation: drift3 32s ease-in-out infinite alternate; }
@keyframes drift1 { from { transform: translate(0,0) scale(1); } to { transform: translate(120px,80px) scale(1.18); } }
@keyframes drift2 { from { transform: translate(0,0) scale(1); } to { transform: translate(-100px,-70px) scale(1.12); } }
@keyframes drift3 { from { transform: translate(0,0) scale(1); } to { transform: translate(-90px,60px) scale(1.2); } }

/* FIRE-only vignette + grain to deepen */
.bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 120%, rgba(255,122,77,0.18), transparent 60%); opacity: var(--ember-op); transition: opacity .7s ease; }

/* embers */
.embers { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: var(--ember-op); transition: opacity .6s ease; }
.ember { position: absolute; bottom: -12px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent-soft); box-shadow: 0 0 8px 1px rgba(255,122,77,0.7); animation: rise linear infinite; }
@keyframes rise {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 1; }
  85% { opacity: 0.9; }
  100% { transform: translateY(-104vh) translateX(var(--drift,20px)); opacity: 0; }
}

/* ── Shell ───────────────────────────────────────────────────── */
.shell { position: relative; z-index: 2; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* top bar */
.bar { display: flex; align-items: center; justify-content: space-between; padding: 22px 32px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-size: 21px; letter-spacing: -0.03em; color: var(--ink); text-decoration: none; }
.brand .mk { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; transition: all .5s; }
.bar-right { display: flex; align-items: center; gap: 14px; }

/* mode toggle */
.toggle { display: flex; align-items: center; gap: 0; background: var(--panel-2); border: 1px solid var(--rule); border-radius: 999px; padding: 4px; position: relative; }
.toggle button { position: relative; z-index: 1; border: none; background: transparent; cursor: pointer; padding: 8px 17px; border-radius: 999px; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; color: var(--mid); display: inline-flex; align-items: center; gap: 7px; transition: color .3s; }
.toggle button:not(.on) { color: #4A3A2D; }
[data-mode="fire"] .toggle button:not(.on) { color: rgba(247,239,226,0.72); }
.toggle button.on { color: #fff; }
.toggle .knob { position: absolute; top: 4px; bottom: 4px; border-radius: 999px; background: var(--accent); transition: left .35s cubic-bezier(.6,.1,.2,1), width .35s, background .4s; z-index: 0; box-shadow: 0 4px 14px rgba(232,112,74,0.4); }
[data-mode="fire"] .toggle .knob { background: linear-gradient(135deg, #FF7A4D, #C9532E); }
.toggle .fl { font-size: 12px; }

.login-btn {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--mid);
  text-decoration: none;
  padding: 10px 18px;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s, transform .15s;
}
.login-btn:hover { color: var(--ink); border-color: var(--ink); transform: translateY(-1px); }
.login-btn:focus-visible,
.req:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-mode="fire"] .login-btn { color: rgba(247, 239, 226, 0.78); border-color: rgba(247, 239, 226, 0.18); }
[data-mode="fire"] .login-btn:hover { color: #fff; border-color: rgba(247, 239, 226, 0.4); }

.req { font-weight: 600; font-size: 13.5px; padding: 10px 18px; border-radius: 999px; border: none; cursor: pointer; background: var(--ink); color: var(--bg); transition: transform .15s, background .5s, color .5s; }
.req:hover { transform: translateY(-1px); }

/* ── Center stage ────────────────────────────────────────────── */
.stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px 24px 40px; text-align: center; }
.eyebrow { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent-deep); font-weight: 500; display: inline-flex; align-items: center; gap: 9px; }
.eyebrow .d { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: blink 1.8s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.35;transform:scale(.7)} }
.prompt { font-family: var(--f-display); font-weight: 400; font-size: clamp(34px, 5vw, 62px); letter-spacing: -0.04em; line-height: 1.0; margin: 18px 0 0; max-width: 760px; }
.prompt em { font-style: italic; color: var(--accent-deep); }
.sub { font-size: 16px; color: var(--mid); margin: 16px 0 0; max-width: 440px; line-height: 1.5; }

/* ── Chat panel ──────────────────────────────────────────────── */
.demo { width: 100%; max-width: 600px; margin: 34px auto 0; background: var(--panel); border: 1px solid var(--rule); border-radius: 26px; box-shadow: var(--panel-shadow); backdrop-filter: blur(20px) saturate(1.3); -webkit-backdrop-filter: blur(20px) saturate(1.3); display: flex; flex-direction: column; overflow: hidden; transition: background .7s ease, border-color .7s ease, box-shadow .7s ease; text-align: left; }
.demo-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--rule-soft); }
.demo-head .mk { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; transition: all .5s; }
.demo-head .nm { font-weight: 600; font-size: 14px; }
.demo-head .st { margin-left: auto; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.demo-badge { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-deep); background: rgba(232,112,74,0.12); padding: 4px 8px; border-radius: 999px; }

.msgs { padding: 20px 18px; display: flex; flex-direction: column; gap: 14px; height: 340px; overflow-y: auto; scroll-behavior: smooth; }
.msgs::-webkit-scrollbar { width: 7px; }
.msgs::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 99px; }

.msg { display: flex; gap: 9px; align-items: flex-end; max-width: 90%; opacity: 1; animation: pop .32s cubic-bezier(.2,.7,.3,1.2); }
.msg.them { align-self: flex-start; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg .mk { width: 36px; height: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all .5s; }
.bub { padding: 11px 15px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; }
.msg.them .bub { background: var(--bub-them); border-bottom-left-radius: 5px; color: var(--ink); }
.msg.me .bub { background: var(--bub-me); color: var(--bub-me-ink); border-bottom-right-radius: 5px; }
.bub b { color: var(--accent-deep); font-weight: 600; }
.msg.me .bub b { color: inherit; }

/* rich card inside a Wallie message */
.rich { margin-top: 10px; background: var(--panel-2); border: 1px solid var(--rule-soft); border-radius: 14px; padding: 15px 16px; transition: background .5s; }
.rich .lab { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mid); }
.rich .big { font-family: var(--f-display); font-weight: 400; font-size: 38px; letter-spacing: -0.04em; line-height: 1; margin-top: 7px; font-variant-numeric: tabular-nums; }
.rich .big em { font-style: italic; color: var(--accent-deep); }
.rich .row { display: flex; align-items: baseline; gap: 10px; }
.rich .up { font-family: var(--f-mono); font-size: 11px; color: var(--pos); }
.rich .bar { height: 7px; border-radius: 99px; background: var(--rule); overflow: hidden; margin-top: 12px; }
.rich .bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.rich .meta { display: flex; justify-content: space-between; margin-top: 9px; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.04em; color: var(--mid); }
.rich .meta b { color: var(--ink); }
.cd-mini { display: flex; gap: 16px; align-items: flex-start; margin-top: 4px; }
.cd-mini .u { text-align: center; }
.cd-mini .u .v { font-family: var(--f-display); font-size: 40px; letter-spacing: -0.04em; line-height: 0.9; }
.cd-mini .u .l { font-family: var(--f-mono); font-size: 8.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mid); margin-top: 6px; }
.chips-mini { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip-acct { font-size: 11.5px; padding: 5px 10px; border-radius: 99px; background: var(--bg); border: 1px solid var(--rule); display: inline-flex; align-items: center; gap: 6px; }
.chip-acct .dt { width: 6px; height: 6px; border-radius: 50%; }
.cat + .cat { margin-top: 10px; }
.cat-top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; }
.cat-top .v { font-family: var(--f-display); }
.cat-track { height: 6px; border-radius: 99px; background: var(--rule); overflow: hidden; }
.cat-fill { height: 100%; border-radius: 99px; background: var(--accent); }

/* CTA card (shown on un-scripted answers) */
.rich-cta { background: var(--accent); border: none; }
[data-mode="fire"] .rich-cta { background: linear-gradient(135deg, #FF7A4D, #C9532E); }
.rich-cta .cta-t { font-size: 13.5px; line-height: 1.45; color: #fff; }
.rich-cta .cta-t b { color: #fff; font-weight: 700; }
.cta-btn { margin-top: 12px; width: 100%; border: none; cursor: pointer; background: #fff; color: #1A1410; border-radius: 11px; padding: 11px 16px; font-family: var(--f-sans); font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .15s; }
.cta-btn span { color: #C9532E; transition: transform .2s; }
.cta-btn:hover { transform: translateY(-1px); }
.cta-btn:hover span { transform: translateX(3px); }

/* typing indicator */
.typing { display: inline-flex; gap: 4px; padding: 13px 15px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: td 1.2s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes td { 0%,60%,100%{transform:translateY(0);opacity:.4} 30%{transform:translateY(-5px);opacity:1} }

/* input */
.compose { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--rule-soft); }
.compose input { flex: 1; border: none; background: transparent; font-size: 15px; color: var(--ink); outline: none; padding: 6px 4px; }
.compose input::placeholder { color: var(--faint); }
.compose .send { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform .15s, background .5s; }
.compose .send:hover { transform: scale(1.06); }
.compose .send svg { stroke: #fff; }

/* suggested chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 20px auto 0; max-width: 600px; }
.chip { border: 1px solid var(--rule); background: var(--panel); color: var(--mid); border-radius: 999px; padding: 9px 16px; font-size: 13.5px; font-weight: 500; cursor: pointer; transition: border-color .15s, color .15s, transform .15s, background .5s; }
.chip:hover { border-color: var(--accent); color: var(--accent-deep); transform: translateY(-1px); }

.foot { margin-top: 26px; font-size: 12.5px; color: var(--faint); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; }
.foot a { color: var(--mid); text-decoration: none; border-bottom: 1px solid var(--rule); }
.foot a:hover { color: var(--ink); }

/* mobile CTA — visible only when the header .req is hidden */
.req.req-mobile { display: none; }

@media (max-width: 560px) {
  .bar { padding: 16px 18px; }
  .toggle button { padding: 7px 12px; }
  .bar .req { display: none; }
  .login-btn { padding: 8px 14px; font-size: 12.5px; }
  .req.req-mobile { display: inline-flex; align-items: center; justify-content: center; margin: 20px auto 0; font-weight: 600; font-size: 15px; padding: 14px 32px; border-radius: 999px; border: none; cursor: pointer; background: var(--ink); color: var(--bg); transition: transform .15s, background .5s, color .5s; }
  .req.req-mobile:hover { transform: translateY(-1px); }
  .stage { padding: 8px 16px 28px; }
  .prompt { font-size: clamp(30px, 9vw, 40px); }
  .msgs { height: clamp(230px, 42dvh, 360px); }
  .demo { border-radius: 22px; margin-top: 24px; }
  .chips { gap: 7px; }
  .chip { padding: 8px 13px; font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .blob, .ember, .eyebrow .d { animation: none; }
  .embers { display: none; }
}

/* ── Request access modal ── */
.ra-overlay { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(4px); animation: raFadeIn 0.2s ease; }
@keyframes raFadeIn { from { opacity: 0; } to { opacity: 1; } }
.ra-modal { position: relative; background: var(--panel); border-radius: 20px; padding: 40px 36px; max-width: 420px; width: 100%; box-shadow: 0 30px 80px rgba(0,0,0,0.3); }
.ra-close { position: absolute; top: 14px; right: 18px; background: none; border: none; font-size: 26px; color: var(--mid); cursor: pointer; line-height: 1; }
.ra-title { font-family: var(--f-sans); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; margin: 0 0 8px; color: var(--ink); }
.ra-sub { font-size: 14px; color: var(--mid); margin: 0 0 20px; line-height: 1.5; }
.ra-form { display: flex; gap: 10px; }
.ra-input { flex: 1; padding: 12px 16px; border-radius: 12px; border: 1.5px solid var(--rule); background: var(--bg); font-size: 15px; font-family: var(--f-sans); color: var(--ink); outline: none; transition: border-color 0.15s; }
.ra-input:focus { border-color: var(--accent); }
.ra-submit { padding: 12px 22px; border-radius: 12px; border: none; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; font-family: var(--f-sans); cursor: pointer; white-space: nowrap; transition: background 0.15s; }
.ra-submit:hover { background: var(--accent-deep); }
.ra-submit:disabled { opacity: 0.6; cursor: default; }
.ra-submit[aria-busy="true"] .ra-submit-label::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  vertical-align: -2px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: raSpin 0.7s linear infinite;
}
@keyframes raSpin { to { transform: rotate(360deg); } }
.ra-msg { margin: 16px 0 0; font-size: 14px; line-height: 1.4; }
.ra-msg--ok { color: var(--pos); }
.ra-msg--err { color: var(--accent-deep); }
@media (max-width: 500px) {
  .ra-modal { padding: 30px 24px; }
  .ra-form { flex-direction: column; }
}

/* ── Cookie notice ── */
.cookie-notice {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 520px;
  margin: 0 auto;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--rule);
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  font-size: 13px;
  color: var(--mid);
}
.cookie-notice p { margin: 0; flex: 1; line-height: 1.45; }
.cookie-notice a { color: var(--accent-deep); text-decoration: underline; }
.cookie-notice__ok {
  flex-shrink: 0;
  padding: 8px 14px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--f-sans);
  cursor: pointer;
}
