/* ============================================================
   Clin A Head — marketing site
   A single, deliberately warm-paper/ink editorial world (not a
   light/dark toggle) — matches the actual product's own palette
   (theme.dart: paper #F7F5F0, ink #1C1B1A, teal #0B4F4A, flag
   #8A2E2E used ONLY as the literal "found in document" highlight
   colour, exactly as in the real app). No webfont network calls —
   every typeface below is a real installed font on the reader's
   machine, chosen for character rather than defaulting to Inter.
   ============================================================ */

:root {
  --paper: #F7F5F0;
  --paper-deep: #EEEAE0;
  --paper-deeper: #E6E1D3;
  --ink: #1C1B1A;
  --ink-soft: #3A3835;
  --ink-muted: #6B6862;
  --ink-faint: #9A968D;
  --teal: #0B4F4A;
  --teal-bright: #12786F;
  --teal-soft: #DCE8E6;
  --flag: #8A2E2E;
  --flag-soft: #F1E1DF;
  --divider: #DCD6C8;
  --divider-strong: #C7C0AE;
  --shadow: 28 26 20;

  --display: "Source Serif Pro", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --body: -apple-system, "Segoe UI", ui-sans-serif, system-ui, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, "SFMono-Regular", monospace;

  --max: 1140px;
}

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

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 32px; }
@media (max-width: 640px) { .wrap { padding: 0 20px; } }

.eyebrow {
  font-family: var(--body);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--teal);
}

h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; margin: 0; text-wrap: balance; }
p { margin: 0; }

/* ── Backed-by bar (sits above the nav, in the page header where it
   was asked to be, not buried further down the page) ───────────── */
.backed-bar {
  background: var(--paper-deep);
  border-bottom: 1px solid var(--divider);
  padding: 9px 0;
  text-align: center;
}
.backed-bar .wrap {
  font-family: var(--display);
  font-style: italic;
  font-size: 14.5px;
  color: var(--flag);
}
.backed-bar strong { font-weight: 700; }

/* ── Top nav ─────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(247, 245, 240, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--divider);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.wordmark {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 1px;
  text-decoration: none;
  color: var(--ink);
}
.wordmark .a { color: var(--teal); font-style: italic; }
.wordmark .arrow {
  font-family: var(--body);
  font-size: 14px;
  color: var(--flag);
  margin-left: 4px;
  transform: translateY(-1px);
}
.nav-links { display: flex; align-items: center; gap: 30px; font-size: 14.5px; }
.nav-links a { text-decoration: none; color: var(--ink-soft); }
.nav-links a:hover { color: var(--teal); }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--body); font-weight: 600; font-size: 14.5px;
  padding: 10px 20px; border-radius: 3px;
  text-decoration: none; cursor: pointer; border: 1.5px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal); color: var(--paper); }
.btn-primary:hover { background: var(--teal-bright); box-shadow: 0 6px 18px -6px rgba(11,79,74,0.55); }
.btn-ghost { border-color: var(--divider-strong); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn-lg { padding: 15px 30px; font-size: 16px; }

/* ── Hero ────────────────────────────────────────────────────── */
.hero { padding: 76px 0 40px; position: relative; overflow: hidden; }
.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 940px) { .hero .wrap { grid-template-columns: 1fr; } }

.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--teal);
  background: var(--teal-soft);
  padding: 6px 12px; border-radius: 100px;
  margin-bottom: 22px;
}
.hero-tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--flag); }

.hero h1 {
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.06;
  letter-spacing: -0.015em;
}
.hero h1 em { font-style: italic; color: var(--teal); }

.moto {
  font-family: var(--display);
  font-style: italic;
  font-size: 21px;
  color: var(--ink-soft);
  margin-top: 20px;
  border-left: 3px solid var(--flag);
  padding-left: 14px;
}

.hero-sub {
  margin-top: 22px;
  font-size: 17.5px;
  color: var(--ink-muted);
  max-width: 46ch;
  line-height: 1.65;
}

