/* ============================================================
   ProsperAI — design system
   Editorial look: warm paper / deep ink, serif display type,
   brand red / blue (from the ProsperAI check-and-star logo)
   used as a thin two-tone motif.
   ============================================================ */

:root {
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Public Sans", -apple-system, "Segoe UI", system-ui, sans-serif;
  --font-mono: "Cascadia Code", Consolas, "SF Mono", monospace;

  --paper: #f7f3ec;
  --paper-2: #efe9de;
  --panel: #fffdf9;
  --ink: #211d19;
  --ink-2: #5c554b;
  --line: #e0d8ca;
  --shadow: 0 1px 2px rgba(60, 45, 20, 0.06), 0 8px 28px rgba(60, 45, 20, 0.09);

  --accent: #9c2130;          /* ProsperAI red — primary action */
  --accent-ink: #fff;
  --accent-soft: #f5dcda;
  --btn-bg: #9c2130;          /* filled-button background (darker than --accent in dark mode so white text stays readable) */
  --blue: #0a4f94;            /* ProsperAI blue — secondary brand color */

  --c-child: #d98e1f;
  --c-child-soft: #f6e7c8;
  --c-teen: #1f8a70;
  --c-teen-soft: #d3ece4;
  --c-adult: #6b5ca5;
  --c-adult-soft: #e3ddf2;

  --mark-bg: #fce8b8;
  --mark-ink: #4a3a08;
  --ok: #2e7d4f;
  --warn: #a33d2a;

  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1080px;

  --spectrum: linear-gradient(90deg, #97202b, #c22a3c 30%, #2f6cb0 70%, #0a4f94);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17151c;
    --paper-2: #1e1b24;
    --panel: #211e29;
    --ink: #ece7df;
    --ink-2: #a79f93;
    --line: #363040;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 32px rgba(0, 0, 0, 0.45);

    --accent: #d95561;
    --accent-ink: #fff;
    --accent-soft: #451a20;
    --btn-bg: #a83440;
    --blue: #5b96d6;

    --c-child-soft: #40311455;
    --c-teen-soft: #14352c88;
    --c-adult-soft: #2b244288;
    --c-child: #eab24f;
    --c-teen: #45b895;
    --c-adult: #a291d8;

    --mark-bg: #4c3d12;
    --mark-ink: #f4dfa0;
    --ok: #58b183;
    --warn: #e08770;
  }
}

:root[data-theme="light"] {
  --paper: #f7f3ec; --paper-2: #efe9de; --panel: #fffdf9;
  --ink: #211d19; --ink-2: #5c554b; --line: #e0d8ca;
  --shadow: 0 1px 2px rgba(60,45,20,.06), 0 8px 28px rgba(60,45,20,.09);
  --accent: #9c2130; --accent-ink: #fff; --accent-soft: #f5dcda; --btn-bg: #9c2130; --blue: #0a4f94;
  --c-child: #d98e1f; --c-child-soft: #f6e7c8;
  --c-teen: #1f8a70; --c-teen-soft: #d3ece4;
  --c-adult: #6b5ca5; --c-adult-soft: #e3ddf2;
  --mark-bg: #fce8b8; --mark-ink: #4a3a08; --ok: #2e7d4f; --warn: #a33d2a;
}
:root[data-theme="dark"] {
  --paper: #17151c; --paper-2: #1e1b24; --panel: #211e29;
  --ink: #ece7df; --ink-2: #a79f93; --line: #363040;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 32px rgba(0,0,0,.45);
  --accent: #d95561; --accent-ink: #fff; --accent-soft: #451a20; --btn-bg: #a83440; --blue: #5b96d6;
  --c-child-soft: #40311455; --c-teen-soft: #14352c88; --c-adult-soft: #2b244288;
  --c-child: #eab24f; --c-teen: #45b895; --c-adult: #a291d8;
  --mark-bg: #4c3d12; --mark-ink: #f4dfa0; --ok: #58b183; --warn: #e08770;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }

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

h1, h2, h3, .display { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); line-height: 1.15; }
h3 { font-size: 1.15rem; }
.kicker {
  font-family: var(--font-body); font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue);
  margin-bottom: 0.7rem;
}
.lede { color: var(--ink-2); font-size: 1.06rem; max-width: 46em; }

