/* ==========================================================
   Somnia — base "perfectly normal" marketing styles.
   All colours come from CSS variables that js/core.js rewrites
   continuously as the visitor scrolls.
   ========================================================== */
:root {
  --bg: #FBF8FF; --surface: #FFFFFF; --text: #1E1B2E; --muted: #6B6684;
  --accent: #6D5DF6; --accent2: #FF9F7A; --line: #ECE8F7;
  --w: 0; --ew: 0; --door: 1;
  --radius: 20px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace;
  --shadow: 0 1px 2px rgba(30,27,46,.04), 0 12px 32px -12px rgba(60,40,140,.18);
}
* { box-sizing: border-box; }
html { scroll-behavior: auto; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.15; }
h2 { font-size: clamp(30px, 4vw, 46px); font-weight: 750; }
h3 { font-size: 19px; font-weight: 650; }
p { margin: 0 0 1em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
section { position: relative; padding: 110px 0; }

.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: .04em;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 18px;
}
.lead { font-size: 19px; color: var(--muted); max-width: 34em; }
.sec-head { text-align: center; max-width: 720px; margin: 0 auto 56px; }
.sec-head .lead { margin: 16px auto 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
  font: 600 16px/1 var(--font); padding: 16px 26px; border-radius: 14px;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 24px -10px var(--accent); }
.btn-ghost { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn-sm { padding: 10px 16px; font-size: 14px; border-radius: 10px; }

/* ---------- top bar + nav ---------- */
.topbar { background: var(--text); color: var(--bg); text-align: center; font-size: 13px; padding: 9px 16px; }
.topbar b { color: var(--accent2); }
.nav {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 32px;
  padding: 14px max(24px, calc((100vw - 1180px) / 2 + 24px));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 22px; letter-spacing: -0.04em; }
.logo-mark {
  width: 26px; height: 26px; border-radius: 50%; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}
.logo-mark::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); top: -3px; right: -5px; }
.nav-links { display: flex; gap: 28px; margin-left: auto; font-size: 15px; color: var(--muted); }
.nav-links a:hover { color: var(--text); }