.hero-ctas { display: flex; align-items: center; gap: 18px; margin-top: 34px; flex-wrap: wrap; }
.hero-note { font-size: 13px; color: var(--ink-faint); }

.hero-badges { display: flex; gap: 22px; margin-top: 40px; flex-wrap: wrap; }
.hero-badge { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-muted); }
.hero-badge svg { width: 15px; height: 15px; flex: none; color: var(--teal); }

/* ── Hero demo stack (staggered mock windows, not a plain grid) ─ */
.demo-stack { position: relative; height: 460px; }
.demo-window {
  position: absolute;
  width: 320px;
  background: #FFFFFF;
  border: 1px solid var(--divider);
  border-radius: 8px;
  box-shadow: 0 24px 48px -20px rgba(var(--shadow) / 0.35), 0 4px 10px -4px rgba(var(--shadow) / 0.18);
  overflow: hidden;
}
.demo-window.win-1 { top: 0; left: 10%; z-index: 3; transform: rotate(-3deg); }
.demo-window.win-2 { top: 120px; left: 46%; z-index: 2; transform: rotate(2.5deg); width: 300px; }
.demo-window.win-3 { top: 268px; left: 4%; z-index: 1; transform: rotate(2deg); width: 290px; }
.demo-window:hover { z-index: 5; }
.win-chrome {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 12px; background: var(--paper-deep); border-bottom: 1px solid var(--divider);
}
.win-dot { width: 8px; height: 8px; border-radius: 50%; }
.win-dot:nth-child(1) { background: #D98A7E; }
.win-dot:nth-child(2) { background: #E0C173; }
.win-dot:nth-child(3) { background: #8FB89A; }
.win-label { margin-left: 8px; font-size: 10.5px; color: var(--ink-faint); font-family: var(--body); }

@media (max-width: 940px) {
  .demo-stack { height: auto; display: flex; flex-direction: column; gap: 22px; padding-bottom: 10px; }
  .demo-window { position: static; width: 100% !important; transform: none !important; }
}

/* ── Demo animation: highlighting ───────────────────────────── */
.demo-doc { padding: 16px 18px; font-size: 12.5px; color: var(--ink-soft); position: relative; min-height: 190px; }
.demo-doc .line { height: 8px; background: var(--paper-deep); border-radius: 2px; margin-bottom: 9px; }
.demo-doc .line.w60 { width: 60%; } .demo-doc .line.w80 { width: 80%; } .demo-doc .line.w40 { width: 40%; } .demo-doc .line.w90 { width: 90%; } .demo-doc .line.w70 { width: 70%; }
.demo-doc .found-text {
  display: inline; background: var(--paper-deep); border-radius: 2px; color: transparent;
  font-family: var(--mono); font-size: 11px; padding: 1px 2px;
}
.demo-doc p { margin-bottom: 10px; }
.hl-box {
  position: absolute;
  border: 2px solid var(--flag);
  border-radius: 3px;
  background: rgba(138, 46, 46, 0.06);
  opacity: 0;
  animation: hlCycle 6s infinite;
}
.hl-box.b1 { top: 40px; left: 18px; width: 130px; height: 20px; animation-delay: 0s; }
.hl-box.b2 { top: 92px; left: 18px; width: 178px; height: 20px; animation-delay: 2s; }
.hl-box.b3 { top: 144px; left: 18px; width: 96px; height: 20px; animation-delay: 4s; }
@keyframes hlCycle {
  0%   { opacity: 0; transform: scale(0.94); }
  6%   { opacity: 1; transform: scale(1); }
  28%  { opacity: 1; transform: scale(1); }
  34%  { opacity: 0; }
  100% { opacity: 0; }
}
.hl-tag {
  position: absolute; background: var(--flag); color: #fff; font-size: 9.5px; font-weight: 600;
  padding: 2px 6px; border-radius: 3px; white-space: nowrap; opacity: 0;
  font-family: var(--body); animation: hlCycle 6s infinite;
}
.hl-tag.t1 { top: 16px; left: 18px; animation-delay: 0s; }
.hl-tag.t2 { top: 68px; left: 18px; animation-delay: 2s; }
.hl-tag.t3 { top: 120px; left: 18px; animation-delay: 4s; }

/* ── Demo animation: chatbot ─────────────────────────────────── */
.demo-chat { padding: 14px 16px; min-height: 190px; display: flex; flex-direction: column; gap: 10px; }
.chat-bubble {
  border-radius: 8px; padding: 9px 12px; font-size: 12px; line-height: 1.45; max-width: 88%;
  opacity: 0; transform: translateY(6px);
}
.chat-q { align-self: flex-end; background: var(--teal); color: var(--paper); border-bottom-right-radius: 2px; }
.chat-a { align-self: flex-start; background: var(--paper-deep); color: var(--ink); border-bottom-left-radius: 2px; }
.chat-cite {
  align-self: flex-start; font-size: 9.5px; color: var(--teal); font-weight: 600;
  background: var(--teal-soft); padding: 2px 7px; border-radius: 100px; opacity: 0;
}
.chat-typing { align-self: flex-start; display: flex; gap: 4px; padding: 6px 0 0 2px; opacity: 0; }
.chat-typing span { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-faint); animation: typingBounce 1s infinite ease-in-out; }
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-3px); opacity: 1; } }

