/* ──────────────────────────────────────────────────────────────────────────
   Breath — Legal site styles
   Theme mirrors the app (BreathColors): dark-first, orange/violet/cyan accents.
   No emoji, Lucide icons only. Motion follows Emil Kowalski's principles.
   ────────────────────────────────────────────────────────────────────────── */

/* ── Design tokens (dark = default) ──────────────────────────────────────── */
:root {
  --bg:            #0B0D14;   /* app surface (dark)   */
  --bg-elev:       #131620;   /* app card             */
  --bg-elev-2:     #171B27;
  --border:        #1C2030;   /* app divider          */
  --border-strong: #272C3D;
  --text:          #F0F2F5;   /* app text             */
  --text-muted:    #9AA3BC;   /* readable secondary   */
  --text-hint:     #5A6378;   /* app textHint-ish     */

  --accent:        #54D2E3;   /* nicotine cyan        */
  --accent-2:      #A78BFA;   /* tar violet           */
  --accent-3:      #F5A056;   /* spent orange         */
  --link:          #7FE0EE;   /* link on dark         */

  --brand-gradient: linear-gradient(135deg, #F5A056 0%, #A78BFA 50%, #54D2E3 100%);

  --warn-bg:       rgba(245, 160, 86, 0.10);
  --warn-border:   rgba(245, 160, 86, 0.32);
  --warn-text:     #F2B27A;

  --info-bg:       rgba(84, 210, 227, 0.08);
  --info-border:   rgba(84, 210, 227, 0.26);

  --radius:        22px;      /* app card radius */
  --radius-sm:     14px;
  --radius-pill:   999px;
  --header-h:      64px;
  --maxw:          1120px;
  --prose:         720px;

  --shadow:        0 1px 0 rgba(255,255,255,0.02) inset, 0 8px 30px rgba(0,0,0,0.30);

  --ease-out:      cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out:   cubic-bezier(0.77, 0, 0.175, 1);

  --scrim:         rgba(8, 10, 16, 0.72);

  color-scheme: dark;
}

[data-theme="light"] {
  --bg:            #F4F6F9;
  --bg-elev:       #FFFFFF;
  --bg-elev-2:     #FBFCFE;
  --border:        #E8ECF0;
  --border-strong: #D7DDE6;
  --text:          #1A1A2E;
  --text-muted:    #5A6173;
  --text-hint:     #8A92A6;

  --accent:        #0E91A8;
  --accent-2:      #6D45F0;
  --accent-3:      #D9772A;
  --link:          #0A6B7D;

  --warn-bg:       rgba(217, 119, 42, 0.10);
  --warn-border:   rgba(217, 119, 42, 0.30);
  --warn-text:     #9A551C;

  --info-bg:       rgba(14, 145, 168, 0.08);
  --info-border:   rgba(14, 145, 168, 0.24);

  --shadow:        0 1px 2px rgba(20,30,55,0.04), 0 10px 30px rgba(20,30,55,0.08);
  --scrim:         rgba(20, 28, 48, 0.42);

  color-scheme: light;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* Soft "breath ripple" glows behind everything — very subtle, on-brand */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(620px 380px at 88% -8%, rgba(167,139,250,0.12), transparent 60%),
    radial-gradient(560px 360px at 6% 2%,  rgba(84,210,227,0.10),  transparent 60%),
    radial-gradient(700px 500px at 50% 120%, rgba(245,160,86,0.07), transparent 60%);
}
[data-theme="light"] body::before {
  background:
    radial-gradient(620px 380px at 88% -8%, rgba(109,69,240,0.10), transparent 60%),
    radial-gradient(560px 360px at 6% 2%,  rgba(14,145,168,0.10), transparent 60%),
    radial-gradient(700px 500px at 50% 120%, rgba(217,119,42,0.06), transparent 60%);
}

img, svg { display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection { background: rgba(84,210,227,0.28); }

/* ── Layout helpers ──────────────────────────────────────────────────────── */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }

.skip-link {
  position: absolute; left: 12px; top: -60px;
  background: var(--bg-elev); color: var(--text);
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--border);
  z-index: 100; transition: top 160ms var(--ease-out);
}
.skip-link:focus { top: 12px; text-decoration: none; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .logo { width: 30px; height: 30px; flex: none; }
.brand .wordmark { font-size: 19px; font-weight: 650; letter-spacing: -0.02em; }

.header-nav { display: flex; align-items: center; gap: 6px; }
.header-nav a.navlink {
  color: var(--text-muted); font-size: 15px; font-weight: 500;
  padding: 8px 12px; border-radius: 10px;
  transition: color 160ms var(--ease-out), background 160ms var(--ease-out);
}
.header-nav a.navlink:hover { color: var(--text); background: var(--bg-elev); text-decoration: none; }
.header-nav a.navlink[aria-current="page"] { color: var(--text); background: var(--bg-elev); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-muted);
  cursor: pointer;
  transition: transform 160ms var(--ease-out), color 160ms var(--ease-out),
              border-color 160ms var(--ease-out);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .moon { display: none; }
[data-theme="light"] .icon-btn .sun { display: none; }
[data-theme="light"] .icon-btn .moon { display: block; }

/* ── Hero (index) ────────────────────────────────────────────────────────── */
.hero { padding: clamp(56px, 11vw, 104px) 0 30px; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--text-muted);
  padding: 7px 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--bg-elev);
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-gradient); }
.hero h1 {
  margin-top: 22px;
  font-size: clamp(34px, 6.5vw, 56px);
  line-height: 1.04; font-weight: 700; letter-spacing: -0.035em;
}
.hero h1 .grad {
  background: var(--brand-gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead {
  margin: 20px auto 0; max-width: 600px;
  font-size: clamp(16px, 2.2vw, 19px); color: var(--text-muted); line-height: 1.6;
}

/* ── Document cards (index) ──────────────────────────────────────────────── */
.doc-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(2, 1fr);
  padding: 34px 0 12px;
}
@media (max-width: 720px) { .doc-grid { grid-template-columns: 1fr; } }

.doc-card {
  position: relative; display: flex; flex-direction: column;
  padding: 26px 24px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  overflow: hidden;
  transition: transform 220ms var(--ease-out), border-color 220ms var(--ease-out);
}
.doc-card::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--brand-gradient); opacity: 0.85;
}
@media (hover: hover) and (pointer: fine) {
  .doc-card:hover { transform: translateY(-3px); border-color: var(--border-strong); text-decoration: none; }
}
.doc-card:active { transform: scale(0.99); }
.doc-card .card-icon {
  width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center; margin-bottom: 16px;
  background: var(--bg-elev-2); border: 1px solid var(--border);
  color: var(--accent);
}
.doc-card .card-icon svg { width: 23px; height: 23px; }
.doc-card h2 { font-size: 21px; font-weight: 650; letter-spacing: -0.02em; }
.doc-card p { margin-top: 8px; color: var(--text-muted); font-size: 15px; line-height: 1.55; }
.doc-card .card-cta {
  margin-top: 18px; display: inline-flex; align-items: center; gap: 7px;
  font-size: 15px; font-weight: 600; color: var(--link);
}
.doc-card .card-cta svg { width: 16px; height: 16px; transition: transform 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .doc-card:hover .card-cta svg { transform: translateX(3px); }
}
.doc-card .updated { margin-top: 14px; font-size: 13px; color: var(--text-hint); }

