/* ==========================================================================
   Loboco — design system
   One stylesheet, shared across every page (cached after first load).
   No @import, no web fonts, no external requests. Mobile-first.
   ========================================================================== */

/* ---- Design tokens ---------------------------------------------------- */
:root {
  /* Brand */
  --brand:        #0E7C5A;   /* deep emerald — pharmacy/health, credible */
  --brand-strong: #0B5A41;   /* darker emerald for hovers/gradients */
  --brand-tint:   #E7F2ED;   /* faint emerald wash for surfaces */
  --accent:       #E08A3C;   /* warm terracotta — the human "hand" note */
  --wa:           #25D366;   /* WhatsApp green — reserved for WA actions */
  --wa-strong:    #1EBE59;

  /* Ink & neutrals (warm) */
  --ink:      #12232A;       /* primary text */
  --muted:    #55676D;       /* secondary text */
  --faint:    #8494999e;     /* hairlines over color */
  --line:     #E7E2D8;       /* borders on the warm bg */
  --bg:       #FBF9F5;       /* warm off-white page */
  --surface:  #FFFFFF;       /* cards */
  --surface-2:#F4F1EA;       /* alt band */

  /* Effects */
  --radius:   16px;
  --radius-sm:10px;
  --shadow:   0 1px 2px rgba(18,35,42,.05), 0 12px 32px -12px rgba(18,35,42,.14);
  --shadow-sm:0 1px 2px rgba(18,35,42,.06), 0 6px 16px -10px rgba(18,35,42,.12);
  --ring:     0 0 0 3px rgba(14,124,90,.35);

  /* Layout */
  --maxw: 1120px;
  --pad:  clamp(1.15rem, 5vw, 2rem);
  --gap:  clamp(1.25rem, 3vw, 2rem);
  --section-y: clamp(5rem, 12vw, 9rem);   /* generous vertical breathing room */

  /* System font stacks — 0 bytes over the wire, instant paint */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  /* Editorial serif for display headings — system fonts, still 0 bytes */
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
          "Times New Roman", serif;
  color-scheme: light;
}

/* Dark mode — black & silver (matches the chrome logo). White is the default;
   this only applies once toggled. */
