/* Compoundrix — the site's one stylesheet.
 *
 * The colours are the apps' own, from CompoundrixCore/Layout/Swatches.swift
 * (the light and the dark step of each pair), so a screenshot sits on the
 * page the way the app sits on the desk. Nothing here is fetched from a
 * third party: the display face is self-hosted, the body face is the
 * system's (SF Pro on a Mac or an iPhone).
 */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100%;
  font-display: swap;
  src: url("fonts/bricolage-grotesque-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100%;
  font-display: swap;
  src: url("fonts/bricolage-grotesque-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens: Swatches.swift, light step ---------- */
:root {
  color-scheme: light dark;

  --ground: #F7F5F1;
  --surface: #FFFEFC;
  --raised: #F0EDE7;
  --line: #E4DFD6;
  --text: #1B1917;
  --dim: #6E6862;
  --faint: #A39C93;
  --accent: #9A5B24;
  --on-accent: #FFFEFC;
  --credit: #2F6B4F;
  --debit: #9A3B32;

  /* The decomposition's four bands (SPEC §7). */
  --from-work: #4F7A2A;
  --from-passive: #3D6E86;
  --brought-in: #6B5E93;
  --from-market: #A9790A;

  /* The categorical ramp, slots 1–6. */
  --s1: #2A78D6;
  --s2: #EB6834;
  --s3: #1BAF7A;
  --s4: #EDA100;
  --s5: #E87BA4;
  --s6: #008300;

  /* The icon's gradient: dark accent to dark gold, in both schemes. */
  --mark-from: #D79552;
  --mark-to: #F0C24E;

  --glow: rgb(169 121 10 / 0.10);
  --shadow-1: 0 1px 2px rgb(27 25 23 / 0.06);
  --shadow-2: 0 12px 32px -8px rgb(27 25 23 / 0.18), 0 32px 80px -24px rgb(27 25 23 / 0.22);

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --measure: 64ch;
  --page: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 20px;
}

/* ---------- Tokens: Swatches.swift, dark step ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #141312;
    --surface: #201E1B;
    --raised: #252320;
    --line: #302D29;
    --text: #EBE7DF;
    --dim: #9B948A;
    --faint: #6A645C;
    --accent: #D79552;
    --on-accent: #1B1917;
    --credit: #6FB58C;
    --debit: #E0857A;

    --from-work: #9CC96A;
    --from-passive: #77B2CC;
    --brought-in: #A79AD1;
    --from-market: #F0C24E;

    --s1: #3987E5;
    --s2: #D95926;
    --s3: #199E70;
    --s4: #C98500;
    --s5: #D55181;
    --s6: #008300;

    --glow: rgb(240 194 78 / 0.08);
    --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-2: 0 12px 32px -8px rgb(0 0 0 / 0.55), 0 32px 80px -24px rgb(0 0 0 / 0.6);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 7vw, 5.2rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.01em; line-height: 1.25; }

p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

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

::selection { background: color-mix(in srgb, var(--from-market) 30%, transparent); }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

/* A token the owner still has to fill: dashed, impossible to miss. */
.tbd {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
  letter-spacing: 0;
  padding: 0.05em 0.35em;
  border: 1px dashed var(--debit);
  border-radius: 4px;
  color: var(--debit);
  white-space: nowrap;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--ground) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.brand img { width: 30px; height: 30px; }
.nav { display: flex; gap: clamp(12px, 3vw, 28px); font-size: 0.95rem; }
.nav a { color: var(--dim); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
@media (max-width: 560px) {
  .nav .nav-wide { display: none; }
}

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 120ms ease, background-color 120ms ease;
}
.button:hover { transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { .button:hover { transform: none; } }
.button-primary { background: var(--text); color: var(--ground); }
.button-quiet { border-color: var(--line); color: var(--text); background: var(--surface); }
.button[aria-disabled="true"] { cursor: default; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow-x: clip;
  padding-block: clamp(56px, 10vw, 120px) clamp(40px, 6vw, 72px);
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% 0 auto;
  height: 90%;
  z-index: -1;
  background: radial-gradient(60% 60% at 70% 30%, var(--glow), transparent 70%);
  pointer-events: none;
}
.hero-icon { width: 88px; height: 88px; margin-bottom: 28px; filter: drop-shadow(0 8px 20px rgb(0 0 0 / 0.18)); }
.eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 16px;
}
.hero h1 .quiet { color: var(--dim); display: block; }
.hero .lede {
  max-width: 40rem;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--dim);
  margin: 28px 0 32px;
}
.hero .lede strong { color: var(--text); font-weight: 600; }
.hero-meta { margin-top: 18px; font-size: 0.9rem; color: var(--dim); }

.hero-shots {
  position: relative;
  margin-top: clamp(48px, 7vw, 88px);
  padding-right: clamp(40px, 10vw, 140px);
}
.hero-shots .shot-phone {
  position: absolute;
  right: 0;
  bottom: -8%;
  width: clamp(110px, 21%, 240px);
}

/* ---------- Device frames: corners and shadow, no fake bezels ---------- */
.shot {
  margin: 0;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line), var(--shadow-2);
}
.shot img { width: 100%; height: auto; }
.shot-mac { border-radius: clamp(8px, 1.1vw, 14px); }
.shot-phone { border-radius: 13% / 6%; }