/* ---- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header::after { content: ""; display: block; height: 3px; background: var(--spectrum); opacity: .85; }
.nav { display: flex; align-items: center; gap: 22px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
.nav-links { display: flex; gap: 20px; margin-left: auto; align-items: center; }
.nav-links a { text-decoration: none; font-size: 0.92rem; color: var(--ink-2); }
.nav-links a:hover { color: var(--ink); }
.theme-btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  border-radius: 999px; width: 34px; height: 34px; display: grid; place-items: center; font-size: 0.95rem;
}

/* ---- hero ---- */
.hero { padding: 84px 0 60px; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5.4vw, 3.9rem); line-height: 1.06; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lede { margin: 1.2rem 0 1.8rem; }
.badge-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 1.1rem; }
.badge {
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; background: var(--panel); color: var(--ink-2);
}
.badge.patent { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px; padding: 12px 22px; font-weight: 600; font-size: 0.98rem;
  text-decoration: none; border: 1px solid transparent; transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--btn-bg); color: var(--accent-ink); box-shadow: var(--shadow); }
.btn-ghost { border-color: var(--line); background: var(--panel); color: var(--ink); }
.btn-sm { padding: 8px 16px; font-size: 0.88rem; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* hero refraction visual */
.refraction { position: relative; padding: 10px 0; }
.refraction .src-card, .refraction .out-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; font-size: 0.8rem; line-height: 1.45;
}
.refraction .src-card { margin-bottom: 26px; position: relative; }
.refraction .src-card .doc-lines span { display: block; height: 7px; border-radius: 4px; background: var(--paper-2); margin: 7px 0; }
.refraction .src-card .doc-lines span:nth-child(1) { width: 88%; }
.refraction .src-card .doc-lines span:nth-child(2) { width: 96%; }
.refraction .src-card .doc-lines span:nth-child(3) { width: 72%; }
.refraction .beam { height: 22px; margin: -6px 30px 6px; background: var(--spectrum); opacity: .55; clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%); border-radius: 3px; }
.out-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.out-card { border-top: 3px solid var(--line); }
.out-card.child { border-top-color: var(--c-child); }
.out-card.teen { border-top-color: var(--c-teen); }
.out-card.adult { border-top-color: var(--c-adult); }
.out-card .who { font-weight: 700; font-size: 0.72rem; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 6px; color: var(--ink-2); }
.out-card p { color: var(--ink-2); font-size: 0.76rem; }

/* ---- sections ---- */
section { padding: 72px 0; }
section.alt { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { margin-bottom: 40px; max-width: 56em; }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.card .icon { font-size: 1.6rem; margin-bottom: 12px; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--ink-2); font-size: 0.95rem; }

/* how it works steps */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; counter-reset: step; }
.step {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 16px; position: relative;
}
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--accent);
  display: block; margin-bottom: 8px;
}
.step h3 { font-size: 1rem; margin-bottom: 6px; }
.step p { font-size: 0.84rem; color: var(--ink-2); }
.device-note {
  margin-top: 26px; display: flex; gap: 12px; align-items: flex-start;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--radius); padding: 16px 20px; font-size: 0.95rem;
}
.device-note .em { font-size: 1.3rem; line-height: 1.4; }

