/* Flowleaks - inbox-forensics landing. Zero external requests: system font stacks only.
   Single accent (leak red-orange) used ONLY for leak states and the CTA. */

/* ---- Tokens: light (paper) ---- */
:root {
  color-scheme: light dark;

  --paper:    #faf7f2;   /* body */
  --paper-2:  #f4eee4;   /* specimen / raised surfaces */
  --ink:      #201b16;   /* headings + body */
  --ink-2:    #52493f;   /* muted / secondary (AA verified) */
  --rule:     #d8cfc0;   /* hairlines */
  --rule-2:   #c9bda9;   /* stronger rule (leaders, stamp) */
  --accent:   #ad3715;   /* LEAK + CTA only (darkened from #c8401a family to clear AA on tinted leak rows) */
  --accent-ink: #faf7f2; /* text on accent */
  --accent-wash: rgba(173, 55, 21, 0.07); /* faint leak-row tint */

  --shadow: 0 1px 1px rgba(32,27,22,.08), 0 18px 42px -24px rgba(32,27,22,.4);

  /* fluid type */
  --step--1: clamp(0.82rem, 0.79rem + 0.14vw, 0.9rem);
  --step-0:  clamp(1rem, 0.98rem + 0.12vw, 1.0625rem);
  --step-1:  clamp(1.125rem, 1.06rem + 0.3vw, 1.25rem);
  --step-2:  clamp(1.6rem, 1.42rem + 0.8vw, 2.15rem);
  --step-3:  clamp(2.35rem, 1.78rem + 2.45vw, 3.75rem);

  --serif: ui-serif, 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --mono:  ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;
  --sans:  system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --measure: 64ch;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

/* ---- Tokens: dark (deep ink paper) ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --paper:    #171410;
    --paper-2:  #211d18;
    --ink:      #f2ece3;
    --ink-2:    #bfb4a5;
    --rule:     #3a332b;
    --rule-2:   #5b5145;
    --accent:   #ff7a4d;   /* lighter for AA on dark */
    --accent-ink: #16120d; /* dark text on accent button */
    --accent-wash: rgba(255, 122, 77, 0.10);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 14px 34px -14px rgba(0,0,0,.7);
  }
}

/* ---- Reset-ish ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.08; margin: 0; text-wrap: balance; letter-spacing: -0.018em; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }

:where(a, button) {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(173, 55, 21, 0.18);
}

.skip-link {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 10;
  padding: 0.7rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-120%);
  transition: transform .16s cubic-bezier(.2,.7,.3,1);
}
.skip-link:focus { transform: translateY(0); }

:where(a, .btn):focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---- Layout shell ---- */
.wrap { max-width: 72rem; margin-inline: auto; padding-inline: var(--gutter); }

.masthead {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: var(--step--1);
}
.masthead .mark { font-weight: 700; letter-spacing: 0.14em; }
.masthead .meta { color: var(--ink-2); letter-spacing: 0.02em; }

section { padding-block: clamp(3.5rem, 7vw, 6rem); }
section + section { border-top: 1px solid var(--rule); }

/* ---- Hero ---- */
.hero { display: grid; gap: clamp(2.5rem, 5vw, 4.75rem); align-items: start; }
@media (min-width: 62rem) {
  .hero { grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); padding-top: clamp(4.5rem, 7vw, 6rem); }
  .hero-copy { max-width: 38rem; }
  .specimen { margin-top: 1.25rem; }
}
.eyebrow {
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  color: var(--ink-2);
  margin: 0 0 1.15rem;
}
.hero h1 { font-size: var(--step-3); line-height: 1.01; max-width: 16ch; margin-bottom: 1.5rem; }
.hero .lede { font-size: var(--step-1); color: var(--ink-2); max-width: 37ch; margin-bottom: 2rem; line-height: 1.58; }
.hero .lede strong { color: var(--ink); font-weight: 600; }