/* JS toggles .show on chat elements in sequence -- see app.js */
.chat-q.show, .chat-a.show, .chat-cite.show { opacity: 1; transform: translateY(0); transition: opacity 0.35s ease, transform 0.35s ease; }
.chat-typing.show { opacity: 1; }

/* ── Demo animation: questionnaire ──────────────────────────── */
.demo-form { padding: 16px 18px; min-height: 190px; }
.form-progress { height: 5px; background: var(--paper-deep); border-radius: 100px; overflow: hidden; margin-bottom: 16px; }
.form-progress > div { height: 100%; background: var(--teal); width: 0%; animation: fillProgress 7s infinite; }
@keyframes fillProgress { 0% { width: 0%; } 75% { width: 100%; } 100% { width: 100%; } }
.form-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--paper-deep); font-size: 12px; color: var(--ink-soft); }
.form-check {
  width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--divider-strong); flex: none;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.form-check svg { width: 10px; height: 10px; opacity: 0; color: #fff; }
.form-check.on { background: var(--teal); border-color: var(--teal); animation: checkPop 7s infinite; }
.form-check.on svg { opacity: 1; }
@keyframes checkPop { 0% { transform: scale(0.8); } 4% { transform: scale(1.12); } 8% { transform: scale(1); } 100% { transform: scale(1); } }
.form-row .line { flex: 1; height: 7px; background: var(--paper-deep); border-radius: 2px; }

/* ── Section rhythm ──────────────────────────────────────────── */
section { padding: 92px 0; }
section.alt { background: var(--paper-deep); }
.section-head { max-width: 640px; margin-bottom: 52px; }
.section-head .eyebrow { display: block; margin-bottom: 14px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 38px); line-height: 1.15; }
.section-head p { margin-top: 16px; font-size: 16.5px; color: var(--ink-muted); }

/* ── Live demo strip (below hero, larger versions) ──────────── */
.strip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
@media (max-width: 900px) { .strip-grid { grid-template-columns: 1fr; } }
.strip-item .demo-window { position: static; width: 100%; transform: none; box-shadow: 0 16px 34px -18px rgba(var(--shadow) / 0.3); }
.strip-item .demo-window:hover { transform: translateY(-4px); transition: transform 0.25s ease; }
.strip-cap { margin-top: 16px; }
.strip-cap .num { font-family: var(--display); font-style: italic; color: var(--flag); font-size: 14px; margin-right: 6px; }
.strip-cap h3 { font-size: 18px; display: inline; }
.strip-cap p { margin-top: 8px; font-size: 14.5px; color: var(--ink-muted); line-height: 1.6; }

