/* ============================================================================
   Prism marketing site. Shared design system.
   Derived from BRANDING.md and src/constants/theme.ts (the app's source of truth).
   Calm, premium, high-key: charcoal text on soft-white / warm-mist, soft
   prismatic accents used sparingly. No em dashes anywhere in copy.
   ========================================================================== */

:root {
  /* Brand core (theme.ts) */
  --charcoal: #202832;
  --soft-white: #FAFAF8;
  --warm-mist: #F4F1EE;
  --warm-mist-2: #ECE7E1;
  --text-secondary: #5A606B;
  --accent: #6A5BA6;        /* single interactive/accent color (AA) */
  --accent-ink: #564a86;    /* darker accent for hover/contrast on light */
  --border: #EAE6E0;

  /* Spectrum accents (glows, rails, dots only, never dominant) */
  --lavender: #C9B7F2;
  --blue: #BFDDF5;
  --aqua: #BEEDE4;
  --butter: #F7E7A6;
  --blush: #F4C7D5;
  --prism-gradient: linear-gradient(135deg, #F4C7D5, #F7E7A6, #BEEDE4, #BFDDF5, #C9B7F2);

  /* Dark surface (from theme.ts dark scale) */
  --ink: #15171C;
  --ink-2: #1E2128;

  /* Radius scale (theme.ts) */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 9999px;

  /* Fonts (loaded via Google Fonts in each page head) */
  --font-display: 'Quicksand', system-ui, sans-serif;
  --font-ui: 'Inter', system-ui, -apple-system, sans-serif;

  --wrap: 1100px;
  --prose: 760px;
  --shadow-1: 0 1px 3px -1px rgba(32,40,50,0.10);
  --shadow-2: 0 18px 40px -30px rgba(32,40,50,0.55);
  --shadow-3: 0 40px 80px -45px rgba(32,40,50,0.62);
}

/* ---- reset / base ---- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
body {
  margin: 0;
  background: var(--soft-white);
  color: var(--charcoal);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.18; }
img { max-width: 100%; display: block; }
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--lavender); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--charcoal); color: #fff; padding: 10px 16px; border-radius: var(--r-sm);
}
.skip-link:focus { left: 16px; color: #fff; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-ui); font-weight: 600; font-size: 15px; line-height: 1;
  background: var(--charcoal); color: #fff;
  padding: 13px 22px; border-radius: var(--r-full); border: 1px solid var(--charcoal);
  text-decoration: none; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  min-height: 44px;
}
.btn:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 14px 28px -14px rgba(32,40,50,0.7); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; color: var(--charcoal); border-color: rgba(32,40,50,0.18); }
.btn.ghost:hover { color: var(--charcoal); background: rgba(32,40,50,0.04); box-shadow: none; }
.btn.accent { background: var(--accent); border-color: var(--accent); }
.btn.accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.lg { font-size: 16px; padding: 15px 26px; }
.btn.block { width: 100%; }

/* ---- nav ---- */
.nav {
  position: sticky; top: 0; z-index: 30;
  background: rgba(250,250,248,0.82); backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgba(32,40,50,0.06);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--charcoal); }
