/* Memora marketing site. Visual system: docs/design/visual-system.md.
   Tokens match docs/design/tokens.md (light). Mobile first, 390 to 1440. */

@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("/fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* paper */
  --bg: #fefffc;
  --surface: #ffffff;
  --surface-2: #f3f5f2;
  --soft: #eef1ed;
  --line: #dee2de;
  --line-strong: #8a8f8a;
  /* ink */
  --ink: #171717;
  --ink-heading: #2c2c2c;
  --ink-800: #444141;
  --ink-muted: #646464;
  --ink-faint: #b4b8b4;
  /* action */
  --primary: #1f1f29;
  --primary-border: #282834;
  --on-primary: #fefffc;
  /* pastel tags */
  --sage: #e9efd0;
  --lilac: #eadffd;
  --rose: #f4dada;
  --butter: #f4f1da;
  --peach: #ffe2d4;
  --accent: #6b5310;
  /* type */
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* shape, motion */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-nav: 12px;
  --r-2xl: 16px;
  --r-3xl: 24px;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(23, 23, 23, 0.06);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t: 250ms;
  --section: 88px;
  --gutter: 20px;
}
@media (min-width: 768px) {
  :root { --section: 112px; --gutter: 32px; }
}
@media (min-width: 1280px) {
  :root { --section: 128px; --gutter: 48px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--primary); color: var(--on-primary); padding: 10px 14px; border-radius: var(--r-lg);
  text-decoration: none; font-weight: 500;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- type ---------- */
h1, h2 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--ink-heading);
  font-kerning: none;
  text-wrap: balance;
}
h2 { font-size: 2rem; line-height: 1.1; letter-spacing: -0.02em; }
@media (min-width: 768px) { h2 { font-size: 2.5rem; letter-spacing: -0.8px; } }
@media (min-width: 1280px) { h2 { font-size: 3rem; letter-spacing: -0.96px; } }
h3 { font-size: 1.0625rem; line-height: 1.4; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); }
.lead { font-size: 1.0625rem; line-height: 1.5; font-weight: 500; letter-spacing: -0.27px; color: var(--ink-800); max-width: 36rem; }
.eyebrow { font-size: 0.8125rem; line-height: 1.4; color: var(--ink-muted); letter-spacing: -0.13px; margin-bottom: 16px; }
.eyebrow-light { color: rgba(254, 255, 252, 0.78); }

/* ---------- buttons and links ---------- */
.chev {
  display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 999px;
  border: 1px solid currentColor; opacity: 0.85; flex: none;
}
.chev svg { width: 10px; height: 10px; transition: transform var(--t) var(--ease); }
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px;
  border-radius: var(--r-lg); font: 500 0.9375rem/1 var(--font-sans); letter-spacing: -0.15px;
  text-decoration: none; border: 1px solid transparent; transition: opacity var(--t) var(--ease), background-color var(--t) var(--ease);
  white-space: nowrap;
}
.btn:hover { opacity: 0.9; }
.btn:hover .chev svg, .link:hover .chev svg { transform: translateX(1.5px); }
.btn-primary {
  background: var(--primary) linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0)); color: var(--on-primary);
  border-color: var(--primary-border);
}
.btn-light { background: var(--bg); color: var(--primary); border-color: rgba(255, 255, 255, 0.6); }
.btn-sm { min-height: 36px; padding: 0 12px; }
.link {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 500; font-size: 0.9375rem;
  padding: 10px 0; color: var(--ink); --u: var(--ink-faint);
  text-decoration: underline; text-decoration-color: var(--u); text-underline-offset: 6px; text-decoration-thickness: 1px;
  transition: text-decoration-color 200ms var(--ease);
}
.link:hover { --u: var(--ink-muted); }
.link-light { color: var(--bg); --u: rgba(254, 255, 252, 0.5); }
.link-light:hover { --u: var(--bg); }
.prose a:not(.link), .footer a, .source a, .crisis a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ink-faint); transition: text-decoration-color 200ms var(--ease); }
.prose a:not(.link):hover, .footer a:hover, .source a:hover, .crisis a:hover { text-decoration-color: currentColor; }