/* trust strip */
.trust { padding: 14px 0 80px; }
.trust ul {
  list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px;
  justify-content: center;
}
.trust li {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--text-muted);
}
.trust li svg { width: 16px; height: 16px; color: var(--accent); flex: none; }

/* ── Document page layout ────────────────────────────────────────────────── */
.doc-shell { padding: 40px 0 90px; }
.doc-head { max-width: var(--prose); }
.doc-head .kicker {
  font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent);
}
.doc-head h1 {
  margin-top: 10px; font-size: clamp(30px, 5vw, 42px);
  font-weight: 700; letter-spacing: -0.03em; line-height: 1.1;
}
.doc-head .meta { margin-top: 14px; color: var(--text-hint); font-size: 14px; }

.doc-layout {
  display: grid; gap: 48px;
  grid-template-columns: 240px minmax(0, 1fr);
  margin-top: 36px; align-items: start;
}
@media (max-width: 940px) { .doc-layout { grid-template-columns: 1fr; gap: 8px; } }

/* TOC — sticky sidebar on desktop, collapsible <details> on mobile */
.toc { position: sticky; top: calc(var(--header-h) + 22px); }
.toc summary {
  list-style: none; cursor: default;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-hint); padding: 0 12px 10px;
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary .chev { display: none; width: 18px; height: 18px; }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc a {
  display: block; position: relative;
  padding: 7px 12px; border-radius: 9px;
  font-size: 14px; line-height: 1.4; color: var(--text-muted);
  border-left: 2px solid transparent;
  transition: color 160ms var(--ease-out), background 160ms var(--ease-out);
}
.toc a:hover { color: var(--text); background: var(--bg-elev); text-decoration: none; }
.toc a.active { color: var(--text); border-left-color: var(--accent); background: var(--bg-elev); }

