/* MicroQualia public page — light blue theme.
 * Plain CSS, no build step. Fonts are self-hosted from assets/fonts/ (no
 * third-party font origin, WO-009 Trap 8): latin subsets of two variable fonts,
 * Bricolage Grotesque (display) and Figtree (body), both under the SIL Open
 * Font License 1.1 (licence texts beside the files).
 */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("assets/fonts/bricolage-grotesque-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/figtree-latin.woff2") format("woff2");
}

:root {
  --ink: #0e1e3a;
  --ink-2: #3c4e6b;
  --muted: #56688a;
  --ground: #f3f7fc;
  --tint: #e6effb;
  --line: #d6e2f2;
  --line-2: #c9d8ec;
  --cobalt: #1d5fd1;
  --cobalt-deep: #143f99;
  --sky: #7fb6ff;
  --white: #ffffff;
  --display: "Bricolage Grotesque", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --body: "Figtree", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --gutter: clamp(20px, 6vw, 120px);
  --radius: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--cobalt); }
a:hover { color: var(--cobalt-deep); }
/* Status notes take focus from form.js so screen readers announce them; no ring. */
[tabindex="-1"]:focus { outline: none; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 3px;
  border-radius: 10px;
}

h1, h2, h3 { margin: 0; }
p { margin: 0; }

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

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  padding: 10px 16px; border-radius: 10px;
  background: var(--ink); color: var(--white); text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--white); }

.eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cobalt);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: rgba(243, 247, 252, 0.92);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid #dce6f4;
}
.site-header .wrap { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand svg { width: 46px; height: auto; }
.wordmark { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); }
.wordmark span { color: var(--cobalt); }

.site-nav { display: flex; align-items: center; gap: 32px; }
.site-nav a { font-size: 15px; font-weight: 500; color: var(--ink-2); text-decoration: none; }
.site-nav a:hover { color: var(--cobalt); }
.site-nav .nav-link { display: none; }
@media (min-width: 820px) { .site-nav .nav-link { display: inline; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px;
  border: 0; border-radius: 999px;
  background: var(--cobalt); color: var(--white);
  font: inherit; font-size: 16px; font-weight: 600; text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--cobalt-deep); color: var(--white); transform: translateY(-1px); }
.btn:disabled { opacity: 0.7; cursor: progress; transform: none; }
.site-nav .btn { min-height: 44px; padding: 0 20px; font-size: 15px; color: var(--white); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 48px 0 64px; }
.hero-rings { position: absolute; right: -220px; top: -80px; width: 760px; height: 760px; pointer-events: none; }
.hero-grid { position: relative; display: grid; gap: 48px; align-items: center; }
@media (min-width: 1024px) {
  .hero { padding: 88px 0 112px; }
  .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 64px; }
}
.hero-copy { display: flex; flex-direction: column; gap: 24px; }

.pill {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 16px 7px 12px; border-radius: 999px;
  background: var(--white); border: 1px solid var(--line);
  font-size: 14px; font-weight: 600; color: var(--cobalt-deep);
}
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cobalt); box-shadow: 0 0 0 4px #d6e6fc; }

.hero h1 {
  font-family: var(--display);
  font-size: clamp(38px, 5.2vw, 62px);
  font-weight: 700; line-height: 1.04; letter-spacing: -0.035em;
}
.hero h1 em, .accent { font-style: normal; color: var(--cobalt); }
.lede { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.55; color: var(--ink-2); max-width: 560px; }

.hero-form { display: flex; flex-direction: column; gap: 10px; max-width: 560px; }
.hero-form label { font-size: 14px; font-weight: 600; }
.inline-field {
  display: flex; flex-direction: column; gap: 8px;
}
.inline-field input { height: 54px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--white); }
.inline-field .btn { min-height: 54px; border-radius: 14px; }
@media (min-width: 560px) {
  .inline-field {
    flex-direction: row; gap: 10px; padding: 6px;
    background: var(--white); border: 1px solid var(--line-2); border-radius: 18px;
    box-shadow: 0 12px 32px -18px rgba(20, 63, 153, 0.35);
  }
  .inline-field input { flex: 1; min-width: 0; height: 52px; border-color: transparent; border-radius: 12px; }
  .inline-field .btn { min-height: 52px; border-radius: 12px; }
}