/* ── Why us: comparison, not cards ───────────────────────────── */
.compare { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--divider); border-radius: 10px; overflow: hidden; }
@media (max-width: 760px) { .compare { grid-template-columns: 1fr; } }
.compare-col { padding: 34px 32px; }
.compare-col.old { background: var(--paper); }
.compare-col.new { background: var(--teal); color: var(--paper); }
.compare-col h4 { font-family: var(--body); font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; margin-bottom: 22px; }
.compare-col.old h4 { color: var(--ink-faint); }
.compare-col.new h4 { color: rgba(247,245,240,0.65); }
.compare-row { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid; font-size: 14.5px; line-height: 1.55; }
.compare-col.old .compare-row { border-color: var(--divider); color: var(--ink-soft); }
.compare-col.new .compare-row { border-color: rgba(247,245,240,0.16); }
.compare-row:last-child { border-bottom: none; }
.compare-row svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.compare-col.old svg { color: var(--ink-faint); }
.compare-col.new svg { color: #E8C97A; }

/* ── Stat row ─────────────────────────────────────────────────── */
.stat-row { display: flex; gap: 56px; margin-top: 54px; flex-wrap: wrap; }
.stat b { font-family: var(--display); font-size: 34px; color: var(--teal); display: block; }
.stat span { font-size: 13.5px; color: var(--ink-muted); }

/* ── Data protection section (kept / removed diagram) ───────── */
.data-flow { display: grid; grid-template-columns: 1fr auto 1fr; gap: 30px; align-items: center; margin-bottom: 56px; }
@media (max-width: 800px) { .data-flow { grid-template-columns: 1fr; } .data-flow .arrow-mid { transform: rotate(90deg); margin: 0 auto; } }
.flow-card { border: 1px solid var(--divider); border-radius: 10px; padding: 26px 26px; background: var(--paper); }
.flow-card h4 { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; font-family: var(--body); font-weight: 700; margin-bottom: 16px; }
.flow-card.doc h4 { color: var(--ink-muted); }
.flow-card.sent h4 { color: var(--teal); }
.arrow-mid { color: var(--flag); }
.token-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--divider); font-size: 13.5px; }
.token-row:last-child { border-bottom: none; }
.token-row .redacted { text-decoration: line-through; color: var(--ink-faint); }
.token-row .kept { color: var(--ink); font-weight: 600; }
.token-pill { font-family: var(--mono); font-size: 10.5px; background: var(--flag-soft); color: var(--flag); padding: 2px 7px; border-radius: 4px; }
.token-pill.keep { background: var(--teal-soft); color: var(--teal); }

.callout { border-left: 3px solid var(--flag); background: var(--flag-soft); padding: 18px 22px; border-radius: 0 8px 8px 0; font-size: 14.5px; color: var(--ink-soft); line-height: 1.6; }
.callout.info { border-color: var(--teal); background: var(--teal-soft); }
.callout strong { color: var(--ink); }

/* ── Trust / backing strip ──────────────────────────────────── */
.trust-strip { border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider); padding: 40px 0; }
.trust-strip .wrap { display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.trust-item { display: flex; align-items: center; }
.trust-note { font-size: 13px; color: var(--ink-muted); max-width: 34ch; font-style: italic; }
.region-row { display: flex; gap: 22px; }
.region { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.region .flagmark { font-size: 17px; }

/* ── For whom / pilot ────────────────────────────────────────── */
.for-whom-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--divider); border: 1px solid var(--divider); border-radius: 10px; overflow: hidden; }
@media (max-width: 760px) { .for-whom-grid { grid-template-columns: 1fr; } }
.for-whom-grid > div { background: var(--paper); padding: 26px 24px; }
.for-whom-grid h4 { font-size: 15.5px; font-family: var(--body); font-weight: 700; margin-bottom: 8px; }
.for-whom-grid p { font-size: 13.5px; color: var(--ink-muted); }