:root[data-theme="dark"] {
  --brand:        #C9CED4;   /* silver — links, accents, primary buttons */
  --brand-strong: #E6EAEE;   /* brighter silver on hover */
  --brand-tint:   #1A1C20;   /* dark tint (chat head, pills, icon chips) */
  --accent:       #B4BAC2;   /* muted steel silver */

  --ink:      #ECEEF1;       /* near-white */
  --muted:    #969BA3;       /* silver-grey */
  --line:     #2A2D33;
  --bg:       #08090B;       /* near-black */
  --surface:  #121317;
  --surface-2:#0E0F12;

  --shadow:   0 1px 2px rgba(0,0,0,.55), 0 16px 40px -16px rgba(0,0,0,.75);
  --shadow-sm:0 1px 2px rgba(0,0,0,.5), 0 8px 20px -12px rgba(0,0,0,.65);
  --ring:     0 0 0 3px rgba(201,206,212,.4);
  color-scheme: dark;
}
/* Dark-mode component fixes: silver surfaces need dark text on them */
:root[data-theme="dark"] .btn-primary { color: #0A0B0D; }
:root[data-theme="dark"] .btn-primary:hover { background: var(--brand-strong); }
:root[data-theme="dark"] .cta-final { background: linear-gradient(135deg, #17181d, #0e0f12); border: 1px solid var(--line); }
:root[data-theme="dark"] .cta-final h2 { color: var(--ink); }
:root[data-theme="dark"] .cta-final p { color: var(--muted); }
:root[data-theme="dark"] .cta-final .btn-primary { background: var(--brand); }

/* ---- Reset-ish -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { font-family: var(--font-display); font-weight: 600; line-height: 1.06;
  letter-spacing: -0.015em; text-wrap: balance; }
h3 { line-height: 1.2; letter-spacing: -0.01em; font-weight: 700; }
h2 { font-size: clamp(1.95rem, 1.2rem + 3vw, 3.2rem); }
h3 { font-size: clamp(1.2rem, 1rem + 0.9vw, 1.5rem); }
p  { color: var(--muted); text-wrap: pretty; }
strong { color: var(--ink); }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

/* ---- Skip link -------------------------------------------------------- */
.skip {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--surface); color: var(--ink);
  padding: .7rem 1rem; border-radius: 0 0 10px 0; box-shadow: var(--shadow-sm);
}
.skip:focus { left: 0; }

/* ---- Layout helpers --------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.section { padding-block: var(--section-y); position: relative; }
.band { background: var(--surface-2); }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--brand);
  padding: .35rem .7rem; border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
  border-radius: 999px; background: color-mix(in srgb, var(--brand) 8%, transparent);
}
.lead { font-size: clamp(1.1rem, 1rem + 0.55vw, 1.35rem); color: var(--muted); max-width: 60ch; line-height: 1.65; }
.muted { color: var(--muted); }

/* ---- Background layer (behind everything) ----------------------------- */
/* CSS fallback gradient — what EVERYONE sees. The WebGL canvas (if the
   device qualifies) fades in on top of this. */
/* Soft drifting "aurora" — calm, premium, pure CSS (no JS, works on 2G).
   Confined to the first screen; the page below is clean and solid. */
.bg-layer {
  position: absolute; top: 0; left: 0; right: 0; height: 100vh;
  z-index: -1; pointer-events: none; overflow: hidden; background: var(--bg);
}
.bg-layer::before {
  content: ""; position: absolute; inset: -25%;
  background:
    radial-gradient(34rem 30rem at 26% 20%, color-mix(in srgb, var(--brand) 26%, transparent), transparent 60%),
    radial-gradient(30rem 30rem at 80% 24%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 60%),
    radial-gradient(42rem 34rem at 58% 82%, color-mix(in srgb, var(--brand) 15%, transparent), transparent 60%);
  animation: aurora 32s ease-in-out infinite alternate;
  will-change: transform;
}
.bg-layer::after { /* fade the backdrop into the page below */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 32%;
  background: linear-gradient(to bottom, transparent, var(--bg));
}
@keyframes aurora {
  from { transform: translate3d(-3%, -2%, 0) scale(1.05) rotate(-1deg); }
  to   { transform: translate3d(4%, 3%, 0) scale(1.14) rotate(1.5deg); }
}
@media (prefers-reduced-motion: reduce) { .bg-layer::before { animation: none; } }

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font: inherit; font-weight: 650; line-height: 1;
  padding: .85rem 1.25rem; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }

.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-strong); }

.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: color-mix(in srgb, var(--ink) 30%, transparent); }

.btn-wa { background: var(--wa); color: #06331b; }
.btn-wa:hover { background: var(--wa-strong); }
:root[data-theme="dark"] .btn-wa { color: #052e18; }

.btn-lg { padding: 1rem 1.6rem; font-size: 1.05rem; }
.btn-block { width: 100%; justify-content: center; }

.arrow-link { display: inline-flex; align-items: center; gap: .35rem; font-weight: 650; }
.arrow-link .a { transition: transform .15s ease; }
.arrow-link:hover .a { transform: translateX(3px); }

/* ---- Header / nav ----------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(150%) blur(14px);
  background: color-mix(in srgb, var(--bg) 68%, transparent);
  /* no border-bottom — the hard line read badly over the aurora in both themes */
}
.nav { display: flex; align-items: center; gap: 1.25rem; min-height: 88px; }
.brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .logo { width: 128px; height: 128px; object-fit: contain; flex: none; }
.brand .wordmark { font-family: var(--font-display); font-style: italic; font-weight: 600;
  font-size: 1.15rem; letter-spacing: -.01em; line-height: 1; }
.brand:hover .wordmark { color: var(--brand); }
@media (max-width: 379px) { .brand .logo { width: 88px; height: 88px; } .brand .wordmark { font-size: 1rem; } }
.nav-links { display: none; gap: .25rem; }
.site-header .brand { order: -1; margin-right: auto; }  /* brand on the LEFT, nav pushed right */
.nav-links a { color: var(--muted); font-weight: 550; padding: .5rem .7rem; border-radius: 8px; }
.nav-links a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--brand); }
.nav-tools { display: flex; align-items: center; gap: .4rem; }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); cursor: pointer;
}
.icon-btn:hover { border-color: color-mix(in srgb, var(--ink) 25%, transparent); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }

.lang { position: relative; }
.lang summary { list-style: none; }
.lang summary::-webkit-details-marker { display: none; }
.lang menu {
  position: absolute; right: 0; top: calc(100% + 6px); margin: 0; padding: .3rem;
  list-style: none; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); min-width: 168px;
}
.lang menu a { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem .7rem;
  border-radius: 8px; color: var(--ink); font-weight: 550; }
.lang menu a:hover { background: var(--brand-tint); text-decoration: none; }
.lang menu a[aria-current="true"] { color: var(--brand); }
.lang menu .soon { color: var(--muted); font-size: .8rem; font-weight: 500; }
.lang menu .disabled { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem .7rem;
  border-radius: 8px; color: var(--muted); font-weight: 550; cursor: not-allowed; user-select: none; }

.nav-cta { display: none; }

@media (min-width: 900px) {
  .nav-links { display: flex; }
  .nav-cta { display: inline-flex; }
}

/* ---- Hero ------------------------------------------------------------- */
/* Centered, minimal — one statement, lots of air. Home fills the first screen. */
.hero { display: grid; place-items: center; text-align: center;
  padding-block: clamp(4rem, 10vh, 7rem); }
.hero.hero-home { min-height: min(90vh, 840px); }

/* Home page: one screen, no scroll — only the components below are shown. */
body.page-home { height: 100vh; height: 100dvh; overflow: hidden;
  display: flex; flex-direction: column; }
body.page-home .site-header { position: static; background: transparent; backdrop-filter: none; }
body.page-home main { flex: 1 1 auto; min-height: 0; display: grid; place-items: center; }
body.page-home .hero.hero-home { min-height: 0; padding-block: clamp(1.5rem, 4vh, 3rem); }
body.page-home .chat-fab { display: none; }   /* the hero input is the assistant entry here */
.hero > .wrap { max-width: 62rem; }
.hero .eyebrow { margin-bottom: 1.75rem; }
.hero h1 {
  font-size: clamp(2.7rem, 1.3rem + 7.4vw, 5.6rem);
  font-weight: 500; max-width: 15ch; margin: 0 auto 1.5rem;
}
.hero .hl { color: var(--brand); }
.hero .lead { margin: 0 auto 2.25rem; max-width: 48ch; }
.hero-tags { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-bottom: 2.25rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: center; }
.hero-note { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-top: 1.75rem;
  font-size: .9rem; color: var(--muted); }
.hero-note svg { width: 1.05rem; height: 1.05rem; color: var(--brand); flex: none; }
.scroll-hint { display: inline-flex; margin-top: clamp(2rem, 5vh, 3.5rem); color: var(--muted); }
.scroll-hint svg { width: 26px; height: 26px; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(7px); } }
@media (prefers-reduced-motion: reduce) { .scroll-hint svg { animation: none; } }