/* ---------- Sections ---------- */
main section { scroll-margin-top: 72px; }
.section { padding-block: clamp(72px, 11vw, 140px); }
.section + .section { border-top: 1px solid var(--line); }
.section-head { max-width: 46rem; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head p, .feature-text p { color: var(--dim); font-size: 1.08rem; }
.section-head h2 { margin-bottom: 18px; }
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 14px;
}
.kicker::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, var(--mark-from), var(--mark-to));
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.feature.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.feature.flip .feature-text { order: 2; }
.feature-text h2 { margin-bottom: 18px; }
@media (max-width: 860px) {
  .feature, .feature.flip { grid-template-columns: 1fr; }
  .feature.flip .feature-text { order: 0; }
}

.points {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 12px;
}
.points li {
  position: relative;
  padding-left: 22px;
  color: var(--text);
}
.points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--from-market);
}
.points li span { color: var(--dim); }

/* Provenance: the four bands, as the app colours them. Illustrative only. */
.bands { margin-top: 28px; }
.bands-bar {
  display: flex;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  gap: 2px;
}
.bands-bar i { display: block; }
.bands-bar .c-work { flex: 46; }
.bands-bar .c-passive { flex: 12; }
.bands-bar .c-brought { flex: 9; }
.bands-bar .c-market { flex: 33; }
.bands-legend {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 0.92rem;
  color: var(--dim);
}
.bands-legend li { display: inline-flex; align-items: center; gap: 8px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.c-work { background: var(--from-work); }
.c-passive { background: var(--from-passive); }
.c-brought { background: var(--brought-in); }
.c-market { background: var(--from-market); }
.c-s1 { background: var(--s1); }
.c-s2 { background: var(--s2); }

/* Portfolio: a ring drawn in the categorical ramp. Illustrative only. */
.ring-row { display: flex; align-items: center; gap: 20px; margin-top: 28px; }
.ring {
  width: 76px;
  height: 76px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--s1) 0 34%, var(--s2) 0 55%, var(--s3) 0 70%, var(--s4) 0 82%, var(--s5) 0 92%, var(--s6) 0 100%);
  -webkit-mask: radial-gradient(circle, transparent 54%, #000 55%);
  mask: radial-gradient(circle, transparent 54%, #000 55%);
}
.ring-row p { color: var(--dim); font-size: 0.95rem; margin: 0; }

/* Metrics grid on the FI section. */
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  overflow: hidden;
}
@media (max-width: 900px) { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .metrics { grid-template-columns: 1fr; } }
.metric { background: var(--surface); padding: 26px 24px; }
.metric h3 { font-size: 1.08rem; margin-bottom: 8px; }
.metric p { color: var(--dim); font-size: 0.96rem; margin: 0; }
.metric-mark {
  width: 28px;
  height: 3px;
  border-radius: 2px;
  margin-bottom: 18px;
}