/* ---------- hero ---------- */
.hero { padding: 64px 0 90px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(46px, 6.4vw, 82px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.04; margin-bottom: 22px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 26px; }
.rating { font-size: 14px; color: var(--muted); }
.stars { color: #F5B300; letter-spacing: 2px; margin-right: 6px; }
.hero-art { position: relative; }
.illu { width: 100%; height: auto; filter: drop-shadow(0 30px 50px rgba(70,50,160,.18)); }
.float-card {
  position: absolute; background: var(--surface); color: var(--text); border-radius: 14px;
  padding: 12px 16px; font-size: 14px; box-shadow: var(--shadow); animation: floaty 6s ease-in-out infinite;
}
.float-card b { margin-right: 6px; }
.fc-1 { left: -18px; bottom: 16%; }
.fc-2 { right: 6%; top: -14px; animation-delay: -3s; display: flex; align-items: center; gap: 8px; }
.up { color: #18A957; font-weight: 600; margin-left: 6px; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: #18A957; box-shadow: 0 0 0 4px rgba(24,169,87,.18); }
@keyframes floaty { 50% { transform: translateY(-8px); } }

/* illustration colours (derived from palette so they darken with it) */
.i-wall { fill: color-mix(in srgb, var(--accent) 11%, var(--surface)); }
.i-floor { fill: color-mix(in srgb, var(--accent) 20%, var(--surface)); }
.i-rug { fill: color-mix(in srgb, var(--accent2) 30%, var(--surface)); }
.i-window { fill: color-mix(in srgb, var(--accent) 55%, #1b1740); }
.i-moon { fill: #FFF3C9; }
.i-star { fill: #fff; }
.i-pane { stroke: color-mix(in srgb, var(--accent) 20%, var(--surface)); stroke-width: 6; }
.i-curtain { fill: color-mix(in srgb, var(--accent2) 55%, var(--surface)); }
.i-doorframe { fill: color-mix(in srgb, var(--accent) 30%, var(--surface)); }
.i-doorgap { fill: #0b0912; }
.i-door { fill: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.i-door-panel { fill: none; stroke: color-mix(in srgb, var(--accent) 26%, var(--surface)); stroke-width: 3; }
.i-knob { fill: var(--accent2); }
.i-door-g { transform-box: fill-box; transform-origin: left center; transform: scaleX(var(--door)); }
.i-figure { fill: #050407; opacity: 0; transition: opacity 2s; }
.i-figure-arm { stroke: #050407; }
.i-eye { fill: #fff; }
.i-stand { fill: color-mix(in srgb, var(--accent2) 45%, var(--surface)); }
.g-a { stop-color: var(--accent); stop-opacity: .55; }
.g-b { stop-color: var(--accent); stop-opacity: 0; }
.i-orb-glow { animation: pulse 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.i-orb { fill: var(--accent); }
.i-orb-pupil { fill: #fff; opacity: .85; }
.i-head, .i-bedframe { fill: color-mix(in srgb, var(--accent) 40%, var(--surface)); }
.i-mattress { fill: var(--surface); }
.i-pillow { fill: #fff; }
.i-skin { fill: #F2C6A8; }
.i-hair { fill: #3B2A2A; }
.i-lid { stroke: #3B2A2A; stroke-width: 2; stroke-linecap: round; }
.i-blanket { fill: color-mix(in srgb, var(--accent) 70%, var(--surface)); }
.i-z { fill: var(--accent); font: 700 18px var(--font); opacity: .7; animation: zz 3s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.12); opacity: .7; } }
@keyframes zz { 50% { transform: translateY(-6px); opacity: .25; } }

/* ---------- press / stats ---------- */
.press { padding: 26px 0 40px; text-align: center; }
.press p { font-size: 13px; color: var(--muted); letter-spacing: .1em; }
.press-logos { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px 56px; color: var(--muted); opacity: .75; font-size: 22px; }
.pl-a { font-family: Georgia, "Songti SC", serif; font-weight: 700; }
.pl-b { font-weight: 800; letter-spacing: -0.05em; }
.pl-c { font-weight: 300; letter-spacing: .2em; }
.pl-d { font-family: var(--mono); }
.pl-e { font-family: Georgia, serif; font-style: italic; }
.stats { padding: 40px 0; }
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center;
  background: var(--surface); border-radius: 28px; padding: 40px 24px; box-shadow: var(--shadow);
}
.stat b { display: block; font-size: clamp(30px, 4vw, 44px); font-weight: 800; letter-spacing: -0.03em; color: var(--accent); }
.stat span { color: var(--muted); font-size: 15px; }

/* ---------- features ---------- */
.feat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); transition: transform .3s;
}
.feat:hover { transform: translateY(-4px); }
.feat-ico {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 20px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.feat-ico svg { width: 24px; height: 24px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.feat h3 { margin-bottom: 10px; }
.feat p { color: var(--muted); font-size: 15px; margin: 0; }

/* ---------- how ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: s; }
.step { position: relative; padding: 32px 28px; border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.step i {
  font-style: normal; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; margin-bottom: 18px;
}
.step h3 { margin-bottom: 8px; }
.step p { color: var(--muted); margin: 0; }
.step.ghost { grid-column: 2; opacity: .035; background: transparent; transition: opacity 3s; }

/* ---------- app ---------- */
.app-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.app h2 { margin-bottom: 26px; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; font-size: 17px; }
.checks li { padding-left: 34px; position: relative; }
.checks li::before {
  content: "✓"; position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; color: #fff; background: var(--accent);
}
.phone-wrap { display: grid; place-items: center; }
.phone {
  width: 300px; height: 610px; border-radius: 46px; background: #0c0b14; padding: 12px; position: relative;
  box-shadow: 0 40px 80px -30px rgba(40,20,120,.45), inset 0 0 0 2px #2b2940;
}
.ph-notch { position: absolute; top: 12px; left: 50%; width: 110px; height: 28px; margin-left: -55px; background: #0c0b14; border-radius: 0 0 16px 16px; z-index: 2; }
.ph-screen { height: 100%; border-radius: 36px; background: linear-gradient(180deg, #1a1838, #121025); color: #ECEAFF; padding: 46px 18px 18px; overflow: hidden; }
.ph-top small { display: block; color: #8C88B5; font-size: 12px; }
.ph-top b { font-size: 20px; }
.ph-score { display: flex; align-items: center; gap: 16px; margin: 16px 0; }
.ph-score svg { width: 84px; height: 84px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #2a2750; stroke-width: 10; }
.ring { fill: none; stroke: #8E80FF; stroke-width: 10; stroke-linecap: round; stroke-dasharray: 314; stroke-dashoffset: 25; }
.ph-score b { font-size: 34px; display: block; line-height: 1; }
.ph-score small { color: #8C88B5; font-size: 12px; }
.hypno { width: 100%; height: 90px; background: rgba(255,255,255,.03); border-radius: 10px; }
.hypno-line { fill: none; stroke: #8E80FF; stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.hypno-mark { stroke: #ff5a6a; stroke-width: 1; stroke-dasharray: 2 3; opacity: .5; vector-effect: non-scaling-stroke; }
.hypno-axis { display: flex; justify-content: space-between; font-size: 10px; color: #6E6A99; margin: 4px 2px 12px; }
.ph-rows > div { display: flex; justify-content: space-between; font-size: 13px; padding: 9px 2px; border-bottom: 1px solid #24214a; position: relative; }
.ph-rows span { color: #9a96c4; }
.anomaly span, .anomaly b { color: #ff8a95 !important; font-size: 12px; }
.dot-red { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #ff5a6a; margin-right: 6px; vertical-align: middle; }
.anomaly { cursor: help; }
.tip {
  position: absolute; right: 0; bottom: 110%; background: #fff; color: #222; font-style: normal; font-size: 12px;
  padding: 6px 10px; border-radius: 8px; opacity: 0; transition: opacity .3s; pointer-events: none; white-space: nowrap;
}
.anomaly:hover .tip { opacity: 1; }

/* ---------- reviews ---------- */
.rev-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.rev { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.rev .stars { display: block; margin: 14px 0 8px; }
.rev blockquote { margin: 0 0 14px; font-size: 16px; }
.rev figcaption { color: var(--muted); font-size: 14px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; }
.avatar svg { width: 100%; height: 100%; }

/* ---------- science ---------- */
.science p { font-size: 19px; line-height: 1.95; }
.science h2 { margin-bottom: 30px; }
.sci-edit { min-height: 2em; font-weight: 600; }
.sci-edit del { color: var(--muted); text-decoration-thickness: 2px; }
.caret { display: inline-block; width: 2px; height: 1.1em; background: currentColor; vertical-align: -3px; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.pull { margin: 48px 0 0; font-size: 26px; font-family: Georgia, "Songti SC", serif; font-style: italic; color: var(--muted); border-left: 3px solid var(--accent); padding-left: 22px; }

/* ---------- night log ---------- */
.log h2 { margin-bottom: 10px; }
.log-date { color: var(--muted); font-family: var(--mono); font-size: 14px; }
.log-list { list-style: none; padding: 0; margin: 28px 0 0; font-size: 18px; }
.log-list li { display: flex; gap: 22px; padding: 14px 0; border-bottom: 1px dashed var(--line); opacity: 0; transform: translateY(8px); transition: opacity .8s, transform .8s; }
.log-list li.in { opacity: 1; transform: none; }
.log-list time { font-family: var(--mono); color: var(--accent); min-width: 72px; }
.log-list.live { margin-top: 0; }

/* ---------- pricing ---------- */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: start; }
.price { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 34px 30px; box-shadow: var(--shadow); text-align: center; }
.price h3 { font-size: 18px; color: var(--muted); }
.price .amt { font-size: 52px; font-weight: 800; letter-spacing: -0.04em; margin: 8px 0 0; }
.price .amt small { font-size: 18px; color: var(--muted); font-weight: 500; }
.price > small { color: var(--muted); }
.price ul { list-style: none; padding: 0; margin: 24px 0 28px; text-align: left; display: grid; gap: 10px; }
.price li::before { content: "✓  "; color: var(--accent); font-weight: 700; }
.price .btn { width: 100%; justify-content: center; }
.price.forever { border: 2px solid var(--accent); }
.badge { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
.runaway { display: inline-block; margin-top: 14px; font-size: 13px; color: var(--muted); cursor: pointer; transition: transform .25s ease-out; user-select: none; }

/* ---------- faq ---------- */
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { list-style: none; cursor: pointer; font-size: 18px; font-weight: 600; padding: 18px 40px 18px 0; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 26px; font-weight: 300; color: var(--accent); transition: transform .3s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); font-size: 17px; padding-bottom: 12px; }

/* ---------- cta ---------- */
.cta h2 { margin-bottom: 16px; }
.cta .lead { margin: 0 auto; }
.sub { display: flex; gap: 10px; max-width: 480px; margin: 34px auto 0; }
.sub input { flex: 1; min-width: 0; font: 16px var(--font); padding: 15px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); outline: none; }
.sub input:focus { border-color: var(--accent); }
.sub-msg { margin-top: 16px; color: var(--muted); min-height: 1.6em; }

/* ---------- demo ---------- */
.demo { height: 720vh; padding: 0; }
.demo-sticky { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 70px 16px 24px; }
.demo-head { display: flex; align-items: center; gap: 14px; }
.demo-head h2 { font-size: clamp(20px, 2.6vw, 30px); }
.live-pill { display: inline-flex; align-items: center; gap: 6px; font: 700 12px var(--mono); color: #fff; background: #c0001a; padding: 4px 9px; border-radius: 6px; }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blink 1.2s steps(1) infinite; }
.demo-frame {
  width: min(1100px, 94vw, calc((100vh - 210px) * 16 / 9)); aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden;
  background: #000; box-shadow: 0 0 0 1px #222, 0 30px 80px -20px #000;
}
#cctv { width: 100%; height: 100%; }
.demo-caption { color: var(--muted); text-align: center; min-height: 3.2em; max-width: 40em; margin: 0; font-size: 16px; }

/* ---------- finale + footer ---------- */
.finale { padding: 30vh 24px 20vh; background: #000; }
.fin { max-width: 900px; margin: 0 auto; text-align: center; }
.fin-line { font-size: clamp(22px, 3.4vw, 40px); color: #b9aaaa; margin: 0 0 42vh; opacity: 0; filter: blur(6px); transition: opacity 2.4s, filter 2.4s; }
.fin-line.in { opacity: 1; filter: none; }
.fin-line b { color: #e0001f; }
.fin-line.dim { color: #6a5a5a; font-size: clamp(18px, 2.4vw, 28px); }
.fin-line.big { font-size: clamp(64px, 14vw, 180px); color: #d8c8c8; font-weight: 800; letter-spacing: .1em; margin-bottom: 30vh; }
.footer { padding: 60px 0 40px; border-top: 1px solid var(--line); }
.foot-grid { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.foot-grid p { color: var(--muted); margin-top: 10px; }
.foot-links { display: flex; gap: 26px; color: var(--muted); flex-wrap: wrap; }
.copy { text-align: center; color: var(--muted); font-size: 13px; margin: 40px 0 0; }

/* ---------- widgets: cookie / toast / sound / chat ---------- */
.cookie {
  position: fixed; z-index: 80; left: 50%; bottom: 20px; transform: translateX(-50%); width: min(720px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 18px; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: 0 20px 50px -20px rgba(0,0,0,.35);
  transition: opacity .4s, transform .4s;
}
.cookie p { margin: 0; font-size: 14px; flex: 1; }
.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }
.cookie.hide { opacity: 0; transform: translate(-50%, 20px); pointer-events: none; }
.toast {
  position: fixed; z-index: 70; left: 20px; bottom: 76px; display: flex; gap: 12px; align-items: center; max-width: 330px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px;
  box-shadow: 0 16px 40px -16px rgba(0,0,0,.3); font-size: 14px; opacity: 0; transform: translateY(16px); transition: opacity .5s, transform .5s; pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }
.toast p { margin: 0; }
.toast small { display: block; color: var(--muted); font-size: 12px; }
.toast-ico { font-size: 20px; }
.sound-btn {
  position: fixed; z-index: 75; left: 20px; bottom: 20px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); display: none; place-items: center; cursor: pointer; box-shadow: var(--shadow);
}
.sound-btn.on { display: grid; }
.sound-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sound-btn.muted .wave { opacity: .15; }
.chat { position: fixed; z-index: 85; right: 20px; bottom: 20px; display: none; }
.chat.on { display: block; }
.chat-fab {
  display: flex; align-items: center; gap: 10px; border: 0; cursor: pointer; font: 600 14px var(--font);
  background: var(--surface); color: var(--text); padding: 10px 16px 10px 10px; border-radius: 999px; box-shadow: 0 14px 34px -12px rgba(0,0,0,.35); position: relative;
}
.chat-badge { position: absolute; top: -4px; right: -4px; background: #ff3b4f; color: #fff; font: 700 11px var(--font); width: 20px; height: 20px; border-radius: 50%; display: none; place-items: center; font-style: normal; }
.chat-badge.on { display: grid; }
.chat-ava { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; background: radial-gradient(circle at 35% 35%, #fff 0 8%, transparent 9%), linear-gradient(135deg, var(--accent), var(--accent2)); }
.chat-ava.sm { width: 30px; height: 30px; }
.chat-panel {
  position: absolute; right: 0; bottom: 0; width: min(350px, calc(100vw - 40px)); height: 470px; display: none; flex-direction: column;
  background: var(--surface); color: var(--text); border-radius: 20px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 30px 70px -20px rgba(0,0,0,.45);
}
.chat.open .chat-panel { display: flex; }
.chat.open .chat-fab { visibility: hidden; }
.chat-head { display: flex; gap: 12px; align-items: center; padding: 14px 16px; background: var(--accent); color: #fff; }
.chat-head small { display: block; opacity: .85; font-size: 12px; }
.chat-head button { margin-left: auto; background: none; border: 0; color: #fff; font-size: 26px; cursor: pointer; line-height: 1; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; animation: pop .25s ease-out; }
.msg.bot { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg.me { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.msg.typing { display: flex; gap: 4px; }
.msg.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: bounce 1s infinite; }
.msg.typing i:nth-child(2) { animation-delay: .15s; } .msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 50% { transform: translateY(-4px); opacity: .4; } }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
.chat-input { display: flex; border-top: 1px solid var(--line); }
.chat-input input { flex: 1; border: 0; padding: 14px 16px; font: 14px var(--font); background: transparent; color: var(--text); outline: none; }
.chat-input button { border: 0; background: none; color: var(--accent); font: 600 14px var(--font); padding: 0 16px; cursor: pointer; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero-grid, .app-grid { grid-template-columns: 1fr; }
  .feat-grid { grid-template-columns: 1fr 1fr; }
  .rev-grid, .price-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .nav .btn { margin-left: auto; }
}
@media (max-width: 640px) {
  section { padding: 76px 0; }
  .wrap { padding: 0 16px; }
  .feat-grid, .rev-grid, .price-grid, .steps { grid-template-columns: 1fr; }
  .step.ghost { grid-column: 1; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .fc-1 { left: 0; }
  .cookie { flex-direction: column; align-items: stretch; }
  .chat-fab span:not(.chat-ava) { display: none; }
  .toast { left: 16px; right: 16px; max-width: none; }
}