/* Hero "How can I assist you?" — opens the Loboco assistant */
.hero-assist { max-width: 34rem; margin: 0 auto; }
.hero-assist form { display: flex; align-items: center; gap: .4rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: .35rem .35rem .35rem 1.25rem; box-shadow: var(--shadow); text-align: left; }
.hero-assist form:focus-within { border-color: color-mix(in srgb, var(--brand) 55%, transparent); }
/* Dark: lift the pill off the near-black background so it reads as an input */
:root[data-theme="dark"] .hero-assist form { background: #1C1F25; border-color: #3A404B; }
.hero-assist input { flex: 1; min-width: 0; border: none; background: transparent; font: inherit;
  font-size: 1.05rem; color: var(--ink); padding: .6rem 0; }
.hero-assist input::placeholder { color: var(--muted); }
.hero-assist input:focus { outline: none; }
.hero-assist button { flex: none; width: 48px; height: 48px; border: none; border-radius: 999px;
  background: var(--brand); color: #fff; display: grid; place-items: center; cursor: pointer;
  transition: background .2s ease; }
.hero-assist button:hover { background: var(--brand-strong); }
:root[data-theme="dark"] .hero-assist button { color: #0A0B0D; }
.hero-assist button svg { width: 20px; height: 20px; }
.hero-assist .hint { margin-top: .9rem; font-size: .85rem; color: var(--muted); }

/* Home hero → inline chat takeover (home page only; chat.js adds .chat-active) */
.hero-home .eyebrow,
.hero-home h1,
.hero-home .hero-assist .hint {
  transition: opacity 1.1s ease, transform 1.3s cubic-bezier(.22, .06, .18, 1);
}
.hero-home.chat-active .eyebrow { opacity: 0; transform: translate(-30px, -18px) rotate(-6deg); pointer-events: none; }
.hero-home.chat-active h1 { opacity: 0; transform: translateY(-30px) scale(.94); pointer-events: none; transition-delay: .15s; }
.hero-home.chat-active .hero-assist .hint {
  opacity: 0; transform: translateY(18px); pointer-events: none; position: absolute; transition-delay: .3s;
}
@media (prefers-reduced-motion: reduce) {
  .hero-home .eyebrow, .hero-home h1, .hero-home .hero-assist .hint { transition: opacity .3s ease; }
  .hero-home.chat-active .eyebrow, .hero-home.chat-active h1, .hero-home.chat-active .hero-assist .hint { transform: none; }
}

/* The box itself stays glass, not a flat card — the aurora bg-layer keeps showing through
   behind it in both themes, same treatment as the sticky header. */
.hero-assist {
  position: relative;
  transition: max-width 1.3s cubic-bezier(.22, .06, .18, 1), margin-top 1.3s cubic-bezier(.22, .06, .18, 1),
    height 1.3s cubic-bezier(.22, .06, .18, 1), background-color .6s ease, backdrop-filter .6s ease;
}
.hero-home.chat-active .hero-assist {
  max-width: min(720px, 92vw); width: 100%; margin-top: 1.25rem;
  display: flex; flex-direction: column;
  /* height is set inline by chat.js so it can animate from the pill's real
     starting height instead of the un-animatable "auto" */
  border-radius: 22px; border: 1px solid var(--line); box-shadow: var(--shadow);
  overflow: hidden;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: saturate(150%) blur(18px);
}
/* Specificity note: the log also carries the generic .chat-log class (shared
   with the floating widget), which forces display:flex unconditionally — the
   extra .hero-assist here has to outweigh that single-class rule or it wins
   regardless of source order and the log stays visible after closing. */
.hero-assist .hero-chat-log {
  position: relative; flex: 1; overflow-y: auto; text-align: left;
  padding: 1.1rem 1.1rem 0; display: none; flex-direction: column; gap: .6rem;
}
.hero-home.chat-active .hero-assist .hero-chat-log { display: flex; }
.hero-home.chat-active .hero-assist form { position: relative; margin: .9rem; }
.hero-chat-disc {
  position: relative; margin: 0 1.1rem .8rem;
  font-size: .72rem; color: var(--muted); text-align: center; display: none;
}
.hero-home.chat-active .hero-chat-disc { display: block; }
/* .hero-assist (not just the class) so this reliably beats the generic
   ".hero-assist button" send-button styling, which also matches this
   element and would otherwise win the display property by specificity. */
.hero-assist .hero-chat-close { display: none; }

/* Below ~640px, expanding in place left the box clipped by the viewport with
   awkward empty space above it — take over the full screen instead, same
   treatment as the floating widget's mobile view (chat.js skips the inline
   height animation on this breakpoint so it doesn't fight this rule). */
@media (max-width: 640px) {
  .hero-home.chat-active .hero-assist {
    position: fixed; inset: 0; z-index: 70; max-width: 100%; width: 100%;
    height: 100dvh; margin: 0; border-radius: 0; border: none;
    padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
  }
  /* Only the full-screen takeover needs a way back out — sits right above
     the input row, as its own line so it can't be mistaken for a send action. */
  .hero-home.chat-active .hero-chat-close {
    /* .hero-assist button (the send button's styling) also matches this
       element and forces its own width/height/border-radius/background —
       override every one of those explicitly, not just the ones that differ. */
    display: flex; align-items: center; justify-content: center; gap: .35rem;
    width: calc(100% - 1.8rem); height: auto; margin: 0 .9rem; padding: .55rem;
    border: none; border-radius: 10px; background: transparent; white-space: nowrap;
    color: var(--muted); font-size: .82rem; font-weight: 600; cursor: pointer;
  }
  .hero-home.chat-active .hero-chat-close svg { width: 15px; height: 15px; flex: none; }
  .hero-home.chat-active .hero-chat-close:hover { color: var(--ink); }
}

/* ---- Trust strip ------------------------------------------------------ */
.trust { border-block: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 55%, transparent); }
.trust .wrap { display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; align-items: center;
  padding-block: 1rem; font-size: .875rem; color: var(--muted); }
.trust b { color: var(--ink); font-weight: 650; }
.trust .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); flex: none; }