.brand:hover { color: var(--charcoal); }
.brand .mark { width: 30px; height: 30px; border-radius: 24%; object-fit: cover; display: block; }
.brand .word { font-family: var(--font-display); font-weight: 600; font-size: 21px; letter-spacing: 0.04em; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a:not(.btn) { color: var(--text-secondary); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav-links a:not(.btn):hover { color: var(--charcoal); }
.nav-toggle { display: none; }

/* ---- sections / type ---- */
section { padding: 76px 0; }
.eyebrow, .section-tag {
  font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  font-size: 12.5px; color: var(--text-secondary); margin: 0 0 12px;
}
h1.display { font-size: clamp(2.3rem, 5.2vw, 3.6rem); line-height: 1.07; letter-spacing: -0.015em; margin: 0 0 20px; font-weight: 700; }
h2.section-title { font-size: clamp(1.7rem, 3.4vw, 2.3rem); margin: 0 0 16px; }
.lede { font-size: 1.12rem; color: #36404c; max-width: 64ch; margin: 0; }
.center { text-align: center; }
.center .lede { margin-left: auto; margin-right: auto; }

/* ---- cards / grids ---- */
.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: 26px 22px; box-shadow: var(--shadow-2);
}
.card.soft { box-shadow: none; background: var(--warm-mist); border-color: transparent; }
.feature { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-3); }
.swatch { width: 38px; height: 38px; border-radius: var(--r-md); margin-bottom: 16px; }
.card h3 { font-size: 1.16rem; margin: 0 0 8px; line-height: 1.25; }
.card p { font-size: 14.5px; color: #424c57; margin: 0; line-height: 1.6; }
.num-badge {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--warm-mist); margin-bottom: 14px;
}

/* ---- pills / chips ---- */
.chip {
  display: inline-block; font-size: 14px; font-weight: 500;
  background: var(--warm-mist); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: var(--r-full); color: var(--charcoal);
}
.chip b { font-family: var(--font-display); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---- inverted (dark) band ---- */
.invert { background: var(--charcoal); color: #eef0f2; }
.invert .section-tag { color: #aab3bd; }
.invert h2 { color: #fff; }
.invert .lede { color: #cdd3da; }
.invert a:not(.btn) { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.invert .chip { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.14); color: #eef0f2; }
.invert .btn.accent { background: #fff; color: var(--charcoal); border-color: #fff; }
.invert .btn.accent:hover { background: #f0eef8; border-color: #f0eef8; color: var(--charcoal); }

/* soft prismatic glow helper */
.glow-wrap { position: relative; overflow: hidden; }
.glow-wrap::before {
  content: ""; position: absolute; inset: -30% -10% auto -10%; height: 70%;
  background: var(--prism-gradient); filter: blur(90px); opacity: 0.5; z-index: 0;
}
.glow-wrap > * { position: relative; z-index: 1; }

/* ---- forms ---- */
.field { margin: 0 0 14px; text-align: left; }
.field label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 6px; }
input[type="email"], input[type="text"] {
  font-family: var(--font-ui); font-size: 16px; width: 100%;
  padding: 13px 16px; border-radius: var(--r-md);
  border: 1px solid rgba(32,40,50,0.18); background: #fff; color: var(--charcoal);
}
input[type="email"]:focus, input[type="text"]:focus { outline: 3px solid var(--lavender); outline-offset: 1px; border-color: var(--accent); }
select { font-family: var(--font-ui); font-size: 16px; width: 100%; padding: 12px 16px; border-radius: var(--r-md); border: 1px solid rgba(32,40,50,0.18); background: #fff; color: var(--charcoal); }
select:focus { outline: 3px solid var(--lavender); outline-offset: 1px; border-color: var(--accent); }
.platform-field { margin: 0 0 12px; text-align: left; }
.platform-field label { display: block; font-weight: 500; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; text-align: left; }
.consent input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto;
  width: 20px; height: 20px; margin-top: 2px; border-radius: 6px;
  border: 1.5px solid rgba(32,40,50,0.35); background: #fff; cursor: pointer; position: relative;
}
.consent input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.consent input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.consent input[type="checkbox"]:focus-visible { outline: 3px solid var(--lavender); outline-offset: 2px; }
.consent label { font-size: 13.5px; color: #424c57; line-height: 1.5; font-weight: 400; }
.consent .req { color: var(--accent-ink); font-weight: 600; }
.form-note { font-size: 12.5px; color: var(--text-secondary); margin: 8px 0 0; }
.form-status { font-size: 14px; margin: 12px 0 0; min-height: 1px; }
.form-status.error { color: #9a2f3a; }
.form-status.success { color: #2f6b4f; }
.field-error { color: #9a2f3a; font-size: 12.5px; margin: 6px 0 0; }
.waitlist-form .row { display: flex; gap: 10px; flex-wrap: wrap; }
.waitlist-form .row input { flex: 1 1 220px; }

/* ---- cookie banner ---- */
.cookie-bar {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60;
  max-width: 640px; margin: 0 auto;
  background: var(--charcoal); color: #eef0f2;
  border-radius: var(--r-lg); padding: 18px 20px;
  box-shadow: 0 30px 60px -25px rgba(0,0,0,0.6);
  display: none;
}
.cookie-bar[data-open="true"] { display: block; }
.cookie-bar p { margin: 0 0 14px; font-size: 14px; color: #d4d9df; }
.cookie-bar a { color: #fff; text-decoration: underline; }
.cookie-bar .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-bar .btn { min-height: 40px; padding: 10px 18px; font-size: 14px; }
.cookie-bar .btn.ghost { color: #fff; border-color: rgba(255,255,255,0.3); }
.cookie-bar .btn.ghost:hover { background: rgba(255,255,255,0.08); color: #fff; }
.cookie-bar .btn.accent { background: #fff; color: var(--charcoal); border-color: #fff; }

/* ---- prose / legal pages ---- */
.prose { max-width: var(--prose); margin: 0 auto; padding: 40px 28px 24px; }
.prose h1 { font-size: clamp(2rem, 5vw, 2.9rem); line-height: 1.12; margin: 8px 0 12px; font-weight: 700; }
.prose .updated { color: var(--text-secondary); font-size: 14px; margin: 0 0 8px; }
.prose h1::after { content: ""; display: block; width: 92px; height: 6px; margin-top: 18px; border-radius: var(--r-full); background: var(--prism-gradient); }
.prose h2 { font-size: 1.5rem; margin: 48px 0 12px; }
.prose h3 { font-size: 1.16rem; margin: 30px 0 6px; }
.prose p { margin: 0 0 18px; }
.prose a { word-break: break-word; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 18px; }
.prose li { margin: 0 0 10px; }
.prose strong { font-weight: 600; }
.prose hr { border: none; height: 1px; margin: 40px 0; background: linear-gradient(90deg, transparent, rgba(32,40,50,0.14), transparent); }
.legal-toc { background: var(--warm-mist); border-radius: var(--r-lg); padding: 18px 22px; margin: 0 0 28px; }
.legal-toc h2 { font-size: 1rem; margin: 0 0 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary); }
.legal-toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 28px; }
.legal-toc li { margin: 0 0 6px; }
.placeholder { background: #fff4d6; padding: 0 4px; border-radius: 4px; font-weight: 600; }
.prose ol.refs { font-size: 14.5px; color: var(--text-secondary); }
.prose ol.refs li { margin-bottom: 12px; }
.prose ol.refs em { color: var(--charcoal); }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--border); background: #fff; box-shadow: var(--shadow-2); margin: 8px 0 22px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
thead th { text-align: left; background: var(--warm-mist); font-family: var(--font-display); font-weight: 600; padding: 13px 16px; }
tbody td { padding: 12px 16px; border-top: 1px solid var(--border); vertical-align: top; }
tbody tr:nth-child(even) td { background: rgba(244,241,238,0.4); }

/* ---- footer ---- */
.site-footer { border-top: 1px solid var(--border); padding: 44px 0 36px; background: var(--soft-white); }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.site-footer .word { font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: 0.04em; }
.site-footer .tagline { color: var(--text-secondary); font-size: 14px; margin: 10px 0 0; max-width: 30ch; }
.site-footer h4 { font-family: var(--font-ui); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-secondary); margin: 4px 0 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0 0 9px; }
.site-footer a { color: var(--charcoal); text-decoration: none; font-size: 14.5px; }
.site-footer a:hover { color: var(--accent-ink); text-decoration: underline; }
.site-footer .legal-line { grid-column: 1 / -1; border-top: 1px solid var(--border); margin-top: 28px; padding-top: 20px; color: var(--text-secondary); font-size: 13px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer .legal-line button.linklike { background: none; border: none; padding: 0; color: var(--text-secondary); font: inherit; text-decoration: underline; cursor: pointer; }

/* ---- responsive ---- */
@media (max-width: 880px) {
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .cols-3 { grid-template-columns: 1fr 1fr; }
  .site-footer .wrap { grid-template-columns: 1fr 1fr; }
  .legal-toc ol { columns: 1; }
}
/* tablet portrait + phones: collapse the nav links into a toggle menu */
@media (max-width: 720px) {
  .nav .wrap { position: relative; }
  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 11px; margin-right: -8px;
    background: none; border: none; cursor: pointer;
  }
  .nav-toggle-bar { width: 22px; height: 2px; border-radius: 2px; background: var(--charcoal); }
  .nav-links {
    position: absolute; top: calc(100% + 8px); right: 28px; left: 28px;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--soft-white); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: 12px; box-shadow: var(--shadow-2);
    display: none;
  }
  .nav-links[data-open="true"] { display: flex; }
  .nav-links a:not(.btn) { padding: 11px 12px; border-radius: var(--r-md); font-size: 16px; }
  .nav-links a:not(.btn):hover { background: var(--warm-mist); }
  .nav-links .btn { width: 100%; margin-top: 6px; }
}
@media (max-width: 620px) {
  section { padding: 56px 0; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .site-footer .wrap { grid-template-columns: 1fr; }
}