/* ── FR-only panel ───────────────────────────────────────────── */
.fr-panel {
  background: var(--ink); color: var(--paper);
  border-radius: 14px; padding: 52px 48px; position: relative; overflow: hidden;
}
.fr-panel::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 55%, rgba(11,79,74,0.35) 100%);
  pointer-events: none;
}
.fr-flag-strip { display: flex; height: 4px; width: 64px; border-radius: 3px; overflow: hidden; margin-bottom: 22px; }
.fr-flag-strip span { flex: 1; }
.fr-flag-strip span:nth-child(1) { background: #3B5F8A; }
.fr-flag-strip span:nth-child(2) { background: #F0EDE4; }
.fr-flag-strip span:nth-child(3) { background: #9A4B44; }
.fr-panel h2 { font-size: clamp(24px, 3vw, 30px); color: var(--paper); max-width: 26ch; }
.fr-panel .lead { margin-top: 14px; font-size: 15.5px; color: rgba(247,245,240,0.72); max-width: 60ch; }
.fr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 40px; }
@media (max-width: 760px) { .fr-grid { grid-template-columns: 1fr; } }
.fr-grid h4 { font-family: var(--body); font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; color: #E8C97A; margin-bottom: 14px; }
.fr-grid ul { list-style: none; margin: 0; padding: 0; }
.fr-grid li { padding: 8px 0; border-bottom: 1px solid rgba(247,245,240,0.12); font-size: 14px; color: rgba(247,245,240,0.85); }
.fr-contact { margin-top: 40px; padding-top: 28px; border-top: 1px solid rgba(247,245,240,0.18); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.fr-contact a { color: var(--paper); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(247,245,240,0.4); }

/* ── Final CTA ───────────────────────────────────────────────── */
.cta-final { text-align: center; padding: 100px 0; }
.cta-final h2 { font-size: clamp(30px, 4vw, 44px); max-width: 18ch; margin: 0 auto; }
.cta-final .moto { border: none; padding: 0; margin: 18px auto 0; text-align: center; }
.cta-final .hero-ctas { justify-content: center; margin-top: 36px; }

/* ── Footer ──────────────────────────────────────────────────── */
footer { border-top: 1px solid var(--divider); padding: 52px 0 36px; }
.footer-grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-brand .wordmark { margin-bottom: 10px; }
.footer-brand p { font-size: 13px; color: var(--ink-muted); max-width: 34ch; }
.footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col h5 { font-family: var(--body); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 14px; }
.footer-col a { display: block; font-size: 14px; color: var(--ink-soft); text-decoration: none; margin-bottom: 9px; }
.footer-col a:hover { color: var(--teal); }
.footer-bottom { margin-top: 46px; padding-top: 24px; border-top: 1px solid var(--divider); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--ink-faint); }

/* ── Terms page ──────────────────────────────────────────────── */
.legal { padding: 64px 0 100px; }
.legal .wrap { max-width: 780px; }
.legal h1 { font-size: 32px; margin-bottom: 6px; }
.legal .updated { font-size: 13px; color: var(--ink-faint); margin-bottom: 44px; }
.legal h2 { font-size: 19px; margin-top: 40px; margin-bottom: 12px; }
.legal p, .legal li { font-size: 15px; color: var(--ink-soft); line-height: 1.75; }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 8px; }
.legal .box { background: var(--flag-soft); border-left: 3px solid var(--flag); border-radius: 0 8px 8px 0; padding: 18px 22px; margin: 20px 0; }
.legal .box p { color: var(--ink); font-weight: 500; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--teal); text-decoration: none; margin-bottom: 30px; }

/* ── Reveal-on-scroll (subtle, respects reduced motion) ─────── */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
  .reveal.in { opacity: 1; transform: translateY(0); }
}
