/* ─────────────────────────────────────────────────────────────────────────
   getdelva.com — site styles
   Tokens mirror the app's design tokens (shared/theme/index.ts):
   lilac wash #EDE9F8, accent purple #6B4FD3, Inter + Georgia.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --bg-app: #EDE9F8;
  --bg-card: #FFFFFF;
  --bg-subtle: #F8F6FC;
  --ink: #221936;
  --ink-2: #4E4265;
  --ink-3: #6D6280;
  --ink-on-white: #241F2F;
  --ink-on-white-2: #5F536F;
  --ink-on-white-3: #7A7088;
  --accent: #6B4FD3;
  --accent-ink: #4E3792;
  --accent-soft: #C8BAF7;
  --accent-subtle: #F5F2FF;
  --like: #E84D5B;
  --line: #CFC7DE;
  --dot: #CFC7DE;

  /* topic palettes (primary / soft / ink) — used by the feed demo */
  --t-empires: #7B4A0C; --t-empires-soft: #FBE8C5; --t-empires-sec: #D99A3D;
  --t-wars: #8A360E;    --t-wars-soft: #FADDC9;    --t-wars-sec: #E26C2D;
  --t-ideas: #4E3792;   --t-ideas-soft: #F5F2FF;   --t-ideas-sec: #8D75E6;
  --t-nations: #24508F; --t-nations-soft: #D4E8FF; --t-nations-sec: #4E8FE0;
  --t-science: #11667F; --t-science-soft: #D5F4FA; --t-science-sec: #35B9D6;
  --t-society: #256A46; --t-society-soft: #D7F2E2; --t-society-sec: #56B881;
  --t-culture: #8A2862; --t-culture-soft: #F9D8EA; --t-culture-sec: #D85CA3;
  --t-leaders: #8F1D2E; --t-leaders-soft: #FAD4D9; --t-leaders-sec: #D94B5D;

  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius-card: 24px;
  --radius-widget: 18px;
  --shadow-widget: 0 10px 30px rgba(34, 25, 54, 0.10), 0 1px 2px rgba(34, 25, 54, 0.06);
  --shadow-phone: 0 40px 80px rgba(34, 25, 54, 0.22), 0 8px 24px rgba(34, 25, 54, 0.12);

  --maxw: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
}

*, *::before, *::after { 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;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 999px; text-decoration: none;
}
.skip:focus { top: 16px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }

/* ── Type ─────────────────────────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: -0.02em; margin: 0; color: var(--ink); }
h1 { font-size: clamp(2.5rem, 7.2vw, 4.6rem); line-height: 1.02; }
h2 { font-size: clamp(1.9rem, 4.2vw, 2.75rem); line-height: 1.1; }
h3 { font-size: 1.35rem; line-height: 1.25; }
p { margin: 0; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--ink-2); max-width: 34em; }
.eyebrow {
  font-family: var(--sans); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.muted { color: var(--ink-3); }
.small { font-size: 0.9rem; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px; border-radius: 999px; text-decoration: none;
  font-weight: 600; font-size: 1rem; line-height: 1; border: 1.5px solid transparent;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--ink); color: #fff; box-shadow: 0 6px 18px rgba(34,25,54,.18); }
.btn-primary:hover { background: #2E2349; }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 8px 22px rgba(107,79,211,.30); }
.btn-accent:hover { background: #5B41BE; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: rgba(255,255,255,.55); }
.btn .apple { width: 18px; height: 18px; }
.btn small { display: block; font-size: .68rem; font-weight: 500; opacity: .75; letter-spacing: .02em; }
.btn-store { text-align: left; padding: 8px 22px 8px 18px; min-height: 56px; }
.btn-store > span { display: flex; flex-direction: column; line-height: 1.15; }
.btn-store > span b { font-size: 1.05rem; font-weight: 600; }

/* ── Header ───────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(237, 233, 248, 0.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(34,25,54,0.06);
}
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav-links { display: none; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; font-weight: 500; color: var(--ink-2); }
.nav-links a:hover { color: var(--ink); }
.nav .btn { min-height: 42px; padding-inline: 18px; font-size: .92rem; }
@media (min-width: 760px) { .nav-links { display: flex; } }

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero { padding-block: clamp(40px, 8vw, 96px) clamp(48px, 8vw, 96px); overflow: hidden; }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.1fr .9fr; gap: 56px; } }
.hero-copy { display: flex; flex-direction: column; gap: 22px; }
.hero-copy h1 { max-width: 11em; }
.hero-copy h1 em { font-style: italic; color: var(--accent); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 6px; }
.hero-note { font-size: .85rem; color: var(--ink-3); }

/* ── Phone mockup ─────────────────────────────────────────────────────── */
.phone-stage { display: flex; justify-content: center; }
.phone {
  position: relative; width: min(330px, 78vw); aspect-ratio: 9 / 19.2;
  border-radius: 48px; background: #17122A; padding: 12px;
  box-shadow: var(--shadow-phone);
}
.phone::after { /* island */
  content: ""; position: absolute; left: 50%; top: 24px; width: 92px; height: 26px; border-radius: 999px;
  background: #17122A; transform: translateX(-50%); z-index: 5;
}
.screen {
  position: relative; width: 100%; height: 100%; border-radius: 38px; overflow: hidden; background: var(--bg-app);
}
.feed { position: absolute; inset: 0; }
.card {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 24px 22px 92px; opacity: 0; transform: translateY(100%);
  transition: transform .7s cubic-bezier(.2,.8,.2,1), opacity .5s ease;
  --tp: var(--t-empires); --ts: var(--t-empires-soft); --tsec: var(--t-empires-sec);
}
.card.is-active { opacity: 1; transform: translateY(0); }
.card.is-prev { opacity: 1; transform: translateY(-100%); }
.card::before { /* backdrop: topic tint dissolving into the lilac field */
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 70% at 80% 0%, var(--tsec) 0%, transparent 60%),
    linear-gradient(180deg, var(--tp) 0%, var(--tp) 30%, var(--bg-app) 68%);
}
.card::after { /* faint glyph watermark */
  content: ""; position: absolute; right: -8%; top: 8%; width: 60%; aspect-ratio: 519/581; opacity: .12;
  background: url("../img/logo-glyph-white.svg") center / contain no-repeat;
}
.card > * { position: relative; }
.kicker { font-weight: 700; font-size: .66rem; letter-spacing: .14em; color: var(--tp); margin-bottom: 8px; }
.card h3 { font-family: var(--serif); font-size: 1.9rem; line-height: 1.05; margin-bottom: 10px; color: var(--ink); }
.hook { font-size: .92rem; line-height: 1.45; color: var(--ink-2); }
.chips { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.chip { font-size: .68rem; font-weight: 600; padding: 5px 9px; border-radius: 999px; background: var(--ts); color: var(--tp); }
.dots { position: absolute; left: 0; right: 0; bottom: 70px; display: flex; justify-content: center; gap: 5px; z-index: 3; }
.dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--dot); }
.dots i:first-child { width: 16px; background: var(--accent); }
.dock {
  position: absolute; left: 18px; right: 18px; bottom: 16px; height: 46px; border-radius: 999px; z-index: 4;
  background: rgba(255,255,255,.9); box-shadow: var(--shadow-widget); display: flex; align-items: center; justify-content: space-around; padding-inline: 8px;
}
.dock svg { width: 20px; height: 20px; stroke: #A59CAF; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dock svg.on { stroke: var(--accent); }
.card[data-topic="wars"]     { --tp: var(--t-wars);    --ts: var(--t-wars-soft);    --tsec: var(--t-wars-sec); }
.card[data-topic="ideas"]    { --tp: var(--t-ideas);   --ts: var(--t-ideas-soft);   --tsec: var(--t-ideas-sec); }
.card[data-topic="nations"]  { --tp: var(--t-nations); --ts: var(--t-nations-soft); --tsec: var(--t-nations-sec); }
.card[data-topic="science"]  { --tp: var(--t-science); --ts: var(--t-science-soft); --tsec: var(--t-science-sec); }
.card[data-topic="society"]  { --tp: var(--t-society); --ts: var(--t-society-soft); --tsec: var(--t-society-sec); }
.card[data-topic="culture"]  { --tp: var(--t-culture); --ts: var(--t-culture-soft); --tsec: var(--t-culture-sec); }
.card[data-topic="leaders"]  { --tp: var(--t-leaders); --ts: var(--t-leaders-soft); --tsec: var(--t-leaders-sec); }
@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
}

/* ── Proof strip ──────────────────────────────────────────────────────── */
.proof { border-block: 1px solid rgba(34,25,54,.08); background: rgba(255,255,255,.35); }
.proof-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 24px; padding-block: 26px; }
@media (min-width: 760px) { .proof-grid { grid-template-columns: repeat(4, 1fr); } }
.proof-item b { display: block; font-family: var(--serif); font-size: 1.35rem; letter-spacing: -0.01em; }
.proof-item span { font-size: .85rem; color: var(--ink-3); }

