/* Life Buddy web pages (home, /buy, /phone, /privacy, /en/*). The one stylesheet for them.
   Tokens = DESIGN.md §2 ("Night Market, pro", 2026-11-14) — keep in step with web/src/index.css and
   worker/src/lib/brandcss.ts. Fonts: Bai Jamjuree (display, prices) + Anuphan (body), linked in each page. */

:root {
  color-scheme: dark;
  --bg: #120E14;
  --surface-1: #1B161E;
  --surface-2: #241E28;
  --surface-3: #2E2733;
  --border: rgba(255, 255, 255, .07);
  --border-strong: rgba(255, 255, 255, .12);
  --text-1: #F5F1F4;
  --text-2: #B4A9B6;
  --text-3: #9A8F9D;
  --accent: #FF5D8F;
  --accent-hover: #FF6E9B;
  --accent-press: #F24A80;
  --accent-ink: #1A1418;
  /* One accent (Ben 2026-11-19 "1a"): night + cream carry the page, pink only on the solid primary button (.btn.main). */
  --hi: #F7F2E6;
  --accent-text: #F1E7D3;
  --accent-soft: rgba(247, 242, 230, .10);
  --success: #3DD68C;
  --grad-band: radial-gradient(120% 90% at 50% 0%, rgba(247, 242, 230, .07) 0%, rgba(247, 242, 230, .03) 40%, rgba(18, 14, 20, 0) 72%);
  --grad-hero: linear-gradient(155deg, #2C2631 0%, #231E28 55%, #1D1822 100%);
  --grad-cta: linear-gradient(180deg, #FF6E9B 0%, #FF5D8F 55%, #F7518A 100%);
  --shadow-1: inset 0 1px 0 rgba(255, 255, 255, .04), 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-2: inset 0 1px 0 rgba(255, 255, 255, .06), 0 12px 32px -12px rgba(0, 0, 0, .70);
  --shadow-hero: inset 0 1px 0 rgba(255, 255, 255, .10), 0 20px 44px -18px rgba(0, 0, 0, .75), 0 2px 6px rgba(0, 0, 0, .35);
  --shadow-cta: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 20px -8px rgba(255, 93, 143, .55);
  --r-sm: 14px; --r-md: 18px; --r-lg: 26px; --r-xl: 34px; --r-pill: 9999px;
  --ease-out: cubic-bezier(.2, 0, 0, 1);
  --font-display: "Bai Jamjuree", Anuphan, system-ui, sans-serif;
  --font-body: Anuphan, system-ui, sans-serif;
}

/* ── browser surfaces ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); scrollbar-color: var(--surface-3) var(--bg); -webkit-text-size-adjust: 100%; }
::selection { background: rgba(247, 242, 230, .24); color: var(--text-1); }
:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--hi); border-radius: var(--r-sm); }
input, textarea { caret-color: var(--hi); }
[hidden] { display: none !important; }
img { max-width: 100%; }

body {
  margin: 0; background: var(--bg); color: var(--text-1);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em;
    text-decoration-color: rgba(255, 133, 169, .45); transition: color 120ms var(--ease-out), text-decoration-color 120ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { a:hover { color: var(--text-1); text-decoration-color: currentColor; } }
b, strong { font-weight: 600; color: var(--text-1); }

/* ── page shell ───────────────────────────────────────────── */
.wrap { width: 100%; max-width: 1040px; margin-inline: auto; padding-inline: 20px; }
.wrap.narrow { max-width: 720px; }
/* The one hero band per page: pink→plum fade behind the top of the page, scrolls with it. */
.band { background: var(--grad-band); background-repeat: no-repeat; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap;
       padding-block: max(16px, env(safe-area-inset-top)) 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text-1); text-decoration: none; min-height: 44px; }
.brand img { width: 36px; height: 36px; border-radius: var(--r-sm); display: block; }
.brand b { font: 600 20px/1 var(--font-display); letter-spacing: -.01em; }
.brand span { color: var(--text-2); font-size: 13px; }

/* Section nav: one row everywhere. Phones get it as its own full-width row under the brand. */
.nav { display: flex; gap: 2px; margin: 0 -8px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: none; color: var(--text-2); text-decoration: none; font-size: 15px; font-weight: 500; white-space: nowrap;
         padding: 10px 8px; border-radius: var(--r-sm); transition: color 120ms var(--ease-out), background-color 120ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .nav a:hover { color: var(--text-1); background: var(--surface-1); } }
@media (max-width: 639px) { .nav { flex-basis: calc(100% + 16px); justify-content: space-between; } }

/* ── type ─────────────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; color: var(--text-1); text-wrap: balance; margin: 0; }
h1 { font-size: 32px; line-height: 1.25; letter-spacing: -.02em; text-wrap: pretty; }
h2 { font-size: 24px; line-height: 1.3; letter-spacing: -.01em; margin-bottom: 12px; }
h3 { font-size: 17px; line-height: 1.4; margin-bottom: 4px; }
@media (min-width: 760px) { h1 { font-size: 44px; } }
h1 em { font-style: normal; color: var(--accent-text); }
p { margin: 0 0 12px; max-width: 65ch; }
.lead { color: var(--text-2); font-size: 17px; line-height: 1.6; max-width: 40ch; margin: 12px 0 0; }
.muted, .note { color: var(--text-2); font-size: 15px; }
.small { font-size: 13px; color: var(--text-3); margin-top: 12px; }
.grid + .btn.block { margin-top: 20px; }

section { padding-block: 32px 8px; scroll-margin-top: 16px; }

/* Simple pages (/buy, /phone, /privacy): icon + title in the band, then one reading column. */
.page-head { padding-block: max(28px, env(safe-area-inset-top)) 36px; }
.page-head .mark { width: 56px; height: 56px; border-radius: var(--r-md); display: block; margin-bottom: 20px; box-shadow: var(--shadow-2); }
.doc { padding-bottom: max(56px, env(safe-area-inset-bottom)); }
.doc > h2 { margin: 40px 0 12px; }
.doc > h2:first-child { margin-top: 8px; }
.stack > * + * { margin-top: 12px; }

/* ── lists ────────────────────────────────────────────────── */
ul, ol { margin: 8px 0 0; padding-left: 22px; max-width: 65ch; }
li { margin-block: 6px; padding-left: 2px; }
li::marker { color: var(--text-3); }
ol > li::marker { font-family: var(--font-display); font-weight: 600; color: var(--accent-text); }
/* Plan features: a drawn check, not a glyph. */
ul.ticks { list-style: none; padding-left: 0; }
ul.ticks li { position: relative; padding-left: 28px; }
ul.ticks li::before { content: ""; position: absolute; left: 0; top: .32em; width: 18px; height: 18px; border-radius: var(--r-pill);
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F1E7A9' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat; }

/* ── cards ────────────────────────────────────────────────── */
.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px;
        box-shadow: var(--shadow-1); }
.card > :last-child, .card ol:last-child, .card ul:last-child { margin-bottom: 0; }
.card p { color: var(--text-2); }
.card.raised { background: var(--surface-2); box-shadow: var(--shadow-2); }
/* The hero card: one per page (the paid plan). */
.card.hero-card { background: var(--grad-hero); border-color: rgba(255, 255, 255, .10); border-radius: var(--r-xl); box-shadow: var(--shadow-hero); }
.card.hero-card p, .card.hero-card li { color: var(--text-1); }
.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }

/* ── price ────────────────────────────────────────────────── */
.price { font: 600 44px/1.1 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--text-1);
         margin: 8px 0 12px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.price .cur { font-size: .6em; color: var(--text-2); margin-right: -6px; }
.price .per { font: 500 15px/1.4 var(--font-body); letter-spacing: 0; color: var(--text-2); }

/* ── buttons ──────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 24px;
       border-radius: var(--r-pill); border: 0; font: 600 17px/1.3 var(--font-body); text-align: center; text-decoration: none;
       cursor: pointer; -webkit-tap-highlight-color: transparent;
       transition: transform 200ms var(--ease-out), filter 200ms var(--ease-out), background-color 120ms var(--ease-out); }
.btn:active { transform: scale(.97); filter: brightness(.94); transition-duration: 100ms; }
@media (hover: hover) and (pointer: fine) { .btn:hover { filter: brightness(1.05); } .btn:active { filter: brightness(.94); } }
.btn:focus-visible { border-radius: var(--r-pill); }
/* Primary: one per view. Ink on pink (white on pink fails contrast). */
.btn.main { background: var(--grad-cta); color: var(--accent-ink); box-shadow: var(--shadow-cta); }
/* Secondary: a surface step, never a second pink. */
.btn.alt, .btn.soon, .btn.ghost { background: var(--surface-3); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--border-strong); }
@media (hover: hover) and (pointer: fine) { .btn.alt:hover, .btn.soon:hover, .btn.ghost:hover { background: #383040; filter: none; } }
.btn.block { display: flex; width: 100%; margin-top: 12px; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
@media (max-width: 479px) { .ctas .btn { width: 100%; } }

/* ── segmented tabs (phone guide) ─────────────────────────── */
.tabs { display: inline-flex; gap: 4px; padding: 4px; margin: 24px 0 4px; background: var(--surface-1); border: 1px solid var(--border);
        border-radius: var(--r-pill); }
.tabs button { font: 600 15px/1 var(--font-body); color: var(--text-2); background: transparent; border: 0; border-radius: var(--r-pill);
               min-height: 40px; padding: 0 20px; cursor: pointer; transition: background-color 120ms var(--ease-out), color 120ms var(--ease-out); }
.tabs button.on { background: var(--accent-soft); color: var(--text-1); box-shadow: inset 0 0 0 1px rgba(247, 242, 230, .45); }
@media (hover: hover) and (pointer: fine) { .tabs button:not(.on):hover { color: var(--text-1); } }
.tag { display: inline-block; vertical-align: 2px; margin-left: 4px; font: 600 12px/1.6 var(--font-body); color: var(--text-2);
       background: var(--surface-3); border-radius: var(--r-pill); padding: 1px 10px; }

/* ── callout (privacy: Google policy line) ────────────────── */
.callout { background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 14px 16px;
           font-size: 15px; color: var(--text-2); box-shadow: var(--shadow-1); }

/* ── seller / contact table ───────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.facts { border-collapse: collapse; width: 100%; font-size: 15px; }
.facts td { padding: 12px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.facts tr:last-child td { border-bottom: 0; }
.facts td:first-child { color: var(--text-3); white-space: nowrap; width: 1%; padding-left: 0; padding-right: 20px; }
.facts td:last-child { padding-right: 0; }
@media (max-width: 479px) {
  .facts tr { display: block; padding-block: 10px; border-bottom: 1px solid var(--border); }
  .facts tr:last-child { border-bottom: 0; }
  .facts td { display: block; padding: 0; border: 0; }
  .facts td:first-child { font-size: 13px; padding: 0 0 2px; }
}

/* ── footer ───────────────────────────────────────────────── */
.foot { color: var(--text-3); font-size: 14px; border-top: 1px solid var(--border); margin-top: 40px;
        padding-block: 24px max(40px, env(safe-area-inset-bottom)); }
.foot p { margin: 0; max-width: none; }
.foot a { color: var(--text-2); }
/* full address + phone: on the page for DBD, kept small on purpose */
.fine { font-size: 12px; line-height: 1.5; color: var(--text-3); }
.foot .fine { margin-top: 6px; }
.fine a { color: inherit; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 1ms !important; } }
