/* Dear Friend — South Beach after dark */
:root {
  --ink: #13101f; --ink-2: #1b1730; --card: #221d3a; --line: #332c52;
  --sand: #f7efe4; --muted: #b9afcb; --dim: #8a80a3;
  --coral: #ff8f70; --flamingo: #ff6f91; --mint: #7fe0cf; --gold: #f2c879;
  --radius: 18px;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--ink); color: var(--sand); font: 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(255,111,145,.16), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(127,224,207,.09), transparent 60%);
  background-attachment: fixed;
}
a { color: var(--mint); }
a:hover { color: var(--gold); }
img, svg { display: block; max-width: 100%; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 22px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 12px; background: var(--sand); color: var(--ink); padding: 8px 12px; border-radius: 8px; z-index: 99; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }

/* ---------- nav ---------- */
.nav { display: flex; align-items: center; gap: 18px; padding: 18px 0; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--sand); text-decoration: none; font: 600 20px/1 var(--display); letter-spacing: .2px; }
.brand img { width: 34px; height: 34px; }
.nav .links { margin-left: auto; display: flex; gap: 18px; align-items: center; }
.nav .links a:not(.btn) { color: var(--muted); text-decoration: none; font-size: 15px; }
.nav .links a:not(.btn):hover { color: var(--sand); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none;
  background: linear-gradient(135deg, var(--coral), var(--flamingo)); color: #1a0f16; font: 700 15px/1 var(--body);
  padding: 13px 20px; border-radius: 999px; box-shadow: 0 8px 24px -10px rgba(255,111,145,.7); transition: transform .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); color: #1a0f16; box-shadow: 0 12px 28px -10px rgba(255,111,145,.85); }
.btn.big { padding: 17px 26px; font-size: 17px; }
.btn.ghost { background: transparent; color: var(--sand); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--muted); color: var(--sand); }
.btn.danger { background: #ff5d73; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--line);
  background: var(--ink-2); color: var(--sand); cursor: pointer; font-size: 18px; transition: background .15s, border-color .15s; }
.icon-btn:hover { border-color: var(--muted); }
.icon-btn[aria-pressed="true"] { background: rgba(127,224,207,.16); border-color: var(--mint); color: var(--mint); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding: 48px 0 70px; }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .18em; font-size: 12px; font-weight: 700; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.12; margin: 0 0 14px; }
h1 { font-size: clamp(38px, 5.4vw, 64px); letter-spacing: -.5px; }
h1 em { font-style: italic; color: var(--coral); }
h2 { font-size: clamp(28px, 3.4vw, 40px); }
h3 { font-size: 20px; }
.lead { font-size: 19px; color: var(--muted); max-width: 560px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 14px; }
.trust { color: var(--dim); font-size: 14px; display: flex; gap: 16px; flex-wrap: wrap; }
.trust span::before { content: "✦ "; color: var(--mint); }
.hero-pet { position: relative; aspect-ratio: 1; max-width: 400px; justify-self: center; width: 100%; }
.hero-pet::before { content: ""; position: absolute; inset: 6%; border-radius: 50%;
  background: conic-gradient(from 200deg, var(--flamingo), var(--gold), var(--mint), var(--flamingo)); filter: blur(46px); opacity: .35; }
.bubble-hint { position: absolute; right: -4%; top: 6%; background: var(--sand); color: var(--ink); padding: 10px 14px; border-radius: 16px 16px 4px 16px;
  font: 500 14px/1.35 var(--body); max-width: 190px; box-shadow: 0 10px 30px -12px #000; }

/* ---------- pet avatar ---------- */
.pet { width: 100%; height: 100%; position: relative; }
.pet .body { transform-origin: 50% 80%; animation: breathe 4.5s ease-in-out infinite; }
.pet .eye { transform-box: fill-box; transform-origin: center; animation: blink 6s infinite; }
.pet .mouth { transition: d .2s; }
.pet.speaking .mouth-open { animation: talk .32s ease-in-out infinite alternate; }
.pet .mouth-open { opacity: 0; transform-box: fill-box; transform-origin: center; }
.pet.speaking .mouth-open { opacity: 1; }
.pet.speaking .mouth-closed { opacity: 0; }
.pet.listening .ear { fill: var(--mint); }
.pet.listening .halo { opacity: .9; animation: pulse 1.4s ease-in-out infinite; }
.pet.thinking .pupil { transform: translate(2px, -3px); }
.pet .pupil { transition: transform .4s; }
.pet .halo { opacity: 0; transform-box: fill-box; transform-origin: center; }
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.025, .985); } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes talk { from { transform: scaleY(.35); } to { transform: scaleY(1.1); } }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: .5; } 50% { transform: scale(1.06); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pet * { animation: none !important; } }