input[type="email"], input[type="text"], textarea, select {
  width: 100%;
  padding: 0 16px;
  font: inherit; font-size: 17px; color: var(--ink);
  background: var(--white);
}
input::placeholder, textarea::placeholder { color: #6a7b96; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--cobalt) !important;
  box-shadow: 0 0 0 4px rgba(29, 95, 209, 0.18);
}

.form-note { font-size: 14px; line-height: 1.5; color: var(--muted); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.hero-thanks {
  max-width: 560px;
  display: flex; gap: 16px; align-items: flex-start;
  padding: 20px 22px; border-radius: 18px;
  background: var(--white); border: 1px solid var(--line-2);
}
.hero-thanks strong { display: block; font-size: 17px; }
.hero-thanks p { font-size: 15px; color: var(--ink-2); }
.check-dot {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
  background: var(--cobalt); display: flex; align-items: center; justify-content: center;
}
.check-dot svg { width: 20px; height: 20px; }

.dev-note {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 500; color: var(--ink-2); text-decoration: none;
}
.dev-note code {
  padding: 3px 8px; border-radius: 6px; background: #e0ebfa;
  font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: var(--cobalt-deep);
}

.diagram-card {
  justify-self: end; width: 100%; max-width: 580px;
  padding: 12px; border-radius: 28px;
  background: var(--white); border: 1px solid var(--line);
  box-shadow: 0 40px 80px -40px rgba(14, 30, 58, 0.28);
}
.diagram { width: 100%; height: auto; font-family: var(--body); }
.flow { stroke-dasharray: 4 7; animation: flow 1.6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -22; } }
.pulse { transform-origin: 330px 200px; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 0.08; transform: scale(1.18); }
}
@media (prefers-reduced-motion: reduce) { .flow, .pulse { animation: none; } }

/* ---------- Sections ---------- */
section { scroll-margin-top: 84px; }

