/* ============================================================================
   mostpost.io — design system + product-UI vignettes
   Warm "Alvorado" palette, DM Sans, forest-green ink. One file, tokens on top.
   Kept in sync with the app (DESIGN.md / theming.md). No third-party requests.
   ============================================================================ */

/* --- Self-hosted DM Sans (variable, no CDN) ------------------------------- */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url("/assets/fonts/dmsans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url("/assets/fonts/dmsans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- Tokens --------------------------------------------------------------- */
:root {
  /* Alvorado light (matches the app's light theme) */
  --bg: #ece4d2;
  --bg-card: #f5efe0;
  --border: #d6cfbf;
  --ink: #1a1a1a;
  --muted: #6b6555;
  --accent: #2c5b3f;       /* forest green */
  --accent-soft: #d9e5dc;
  --accent-text: #224a33;
  --terra: #985020;        /* terracotta highlight */
  --green: #2f7048;
  --cyan: #0b6b5e;         /* synthesized bot meta-contacts */
  --on-accent: #fff;
  --accent-dark: #234a33;   /* --accent darkened, for button hover */
  --bubble-mine: #c8dccb;   /* sent-message bubble tint (app light theme) */

  /* Dark "encryption beat" (matches the app's dark theme) */
  --d-bg: #0b100d;
  --d-card: #101814;
  --d-border: #1c2420;
  --d-ink: #e6e8e4;
  --d-muted: #828c84;
  --d-violet: #8b6cff;
  --d-violet-text: #c5b4ff;
  --d-cyan: #00d4aa;

  /* chat-bubble + frame radii (the recurring motif) */
  --r-bubble-them: 14px 14px 14px 4px;
  --r-bubble-mine: 14px 14px 4px 14px;
  --r-card: 14px;

  --maxw: 1120px;
  --read: 64ch;
  --pad: clamp(20px, 5vw, 56px);
}

/* --- Base ----------------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(16px, 1.05rem, 18px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { line-height: 1.08; letter-spacing: -0.02em; margin: 0; font-weight: 700; }
h1 { font-size: clamp(2.4rem, 6vw, 4.1rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h3 { font-size: clamp(1.15rem, 2.4vw, 1.5rem); letter-spacing: -0.01em; }
p  { margin: 0 0 1em; }
a  { color: var(--accent); text-underline-offset: 3px; }
mono, .mono, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }
section { padding-block: clamp(64px, 12vw, 140px); }
.lede { font-size: clamp(1.2rem, 2.6vw, 1.6rem); color: var(--muted); max-width: 34ch; }

/* uppercase editorial micro-label (mirrors the app's section headers) */
.eyebrow {
  font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--terra); margin: 0 0 1rem;
}

/* --- Header (quiet, recedes) --------------------------------------------- */
.masthead {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.masthead.scrolled { border-bottom-color: var(--border); }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.masthead img { height: 44px; width: auto; display: block; }
.nav { display: flex; gap: clamp(14px, 3vw, 30px); align-items: center; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: .98rem; }
.nav a:hover { color: var(--accent); }
.nav .cta { color: var(--on-accent); background: var(--accent); padding: 8px 16px; border-radius: 20px; }
@media (max-width: 600px) { .nav a:not(.cta) { display: none; } }

/* --- Buttons / badges ----------------------------------------------------- */
.btn { display: inline-block; background: var(--accent); color: var(--on-accent);
  padding: 12px 22px; border-radius: 24px; font-weight: 600; text-decoration: none; }
.btn:hover { background: var(--accent-dark); }
.skip { position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: 0 0 8px 0; }
.skip:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.dark :focus-visible { outline-color: var(--d-violet); }
.store-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 1.4rem; }
.store-badge {
  display: inline-flex; gap: 10px; align-items: center;
  border: 1px solid var(--border); background: var(--bg-card);
  border-radius: 12px; padding: 10px 16px; color: var(--muted);
  font-weight: 500; cursor: default; opacity: .85;
}
.store-badge small { display: block; font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; }
.store-badge b { font-size: 1.02rem; color: var(--ink); font-weight: 600; }
.soon { font-size: .8rem; color: var(--terra); font-weight: 600; align-self: center; }

/* --- Hero (asymmetric) ---------------------------------------------------- */
.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero { padding-top: clamp(48px, 8vw, 96px); }
.hero h1 { margin-bottom: .5em; max-width: 14ch; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; } .hero-art { order: -1; } }

/* --- Product beats (alternating editorial rows) --------------------------- */
.beat .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.beat.flip .beat-media { order: 2; }
.beat-copy p { color: var(--muted); max-width: 46ch; }
.beat-copy h2 { color: var(--ink); margin-bottom: .4em; }
@media (max-width: 820px) { .beat .wrap { grid-template-columns: 1fr; } .beat.flip .beat-media { order: 0; } }

/* ============================================================================
   Product-UI vignettes — the real app UI rebuilt in HTML/CSS with app tokens.
   ============================================================================ */