/* ---- Generic grid ----------------------------------------------------- */
.grid { display: grid; gap: var(--gap); }
@media (min-width: 680px)  { .grid.cols-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 860px)  { .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
.section-head { max-width: 60ch; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head .eyebrow { margin-bottom: 1.1rem; }
.section-head h2 { margin-bottom: .9rem; }

/* ---- Cards ------------------------------------------------------------ */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 1.75rem); box-shadow: var(--shadow-sm);
  height: 100%; display: flex; flex-direction: column;
}
.card h3 { margin-bottom: .4rem; }
.card p { margin-bottom: 0; }
.card .ico {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-tint); color: var(--brand); margin-bottom: 1rem;
}
.card .ico svg { width: 24px; height: 24px; }
.card .arrow-link { margin-top: 1rem; }

/* Numbered step cards (01 -> 02 -> 03) */
.step { position: relative; }
.step .num {
  font-size: .95rem; font-weight: 750; letter-spacing: .05em; color: var(--accent);
  margin-bottom: .75rem; display: inline-flex; align-items: center; gap: .5rem;
}
.step .num::before { content: ""; width: 1.6rem; height: 2px; background: var(--accent); opacity: .5; }

/* ---- Feature split (WhatsApp / AI) ------------------------------------ */
.split { display: grid; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
@media (min-width: 880px) { .split { grid-template-columns: 1.05fr .95fr; }
  .split.flip .split-media { order: -1; } }
.split-media {
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow); padding: clamp(1.25rem, 3vw, 1.75rem); overflow: hidden;
}
.split-media.photo { padding: 0; aspect-ratio: 1; }
.split-media.photo img { width: 100%; height: 100%; object-fit: cover; }