/* ── Sections ─────────────────────────────────────────────────────────── */
.section { padding-block: clamp(56px, 9vw, 112px); }
.section-head { max-width: 40em; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head p { margin-top: 14px; }
.alt { background: #fff; }

/* how it works */
.steps { display: grid; gap: 20px; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step {
  background: var(--bg-card); border-radius: var(--radius-card); padding: 28px 26px 30px; box-shadow: var(--shadow-widget);
  display: flex; flex-direction: column; gap: 12px;
}
.alt .step { background: var(--bg-subtle); box-shadow: none; border: 1px solid rgba(34,25,54,.06); }
.step .num { font-family: var(--serif); font-size: 2.2rem; color: var(--accent); line-height: 1; }
.step h3 { color: var(--ink-on-white); }
.step p { color: var(--ink-on-white-2); }

/* sample (card-back widgets) */
.sample { display: grid; gap: 28px; align-items: start; }
@media (min-width: 900px) { .sample { grid-template-columns: 1fr 1fr; gap: 48px; } }
.widget-stack { display: grid; gap: 16px; }
.widget {
  background: #fff; border-radius: var(--radius-widget); padding: 22px 22px 24px; box-shadow: var(--shadow-widget);
  color: var(--ink-on-white);
}
.widget .wl { font-weight: 700; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--t-empires); margin-bottom: 10px; }
.widget h4 { font-family: var(--serif); font-size: 1.35rem; margin: 0 0 8px; letter-spacing: -0.01em; }
.widget p { color: var(--ink-on-white-2); font-size: .98rem; }
.quote { font-family: var(--serif); font-size: 1.35rem; line-height: 1.3; color: var(--ink-on-white); }
.quote + p { margin-top: 10px; font-size: .85rem; }
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; position: relative; margin-top: 6px; }
.timeline::before { content: ""; position: absolute; left: 6px; right: 6px; top: 7px; height: 2px; background: var(--t-empires-soft); }
.tl { position: relative; padding-top: 22px; font-size: .78rem; line-height: 1.3; color: var(--ink-on-white-2); }
.tl::before { content: ""; position: absolute; left: 0; top: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--t-empires-soft); box-shadow: 0 0 0 1px rgba(123,74,12,.35) inset; }
.tl.on::before { background: var(--t-empires); }
.tl b { display: block; color: var(--t-empires); font-family: var(--serif); font-size: .95rem; }
.tl.on { color: var(--t-empires); }
.dyk { border-left: 4px solid var(--accent-soft); background: var(--accent-subtle); }
.dyk .wl { color: var(--accent); }