/* Checkpoint illustration: a statement line turning into a row. */
.rows {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  font-size: 0.92rem;
  overflow: hidden;
}
.rows div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 10px 16px;
}
.rows div + div { border-top: 1px solid var(--line); }
.rows .dim { color: var(--dim); }
.rows .derived { background: color-mix(in srgb, var(--from-market) 9%, var(--surface)); }
.rows .amt-in { color: var(--credit); }

/* Phones in a row. */
.phones {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 40px);
  max-width: 900px;
  margin-inline: auto;
}
.phones figure { margin: 0; }
.phones figcaption { margin-top: 18px; text-align: center; font-size: 0.95rem; color: var(--dim); }
.phones figcaption strong { display: block; color: var(--text); font-weight: 600; }
@media (max-width: 640px) {
  .phones { grid-template-columns: 1fr; max-width: 280px; }
}

/* Your data. */
.trust {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(20px, 3vw, 32px);
}
.trust div { border-top: 2px solid var(--text); padding-top: 18px; }
.trust h3 { margin-bottom: 8px; }
.trust p { color: var(--dim); font-size: 0.98rem; }

/* ---------- Pricing ---------- */
.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: 900px;
}
.plan {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: clamp(24px, 4vw, 36px);
  box-shadow: var(--shadow-1);
}
.plan-pro {
  border-color: color-mix(in srgb, var(--from-market) 55%, var(--line));
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, var(--mark-from), var(--mark-to)) border-box;
  border: 1.5px solid transparent;
}
.plan h3 { font-size: 1.35rem; }
.price-or { font-size: 0.6em; font-weight: 400; color: var(--dim); margin: 0 0.25em; }
.price {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 12px 0 4px;
}
.price-note { color: var(--dim); font-size: 0.92rem; margin-bottom: 20px; }
.plan .points { margin-top: 0; }
.fineprint { margin-top: 24px; color: var(--dim); font-size: 0.92rem; max-width: 46rem; }

/* ---------- Prose pages: privacy, support, terms ---------- */
.doc { padding-block: clamp(48px, 8vw, 96px) clamp(72px, 10vw, 120px); }
.doc-head { max-width: var(--measure); margin-bottom: 40px; }
.doc-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 16px; }
.doc-head p { color: var(--dim); }
.prose { max-width: var(--measure); }
.prose h2 { font-size: 1.55rem; margin: 2.4em 0 0.6em; scroll-margin-top: 80px; }
.prose h3 { font-size: 1.12rem; margin: 1.8em 0 0.5em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4em; }
.prose code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.88em;
  background: var(--raised);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 600; }
.table-scroll { overflow-x: auto; }
.callout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--from-market);
  border-radius: var(--radius-s);
  padding: 16px 20px;
  margin: 0 0 1.4em;
}
.toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 18px 22px;
  margin-bottom: 8px;
  font-size: 0.95rem;
}
.toc strong { display: block; margin-bottom: 6px; }
.toc ol { margin: 0; padding-left: 1.2em; columns: 2 16rem; column-gap: 32px; }

details {
  border-bottom: 1px solid var(--line);
  padding: 4px 0;
}
details:first-of-type { border-top: 1px solid var(--line); }
summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 32px 14px 0;
  font-weight: 600;
  position: relative;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 10px;
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--dim);
}
details[open] summary::after { content: "–"; }
details > div { padding: 0 0 18px; color: var(--text); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 40px 48px;
  font-size: 0.92rem;
  color: var(--dim);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  justify-content: space-between;
  align-items: center;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { color: var(--dim); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer .brand { font-size: 1rem; }
.site-footer .brand img { width: 22px; height: 22px; }