/* ---------- nav (floating pill) ---------- */
.nav-wrap { position: fixed; top: 12px; left: 0; right: 0; z-index: 50; display: flex; justify-content: center; padding: 0 12px; pointer-events: none; }
.nav {
  pointer-events: auto; position: relative;
  display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: var(--r-nav);
  background: rgba(254, 255, 252, 0.86); border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow); -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px);
  width: 100%; max-width: 560px;
}
.nav-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 0.9375rem; letter-spacing: -0.15px; padding-right: 8px; margin-right: auto; border-radius: var(--r-lg); }
.mark {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); color: #1f2937;
}
.nav-links { display: none; }
.nav-links a, .nav-menu a {
  display: block; padding: 8px 10px; font-size: 0.9375rem; font-weight: 500; letter-spacing: -0.15px; text-decoration: none;
  border-radius: var(--r-lg); transition: opacity var(--t) var(--ease);
}
.nav-links a:hover { opacity: 0.8; }
.nav-menu summary {
  list-style: none; cursor: pointer; display: grid; place-items: center; width: 40px; height: 40px; margin-left: 4px;
  border-radius: var(--r-lg); border: 1px solid rgba(0, 0, 0, 0.06); background: var(--surface);
}
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu ul {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-nav); box-shadow: var(--shadow);
}
.nav-menu a { padding: 12px; }
.nav-menu a:hover { background: var(--surface-2); }
@media (min-width: 900px) {
  .nav { width: auto; max-width: none; }
  .nav-brand { margin-right: 4px; }
  .nav-links { display: flex; gap: 2px; margin-right: 6px; }
  .nav-menu { display: none; }
}

/* ---------- hero ---------- */
.hero { position: relative; color: var(--bg); background: #161420; overflow: hidden; isolation: isolate; }
.scene { position: absolute; top: 0; left: 0; width: 100%; height: 620px; z-index: -1; }
.hero-inner { padding: 96px var(--gutter) 24px; max-width: 1360px; margin: 0 auto; }
.masthead {
  font-family: var(--font-display); font-size: 3.25rem; line-height: 1; letter-spacing: -0.03em; text-align: center;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}
.hero-kicker { text-align: center; margin-top: 10px; font-size: 0.9375rem; font-weight: 500; color: rgba(254, 255, 252, 0.86); text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4); }
.hero-grid { display: grid; gap: 28px; margin-top: 290px; }
.glass {
  border-radius: var(--r-2xl); border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(160deg, rgba(14, 12, 22, 0.62), rgba(14, 12, 22, 0.48));
  -webkit-backdrop-filter: blur(15px); backdrop-filter: blur(15px);
  box-shadow: var(--shadow);
}
.hero-card { padding: 24px; max-width: 520px; }
.hero-card h1 { color: var(--bg); font-size: 2.25rem; line-height: 1.08; letter-spacing: -0.02em; }
.hero-card .lead { color: rgba(254, 255, 252, 0.9); margin-top: 14px; }
.hero-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 22px; }
.reassure { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.16); font-size: 0.9375rem; line-height: 1.5; color: rgba(254, 255, 252, 0.86); }

@media (min-width: 640px) {
  .hero-card { padding: 32px; }
  .hero-card h1 { font-size: 2.75rem; }
}
@media (min-width: 1024px) {
  .hero { min-height: 100svh; }
  .scene { height: 100%; }
  .hero-inner { padding-top: 96px; padding-bottom: 32px; }
  .masthead { font-size: 4rem; }
  .hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) 380px; grid-template-rows: auto auto 1fr; column-gap: 56px; }
  .hero-grid { display: contents; }
  .masthead, .hero-kicker { grid-column: 1; }
  .masthead { margin-top: 40px; }
  .hero-card { grid-column: 1; grid-row: 3; align-self: end; margin: 40px 0 28px; }
  .preview { grid-column: 2; grid-row: 1 / span 3; align-self: start; }
  .hero-card { padding: 36px; }
  .hero-card h1 { font-size: 3.375rem; line-height: 1.1; letter-spacing: -1.08px; }
}