/* ---- demo ---- */
#demo .demo-shell {
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow); overflow: hidden;
}
.demo-topbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 22px; border-bottom: 1px solid var(--line); background: var(--paper-2);
}
.demo-topbar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--spectrum); }
.demo-topbar strong { font-family: var(--font-display); }
.mode-switch { margin-left: auto; display: flex; gap: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.mode-switch button {
  border: 0; background: transparent; color: var(--ink-2); border-radius: 999px; padding: 6px 14px; font-size: 0.85rem; font-weight: 600;
}
.mode-switch button.active { background: var(--btn-bg); color: var(--accent-ink); }

.stepper { display: flex; gap: 4px; padding: 16px 22px 0; flex-wrap: wrap; }
.stepper .tab {
  border: 0; background: transparent; padding: 8px 14px; border-radius: 999px 999px 0 0;
  font-size: 0.86rem; font-weight: 600; color: var(--ink-2); border-bottom: 2px solid transparent;
}
.stepper .tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.stepper .tab.done { color: var(--ok); }
.stepper .tab[disabled] { opacity: 0.45; cursor: default; }

.demo-body { padding: 26px 22px 30px; }
.demo-pane { display: none; }
.demo-pane.active { display: block; animation: fadeup .25s ease; }
@keyframes fadeup { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pane-title { margin-bottom: 4px; }
.pane-sub { color: var(--ink-2); font-size: 0.92rem; margin-bottom: 20px; }

/* profile cards */
.profile-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.profile-card {
  text-align: left; background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 16px; transition: border-color .12s ease, transform .12s ease;
}
.profile-card:hover { transform: translateY(-2px); }
.profile-card .emoji { font-size: 1.7rem; }
.profile-card h4 { font-family: var(--font-display); margin: 8px 0 4px; }
.profile-card p { font-size: 0.8rem; color: var(--ink-2); }
.profile-card.selected.child { border-color: var(--c-child); background: var(--c-child-soft); }
.profile-card.selected.teen { border-color: var(--c-teen); background: var(--c-teen-soft); }
.profile-card.selected.adult { border-color: var(--c-adult); background: var(--c-adult-soft); }
.profile-card.selected.custom { border-color: var(--accent); background: var(--accent-soft); }

.custom-form {
  margin-top: 18px; border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px;
  display: none; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.custom-form.visible { display: grid; }
.custom-form label { font-size: 0.8rem; font-weight: 600; display: block; margin-bottom: 4px; color: var(--ink-2); }
.custom-form input, .custom-form select, .custom-form textarea, .keybox input, .pastebox textarea, .prompt-editor {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--ink); padding: 9px 11px; font: inherit; font-size: 0.9rem;
}
.custom-form .checks { display: flex; flex-direction: column; gap: 8px; font-size: 0.88rem; }
.custom-form .checks label { display: flex; align-items: center; gap: 9px; font-weight: 500; margin: 0; color: var(--ink); }
.custom-form .checks-title { font-size: 0.8rem; font-weight: 600; color: var(--ink-2); margin-bottom: 1px; }
/* checkboxes must escape the generic full-width input styling above */
.custom-form input[type="checkbox"] {
  width: 17px; height: 17px; flex: none; padding: 0; border: 0;
  background: none; accent-color: var(--accent); margin: 0;
}
.custom-form .span-3 { grid-column: 1 / -1; }

.criteria-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip { font-size: 0.78rem; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 4px 12px; color: var(--ink-2); }

/* sample cards */
.sample-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.sample-card {
  text-align: left; background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px;
}
.sample-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.sample-card .icon { font-size: 1.5rem; }
.sample-card h4 { font-family: var(--font-display); margin: 8px 0 2px; }
.sample-card p { font-size: 0.8rem; color: var(--ink-2); }
.pastebox { margin-top: 18px; display: none; }
.pastebox.visible { display: block; }
.pastebox textarea { min-height: 130px; resize: vertical; }
.hint { font-size: 0.8rem; color: var(--ink-2); margin-top: 6px; }

.source-preview { margin-top: 22px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.source-preview .sp-head { padding: 10px 16px; background: var(--paper-2); border-bottom: 1px solid var(--line); font-size: 0.8rem; color: var(--ink-2); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.source-preview .sp-body { padding: 18px; max-height: 260px; overflow: auto; font-size: 0.92rem; }
.sp-body h4 { font-family: var(--font-display); margin-bottom: 10px; }
.sp-body p { margin-bottom: 12px; }

/* prompt pane */
.prompt-editor { font-family: var(--font-mono); font-size: 0.8rem; min-height: 240px; resize: vertical; white-space: pre-wrap; line-height: 1.55; }
.prompt-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.prompt-meta .tag { font-size: 0.75rem; font-weight: 700; border-radius: 999px; padding: 3px 11px; }
.tag.child { background: var(--c-child-soft); color: var(--c-child); }
.tag.teen { background: var(--c-teen-soft); color: var(--c-teen); }
.tag.adult { background: var(--c-adult-soft); color: var(--c-adult); }
.tag.custom { background: var(--accent-soft); color: var(--accent); }

.keybox { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--paper); display: none; }
.keybox.visible { display: block; }
.keybox .row { display: flex; gap: 10px; flex-wrap: wrap; }
.keybox input { flex: 1; min-width: 220px; font-family: var(--font-mono); }
.keybox .hint { margin-top: 8px; }

.run-row { margin-top: 20px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.spinner { width: 18px; height: 18px; border: 2.5px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: none; }
.spinner.visible { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.run-status { font-size: 0.85rem; color: var(--ink-2); }
.run-status.error { color: var(--warn); font-weight: 600; }

/* review pane */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.compare .col { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.compare .col-head { padding: 9px 14px; font-size: 0.78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--line); color: var(--ink-2); background: var(--paper-2); }
.compare .col-head.edited { color: var(--ok); }
.compare .col-body { padding: 16px; font-size: 0.92rem; max-height: 380px; overflow: auto; }
.col-body p { margin-bottom: 12px; }
mark { background: var(--mark-bg); color: var(--mark-ink); border-radius: 3px; padding: 0 3px; }

.edit-summary { margin-top: 18px; border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: var(--radius-sm); background: var(--paper); padding: 14px 18px; }
.edit-summary h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ok); margin-bottom: 8px; }
.edit-summary ul { padding-left: 20px; font-size: 0.9rem; }
.edit-summary li { margin-bottom: 4px; }
.approve-row { margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.guardian-note { font-size: 0.82rem; color: var(--ink-2); }

/* read pane */
.read-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.toggle-pill { display: flex; gap: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.toggle-pill button { border: 0; background: transparent; color: var(--ink-2); border-radius: 999px; padding: 6px 16px; font-size: 0.85rem; font-weight: 600; }
.toggle-pill button.active { background: var(--ink); color: var(--paper); }
.reader {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  padding: 30px clamp(18px, 5vw, 48px); font-size: 1.02rem; max-width: 46em;
}
.reader h4 { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 14px; }
.reader p { margin-bottom: 14px; }
.reader.original-mode { border-style: dashed; }
.reader .orig-note { font-size: 0.8rem; color: var(--warn); font-weight: 600; margin-bottom: 12px; }

/* feed rendering */
.feed .post { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); padding: 12px 14px; margin-bottom: 10px; }
.feed .post .handle { font-weight: 700; font-size: 0.85rem; margin-bottom: 3px; }
.feed .post.placeholder { border-style: dashed; background: var(--paper-2); color: var(--ink-2); font-style: italic; }
.feed .post .ph-why { font-size: 0.78rem; }

/* other readers strip */
.others { margin-top: 26px; }
.others h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin-bottom: 10px; }
.others-tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.others-tabs button { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 14px; font-size: 0.82rem; font-weight: 600; color: var(--ink-2); }
.others-tabs button.active.child { border-color: var(--c-child); color: var(--c-child); background: var(--c-child-soft); }
.others-tabs button.active.teen { border-color: var(--c-teen); color: var(--c-teen); background: var(--c-teen-soft); }
.others-tabs button.active.adult { border-color: var(--c-adult); color: var(--c-adult); background: var(--c-adult-soft); }
.others-body { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: 18px; font-size: 0.9rem; max-height: 280px; overflow: auto; }
.others-body p { margin-bottom: 10px; }

/* ---- technology section ---- */
.embodiments { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.embodiment { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.embodiment .fig { font-size: 0.72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.embodiment h3 { margin-bottom: 8px; }
.embodiment p { font-size: 0.9rem; color: var(--ink-2); margin-bottom: 12px; }
.flow { display: flex; flex-direction: column; gap: 6px; }
.flow span { font-size: 0.78rem; background: var(--paper); border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; position: relative; }
.flow span:not(:last-child)::after { content: "↓"; position: absolute; left: 12px; bottom: -14px; color: var(--ink-2); font-size: 0.7rem; z-index: 1; }
.flow span:not(:last-child) { margin-bottom: 8px; }

.privacy-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 30px; }
.privacy-list .p-item { display: flex; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; font-size: 0.92rem; }
.privacy-list .p-item .tick { color: var(--ok); font-weight: 700; }

/* ---- footer ---- */
footer { border-top: 1px solid var(--line); padding: 40px 0 60px; background: var(--paper-2); }
footer::before { content: ""; display: block; height: 3px; background: var(--spectrum); opacity: .85; margin: -41px 0 40px; }
.foot-grid { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
footer .brand { font-size: 1.1rem; }
footer p { font-size: 0.85rem; color: var(--ink-2); max-width: 40em; }
footer .patent-line { font-weight: 600; color: var(--ink); margin-bottom: 6px; }

/* ---- homepage demo teaser ---- */
.teaser {
  text-align: center; background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: var(--shadow); padding: clamp(32px, 6vw, 56px);
  position: relative; overflow: hidden;
}
.teaser::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--spectrum); opacity: .85; }
.teaser .lede { margin: 0.9rem auto 1.4rem; }
.teaser-chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 1.6rem; }

/* ---- dedicated demo page ---- */
.page-hero { padding: 56px 0 8px; }
.page-hero h1 { font-size: clamp(1.9rem, 4.2vw, 2.8rem); line-height: 1.12; max-width: 22em; }
.page-hero .kicker { margin-bottom: 0.6rem; }
.page-hero .lede { margin-top: 0.9rem; }
.mode-explainer { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.mode-explainer .mx-item {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: 0.9rem; color: var(--ink-2);
}
.mode-explainer .mx-item strong { color: var(--ink); }

.demo-section { padding: 32px 0 72px; }

/* Give the demo room to breathe on its own page: no clipped shell, sticky
   step tabs, page-level scrolling instead of inner scrollboxes. */
.demo-page .demo-shell { overflow: visible; }
.demo-page .demo-topbar { border-radius: 20px 20px 0 0; }
.demo-page .stepper {
  position: sticky; top: 63px; z-index: 40;
  background: var(--panel); border-bottom: 1px solid var(--line);
  padding: 12px 22px 0;
}
.demo-page .demo-body { padding: 32px clamp(20px, 4vw, 44px) 44px; }
.demo-page .pane-sub { font-size: 0.98rem; max-width: 52em; }
.demo-page .compare .col-body { max-height: none; font-size: 0.98rem; padding: 20px; }
.demo-page .others-body { max-height: none; font-size: 0.95rem; padding: 20px; }
.demo-page .source-preview .sp-body { max-height: 340px; }
.demo-page .prompt-editor { min-height: 300px; font-size: 0.84rem; }
.demo-page .reader { font-size: 1.05rem; line-height: 1.7; }

.demo-after { margin-top: 36px; text-align: center; color: var(--ink-2); }
.demo-after p { margin-bottom: 12px; }

/* ---- responsive ---- */
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .card-grid, .embodiments { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: repeat(2, 1fr); }
  .sample-grid { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; }
  .custom-form { grid-template-columns: 1fr 1fr; }
  .privacy-list { grid-template-columns: 1fr; }
  .nav-links a:not(.btn) { display: none; }
}
@media (max-width: 560px) {
  .profile-grid, .custom-form, .steps { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 40px; }
  section { padding: 52px 0; }
  .mode-explainer { grid-template-columns: 1fr; }
  .demo-page .stepper { top: 0; position: static; }
}

/* ---- ProsperAI logo assets ----
   Wordmark PNGs are dark red/blue art on transparency; in dark themes a
   brightness lift keeps them legible. Each logo sits in a .logo-wrap so an
   animated sparkle can twinkle exactly over the star baked into the art
   (star center: 57.7%/7.0% on the wordmark, 57.9%/5.4% on the tagline cut). */
.logo-wrap { position: relative; display: inline-block; line-height: 0; }
.logo-wrap > img { width: 100%; height: auto; display: block; }
.nav-logo { width: 102px; }
.hero-logo { display: block; width: min(430px, 92%); margin: 0 0 22px; }
footer .foot-logo { width: min(185px, 48vw); }
footer .foot-row { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
footer .foot-row .foot-app { margin-top: 0; }
.site-link { font-weight: 600; color: var(--blue); text-decoration: none; }
.site-link:hover { text-decoration: underline; }
/* Site address and contact sit on one line, wrapping to two on a phone
   rather than letting the address run into the email. */
.foot-contact { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.foot-contact .foot-dot { color: var(--ink-2); opacity: .6; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-wrap > img { filter: brightness(1.9) saturate(1.05); }
}
:root[data-theme="dark"] .logo-wrap > img { filter: brightness(1.9) saturate(1.05); }
:root[data-theme="light"] .logo-wrap > img { filter: none; }
@media (max-width: 560px) {
  .nav-logo { width: 82px; }
}

/* the sparkle: a golden four-point glint twinkling over the logo's star */
.sparkle, .sparkle::before, .sparkle::after {
  clip-path: polygon(50% 0%, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0% 50%, 38% 38%);
  background: radial-gradient(circle, #fff 0 16%, #ffd98f 46%, rgba(232, 161, 61, 0.9) 62%, transparent 78%);
  animation: sparkle 2.2s ease-in-out infinite;
  pointer-events: none;
}
.sparkle { position: absolute; width: 8%; aspect-ratio: 1 / 1; left: 57.7%; top: 7%; }
.logo-wrap.tag .sparkle { left: 57.9%; top: 5.4%; width: 7%; }
.sparkle::before, .sparkle::after { content: ""; position: absolute; }
.sparkle::before { width: 52%; height: 52%; left: -55%; top: 60%; animation-delay: 0.75s; }
.sparkle::after { width: 40%; height: 40%; left: 108%; top: -12%; animation-delay: 1.4s; }
@keyframes sparkle {
  0%, 100% { transform: translate(-50%, -50%) scale(0.4) rotate(-18deg); opacity: 0.35; }
  50% { transform: translate(-50%, -50%) scale(1.1) rotate(24deg); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .sparkle, .sparkle::before, .sparkle::after { animation: none; opacity: 0.75; }
}

/* ---- tagline manifesto ---- */
.manifesto { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 44px 46px 38px; overflow: hidden; }
.manifesto::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--spectrum); opacity: .85; }
.meanings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin-top: 26px; }
.meaning h3 { margin-bottom: 8px; }
.meaning .num { color: var(--accent); font-style: italic; margin-right: 7px; }
.meaning p { color: var(--ink-2); font-size: 0.95rem; }
.manifesto .close { margin-top: 28px; font-family: var(--font-display); font-style: italic; font-size: 1.18rem; }
@media (max-width: 880px) {
  .meanings { grid-template-columns: 1fr; }
  .manifesto { padding: 34px 26px 30px; }
}

/* ---- app icon spots ---- */
.app-chip { display: inline-flex; align-items: center; gap: 14px; margin-top: 24px; text-decoration: none; border: 1px solid var(--line); background: var(--panel); border-radius: 16px; padding: 10px 18px 10px 10px; box-shadow: var(--shadow); }
.app-chip img { width: 56px; height: 56px; border-radius: 14px; }
.app-chip span { font-size: 0.84rem; color: var(--ink-2); line-height: 1.4; }
.app-chip strong { display: block; color: var(--ink); font-size: 0.95rem; }
.foot-app { display: inline-flex; align-items: center; gap: 11px; margin-top: 16px; text-decoration: none; font-weight: 600; }
.foot-app img { width: 42px; height: 42px; border-radius: 10px; box-shadow: var(--shadow); }
.chip-row { display: flex; gap: 12px; flex-wrap: wrap; }
.chip-row .app-chip span { max-width: 240px; }

/* ---- the family pair (Guardian + Prism) ---- */
.family-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.family-card {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; text-decoration: none; color: var(--ink);
  transition: transform .12s ease, border-color .12s ease;
}
.family-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.family-card img { width: 64px; height: 64px; border-radius: 15px; flex: none; }
.family-card h3 { font-family: var(--font-display); font-size: 1.15rem; margin-bottom: 6px; }
.family-card p { font-size: 0.92rem; color: var(--ink-2); margin-bottom: 10px; }
.fc-by { font-size: 0.68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); margin-left: 4px; }
.fc-cta { font-weight: 700; color: var(--accent); font-size: 0.92rem; }
.family-note {
  border: 1px dashed var(--line); border-radius: var(--radius-sm); background: var(--paper);
  padding: 12px 16px; font-size: 0.92rem; color: var(--ink-2);
}
.phone-row {
  display: flex; gap: 26px; align-items: center; flex-wrap: wrap;
  margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); padding: 18px 22px;
}
.phone-copy { flex: 1; min-width: 260px; }
.phone-copy h3 { margin-bottom: 6px; }
.phone-copy p { color: var(--ink-2); font-size: 0.95rem; }
.phone-copy .qr-hint { margin-top: 8px; font-size: 0.85rem; }
.qr-grid { display: flex; gap: 18px; }
.qr-card { display: grid; justify-items: center; gap: 2px; font-size: 0.85rem; }
.qr-card .qr {
  width: 128px; height: 128px; box-sizing: content-box; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: 7px;
}
.qr-card .qr svg { width: 100%; height: 100%; display: block; }
.qr-card span { color: var(--ink-2); font-size: 0.78rem; }
@media (max-width: 720px) { .family-grid { grid-template-columns: 1fr; } }