/* ---------- sections ---------- */
section.block { padding: 70px 0; border-top: 1px solid rgba(255,255,255,.06); }
.section-head { max-width: 680px; margin-bottom: 34px; }
.section-head p { color: var(--muted); font-size: 18px; }
.grid { display: grid; gap: 18px; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.card { background: linear-gradient(180deg, var(--card), var(--ink-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card p { color: var(--muted); margin: 0; }
.step-num { font: 600 44px/1 var(--display); color: var(--coral); opacity: .9; margin-bottom: 10px; }
.lens-tag { display: inline-block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--mint); margin-bottom: 8px; font-weight: 700; }
.deco { height: 10px; margin: 0 0 18px; width: 90px; background:
  repeating-linear-gradient(90deg, var(--gold) 0 3px, transparent 3px 9px); opacity: .6; border-radius: 2px; }
.quote { font: italic 500 22px/1.45 var(--display); color: var(--sand); }
.voice-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.voice-list li { padding-left: 28px; position: relative; color: var(--muted); }
.voice-list li::before { content: "◗"; position: absolute; left: 0; color: var(--coral); }
details.faq { border-bottom: 1px solid var(--line); padding: 18px 0; }
details.faq summary { cursor: pointer; font: 600 19px/1.35 var(--display); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.faq summary::after { content: "+"; color: var(--coral); font-size: 24px; line-height: 1; }
details.faq[open] summary::after { content: "–"; }
details.faq p { color: var(--muted); margin: 12px 0 0; }
.safety-strip { background: rgba(127,224,207,.08); border: 1px solid rgba(127,224,207,.3); border-radius: var(--radius); padding: 18px 22px; color: var(--sand); }
.safety-strip a { font-weight: 700; }

/* ---------- ads ---------- */
.ad-slot { margin: 30px auto; min-height: 0; text-align: center; }
.ad-slot:not(:empty) { min-height: 100px; }
.ad-slot::before { content: attr(data-label); display: block; font-size: 11px; color: var(--dim); letter-spacing: .1em; text-transform: uppercase; }
.ad-slot:empty::before { content: none; }

/* ---------- footer ---------- */
footer.site { border-top: 1px solid rgba(255,255,255,.07); padding: 40px 0 50px; color: var(--dim); font-size: 14px; }
footer.site .cols { display: flex; gap: 30px; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; }
footer.site nav { display: flex; gap: 18px; flex-wrap: wrap; }
footer.site nav a { color: var(--muted); text-decoration: none; }
footer.site .sig { text-align: right; }
footer.site .sig .place { color: var(--gold); letter-spacing: .14em; text-transform: uppercase; font-size: 12px; margin-top: 4px; }

/* ---------- legal pages ---------- */
.legal { max-width: 760px; padding: 30px 0 60px; }
.legal h1 { font-size: clamp(34px, 4.6vw, 48px); }
.legal h2 { font-size: 24px; margin-top: 36px; }
.legal p, .legal li { color: var(--muted); }
.legal strong { color: var(--sand); }
.legal .updated { color: var(--dim); font-size: 14px; }

/* ---------- consent ---------- */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin: 0 auto; z-index: 60; background: var(--card);
  border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: 0 20px 50px -20px #000; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.consent p { margin: 0; flex: 1 1 260px; }
.consent .row { display: flex; gap: 8px; }
.consent .btn { padding: 10px 16px; font-size: 14px; }

/* =========================================================
   APP (chat) VIEW
   ========================================================= */
#app { position: fixed; inset: 0; z-index: 40; background: var(--ink); display: flex; flex-direction: column;
  background-image: radial-gradient(800px 400px at 100% 0, rgba(255,111,145,.12), transparent 60%); }
#app[hidden] { display: none; }
body.app-open { overflow: hidden; }
.app-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: rgba(19,16,31,.85); backdrop-filter: blur(8px); }
.app-top .mini-pet { width: 44px; height: 44px; flex: none; }
.app-top .who { line-height: 1.2; min-width: 0; }
.app-top .who b { font: 600 18px/1.1 var(--display); display: block; }
.chip { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 46vw; }
.chip.hot { color: var(--flamingo); }
.app-top .tools { margin-left: auto; display: flex; gap: 6px; }
.app-main { flex: 1; overflow: hidden; display: flex; flex-direction: column; width: 100%; max-width: 820px; margin: 0 auto; }
.crisis { margin: 12px 14px 0; background: #3a1825; border: 1px solid #ff6f91; color: var(--sand); border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.crisis[hidden] { display: none; }
.crisis ul { margin: 6px 0 0; padding-left: 18px; }
.crisis a { color: #ffd2dc; font-weight: 700; }

/* onboarding */
.onboard { margin: auto; width: 100%; max-width: 620px; padding: 20px; }
.onboard .card { padding: 28px; }
.progress { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-bottom: 22px; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--coral), var(--gold)); transition: width .35s; }
.q-count { color: var(--dim); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.q-text { font: 600 26px/1.25 var(--display); margin: 8px 0 6px; }
.q-hint { color: var(--muted); margin: 0 0 16px; font-size: 15px; }
textarea, input[type=text], select { width: 100%; background: #0f0d1a; color: var(--sand); border: 1px solid var(--line); border-radius: 14px; padding: 14px; font: 16px/1.5 var(--body); }
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--mint); }
.input-row { position: relative; }
.input-row .icon-btn { position: absolute; right: 8px; bottom: 8px; }
.ob-actions { display: flex; gap: 10px; margin-top: 16px; align-items: center; }
.ob-actions .spacer { flex: 1; }
.fine { color: var(--dim); font-size: 13px; margin-top: 16px; }

/* chat */
.messages { flex: 1; overflow-y: auto; padding: 18px 14px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.msg { max-width: 84%; padding: 13px 16px; border-radius: 18px; line-height: 1.6; white-space: pre-wrap; word-wrap: break-word; position: relative; animation: rise .25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.msg.user { align-self: flex-end; background: #2e2850; border-bottom-right-radius: 6px; }
.msg.assistant { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.assistant.typing::after { content: "▍"; color: var(--coral); animation: caret 1s steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.msg .replay { position: absolute; right: -40px; bottom: 4px; width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line); background: var(--ink-2);
  color: var(--muted); cursor: pointer; font-size: 13px; opacity: .65; }
.msg .replay:hover { opacity: 1; color: var(--sand); }
.dots { display: inline-flex; gap: 5px; } .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: dot 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 10px 14px 14px; border-top: 1px solid var(--line); }
.composer textarea { resize: none; min-height: 52px; max-height: 160px; }
.composer .btn { height: 52px; }
.composer .icon-btn { width: 52px; height: 52px; border-radius: 14px; flex: none; }
.mic.live { background: rgba(255,111,145,.18) !important; border-color: var(--flamingo) !important; color: var(--flamingo) !important; animation: pulse 1.3s infinite; }
.status-line { font-size: 12px; color: var(--dim); text-align: center; padding: 0 14px 8px; min-height: 18px; }
.disclaimer { font-size: 12px; color: var(--dim); text-align: center; padding: 0 14px 10px; }

/* dialogs */
dialog { background: var(--card); color: var(--sand); border: 1px solid var(--line); border-radius: 20px; padding: 0; width: min(640px, 94vw); max-height: 88vh; }
dialog::backdrop { background: rgba(8,6,15,.7); backdrop-filter: blur(3px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { font-size: 22px; margin: 0; }
.dlg-body { padding: 20px 22px; overflow-y: auto; max-height: calc(88vh - 140px); }
.dlg-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field textarea { min-height: 76px; }
.range-row { display: flex; align-items: center; gap: 12px; } .range-row input { flex: 1; accent-color: var(--coral); } .range-row output { width: 42px; text-align: right; color: var(--muted); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.switch small { color: var(--dim); display: block; }
.switch input { width: 20px; height: 20px; accent-color: var(--coral); }
.chart { width: 100%; height: 160px; }
.bars { display: grid; gap: 8px; margin-top: 10px; }
.bar { display: grid; grid-template-columns: 96px 1fr 30px; gap: 10px; align-items: center; font-size: 14px; color: var(--muted); }
.bar span.fill { height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--coral), var(--gold)); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 20px; }
  .hero-pet { max-width: 280px; order: -1; }
  .g3, .g2 { grid-template-columns: 1fr; }
  .nav .links a.hide-sm { display: none; }
  footer.site .sig { text-align: left; }
  .msg { max-width: 88%; }
  .msg .replay { right: 6px; bottom: -14px; width: 28px; height: 28px; }
  .msg.assistant { margin-bottom: 10px; }
  .app-top .tools .icon-btn { width: 36px; height: 36px; }
}