.problem { background: var(--ink); color: var(--white); padding: clamp(56px, 8vw, 104px) 0; }
.problem .wrap { display: grid; gap: 20px; }
@media (min-width: 1024px) { .problem .wrap { grid-template-columns: 260px minmax(0, 1fr); gap: 80px; } }
.problem .eyebrow { color: var(--sky); padding-top: 12px; }
.problem-body { display: flex; flex-direction: column; gap: 28px; }
.problem h2 {
  font-family: var(--display); font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 600; line-height: 1.15; letter-spacing: -0.025em;
}
.problem h2 span { color: var(--sky); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.problem .chips li { padding: 9px 16px; border-radius: 999px; border: 1px solid #34507e; font-size: 16px; color: #dce6f4; }
.problem p { max-width: 760px; font-size: clamp(16.5px, 1.5vw, 19px); line-height: 1.6; color: #b9c8df; }

.section-head { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 900px) {
  .section-head.split { flex-direction: row; justify-content: space-between; align-items: flex-end; gap: 48px; }
}
.section-head h2, .h2 {
  font-family: var(--display); font-size: clamp(32px, 4vw, 52px);
  font-weight: 700; line-height: 1.06; letter-spacing: -0.03em;
}
.section-head p { max-width: 380px; font-size: 17px; color: var(--ink-2); }

.how { padding: clamp(64px, 9vw, 120px) 0 clamp(40px, 5vw, 64px); }
.how .wrap { display: flex; flex-direction: column; gap: clamp(28px, 4vw, 56px); }
.steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 16px; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }
.step {
  padding: clamp(26px, 3vw, 36px) clamp(22px, 2.5vw, 32px);
  border-radius: var(--radius); background: var(--white); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 16px;
}
.step-top { display: flex; justify-content: space-between; align-items: center; }
.icon-tile {
  width: 52px; height: 52px; border-radius: 16px; background: var(--tint);
  display: flex; align-items: center; justify-content: center;
}
.icon-tile svg { width: 26px; height: 26px; }
.step-num { font-family: var(--display); font-size: 44px; font-weight: 800; line-height: 1; color: #dce6f4; }
.step h3 { font-family: var(--display); font-size: clamp(22px, 2vw, 26px); font-weight: 700; letter-spacing: -0.02em; }
.step p { font-size: 17px; color: var(--ink-2); }
.step-feature { background: var(--cobalt); border-color: var(--cobalt); color: var(--white); box-shadow: 0 30px 60px -30px rgba(29, 95, 209, 0.6); }
.step-feature .icon-tile { background: rgba(255, 255, 255, 0.16); }
.step-feature .step-num { color: rgba(255, 255, 255, 0.28); }
.step-feature p { color: #e3edfd; }

.benefits { padding: clamp(24px, 5vw, 64px) 0 clamp(56px, 9vw, 120px); }
.benefits .wrap { display: flex; flex-direction: column; gap: 32px; }
.benefits h2 { font-family: var(--display); font-size: clamp(28px, 3vw, 40px); font-weight: 700; letter-spacing: -0.025em; }
.benefit-grid { display: grid; gap: 28px; }
@media (min-width: 640px) { .benefit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .benefit-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; } }
.benefit { display: flex; flex-direction: column; gap: 12px; padding-top: 22px; border-top: 2px solid var(--cobalt); }
.benefit svg { width: 28px; height: 28px; }
.benefit h3 { font-size: 19px; font-weight: 700; line-height: 1.3; }
.benefit p { font-size: 16px; color: var(--ink-2); }

.trust-fits { padding-bottom: clamp(56px, 9vw, 120px); }
.trust-fits .wrap { display: grid; gap: 16px; }
@media (min-width: 960px) { .trust-fits .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; } }
.panel { padding: clamp(28px, 4vw, 48px); border-radius: 28px; display: flex; flex-direction: column; gap: 24px; }
.panel h2 { font-family: var(--display); font-size: clamp(26px, 2.6vw, 34px); font-weight: 700; letter-spacing: -0.02em; }
.panel-trust { background: var(--tint); }
.panel-head { display: flex; align-items: center; gap: 14px; }
.panel-head svg { width: 30px; height: 30px; flex-shrink: 0; }
.trust-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.trust-list li { display: flex; gap: 14px; align-items: flex-start; font-size: 18px; font-weight: 500; line-height: 1.45; }
.tick {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--cobalt);
  display: flex; align-items: center; justify-content: center;
}
.tick svg { width: 15px; height: 15px; }
.fine-print { font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }

.panel-fits { background: var(--white); border: 1px solid var(--line); }
.fit-chips li { padding: 11px 16px; border-radius: 14px; background: var(--cobalt); color: var(--white); font-size: 16px; font-weight: 600; }
.divider { height: 1px; background: #e3ebf6; }
.not-fit-label { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.nofit-chips li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 14px; border: 1px dashed #a9bad3;
  color: var(--ink-2); font-size: 16px;
}
.nofit-chips svg { width: 14px; height: 14px; }

/* ---------- Early access ---------- */
.join { padding-bottom: clamp(56px, 9vw, 120px); }
.join-panel {
  position: relative; overflow: hidden;
  border-radius: 36px; background: var(--cobalt-deep);
  padding: clamp(36px, 6vw, 80px) clamp(22px, 6vw, 88px);
  display: grid; gap: 32px; align-items: center;
}
@media (min-width: 1024px) { .join-panel { grid-template-columns: minmax(0, 1fr) 480px; gap: 64px; } }
.join-mark { position: absolute; right: -60px; bottom: -90px; width: 520px; height: auto; opacity: 0.12; pointer-events: none; }
.join-copy { position: relative; display: flex; flex-direction: column; gap: 18px; }
.join-copy h2 {
  font-family: var(--display); font-size: clamp(32px, 4vw, 52px);
  font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; color: var(--white);
}
.join-copy p { max-width: 520px; font-size: 18px; line-height: 1.6; color: #d3e2fb; }

.form-card {
  position: relative;
  padding: clamp(22px, 3vw, 32px); border-radius: 24px;
  background: var(--white); color: var(--ink);
  box-shadow: 0 30px 60px -30px rgba(3, 12, 36, 0.55);
}
.form-card form > div, #email-step, #optional-step { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.field .hint { font-weight: 400; color: var(--muted); }
.field input, .field select { height: 52px; border: 1px solid var(--line-2); border-radius: 12px; }
.field textarea { min-height: 88px; padding: 12px 16px; border: 1px solid var(--line-2); border-radius: 12px; resize: vertical; }
.form-card .btn { width: 100%; min-height: 54px; border-radius: 14px; font-size: 17px; }
.form-card h3 { font-size: 20px; font-weight: 700; }
.form-card p { font-size: 15px; color: var(--ink-2); }
.form-card .form-note { font-size: 14px; color: var(--muted); }

.thanks { display: flex; flex-direction: column; gap: 8px; }
.thanks + #optional-form { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
/* No-JS landing: the API 303s a plain post to /#thanks, which reveals the note. */
#thanks:target { display: flex !important; }

/* ---------- FAQ ---------- */
.faq-section { padding-bottom: clamp(56px, 9vw, 120px); }
.faq-section .wrap { display: grid; gap: 28px; }
@media (min-width: 1024px) { .faq-section .wrap { grid-template-columns: 320px minmax(0, 1fr); gap: 80px; } }
.faq-section .h2 { font-size: clamp(32px, 3.4vw, 44px); }
.faq { border-top: 1px solid var(--line-2); }
.faq details { border-bottom: 1px solid var(--line-2); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 44px; padding: 22px 4px;
  font-size: clamp(17px, 1.5vw, 19px); font-weight: 600; line-height: 1.4;
  cursor: pointer; list-style: none;
  transition: color 0.15s ease;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--cobalt); }
.faq-icon {
  position: relative; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  background: var(--tint); transition: background 0.2s ease, transform 0.25s ease;
}
.faq-icon::before, .faq-icon::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 12px; height: 2px; margin: -1px 0 0 -6px; border-radius: 2px;
  background: var(--cobalt); transition: background 0.2s ease;
}
.faq-icon::after { transform: rotate(90deg); }
.faq details[open] .faq-icon { background: var(--cobalt); transform: rotate(45deg); }
.faq details[open] .faq-icon::before, .faq details[open] .faq-icon::after { background: var(--white); }
.faq details[open] summary { color: var(--cobalt-deep); }
.faq details p { max-width: 680px; padding: 0 56px 24px 4px; font-size: 16px; line-height: 1.65; color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) { .faq-icon { transition: none; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid #dce6f4; padding: 32px 0 40px; font-size: 14px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-direction: column-reverse; gap: 14px; }
@media (min-width: 760px) { .site-footer .wrap { flex-direction: row; justify-content: space-between; align-items: center; } }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand svg { width: 40px; height: auto; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px 28px; }
.site-footer nav a { color: var(--ink-2); }

/* ---------- Article pages (privacy, confirmed, 404) ---------- */
.article { padding: clamp(40px, 7vw, 88px) 0 clamp(56px, 8vw, 104px); }
.article .wrap { max-width: calc(760px + 2 * var(--gutter)); }
.article h1 {
  font-family: var(--display); font-size: clamp(34px, 4.4vw, 52px);
  font-weight: 700; line-height: 1.06; letter-spacing: -0.03em; margin-bottom: 20px;
}
.article h2 { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -0.015em; margin: 40px 0 12px; }
.article p, .article li { color: var(--ink-2); }
.article p + p { margin-top: 14px; }
.article ul { padding-left: 22px; margin: 12px 0; }
.article li + li { margin-top: 8px; }
.article strong { color: var(--ink); }
.article .lede { max-width: none; }
.article .thanks {
  padding: 28px; margin-bottom: 28px; border-radius: 24px;
  background: var(--white); border: 1px solid var(--line);
}
.article .thanks h1 { margin-bottom: 4px; }

.nowrap { white-space: nowrap; }
.problem h2 .nowrap { color: inherit; }
.mt-0 { margin-top: 0 !important; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