/* topics */
.era-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.era { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 8px 14px; border-radius: 999px; background: #fff; color: var(--ink-2); border: 1px solid rgba(34,25,54,.08); }
.topic-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.topic {
  font-family: var(--serif); font-size: 1.05rem; padding: 10px 16px; border-radius: 999px; background: var(--ts, #fff); color: var(--tp, var(--ink));
}
.topic[data-t="empires"] { --ts: var(--t-empires-soft); --tp: var(--t-empires); }
.topic[data-t="wars"]    { --ts: var(--t-wars-soft);    --tp: var(--t-wars); }
.topic[data-t="ideas"]   { --ts: var(--t-ideas-soft);   --tp: var(--t-ideas); }
.topic[data-t="nations"] { --ts: var(--t-nations-soft); --tp: var(--t-nations); }
.topic[data-t="science"] { --ts: var(--t-science-soft); --tp: var(--t-science); }
.topic[data-t="society"] { --ts: var(--t-society-soft); --tp: var(--t-society); }
.topic[data-t="culture"] { --ts: var(--t-culture-soft); --tp: var(--t-culture); }
.topic[data-t="leaders"] { --ts: var(--t-leaders-soft); --tp: var(--t-leaders); }

/* pricing */
.plans { display: grid; gap: 18px; max-width: 760px; }
@media (min-width: 700px) { .plans { grid-template-columns: 1fr 1fr; } }
.plan { background: #fff; border-radius: var(--radius-card); padding: 28px 26px; box-shadow: var(--shadow-widget); position: relative; color: var(--ink-on-white); }
.plan.featured { outline: 2px solid var(--accent); }
.plan .tag { position: absolute; top: -12px; left: 22px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; }
.plan .name { font-weight: 600; color: var(--ink-on-white-2); }
.plan .price { font-family: var(--serif); font-size: 2.4rem; letter-spacing: -0.02em; margin: 8px 0 2px; }
.plan .price span { font-family: var(--sans); font-size: 1rem; color: var(--ink-on-white-3); letter-spacing: 0; }
.plan .per { font-size: .9rem; color: var(--ink-on-white-3); }
.plan ul { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: .95rem; color: var(--ink-on-white-2); }
.plan li::before { content: "✓"; color: var(--accent); font-weight: 700; margin-right: 8px; }
.terms-note { margin-top: 22px; font-size: .85rem; color: var(--ink-3); max-width: 60em; }
.terms-note a { color: var(--accent-ink); }

/* FAQ */
.faq { max-width: 760px; }
.faq details { border-top: 1px solid rgba(34,25,54,.1); padding: 4px 0; }
.faq details:last-child { border-bottom: 1px solid rgba(34,25,54,.1); }
.faq summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 0; font-weight: 600; font-size: 1.05rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--serif); font-size: 1.6rem; color: var(--accent); line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .a { padding: 0 0 20px; color: var(--ink-2); max-width: 60em; }
.faq .a a { color: var(--accent-ink); }

/* closing CTA */
.closing { background: var(--ink); color: #fff; border-radius: 32px; padding: clamp(36px, 6vw, 64px); display: grid; gap: 28px; align-items: center; overflow: hidden; position: relative; }
@media (min-width: 800px) { .closing { grid-template-columns: 1.2fr .8fr; } }
.closing h2 { color: #fff; }
.closing p { color: rgba(255,255,255,.72); }
.closing::after { content: ""; position: absolute; right: -6%; bottom: -30%; width: 46%; aspect-ratio: 519/581; opacity: .08; background: url("../img/logo-glyph-white.svg") center / contain no-repeat; pointer-events: none; }
.closing .btn-primary { background: #fff; color: var(--ink); }
.closing .btn-primary:hover { background: #F3F0FA; }
.qr { justify-self: center; background: #fff; padding: 14px; border-radius: 18px; display: grid; gap: 8px; justify-items: center; color: var(--ink); text-align: center; font-size: .8rem; }
.qr img { width: 150px; height: 150px; image-rendering: pixelated; }

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer { padding-block: 48px 40px; border-top: 1px solid rgba(34,25,54,.08); font-size: .9rem; color: var(--ink-3); }
.foot-grid { display: grid; gap: 28px; }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.foot-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.foot-links a { text-decoration: none; color: var(--ink-2); }
.foot-links a:hover { color: var(--ink); text-decoration: underline; }
.foot-head { font-weight: 700; color: var(--ink); margin-bottom: 12px; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; }
.legal-line { margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(34,25,54,.08); font-size: .8rem; line-height: 1.6; }
.legal-line a { color: inherit; }

/* ── Legal / prose pages ──────────────────────────────────────────────── */
.prose { max-width: 760px; padding-block: clamp(36px, 6vw, 72px) clamp(56px, 8vw, 96px); }
.prose h1 { font-size: clamp(2.1rem, 5vw, 3rem); margin-bottom: 8px; }
.prose .updated { color: var(--ink-3); font-size: .9rem; margin-bottom: 36px; }
.prose h2 { font-size: 1.5rem; margin: 40px 0 12px; }
.prose h3 { font-size: 1.12rem; font-family: var(--sans); font-weight: 700; margin: 24px 0 8px; }
.prose p, .prose li { color: var(--ink-2); }
.prose p { margin-bottom: 14px; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 16px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--accent-ink); }
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 12px 0 20px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 10px 10px 0; border-bottom: 1px solid rgba(34,25,54,.1); color: var(--ink-2); }
.prose th { color: var(--ink); font-weight: 700; }
.prose .table-scroll { overflow-x: auto; }
.prose .callout { background: #fff; border-radius: 16px; padding: 18px 20px; border-left: 4px solid var(--accent-soft); margin: 18px 0 24px; }
.prose .callout p:last-child { margin-bottom: 0; }
.toc { background: #fff; border-radius: 16px; padding: 18px 22px; margin-bottom: 32px; font-size: .92rem; }
.toc ol { margin: 0; padding-left: 1.2em; columns: 2; column-gap: 24px; }
@media (max-width: 600px) { .toc ol { columns: 1; } }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* 404 */
.notfound { min-height: 60vh; display: grid; place-items: center; text-align: center; padding-block: 64px; }
.notfound h1 { font-size: clamp(3rem, 12vw, 7rem); }

/* utilities */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
