/* David's public site (Stage 18): the landing page and the account page.
   The same dark brown and orange amber as the phone, David Desktop, and David on the web. */
:root {
  --bg: #16100B;
  --surface: #1E1610;
  --surface2: #2A1F16;
  --raised: #33261B;
  --line: #3A2B1E;
  --accent: #D97A1A;
  --accent-text: #F29A4E;
  --on-accent: #16100B;
  --text: #F6EFE6;
  --muted: #C4B5A3;
  --faint: #9A8875;
  --good: #7FB685;
  --danger: #EF6B66;
  --ui: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "Cascadia Code", Consolas, ui-monospace, monospace;
  --max: 1120px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--ui); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent-text); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 14px; }
.mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--accent); color: var(--on-accent); padding: 10px 14px; border-radius: 10px; z-index: 50; font-weight: 600; }
.skip:focus { top: 12px; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

button, .btn { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: 12px; font-weight: 600; white-space: nowrap; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border: 1px solid var(--line); color: var(--text); font-weight: 500; }
.btn.ghost:hover { background: var(--surface2); }
.btn.danger { border: 1px solid #6B2A27; color: var(--danger); font-weight: 500; }
.btn.danger:hover { background: #2A1514; }
.btn.big { min-height: 54px; padding: 12px 24px; font-size: 17px; }
.btn[disabled] { opacity: 0.6; cursor: default; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(22, 16, 11, 0.86); backdrop-filter: blur(12px); border-bottom: 1px solid transparent; }
.top.scrolled { border-bottom-color: var(--line); }
.top-in { max-width: var(--max); margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: 0.04em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-size: 15px; }
.nav a:hover { color: var(--text); background: var(--surface2); }
.top-gap { flex: 1; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--raised); color: var(--accent-text); display: grid; place-items: center; font-weight: 700; text-decoration: none; border: 1px solid var(--line); }
@media (max-width: 860px) { .nav { display: none; } }
@media (max-width: 480px) { .top-actions .hide-xs { display: none; } .hero h1 { margin-top: 16px; } .top-in { padding: 10px 16px; gap: 10px; } }

/* ---------- landing ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.hero { position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -30% -10% auto; height: 620px; background: radial-gradient(ellipse at 30% 40%, rgba(217, 122, 26, 0.22), transparent 60%), radial-gradient(ellipse at 80% 20%, rgba(143, 152, 192, 0.12), transparent 55%); pointer-events: none; }
.hero-in { position: relative; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; padding: 72px 0 80px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-text); font-size: 14px; font-weight: 600; letter-spacing: 0.04em; background: rgba(217, 122, 26, 0.1); border: 1px solid rgba(217, 122, 26, 0.3); padding: 6px 12px; border-radius: 999px; }
.hero h1 { font-size: clamp(38px, 5.4vw, 62px); line-height: 1.05; margin: 20px 0 18px; }
.hero h1 em { font-style: normal; color: var(--accent-text); }
.lead { font-size: 19px; color: var(--muted); max-width: 34em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.fine { margin-top: 16px; color: var(--faint); font-size: 14px; }

.demo { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); }
.demo-top { display: flex; align-items: center; gap: 10px; padding: 2px 4px 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; color: var(--muted); font-size: 14px; }
.demo-top img { width: 26px; height: 26px; border-radius: 7px; }
.demo-top .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-left: auto; }
.msg { max-width: 88%; padding: 11px 14px; border-radius: 16px; margin: 8px 0; font-size: 15px; line-height: 1.5; }
.msg.you { margin-left: auto; background: var(--raised); border-bottom-right-radius: 6px; }
.msg.david { background: var(--surface2); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg .tag { display: block; font-size: 12px; color: var(--accent-text); font-weight: 600; margin-bottom: 3px; letter-spacing: 0.03em; }
.chip { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; margin-top: 8px; }
.chip svg.i { width: 15px; height: 15px; color: var(--good); }

section.band { padding: 84px 0; border-top: 1px solid var(--line); }
.kicker { color: var(--accent-text); font-weight: 600; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; }
.band h2 { font-size: clamp(28px, 3.6vw, 40px); margin: 10px 0 14px; }
.band .lead { margin-bottom: 40px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.card h3 { font-size: 18px; margin: 14px 0 6px; }
.card p { color: var(--muted); font-size: 15px; }
.ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: rgba(217, 122, 26, 0.12); color: var(--accent-text); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 700; margin-bottom: 14px; }
.steps h3 { font-size: 18px; margin-bottom: 6px; }
.steps p { color: var(--muted); font-size: 15px; }

.download { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dl-main { display: flex; flex-direction: column; gap: 14px; }
.dl-ver { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.dl-ver strong { font-family: var(--display); font-size: 30px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 15px; }
.facts dt { color: var(--faint); }
.facts dd { margin: 0; }
.how { padding-left: 20px; margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.how li { margin: 6px 0; }

.safety { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.safe { display: flex; gap: 14px; }
.safe svg.i { color: var(--good); margin-top: 2px; }
.safe h3 { font-size: 17px; margin-bottom: 4px; }
.safe p { color: var(--muted); font-size: 15px; }

.closing { text-align: center; padding: 90px 0; border-top: 1px solid var(--line); }
.closing h2 { font-size: clamp(28px, 3.6vw, 40px); margin-bottom: 12px; }
.closing .cta { justify-content: center; }

footer { border-top: 1px solid var(--line); padding: 30px 0 40px; color: var(--faint); font-size: 14px; }
.foot-in { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.foot-in .gap { flex: 1; }

@media (max-width: 900px) {
  .hero-in { grid-template-columns: 1fr; gap: 40px; padding: 40px 0 56px; }
  .grid, .steps { grid-template-columns: 1fr 1fr; }
  .download, .safety { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .grid, .steps { grid-template-columns: 1fr; }
  section.band { padding: 60px 0; }
  .lead { font-size: 17px; }
  .wrap { padding: 0 16px; }
}

/* ---------- dialogs and forms ---------- */
dialog { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 20px; padding: 0; width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6); }
dialog::backdrop { background: rgba(8, 5, 3, 0.72); backdrop-filter: blur(3px); }
.dlg { padding: 26px 24px 22px; }
.dlg-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.dlg-head h2 { font-size: 24px; flex: 1; }
.x { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); margin: -6px -8px 0 0; }
.x:hover { background: var(--surface2); color: var(--text); }
label { display: block; color: var(--muted); font-size: 14px; margin: 16px 0 6px; }
input[type=text], input[type=email], input[type=password], textarea {
  width: 100%; background: var(--surface2); color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 13px; font: inherit; font-size: 16px;
}
textarea { resize: vertical; min-height: 76px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(217, 122, 26, 0.25); }
.hint { color: var(--faint); font-size: 13px; margin-top: 6px; }
.error { color: var(--danger); font-size: 14px; min-height: 20px; margin-top: 12px; }
.ok { color: var(--good); }
.form-actions { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.link-btn { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; padding: 4px 0; font-size: 15px; }
.done { text-align: center; padding: 10px 0; }
.done .ico { margin: 0 auto 14px; width: 56px; height: 56px; border-radius: 50%; background: rgba(127, 182, 133, 0.14); color: var(--good); }

/* ---------- account page ---------- */
.acct { display: grid; grid-template-columns: 220px 1fr; gap: 32px; padding: 40px 0 80px; align-items: start; }
.side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; }
.side a { color: var(--muted); text-decoration: none; padding: 10px 14px; border-radius: 10px; display: flex; gap: 10px; align-items: center; }
.side a:hover { background: var(--surface2); color: var(--text); }
.side a.on { background: var(--surface2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.acct-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.acct-main h1 { font-size: 32px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.panel > h2 { font-size: 20px; margin-bottom: 4px; }
.panel > .muted { font-size: 15px; margin-bottom: 8px; }
.who { display: flex; gap: 16px; align-items: center; }
.who .big-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--raised); display: grid; place-items: center; font-size: 26px; font-weight: 700; color: var(--accent-text); border: 1px solid var(--line); flex: none; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; padding: 3px 10px; border-radius: 999px; background: rgba(217, 122, 26, 0.12); color: var(--accent-text); border: 1px solid rgba(217, 122, 26, 0.3); }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 200px; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; }
.kv:first-of-type { border-top: 0; }
.kv span:first-child { color: var(--muted); }
.meter { height: 12px; border-radius: 999px; background: var(--surface2); border: 1px solid var(--line); overflow: hidden; margin: 14px 0 8px; }
.meter > div { height: 100%; background: var(--accent); border-radius: 999px; width: 0; transition: width 0.5s ease; }
.meter.full > div { background: var(--danger); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.stat { background: var(--surface2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat b { display: block; font-family: var(--display); font-size: 26px; font-weight: 600; }
.stat span { color: var(--muted); font-size: 14px; }
.code-box { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--surface2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-top: 8px; }
.code-box strong { font-family: var(--mono); font-size: 20px; letter-spacing: 0.12em; flex: 1; min-width: 140px; }
.danger-zone { border-color: #4A2220; }
@media (max-width: 860px) {
  .acct { grid-template-columns: 1fr; padding-top: 20px; gap: 16px; }
  .side { position: static; flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .side a { white-space: nowrap; padding: 8px 12px; }
  .side a.on { box-shadow: inset 0 -3px 0 var(--accent); }
  .stats { grid-template-columns: 1fr; }
  .panel { padding: 20px 18px; }
}
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--raised); border: 1px solid var(--line); color: var(--text); padding: 12px 18px; border-radius: 12px; z-index: 60; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); max-width: calc(100vw - 32px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .meter > div { transition: none; } }

/* ---------- David credit (Stage 21) ---------- */
.c-balance { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 4px; }
.c-balance b { font-family: var(--display); font-size: 40px; font-weight: 600; }
.c-member { margin-top: 16px; background: var(--surface2); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.c-member h3 { font-size: 17px; margin: 0 0 4px; }
.c-member p { color: var(--muted); font-size: 15px; }
.c-member .row { margin-top: 12px; }
.c-history { margin-top: 18px; color: var(--muted); }
.c-history summary { cursor: pointer; color: var(--text); padding: 6px 0; }
.c-history ul { list-style: none; padding: 0; margin: 8px 0 0; }
.c-history li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.price { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.price.best { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.price h3 { font-size: 18px; }
.price .amt { font-family: var(--display); font-size: 34px; font-weight: 600; }
.price .amt small { font-size: 15px; color: var(--muted); font-weight: 400; }
.price ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 15px; }
.price li { margin: 4px 0; }
@media (max-width: 900px) { .pricing { grid-template-columns: 1fr; } }

/* Stage 23: Mobile, Browser, Desktop */
.get3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 28px 0 36px; }
.get { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 26px 22px 22px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s, background .15s; }
.get:hover { border-color: var(--accent); background: var(--surface2); transform: translateY(-3px); }
.get.rec { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.get-i { width: 56px; height: 56px; fill: none; stroke: var(--accent-text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 6px; }
.get strong { font-size: 22px; }
.get span { color: var(--muted); }
.get em { font-style: normal; color: var(--faint); font-size: 14px; margin-top: auto; padding-top: 6px; }
.get-badge { position: absolute; top: 16px; right: 16px; font-size: 12px; font-weight: 600; color: var(--on-accent); background: var(--accent); padding: 3px 10px; border-radius: 999px; }
.dl-sub-h { margin: 28px 0 14px; }
@media (max-width: 820px) { .get3 { grid-template-columns: 1fr; } .get { flex-direction: column; } }
@media (prefers-reduced-motion: reduce) { .get { transition: none; } .get:hover { transform: none; } }