/* Faux WhatsApp chat preview */
.chat { display: flex; flex-direction: column; gap: .5rem; font-size: .92rem; }
.chat .msg { max-width: 82%; padding: .6rem .8rem; border-radius: 14px; line-height: 1.4; }
.chat .in  { align-self: flex-start; background: var(--surface-2); color: var(--ink); border-bottom-left-radius: 4px; }
.chat .out { align-self: flex-end; background: #d9fdd3; color: #06331b; border-bottom-right-radius: 4px; }
:root[data-theme="dark"] .chat .out { background: #144d34; color: #eafff2; }
.chat .meta { font-size: .72rem; color: var(--muted); text-align: center; margin: .2rem 0 .1rem; }

/* Feature bullets */
.checks { list-style: none; padding: 0; display: grid; gap: .7rem; }
.checks li { display: flex; gap: .65rem; align-items: flex-start; color: var(--muted); }
.checks svg { width: 1.25rem; height: 1.25rem; color: var(--brand); flex: none; margin-top: .15rem; }
.checks b { color: var(--ink); }

/* ---- Audience cards --------------------------------------------------- */
.audience { display: grid; gap: var(--gap); }
@media (min-width: 780px) { .audience { grid-template-columns: 1fr 1fr; } }
.audience .card { padding: clamp(1.5rem, 4vw, 2.25rem); }
.audience .ico { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }

/* ---- Compliance mini -------------------------------------------------- */
.pills { display: flex; flex-wrap: wrap; gap: .6rem; }
.pill { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .85rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: .875rem; font-weight: 550; color: var(--ink); }
.pill svg { width: 1.05rem; height: 1.05rem; color: var(--brand); }

/* ---- Final CTA -------------------------------------------------------- */
.cta-final {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff; border-radius: var(--radius); padding: clamp(2rem, 6vw, 3.5rem);
  text-align: center; box-shadow: var(--shadow);
}
.cta-final h2 { color: #fff; }
.cta-final p { color: #dff0e9; max-width: 52ch; margin-inline: auto; }
.cta-final .hero-cta { justify-content: center; margin-top: 1.5rem; }
.cta-final .btn-ghost { background: rgba(255,255,255,.12); color:#fff; border-color: rgba(255,255,255,.4); }
.cta-final .btn-ghost:hover { background: rgba(255,255,255,.2); }

/* ---- Footer ----------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface-2); }
.footer-grid { display: grid; gap: 2rem; padding-block: clamp(2.5rem, 6vw, 4rem) 1.5rem; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-grid h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); margin-bottom: .9rem; font-weight: 700; }
.footer-links { list-style: none; padding: 0; display: grid; gap: .5rem; }
.footer-links a { color: var(--muted); font-weight: 500; }
.footer-links a:hover { color: var(--ink); }
.legal-id { font-size: .82rem; color: var(--muted); line-height: 1.7; }
.legal-id .todo { color: var(--accent); font-weight: 600; }
/* Pending details we don't have yet: blur them out (both themes) rather than
   showing raw placeholder brackets. Non-selectable so they read as "coming soon". */
.todo { filter: blur(5px); -webkit-filter: blur(5px);
  user-select: none; -webkit-user-select: none; cursor: default; }
.footer-bottom { border-top: 1px solid var(--line); padding-block: 1.25rem;
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center;
  font-size: .82rem; color: var(--muted); }
.footer-bottom .disc { max-width: 70ch; }
.footer-bottom a { color: var(--muted); text-decoration: underline; }

/* ---- Auth link in nav ------------------------------------------------- */
.nav-auth { display: none; color: var(--muted); font-weight: 550; padding: .5rem .7rem;
  border-radius: 8px; }
.nav-auth:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); text-decoration: none; }
@media (min-width: 900px) { .nav-auth { display: inline-flex; } }

/* ---- AI chat widget (lazy-loaded enhancement) ------------------------- */
.chat-fab {
  position: fixed; right: clamp(1rem, 4vw, 1.5rem); bottom: clamp(1rem, 4vw, 1.5rem);
  z-index: 60; display: inline-flex; align-items: center; gap: .55rem;
  padding: .8rem 1.15rem; border: none; border-radius: 999px; cursor: pointer;
  font: inherit; font-weight: 650; color: #fff; background: var(--brand);
  box-shadow: var(--shadow); transition: transform .12s ease, background .2s ease;
}
.chat-fab:hover { transform: translateY(-2px); background: var(--brand-strong); }
.chat-fab svg { width: 1.25rem; height: 1.25rem; }
.chat-fab .label { display: none; }
@media (min-width: 560px) { .chat-fab .label { display: inline; } }

.chat-panel {
  position: fixed; right: clamp(.75rem, 4vw, 1.5rem); bottom: clamp(.75rem, 4vw, 1.5rem);
  z-index: 61; width: min(94vw, 380px); height: min(78vh, 560px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow);
}
.chat-panel[hidden] { display: none; }
/* Below ~640px a corner-anchored box reads as cramped and half-off-screen —
   take over the full viewport instead, like a native chat sheet. No
   horizontal overflow either way since width was always capped at 94vw. */
@media (max-width: 640px) {
  .chat-panel {
    right: 0; left: 0; top: 0; bottom: 0;
    width: 100%; height: 100%; height: 100dvh;
    border-radius: 0; border: none;
    padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
  }
}
.chat-head { position: relative; overflow: hidden; display: flex; align-items: center; gap: .7rem;
  padding: .9rem 1rem; border-bottom: 1px solid var(--line); background: var(--brand-tint); }
/* Moving canvas backdrop behind the greeting (chat.js paints it) */
#chat-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.chat-head > * { position: relative; z-index: 1; }
.chat-head .avatar { width: 34px; height: 34px; border-radius: 10px; flex: none;
  object-fit: contain; background: var(--brand); padding: 4px; }
.chat-head .who { font-weight: 700; line-height: 1.15; }
.chat-head .who small { display: block; font-weight: 500; font-size: .72rem; color: var(--muted); }
.chat-head .x { margin-left: auto; width: 34px; height: 34px; border: none; cursor: pointer;
  background: transparent; color: var(--muted); border-radius: 8px; display: grid; place-items: center; }
.chat-head .x:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.chat-head .x svg { width: 20px; height: 20px; }

.chat-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.chat-log .b { max-width: 85%; padding: .6rem .8rem; border-radius: 14px; line-height: 1.45;
  font-size: .93rem; white-space: pre-wrap; word-wrap: break-word; }
.chat-log .b.bot { align-self: flex-start; background: var(--surface-2); color: var(--ink); border-bottom-left-radius: 4px; }
.chat-log .b.me  { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.chat-log .b.err { background: color-mix(in srgb, #c0392b 12%, transparent); color: var(--ink); }
.chat-typing { align-self: flex-start; display: inline-flex; gap: .25rem; padding: .7rem .85rem; }
.chat-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .6;
  animation: chatdot 1.1s infinite ease-in-out; }
.chat-typing span:nth-child(2){ animation-delay: .18s; } .chat-typing span:nth-child(3){ animation-delay: .36s; }
@keyframes chatdot { 0%,60%,100%{ transform: translateY(0);opacity:.4 } 30%{ transform: translateY(-4px);opacity:.9 } }
@media (prefers-reduced-motion: reduce) { .chat-typing span { animation: none; } }

.chat-form { border-top: 1px solid var(--line); padding: .7rem; display: flex; gap: .5rem; align-items: flex-end; }
.chat-form textarea { flex: 1; resize: none; font: inherit; font-size: .93rem; line-height: 1.4;
  max-height: 120px; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--ink); }
.chat-form textarea:focus-visible { border-color: var(--brand); box-shadow: none; }
.chat-form button { flex: none; width: 42px; height: 42px; border: none; border-radius: 12px; cursor: pointer;
  background: var(--brand); color: #fff; display: grid; place-items: center; }
.chat-form button:disabled { opacity: .5; cursor: default; }
.chat-form button svg { width: 20px; height: 20px; }
.chat-disc { padding: 0 1rem .7rem; font-size: .72rem; color: var(--muted); text-align: center; }
.chat-disc.demo { color: var(--accent); font-weight: 600; }

/* ---- Auth page -------------------------------------------------------- */
.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: var(--section-y) var(--pad); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1.5rem, 5vw, 2.25rem); }
.auth-card h1 { font-size: clamp(1.5rem, 1.2rem + 1.6vw, 1.9rem); margin-bottom: .35rem; }
.auth-card .lead { font-size: .95rem; margin-bottom: 1.5rem; }
.auth-tabs { display: flex; gap: .3rem; background: var(--surface-2); padding: .3rem; border-radius: 12px; margin-bottom: 1.4rem; }
.auth-tabs button { flex: 1; font: inherit; font-weight: 600; padding: .55rem; border: none; cursor: pointer;
  border-radius: 9px; background: transparent; color: var(--muted); }
.auth-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-google { width: 100%; justify-content: center; gap: .6rem; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); }
.btn-google:hover { border-color: color-mix(in srgb, var(--ink) 30%, transparent); }
.btn-google svg { width: 1.15rem; height: 1.15rem; }
.auth-or { display: flex; align-items: center; gap: .8rem; margin: 1.25rem 0; color: var(--muted); font-size: .82rem; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.field { display: grid; gap: .35rem; margin-bottom: 1rem; }
.field label { font-size: .85rem; font-weight: 600; }
.field input { font: inherit; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); }
.field input:focus-visible { border-color: var(--brand); box-shadow: none; }
.auth-fine { font-size: .8rem; color: var(--muted); margin-top: 1rem; text-align: center; }
.auth-note { margin-top: 1.25rem; padding: .8rem .9rem; border-radius: 10px; font-size: .8rem;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--ink); }

/* ---- Mobile nav menu -------------------------------------------------- */
.m-nav { display: inline-block; position: relative; }
.m-nav > summary { list-style: none; }
.m-nav > summary::-webkit-details-marker { display: none; }
.m-nav[open] .nav-toggle { border-color: var(--brand); color: var(--brand); }
.m-menu {
  position: absolute; right: 0; top: calc(100% + 10px); left: auto;
  min-width: 220px; z-index: 60;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow);
  padding: .5rem; display: grid; gap: .1rem;
}
.m-menu a { color: var(--ink); font-weight: 600; padding: .75rem .3rem; border-radius: 8px; }
.m-menu a:hover { background: var(--brand-tint); text-decoration: none; }
.m-menu a[aria-current="page"] { color: var(--brand); }
.m-menu .btn { margin-top: .7rem; }
@media (min-width: 900px) { .m-nav { display: none; } }

/* ---- Utility ---------------------------------------------------------- */
.mt-0 { margin-top: 0; }
.hide { display: none !important; }
.center-narrow { max-width: 62ch; margin-inline: auto; }
img, svg { max-width: 100%; }              /* nothing overflows 320px */
@media (max-width: 480px) { .btn-lg { width: 100%; justify-content: center; } }
@media (max-width: 379px) {
  .brand small { display: none; }          /* keep header tight at 320px */
  :root { --pad: 1rem; }
}