/* ---------- product preview (mirrors web/components) ---------- */
.preview { width: 100%; max-width: 380px; justify-self: center; }
.phone {
  background: var(--bg); color: var(--ink); border-radius: var(--r-3xl); padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.5); box-shadow: 0 24px 60px rgba(8, 6, 16, 0.45), var(--shadow);
}
.phone-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 12px; }
.phone-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.9375rem; }
.phone-brand .mark { width: 28px; height: 28px; border-radius: var(--r-md); }
.badge {
  font: 500 0.75rem/1 var(--font-sans); padding: 6px 10px; border-radius: 999px; background: var(--butter); color: var(--ink-800);
}
.phone-stack { display: grid; gap: 8px; }
.voice { background: var(--primary); color: var(--on-primary); border-radius: var(--r-2xl); padding: 14px 16px; }
.voice-meta { display: flex; align-items: center; gap: 10px; font: 500 0.75rem/1 var(--font-mono); color: rgba(254, 255, 252, 0.75); }
.voice-bars { display: inline-flex; align-items: center; gap: 2px; height: 16px; }
.voice-bars span { width: 2px; border-radius: 2px; background: rgba(254, 255, 252, 0.8); }
.voice-text { margin-top: 8px; font-size: 0.9375rem; line-height: 1.45; }
.p-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2xl); padding: 14px 16px; }
.p-label { font-size: 0.75rem; color: var(--ink-muted); margin-bottom: 6px; }
.p-card .p-title { font-size: 0.9375rem; line-height: 1.4; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); }
.p-card > p { font-size: 0.875rem; line-height: 1.5; color: var(--ink-800); margin-top: 4px; }
.log-grid { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 0.875rem; line-height: 1.45; }
.log-grid dt { color: var(--ink-muted); }
.log-grid dd { color: var(--ink); }
.severity { display: inline-flex; align-items: center; gap: 8px; }
.dots { display: inline-flex; gap: 3px; }
.dots span { width: 7px; height: 7px; border-radius: 999px; border: 1px solid var(--ink-muted); }
.dots .on { background: var(--ink); border-color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.chips li { font-size: 0.75rem; padding: 4px 9px; border-radius: 999px; background: var(--soft); color: var(--ink-800); }
.p-card .source { font-size: 0.8125rem; color: var(--ink-muted); margin-top: 8px; }
.tag { display: inline-block; font: 500 0.75rem/1 var(--font-sans); padding: 6px 10px; border-radius: 999px; color: var(--ink); }
.p-card .tag { margin-top: 8px; font-size: 0.6875rem; padding: 5px 8px; }
.tag-draft { background: var(--surface-2); color: var(--ink-800); }
.tag-sage { background: var(--sage); }
.tag-lilac { background: var(--lilac); }
.tag-peach { background: var(--peach); }
.checkin { background: var(--butter); border-radius: var(--r-2xl); padding: 14px 16px; }
.checkin-title { font-weight: 600; font-size: 0.9375rem; }
.checkin-choices { display: flex; gap: 6px; margin-top: 10px; }
.checkin-choices span {
  flex: 1; text-align: center; font-size: 0.8125rem; font-weight: 500; padding: 8px 0; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
}
.more { font-size: 0.8125rem; color: var(--ink-muted); padding: 2px 4px; }
.preview-cap { font-size: 0.8125rem; color: rgba(254, 255, 252, 0.8); text-align: center; margin-top: 12px; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); }

/* ---------- sections ---------- */
.section { padding: var(--section) 0 0; }
.section-head { max-width: 40rem; }
.section-head .lead { margin-top: 18px; }
.split { display: grid; gap: 40px; }
@media (min-width: 1024px) { .split { grid-template-columns: 5fr 6fr; gap: 80px; align-items: start; } }