/* ---- CTA ---- */
.cta-group { display: flex; flex-direction: column; gap: 0.55rem; align-items: flex-start; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px;
  padding: 0.85rem 1.6rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 3px;
  box-shadow: var(--shadow);
  transition: transform .18s cubic-bezier(.2,.7,.3,1), filter .18s ease;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.cta-note { font-family: var(--mono); font-size: var(--step--1); color: var(--ink-2); margin: 0; }
.cta-fallback { font-size: var(--step--1); color: var(--ink-2); margin: 0.45rem 0 0; max-width: 48ch; line-height: 1.5; }

/* ---- Specimen card (signature) ---- */
.specimen {
  position: relative;
  margin: 0;
  background: var(--paper-2);
  border: 1px solid var(--rule-2);
  border-radius: 1px;
  box-shadow: var(--shadow);
  padding: clamp(1.2rem, 2.6vw, 1.65rem);
  /* scalloped bottom edge = torn receipt stub */
  -webkit-mask:
    linear-gradient(#000 0 0) top / 100% calc(100% - 9px) no-repeat,
    radial-gradient(circle 9px at 9px 100%, #0000 9px, #000 9.5px) bottom left / 18px 18px repeat-x;
  mask:
    linear-gradient(#000 0 0) top / 100% calc(100% - 9px) no-repeat,
    radial-gradient(circle 9px at 9px 100%, #0000 9px, #000 9.5px) bottom left / 18px 18px repeat-x;
  padding-bottom: calc(clamp(1.2rem, 2.6vw, 1.65rem) + 12px);
}
.specimen figcaption {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--ink-2);
  letter-spacing: 0.02em;
  padding-bottom: 0.9rem;
  padding-right: 7rem; /* reserved lane for the SAMPLE stamp so it never overlaps row text */
  margin-bottom: 1rem;
  border-bottom: 1px dashed var(--rule-2);
  min-height: 2.2rem;
}

.evidence { list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: clamp(0.78rem, 0.72rem + 0.3vw, 0.92rem); font-variant-numeric: tabular-nums; }
.ev-row {
  display: flex; align-items: baseline; gap: 0.5rem;
  padding: 0.58rem 0.5rem;
}
.ev-row + .ev-row { border-top: 1px solid var(--rule); }
.ev-row.leak { background: var(--accent-wash); }
.ev-name { color: var(--ink); white-space: nowrap; }
.ev-lead { flex: 1 1 auto; align-self: center; border-bottom: 1px dotted var(--rule-2); min-width: 1.2rem; height: 0; margin: 0 0.15rem; }
.ev-out { display: inline-flex; align-items: baseline; gap: 0.5rem; } /* result + status wrap as one unit */
.ev-result { color: var(--ink-2); white-space: nowrap; }
.ev-status { white-space: nowrap; font-weight: 600; }
.ev-status.ok   { color: var(--ink-2); }
.ev-status.leak { color: var(--accent); }

/* Narrow screens: never clip evidence text - the outcome wraps onto its own
   right-aligned line under the flow name, leader fills line one. */
@media (max-width: 30rem) {
  .evidence { font-size: 0.75rem; }
  .ev-row { flex-wrap: wrap; row-gap: 0.1rem; }
  .ev-out { margin-left: auto; }
}

.specimen-foot { font-family: var(--mono); font-size: var(--step--1); color: var(--ink-2); margin-top: 1rem; padding-top: 0.9rem; border-top: 1px dashed var(--rule-2); }

/* SAMPLE stamp - must read as illustration, never real client data.
   Lives in the card header zone (figcaption reserves a right-hand lane),
   so it never sits on top of evidence-row text. */
.stamp {
  position: absolute;
  top: clamp(0.8rem, 2.2vw, 1.1rem); right: clamp(0.9rem, 3vw, 1.5rem);
  transform: rotate(-8deg);
  font-family: var(--mono); font-weight: 700;
  font-size: clamp(0.72rem, 0.62rem + 0.4vw, 0.9rem);
  letter-spacing: 0.26em; text-indent: 0.26em;
  color: var(--ink-2);
  border: 2px solid var(--ink-2);
  border-radius: 2px;
  padding: 0.22rem 0.5rem;
  opacity: 0.72;
  pointer-events: none;
}

/* ---- How it works (a real ordered sequence -> numbers earn their place) ---- */
.section-head { font-size: var(--step-2); margin-bottom: 2.75rem; max-width: 20ch; }
.steps { list-style: none; display: grid; gap: 2.25rem; margin: 0; padding: 0; }
@media (min-width: 48rem) { .steps { grid-template-columns: repeat(3, 1fr); gap: clamp(2rem, 4vw, 3.5rem); } }
.step { display: grid; gap: 0.6rem; }
.step .num {
  font-family: var(--mono); font-size: var(--step--1); font-weight: 700;
  color: var(--ink-2); letter-spacing: 0.05em;
  padding-bottom: 0.6rem; border-bottom: 1px solid var(--rule);
}
.step h3 { font-size: var(--step-1); }
.step p { color: var(--ink-2); line-height: 1.62; }

/* ---- Prose sections (diff, catch, who) ---- */
.prose { max-width: var(--measure); }
.prose h2 { font-size: var(--step-2); margin-bottom: 1.35rem; max-width: 24ch; }
.prose p { font-size: var(--step-1); color: var(--ink-2); line-height: 1.62; }
.prose p strong, .prose .lead { color: var(--ink); }

.prose .offer-lede {
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.4;
}
.prose .offer-line {
  max-width: 58rem;
  margin-top: 1.15rem;
  padding: 0.9rem 0;
  border-block: 1px solid var(--rule-2);
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--step-0);
  font-weight: 700;
  line-height: 1.55;
}
.prose .offer-note {
  max-width: 58ch;
  margin-top: 1rem;
  font-size: var(--step-0);
}

.fixes-title { font-family: var(--mono); font-size: var(--step--1); letter-spacing: 0.04em; color: var(--ink-2); margin: 2rem 0 0.5rem; }
.fixes-intro { font-size: var(--step-0); color: var(--ink-2); margin: 0 0 1rem; max-width: 52ch; }
.fixes-note { font-size: var(--step--1); color: var(--ink-2); margin: 1.1rem 0 0; max-width: 60ch; line-height: 1.55; }
.fixes { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; max-width: 46rem; }
.fixes li {
  font-family: var(--mono); font-size: var(--step--1); color: var(--ink);
  padding: 0.7rem 0.2rem; padding-left: 1.4rem; position: relative;
  border-top: 1px solid var(--rule);
}
.fixes li:last-child { border-bottom: 1px solid var(--rule); }
.fixes li::before { content: "+"; position: absolute; left: 0.2rem; color: var(--ink-2); }

@media (min-width: 44rem) {
  .fixes { grid-template-columns: 1fr 1fr; }
  .fixes li:nth-child(even) { border-left: 1px solid var(--rule); padding-left: 2rem; }
  .fixes li:nth-child(even)::before { left: 0.8rem; }
  .fixes li:nth-last-child(2) { border-bottom: 1px solid var(--rule); }
}

.who-cta { margin-top: 2rem; }

/* ---- Footer ---- */
.site-foot { border-top: 1px solid var(--rule); padding-block: 2.5rem 3rem; font-family: var(--mono); font-size: var(--step--1); color: var(--ink-2); }
.site-foot .addr { font-style: normal; }
.site-foot a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-underline-offset: 3px; }
.site-foot .row { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; align-items: baseline; }
.site-foot .sep { color: var(--rule-2); }
.site-foot .privacy-note { margin-top: 0.9rem; }

/* ---- Privacy document page ---- */
.doc { max-width: 46rem; padding-block: clamp(2.5rem, 6vw, 4rem); }
.doc h1 { font-size: var(--step-2); margin-bottom: 0.5rem; }
.doc .doc-sub { font-family: var(--mono); font-size: var(--step--1); color: var(--ink-2); margin-bottom: 2.5rem; }
.doc h2 { font-size: var(--step-1); margin: 2.5rem 0 0.75rem; }
.doc p, .doc li { color: var(--ink-2); }
.doc .controller-address { color: var(--ink); }
.doc p + p { margin-top: 0.9rem; }
.doc ul { margin: 0.75rem 0 0; padding-left: 1.2rem; }
.doc li { margin-bottom: 0.4rem; }
.doc a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.doc .updated { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: var(--step--1); }
.doc .back { display: inline-flex; align-items: center; min-height: 44px; margin-top: 1rem; font-family: var(--mono); font-size: var(--step--1); color: var(--ink); }

@media (max-width: 30rem) {
  .masthead { align-items: flex-start; }
  .masthead .meta { max-width: 18ch; text-align: right; line-height: 1.35; }
  section { padding-block: 3rem; }
  .hero { gap: 2.75rem; }
  .hero h1 { font-size: clamp(2.25rem, 10vw, 2.65rem); }
  .btn { width: 100%; padding-inline: 1rem; }
  .cta-group { width: 100%; }
}

/* ---- Motion off ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