/* Desktop: body always visible regardless of <details> open state */
@media (min-width: 941px) {
  .toc > .toc-body { display: block !important; }
}

/* Mobile: summary becomes a real toggle */
@media (max-width: 940px) {
  .toc {
    position: static;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-elev); padding: 8px; margin-bottom: 26px;
  }
  .toc summary {
    cursor: pointer; padding: 8px 10px; border-radius: 9px;
    font-size: 14px; font-weight: 600; letter-spacing: normal; text-transform: none;
    color: var(--text);
  }
  .toc[open] summary { margin-bottom: 4px; }
  .toc summary .chev { display: block; color: var(--text-muted); transition: transform 200ms var(--ease-out); }
  .toc[open] summary .chev { transform: rotate(180deg); }
}

/* ── Prose ───────────────────────────────────────────────────────────────── */
.prose { max-width: var(--prose); }
.prose section { scroll-margin-top: calc(var(--header-h) + 18px); }
.prose section + section { margin-top: 40px; }
.prose h2 {
  font-size: 22px; font-weight: 660; letter-spacing: -0.02em; line-height: 1.25;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
  display: flex; align-items: baseline; gap: 11px;
}
.prose h2 .num {
  font-size: 14px; font-weight: 600; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.prose h3 { margin-top: 24px; font-size: 17px; font-weight: 640; letter-spacing: -0.01em; }
.prose p { margin-top: 14px; color: var(--text); }
.prose p.muted { color: var(--text-muted); }
.prose ul, .prose ol { margin-top: 14px; padding-left: 22px; }
.prose li { margin-top: 7px; }
.prose li::marker { color: var(--text-hint); }
.prose strong { font-weight: 640; }
.prose a { font-weight: 500; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0; }

/* definition-style data list for "what we collect" */
.datalist { margin-top: 16px; display: grid; gap: 12px; }
.datalist .row {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev); padding: 16px 18px;
}
.datalist .row h4 { font-size: 15px; font-weight: 640; display: flex; align-items: center; gap: 9px; }
.datalist .row h4 svg { width: 17px; height: 17px; color: var(--accent); flex: none; }
.datalist .row p { margin-top: 6px; font-size: 14.5px; color: var(--text-muted); }
.datalist .row.sensitive { border-color: var(--warn-border); background: var(--warn-bg); }
.datalist .row.sensitive h4 svg { color: var(--warn-text); }

/* callouts */
.callout {
  margin-top: 20px; padding: 16px 18px;
  border: 1px solid var(--info-border); background: var(--info-bg);
  border-radius: var(--radius-sm);
  display: flex; gap: 12px; align-items: flex-start;
}
.callout svg { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--accent); }
.callout .callout-body { font-size: 14.5px; line-height: 1.55; }
.callout .callout-body strong { display: block; margin-bottom: 3px; }
.callout.warn { border-color: var(--warn-border); background: var(--warn-bg); }
.callout.warn svg { color: var(--warn-text); }

/* placeholder token — items the owner must fill before publishing */
.ph {
  background: var(--warn-bg);
  color: var(--warn-text);
  border: 1px dashed var(--warn-border);
  border-radius: 6px;
  padding: 0 6px;
  font-size: 0.92em; font-weight: 600;
  white-space: nowrap;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 34px 0 44px;
  color: var(--text-muted);
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; justify-content: space-between; }
.site-footer .foot-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 600; }
.site-footer .foot-brand .logo { width: 22px; height: 22px; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer nav a { color: var(--text-muted); font-size: 14px; }
.site-footer nav a:hover { color: var(--text); }
.site-footer .copy { font-size: 13px; color: var(--text-hint); width: 100%; }

/* ── Entrance motion (progressive enhancement) ───────────────────────────── */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 520ms var(--ease-out), transform 520ms var(--ease-out); }
[data-stagger="1"].in { transition-delay: 40ms; }
[data-stagger="2"].in { transition-delay: 90ms; }
[data-stagger="3"].in { transition-delay: 140ms; }
[data-stagger="4"].in { transition-delay: 190ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.in { opacity: 1; transform: none; transition: none; }
  .doc-card, .icon-btn, .header-nav a, .toc a { transition: none !important; }
}
