/* Havn — public site.
   Colours are the product tokens (apps/havn_app/lib/theme/tokens.dart), dark first, light via prefers-color-scheme.
   System fonts only. No inline styles anywhere: the CSP is style-src 'self'. */

:root{
  --bg-void:#07090C;--bg-deep:#0B0F14;--surface-1:#10151C;--surface-2:#161D26;--surface-3:#1E2731;
  --line-subtle:#232D38;--line-strong:#33404E;
  --text-primary:#EDF2F7;--text-secondary:#9BA9B8;--text-tertiary:#8090A1;
  --accent:#FF9E4A;--on-accent:#0B0F14;--accent-soft:rgba(255,158,74,.14);
  --crypto:#4FD8E8;--verified:#5BE3A8;--caution:#FFC53D;--risk:#FF6B5E;--bridge:#A78BFA;
  --shadow:0 24px 60px rgba(0,0,0,.45);
  --sans:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Noto Sans Thai","Leelawadee UI",sans-serif;
  --mono:ui-monospace,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;
  --r:14px;
}
@media (prefers-color-scheme: light){
  :root{
    --bg-void:#EDEFF3;--bg-deep:#F7F8FA;--surface-1:#FFFFFF;--surface-2:#EEF1F5;--surface-3:#E4E9EF;
    --line-subtle:#DCE2EA;--line-strong:#C3CCD7;
    --text-primary:#0D1319;--text-secondary:#4A5765;--text-tertiary:#59646F;
    --accent:#8A4F0E;--on-accent:#FFFFFF;--accent-soft:rgba(138,79,14,.10);
    --crypto:#0A6B78;--verified:#0C6E4A;--caution:#7F5C00;--risk:#B3251A;--bridge:#5B3FC4;
    --shadow:0 18px 44px rgba(13,19,25,.14);
  }
}

/* ── Base ── */
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
@media (prefers-reduced-motion: no-preference){html{scroll-behavior:smooth}}
body{margin:0;background:var(--bg-deep);color:var(--text-primary);font-family:var(--sans);font-size:17px;line-height:1.6;-webkit-font-smoothing:antialiased}
html[lang="th"] body{line-height:1.8}
a{color:var(--accent)}
a:hover{text-decoration-thickness:2px}
h1,h2,h3{margin:0;letter-spacing:-.018em;text-wrap:balance}
html[lang="th"] h1,html[lang="th"] h2,html[lang="th"] h3,html[lang="vi"] h1,html[lang="vi"] h2,html[lang="vi"] h3{letter-spacing:0}
p{margin:0}
img,svg{max-width:100%}
code{font-family:var(--mono);font-size:.92em}
.mono{font-family:var(--mono)}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.skip{position:absolute;left:-9999px;top:10px;z-index:20;background:var(--accent);color:var(--on-accent);padding:8px 14px;border-radius:8px;font-weight:600}
.skip:focus{left:12px}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:6px}
.wrap{max-width:1120px;margin:0 auto;padding:0 20px}
@media (min-width:720px){.wrap{padding:0 32px}}
.eyebrow{font-family:var(--mono);font-size:12px;letter-spacing:.14em;text-transform:uppercase;color:var(--accent);margin-bottom:12px}
html[lang="th"] .eyebrow,html[lang="vi"] .eyebrow{letter-spacing:.04em;text-transform:none;font-family:var(--sans);font-weight:600}
.lead{font-size:19px;line-height:1.55;color:var(--text-secondary);max-width:58ch}

/* ── Buttons ── */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;text-decoration:none;font:inherit;font-weight:600;padding:12px 20px;border-radius:11px;border:1px solid transparent;cursor:pointer;line-height:1.2;min-height:44px}
.btn.primary{background:var(--accent);color:var(--on-accent)}
.btn.primary:hover{filter:brightness(1.06)}
.btn.ghost{background:var(--surface-2);color:var(--text-primary);border-color:var(--line-strong)}
.btn.ghost:hover{background:var(--surface-3)}
.btn.small{padding:8px 14px;min-height:36px;font-size:15px;border-radius:9px}
.more{display:inline-block;font-weight:600;margin-top:18px}
.more::after{content:" →"}