/* list rows */
.rows { margin-top: 40px; border: 1px solid var(--line); border-radius: var(--r-2xl); background: var(--surface); padding: 0 20px; }
.split .rows { margin-top: 0; }
.row { display: grid; grid-template-columns: auto 1fr; gap: 16px; padding: 22px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.rows-plain .row { grid-template-columns: 1fr; }
.row-num { font: 400 0.8125rem/1.6 var(--font-mono); color: var(--ink-muted); padding-top: 1px; }
.row p { color: var(--ink-muted); margin-top: 4px; }
@media (min-width: 768px) {
  .rows { padding: 0 28px; }
  .row { grid-template-columns: 64px minmax(0, 18rem) 1fr; gap: 24px; align-items: baseline; }
  .row > div { display: contents; }
  .row p { margin-top: 0; }
  .rows-plain .row { grid-template-columns: minmax(0, 15rem) 1fr; }
}

/* cards */
.cards { display: grid; gap: 12px; margin-top: 40px; }
@media (min-width: 768px) { .cards { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2xl); padding: 24px; box-shadow: var(--shadow-soft); }
.card h3 { margin-top: 20px; font-family: var(--font-display); font-weight: 400; font-size: 1.75rem; line-height: 1.1; letter-spacing: -0.02em; color: var(--ink-heading); }
.card p:last-child { margin-top: 10px; color: var(--ink-muted); }

/* programs */
.dusk-panel {
  position: relative; border-radius: var(--r-3xl); padding: 120px 12px 12px; overflow: hidden;
  background:
    radial-gradient(60% 50% at 78% 92%, rgba(232, 167, 122, 0.55), rgba(232, 167, 122, 0) 70%),
    linear-gradient(180deg, #171b2b 0%, #2a3150 55%, #4a4560 100%);
}
.programs-card { padding: 24px; max-width: 540px; color: var(--bg); }
.programs-card h2 { color: var(--bg); }
.programs-card p:not(.eyebrow) { margin-top: 14px; color: rgba(254, 255, 252, 0.9); }
.programs-card .btn { margin-top: 24px; }
@media (min-width: 768px) {
  .dusk-panel { padding: 200px 24px 24px; }
  .programs-card { padding: 36px; }
}
.points { display: grid; gap: 28px; margin-top: 48px; }
.points li { border-top: 1px solid var(--line); padding-top: 18px; }
.points p { margin-top: 6px; color: var(--ink-muted); }
@media (min-width: 768px) { .points { grid-template-columns: repeat(2, 1fr); gap: 32px 40px; } }
@media (min-width: 1024px) { .points { grid-template-columns: repeat(4, 1fr); } }

/* ---------- footer ---------- */
.footer { margin-top: var(--section); padding-top: 0; position: relative; }
.crisis { border: 1px solid var(--line); border-radius: var(--r-2xl); padding: 24px; background: var(--surface); }
.crisis h2 { font-size: 1.75rem; line-height: 1.15; letter-spacing: -0.02em; }
.crisis p { margin-top: 10px; color: var(--ink-800); max-width: 44rem; }
.footer-bar { display: flex; flex-direction: column; gap: 16px; padding: 28px 0 16px; border-bottom: 1px solid var(--line); }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 0.9375rem; font-weight: 500; }
.footer-links a { display: inline-block; padding: 8px 0; text-decoration-color: transparent; }
.footer-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 0.8125rem; color: var(--ink-muted); }
.pilot::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 999px; background: #8aa05a; margin-right: 8px; vertical-align: middle; }
.fineprint { font-size: 0.8125rem; line-height: 1.6; color: var(--ink-muted); padding: 16px 0 40px; max-width: 48rem; }
.footer-scene { width: 100%; height: 72px; }
@media (min-width: 768px) {
  .crisis { padding: 32px; }
  .footer-bar { flex-direction: row; justify-content: space-between; align-items: center; }
  .footer-scene { height: 120px; }
}

/* ---------- documents (privacy, 404) ---------- */
.doc { padding: 128px 0 0; }
.prose { max-width: 720px; }
.prose h1 { font-size: 2.5rem; line-height: 1.1; letter-spacing: -0.02em; }
@media (min-width: 768px) { .prose h1 { font-size: 3.375rem; letter-spacing: -1.08px; } }
.prose .meta { margin-top: 12px; font: 400 0.8125rem/1.5 var(--font-mono); color: var(--ink-muted); }
.prose h2 { font-family: var(--font-sans); font-weight: 600; font-size: 1.375rem; line-height: 1.35; letter-spacing: -0.02em; color: #101828; margin-top: 48px; }
.prose p, .prose li { font-size: 1.125rem; line-height: 1.75; letter-spacing: -0.18px; color: var(--ink-heading); }
.prose p { margin-top: 16px; }
.prose ul { margin-top: 12px; list-style: disc; padding-left: 1.25rem; }
.prose li + li { margin-top: 8px; }
.prose li::marker { color: var(--ink-faint); }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .intro { animation: rise 900ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 110ms + 80ms); }
  .js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
  .js .reveal.is-in { opacity: 1; transform: none; }
  .chev svg { transition: transform var(--t) var(--ease); }
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.prose .eyebrow { font-size: 0.8125rem; line-height: 1.4; margin: 0 0 16px; color: var(--ink-muted); }