.device {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 28px; padding: 14px; box-shadow: 0 24px 60px -28px rgba(20,20,20,.35);
  max-width: 380px; margin-inline: auto; width: 100%;
}
.device-screen { background: var(--bg); border-radius: 18px; overflow: hidden; }
.device-bar { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 8px; }
.device-bar .title { font-weight: 700; font-size: 1.05rem; }
.pillrow { display: flex; gap: 6px; padding: 4px 16px 10px; flex-wrap: wrap; }
.fpill { font-size: .8rem; padding: 4px 11px; border-radius: 20px; color: var(--muted); }
.fpill.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.fpill .ct { font-size: .7rem; background: var(--accent); color: #fff; border-radius: 10px; padding: 0 6px; margin-left: 5px; }

/* chat-list rows */
.row { display: flex; gap: 12px; padding: 12px 16px; align-items: center; }
.row + .row { border-top: 1px solid var(--border); }
.av { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center;
  color: var(--on-accent); font-weight: 700; font-size: 1.1rem; }
.row .meta { min-width: 0; flex: 1; }
.row .nm { display: flex; justify-content: space-between; gap: 8px; }
.row .nm b { font-weight: 600; font-size: .98rem; }
.row .nm span { color: var(--muted); font-size: .8rem; flex: none; }
.row .pv { color: var(--muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { background: var(--terra); color: #fff; font-size: .72rem; font-weight: 700;
  border-radius: 11px; min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; }
.dot-need { width: 8px; height: 8px; border-radius: 50%; background: var(--terra); flex: none; }

/* chat thread bubbles */
.thread { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.bub { max-width: 78%; padding: 10px 14px; font-size: .92rem; line-height: 1.5; }
.bub.them { align-self: flex-start; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-bubble-them); }
.bub.mine { align-self: flex-end; background: var(--bubble-mine); border-radius: var(--r-bubble-mine); }
.ai-card { border: 1px solid var(--accent-soft); background: linear-gradient(135deg,#f2ecdc,#e7eee5);
  border-radius: var(--r-card); padding: 12px 14px; font-size: .9rem; }
.ai-card .lbl { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }

/* transparency explainer (the wedge) */
.transp { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 2rem; }
.transp .col { border-radius: 16px; padding: 22px; }
.transp .sees { background: var(--bg-card); border: 1px solid var(--border); }
.transp .enc  { background: #11201a; color: var(--d-ink); border: 1px solid #1c2c24; }
.transp h3 { margin-bottom: .6rem; }
.transp .enc h3 { color: var(--d-violet-text); }
.transp ul { margin: 0; padding-left: 1.1em; }
.transp .enc a { color: var(--d-violet-text); }
@media (max-width: 720px) { .transp { grid-template-columns: 1fr; } }

/* --- Dark encryption beat ------------------------------------------------- */
.dark { background: var(--d-bg); color: var(--d-ink); }
.dark .eyebrow { color: var(--d-violet); }
.dark h2 { color: var(--d-ink); }
.dark .beat-copy p { color: var(--d-muted); }
.dark a { color: var(--d-violet-text); }
.dark .device { background: var(--d-card); border-color: var(--d-border); box-shadow: 0 24px 60px -28px #000; }
.dark .device-screen { background: var(--d-bg); }
.dark .device-bar .title { color: var(--d-ink); }
.dark .compose { padding: 16px; }
.dark .compose .field { background: var(--d-card); border: 1px solid var(--d-border); border-radius: 12px;
  padding: 12px 14px; color: var(--d-muted); font-size: .9rem; }
.dark .compose .field + .field { margin-top: 8px; }
.dark .sendrow { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.dark .send { background: var(--d-cyan); color: #06241d; border-radius: 20px; padding: 7px 18px; font-weight: 700; font-size: .85rem; }
.enc-foot { display: flex; align-items: center; gap: 8px; color: var(--d-cyan); font-size: .78rem; margin-top: 10px; }
.lock { width: 14px; height: 14px; flex: none; }

/* --- provider chips ------------------------------------------------------- */
.providers { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 1.2rem; }
.chip { border: 1px solid var(--border); background: var(--bg-card); border-radius: 22px;
  padding: 8px 16px; font-weight: 600; font-size: .92rem; }

/* --- footer --------------------------------------------------------------- */
.foot { background: var(--bg-card); border-top: 1px solid var(--border); }
.foot .wrap { padding-block: 48px; display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start; }
.foot img { height: 22px; }
.foot nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.foot a:hover { color: var(--accent); }
.foot .copy { color: var(--muted); font-size: .85rem; width: 100%; margin-top: 8px; }

/* --- reveal on scroll (progressive enhancement) --------------------------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
.no-js .reveal { opacity: 1; transform: none; }

/* --- legal pages (reading-optimized) ------------------------------------- */
.legal .wrap { max-width: 760px; }
.legal h1 { font-size: clamp(2rem, 5vw, 2.6rem); }
.legal h2 { font-size: 1.25rem; color: var(--accent); margin: 2.2em 0 .4em; }
.legal .meta { color: var(--muted); font-size: .95rem; margin-bottom: 2em; }
.legal ul { padding-left: 1.25em; }