/* ── Header ── */
.top{position:sticky;top:0;z-index:10;background:color-mix(in srgb,var(--bg-deep) 88%,transparent);backdrop-filter:saturate(1.4) blur(10px);-webkit-backdrop-filter:saturate(1.4) blur(10px);border-bottom:1px solid var(--line-subtle)}
.top-in{display:flex;align-items:center;justify-content:space-between;gap:14px;height:64px}
.brand{display:inline-flex;align-items:center;gap:10px;text-decoration:none;color:var(--text-primary)}
.wordmark{font-weight:750;font-size:19px;letter-spacing:.12em}
.mark{flex:none;border-radius:9px}
.links{display:none;gap:26px}
.links a{color:var(--text-secondary);text-decoration:none;font-size:15px;font-weight:500;padding:6px 0}
.links a:hover{color:var(--text-primary)}
.tools{display:flex;align-items:center;gap:10px}
.tools .btn.small{display:none}
@media (max-width:400px){
  .top-in{gap:8px}
  .top-in .brand{gap:8px}
  .top-in .wordmark{font-size:16px;letter-spacing:.1em}
  .top-in .tools{gap:6px}
  .top-in .lang-select{max-width:96px}
}
.lang-select{background:var(--surface-2);color:var(--text-primary);border:1px solid var(--line-subtle);border-radius:9px;padding:8px 10px;font:inherit;font-size:14px;min-height:36px}
.menu{position:relative}
.menu summary{list-style:none;cursor:pointer;width:40px;height:36px;display:flex;align-items:center;justify-content:center;border-radius:9px;border:1px solid var(--line-subtle);background:var(--surface-2)}
.menu summary::-webkit-details-marker{display:none}
.burger{width:18px;height:2px;background:var(--text-primary);position:relative;border-radius:2px}
.burger::before,.burger::after{content:"";position:absolute;left:0;width:18px;height:2px;background:var(--text-primary);border-radius:2px}
.burger::before{top:-6px}.burger::after{top:6px}
.menu-list{position:absolute;right:0;top:44px;background:var(--surface-1);border:1px solid var(--line-subtle);border-radius:12px;padding:8px;min-width:220px;display:flex;flex-direction:column;box-shadow:var(--shadow)}
.menu-list a{color:var(--text-primary);text-decoration:none;padding:10px 12px;border-radius:8px;font-size:15px}
.menu-list a:hover{background:var(--surface-2)}
@media (min-width:880px){.links{display:flex}.menu{display:none}.tools .btn.small{display:inline-flex}}

/* ── Hero ── */
.hero{padding:56px 0 40px;background:radial-gradient(1200px 520px at 80% -10%,var(--accent-soft),transparent 60%)}
.hero-grid{display:grid;gap:40px;align-items:center}
.hero h1{font-size:clamp(36px,6.4vw,60px);line-height:1.04;font-weight:700;margin:0 0 18px}
.hero .lead{margin-bottom:24px}
.cta{display:flex;gap:12px;flex-wrap:wrap}
.hero-note{margin-top:16px;font-size:14px;color:var(--text-tertiary)}
.dl{margin-top:18px;background:var(--surface-1);border:1px solid var(--line-subtle);border-radius:var(--r);padding:16px}
.dl-title{font-size:13px;color:var(--text-tertiary);margin-bottom:10px;font-weight:600}
.dl-row{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px}
.dl-name{white-space:nowrap}
.dl-item{display:flex;align-items:center;gap:10px;padding:12px 14px;border-radius:11px;border:1px solid var(--line-strong);background:var(--surface-2);color:var(--text-primary);text-decoration:none;font-weight:600;min-height:48px}
.dl-item[href]:hover{border-color:var(--accent);background:var(--surface-3)}
.dl-item .dl-state{margin-left:auto;font-size:12px;font-weight:500;color:var(--text-tertiary);font-family:var(--mono)}
.dl-item.soon{color:var(--text-tertiary);border-style:dashed;cursor:default}
.dl-item.soon svg{opacity:.6}
.dl-meta{margin-top:12px;font-size:12.5px;color:var(--text-tertiary);word-break:break-all}
.dl-meta b{color:var(--text-secondary);font-weight:600}
.dl-source{margin-top:10px;font-size:13px;color:var(--text-tertiary)}

/* Device mockup (chat list + conversation) — pure CSS */
.hero-art{display:flex;justify-content:center}
.mock{width:100%;max-width:560px;display:grid;grid-template-columns:1fr;background:var(--bg-void);border:1.5px solid var(--line-strong);border-radius:28px;overflow:hidden;box-shadow:var(--shadow);font-size:13.5px;min-height:420px}
.mock-side{display:none;border-right:1px solid var(--line-subtle);background:var(--surface-1);padding:14px 10px}
.mock-side-head{display:flex;align-items:center;justify-content:space-between;font-weight:700;font-size:15px;padding:4px 8px 12px}
.mock-dot{width:8px;height:8px;border-radius:50%;background:var(--verified)}
.mock-row{display:flex;align-items:center;gap:10px;padding:9px 8px;border-radius:10px}
.mock-row.active{background:var(--surface-2)}
.mock-row-t{display:flex;flex-direction:column;min-width:0;flex:1}
.mock-row-t b{font-weight:600;font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mock-row-t small{color:var(--text-tertiary);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mock-time{font-size:11px;color:var(--text-tertiary);font-family:var(--mono)}
.mock-badge{background:var(--accent);color:var(--on-accent);font-size:11px;font-weight:700;border-radius:999px;min-width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;padding:0 5px}
.av{width:34px;height:34px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:13px;color:var(--on-accent);flex:0 0 34px}
.av-a{background:var(--accent)}.av-b{background:var(--crypto)}.av-c{background:var(--bridge)}.av-d{background:var(--verified)}
.mock-main{display:flex;flex-direction:column;background:var(--bg-deep)}
.mock-head{display:flex;align-items:center;gap:10px;padding:14px 16px;border-bottom:1px solid var(--line-subtle);background:var(--surface-1)}
.mock-head-t{display:flex;flex-direction:column}
.mock-head-t b{font-weight:600}
.mock-head-t small{font-size:11.5px;color:var(--verified);display:flex;align-items:center;gap:6px}
.seam{width:2px;height:12px;border-radius:2px;background:var(--verified);display:inline-block}
.mock-chat{flex:1;display:flex;flex-direction:column;gap:8px;padding:16px 14px}
.bubble{max-width:82%;padding:9px 12px 7px;border-radius:14px;line-height:1.35;display:flex;flex-direction:column;gap:3px}
.bubble time{font-size:10.5px;color:var(--text-tertiary);font-family:var(--mono);align-self:flex-end;display:inline-flex;gap:4px;align-items:center}
.bubble.in{align-self:flex-start;background:var(--surface-2);border-bottom-left-radius:4px}
.bubble.out{align-self:flex-end;background:var(--accent-soft);border:1px solid color-mix(in srgb,var(--accent) 35%,transparent);border-bottom-right-radius:4px}
.tick{font-style:normal;font-size:11px;letter-spacing:-.12em;color:var(--text-tertiary)}
.tick.seen{color:var(--crypto)}
.mock-compose{margin:0 12px 14px;background:var(--surface-2);border:1px solid var(--line-subtle);border-radius:999px;padding:10px 14px;color:var(--text-tertiary);display:flex;align-items:center;justify-content:space-between;font-size:13px}
.mock-send{width:26px;height:26px;border-radius:50%;background:var(--accent);position:relative}
.mock-send::after{content:"";position:absolute;left:9px;top:7px;width:8px;height:8px;border-top:2px solid var(--on-accent);border-right:2px solid var(--on-accent);transform:rotate(45deg)}
@media (min-width:560px){.mock{grid-template-columns:200px 1fr;border-radius:18px}.mock-side{display:block}}
@media (min-width:960px){.hero{padding:80px 0 56px}.hero-grid{grid-template-columns:1.05fr 1fr;gap:56px}.mock{grid-template-columns:210px 1fr}}

/* ── Feature sections ── */
.feature{padding:64px 0}
.feature.alt{background:var(--surface-1);border-top:1px solid var(--line-subtle);border-bottom:1px solid var(--line-subtle)}
.feature h2{font-size:clamp(27px,4vw,38px);font-weight:700;line-height:1.14;margin-bottom:16px}
.copy>p{color:var(--text-secondary);font-size:17px;line-height:1.62}
.copy.narrow{max-width:62ch}
.copy.center{margin:0 auto;text-align:center}
.split{display:grid;gap:36px;align-items:center}
.split>*,.hero-grid>*{min-width:0}
.art{margin:0;display:flex;justify-content:center;align-items:center;max-width:100%}
.art-stack{flex-direction:column;gap:16px;align-items:stretch;max-width:420px;margin:0 auto;width:100%}
@media (min-width:880px){.feature{padding:96px 0}.split{grid-template-columns:1fr 1fr;gap:64px}.split.rev .copy{order:2}.split.rev .art{order:1}.art-stack{margin:0}}
.checks{list-style:none;margin:18px 0 0;padding:0;display:flex;flex-direction:column;gap:10px}
.checks li{position:relative;padding-left:30px;color:var(--text-secondary);line-height:1.5}
.checks li::before{content:"";position:absolute;left:0;top:.35em;width:18px;height:18px;border-radius:50%;background:color-mix(in srgb,var(--verified) 18%,transparent)}
.checks li::after{content:"";position:absolute;left:6px;top:calc(.35em + 4px);width:5px;height:8px;border-right:2px solid var(--verified);border-bottom:2px solid var(--verified);transform:rotate(45deg)}
.kv{margin:22px 0 0;display:grid;grid-template-columns:1fr;gap:6px 18px}
.kv dt{font-weight:700;margin-top:10px}
.kv dd{margin:0;color:var(--text-secondary);line-height:1.5}
@media (min-width:600px){.kv{grid-template-columns:max-content 1fr}.kv dt{margin-top:0;padding-top:0}.kv dd{margin-bottom:8px}}
.limit{margin-top:22px;border-left:3px solid var(--caution);background:var(--surface-2);padding:14px 18px;border-radius:0 12px 12px 0}
.limit h3{font-size:14px;letter-spacing:.06em;text-transform:uppercase;color:var(--caution);margin-bottom:6px}
html[lang="th"] .limit h3,html[lang="vi"] .limit h3{letter-spacing:0;text-transform:none}
.limit p{font-size:15px;color:var(--text-secondary);line-height:1.55}
.note{margin:28px auto 0;max-width:70ch;text-align:center;color:var(--text-tertiary);font-size:15px;line-height:1.55}

/* SVG figures */
.fig{width:100%;max-width:520px;height:auto;font-family:var(--sans)}
.fig-device rect{fill:var(--surface-2);stroke:var(--line-strong);stroke-width:1.5}
.fig-device .fig-screen{fill:var(--bg-void);stroke:none}
.fig-key{fill:none;stroke:var(--accent);stroke-width:3}
.fig-key-s{fill:none;stroke:var(--accent);stroke-width:3;stroke-linecap:round}
.fig-server rect,.fig-box rect{fill:var(--surface-1);stroke:var(--line-strong);stroke-width:1.5;stroke-dasharray:5 4}
.fig-box>rect{stroke-dasharray:none}
.fig-slot{fill:var(--bg-void);stroke:none}
.fig-tag{fill:var(--accent-soft);stroke:var(--accent);stroke-dasharray:none}
.fig-cipher{font-family:var(--mono);font-size:13px;fill:var(--text-tertiary);letter-spacing:1px}
.fig-mono{font-family:var(--mono);font-size:13px;fill:var(--accent);font-weight:600}
.fig-line{fill:none;stroke:var(--crypto);stroke-width:2.5;stroke-dasharray:6 6}
.fig-line.arrow{stroke-dasharray:none;marker-end:none}
.fig-lock rect{fill:var(--bg-deep);stroke:var(--crypto);stroke-width:2}
.fig-lock path{fill:none;stroke:var(--crypto);stroke-width:2;stroke-linecap:round}
.fig-lock.open path{stroke:var(--verified)}
.fig-lock.open rect{stroke:var(--verified)}
.fig-label{font-size:14px;font-weight:600;fill:var(--text-primary)}
.fig-small{font-size:12.5px;fill:var(--text-tertiary)}
.fig-small.strike{text-decoration:line-through;fill:var(--risk)}
@media (prefers-reduced-motion: no-preference){
  .fig-line:not(.arrow){animation:dash 1.6s linear infinite}
  @keyframes dash{to{stroke-dashoffset:-24}}
}

/* Friends art */
.chip{display:flex;align-items:center;gap:12px;background:var(--surface-2);border:1px solid var(--line-strong);border-radius:999px;padding:10px 16px;font-size:14px;overflow:hidden}
.chip-label{color:var(--text-tertiary);font-size:12px;font-weight:600;white-space:nowrap}
.chip code{color:var(--accent);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.card{background:var(--surface-1);border:1px solid var(--line-strong);border-radius:16px;padding:18px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:12px}
.feature.alt .card,.feature.alt .chip{background:var(--surface-2)}
.card-top{display:flex;gap:14px;align-items:center}
.card-top b{display:block;font-size:16px;line-height:1.3}
.card-top small{display:block;color:var(--text-tertiary);font-size:12.5px;margin-top:4px}
.identicon{flex:0 0 44px;border-radius:10px;background:var(--surface-3);padding:5px}
.identicon rect{fill:var(--accent)}
.card-preview{color:var(--text-secondary);font-size:14.5px;line-height:1.5;background:var(--surface-2);border-radius:10px;padding:10px 12px}
.card-actions{display:flex;gap:10px}
.card-actions .btn{flex:1;cursor:default}

/* Feature cards / tiles */
.cards{display:grid;grid-template-columns:1fr;gap:14px;margin-top:32px}
.fcard{background:var(--surface-2);border:1px solid var(--line-subtle);border-radius:var(--r);padding:22px;display:flex;flex-direction:column;gap:10px}
.feature:not(.alt) .fcard{background:var(--surface-1)}
.fcard h3{font-size:18px;font-weight:700}
.fcard p{font-size:15px;line-height:1.55;color:var(--text-secondary)}
.ico{width:28px;height:28px;fill:none;stroke:var(--accent);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
@media (min-width:640px){.cards{grid-template-columns:1fr 1fr}}
.tiles{display:grid;grid-template-columns:1fr;gap:14px;margin-top:32px}
.tile{background:var(--surface-1);border:1px solid var(--line-subtle);border-radius:var(--r);padding:26px 22px;text-align:center;display:flex;flex-direction:column;align-items:center;gap:8px}
.tile h3{font-size:18px}
.tile p{font-size:15px;color:var(--text-secondary);line-height:1.55}
.tile-ico{width:56px;height:56px;fill:none;stroke:var(--accent);stroke-width:2.2;stroke-linecap:round}
@media (min-width:720px){.tiles{grid-template-columns:repeat(3,1fr)}}

/* Transparency code card */
.code{width:100%;max-width:min(520px,100%);min-width:0;background:var(--bg-void);border:1px solid var(--line-strong);border-radius:var(--r);overflow:hidden;font-size:12.5px}
.code-head{display:flex;justify-content:space-between;align-items:center;padding:10px 14px;border-bottom:1px solid var(--line-subtle);background:var(--surface-2);color:var(--text-secondary)}
.code-cap{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--text-tertiary)}
.code pre{margin:0;padding:14px 16px;overflow-x:auto;color:var(--text-secondary);line-height:1.5;tab-size:2}
.c-num{color:var(--accent);font-weight:700}
.live{margin-top:18px;font-family:var(--mono);font-size:13.5px;color:var(--text-tertiary)}
.live b{color:var(--text-primary)}
#transparency .cta{margin-top:22px}

/* Pricing */
.tiers{display:grid;grid-template-columns:1fr;gap:14px;margin-top:32px}
.tier{background:var(--surface-1);border:1px solid var(--line-subtle);border-radius:var(--r);padding:22px;display:flex;flex-direction:column;gap:8px}
.tier h3{font-size:18px;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.tier.free{border-color:color-mix(in srgb,var(--verified) 55%,var(--line-subtle))}
.tier p{font-size:15px;color:var(--text-secondary);line-height:1.55}
.pill{display:inline-block;font-size:11.5px;font-weight:600;letter-spacing:.04em;padding:3px 9px;border-radius:999px;background:var(--surface-3);color:var(--text-secondary);border:1px solid var(--line-strong);font-family:var(--mono)}
.pill.ok{background:color-mix(in srgb,var(--verified) 16%,transparent);color:var(--verified);border-color:color-mix(in srgb,var(--verified) 45%,transparent)}
@media (min-width:640px){.tiers{grid-template-columns:1fr 1fr}}
@media (min-width:980px){.tiers{grid-template-columns:repeat(4,1fr)}}

/* FAQ */
.faq{max-width:820px}
.faq h2{margin-bottom:22px}
.faq details{background:var(--surface-2);border:1px solid var(--line-subtle);border-radius:12px;margin-bottom:10px}
.faq summary{cursor:pointer;padding:15px 18px;font-weight:600;font-size:16.5px;list-style:none;display:flex;justify-content:space-between;gap:14px;align-items:flex-start;line-height:1.4;border-radius:12px}
.faq summary::-webkit-details-marker{display:none}
.faq summary::after{content:"+";color:var(--accent);font-family:var(--mono);font-size:20px;line-height:1;flex:0 0 auto}
.faq details[open] summary::after{content:"–"}
.faq details p{padding:0 18px 18px;color:var(--text-secondary);font-size:15.5px;line-height:1.62}

.honest{margin-top:48px;margin-bottom:64px;font-size:15px;color:var(--text-tertiary);max-width:820px;border-left:3px solid var(--accent);padding-left:16px}

/* Footer */
.foot{border-top:1px solid var(--line-subtle);padding:40px 0 30px;color:var(--text-tertiary);font-size:14px}
.foot-grid{display:grid;grid-template-columns:1fr;gap:26px}
.foot-brand p{margin-top:12px;line-height:1.5}
.foot-col h3{font-size:13px;letter-spacing:.08em;text-transform:uppercase;color:var(--text-secondary);margin-bottom:10px}
html[lang="th"] .foot-col h3,html[lang="vi"] .foot-col h3{letter-spacing:0;text-transform:none}
.foot-col p{line-height:1.55;margin-bottom:8px}
.foot a{color:var(--text-secondary)}
.pill-line{margin-top:10px}
.copy-line{margin-top:28px;font-size:13px}
@media (min-width:720px){.foot-grid{grid-template-columns:1.2fr 1.4fr 1fr .8fr;gap:32px}}

@media (prefers-reduced-motion: reduce){*{animation:none!important;transition:none!important}}
@media print{.top,.menu,.dl,.hero-art{display:none}}
