/* =========================================================================
   SamePage — legal pages (privacy.html, terms.html)

   The landing page keeps all of its CSS inline because it is one file and one
   page. The two legal pages share a stylesheet instead, so there is one place
   to change when a token moves.

   Everything from "tokens" down to the Button block is copied verbatim from
   index.html, which in turn copies it from the design system export. If a
   token changes there, change it here. Do not invent new colour, radius or
   spacing values in this file.
   ========================================================================= */

/* ---- tokens/colors.css ------------------------------------------------ */
:root {
  /* Brand duo, from the current logo/app-icon files: Coffee and Foam. */
  --brand-ink:   #251F19;
  --brand-paper: #FEFCF8;

  /* Foam is the one base surface across the whole site: same value under all
     four names below. Bands are told apart by a hairline border, not by a
     shift in surface colour. */
  --paper-canvas: #FEFCF8;
  --paper-page:   #FEFCF8;
  --paper-raised: #FEFCF8;
  --paper-sunken: #FEFCF8;

  --ink:         #251F19;
  --ink-inverse: #FEFCF8;

  /* Two reds, no third hue. Accent is the app's primary — timers, dots,
     active states — so it leads here too; Accent Light is its brighter,
     secondary partner, used on hover. */
  --accent:       #730217;
  --accent-press: #AF0523;

  /* Ink alphas. Use these, never new rgba() literals. */
  --ink-a10: rgba(37, 31, 25, 0.10);
  --ink-a12: rgba(37, 31, 25, 0.12);
  --ink-a14: rgba(37, 31, 25, 0.14);
  --ink-a22: rgba(37, 31, 25, 0.22);
  --ink-a35: rgba(37, 31, 25, 0.35);
  --ink-a45: rgba(37, 31, 25, 0.45);
  --ink-a60: rgba(37, 31, 25, 0.60);
  --ink-a75: rgba(37, 31, 25, 0.75);

  --on-ink-a18: rgba(254, 252, 248, 0.18);
  --on-ink-a38: rgba(254, 252, 248, 0.38);
  --on-ink-a45: rgba(254, 252, 248, 0.45);
  --on-ink-a62: rgba(254, 252, 248, 0.62);

  --border-hairline: var(--ink-a10);
  --border-rule:     var(--ink-a12);
  --border-control:  var(--ink-a22);
  --border-selected: var(--ink);
}

/* ---- Small-text contrast boost ---------------------------------------
   The design system's a45 / a60 alphas fail WCAG AA at the 10-14px sizes this
   page uses them at (a45 mono 10px measures ~2.6:1, a60 body 14px ~3.8:1).
   These aliases raise small text one documented step, which is still inside
   the token set. Comment this block out to render at literal spec values.
   -------------------------------------------------------------------- */
:root {
  --label-quiet:  var(--ink-a75);      /* was --ink-a45, mono eyebrows + metadata */
  --prose-quiet:  var(--ink-a75);      /* was --ink-a60, 14px supporting prose    */
  --on-ink-label: var(--on-ink-a62);   /* was --on-ink-a45, labels on ink         */
}

/* ---- tokens/typography.css -------------------------------------------- */
:root {
  /* Three voices. Newsreader for anything read slowly, system UI for anything
     operated, mono for anything labelled. Never a fourth. */
  --font-read:  "Newsreader", Georgia, "Times New Roman", serif;
  --font-ui:    system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-label: ui-monospace, Menlo, "SF Mono", "Cascadia Mono", monospace;

  --title-lg: 400 24px/1.10 var(--font-read);
  --title-sm: 500 16.5px/1.35 var(--font-read);
  --title-xs: 500 15px/1.20 var(--font-read);

  --quote-sm: italic 400 13.5px/1.50 var(--font-read);

  --action-lg: 600 15px var(--font-ui);
  --action-md: 600 14px var(--font-ui);
  --action-xs: 600 11.5px var(--font-ui);

  --label-md: 600 10px var(--font-label);
  --label-sm: 600 9.5px var(--font-label);
  --label-xs: 600 8.5px var(--font-label);
  --label-tracking: 0.14em;
  --label-tracking-tight: 0.10em;

  --metric-md: 500 12px var(--font-label);
  --metric-sm: 400 11px var(--font-label);
}

/* ---- tokens/spacing.css ----------------------------------------------- */
:root {
  /* Not a strict 4-grid. Measured values from the app screens; the odd
     numbers are intentional. */
  --s-3: 5px;  --s-4: 7px;  --s-5: 9px;  --s-7: 13px;
  --s-8: 16px; --s-9: 22px; --s-10: 26px; --s-11: 32px;

  --pad-card-sm:   14px 15px;
  --pad-screen:    24px;
  --indent-answer: 31px;   /* answers align past the checkbox, not under it */

  --shell:  1120px;
  --gutter: 40px;
}

/* ---- tokens/shape.css -------------------------------------------------- */
:root {
  --r-device: 44px;
  --r-pill: 26px;
  --r-pill-sm: 18px;
  --r-card: 16px;
  --r-card-sm: 14px;
  --r-bar: 3px;
  --r-circle: 50%;

  /* Shadows are warm-ink, never neutral grey, and never coloured. */
  --shadow-card:   0 3px 12px rgba(37, 31, 25, 0.09);
  --shadow-device: 0 18px 40px rgba(37, 31, 25, 0.22);
  --bezel-device:  0 0 0 10px var(--ink);

  /* Motion: paper doesn't bounce. */
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-fast: 140ms;
  --dur-base: 240ms;
  --dur-screen: 380ms;
}

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

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

body {
  margin: 0;
  background: var(--paper-canvas);
  color: var(--ink);
  font: 400 16px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--ink-a22);
}
a:hover { color: var(--accent-press); border-bottom-color: var(--accent-press); }

/* Focus rings are absent on the in-app ruled input by design, but a marketing
   page is keyboard-navigated. Ink outline, never a glow. */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}
.on-ink :focus-visible { outline-color: var(--ink-inverse); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--ink-inverse);
  font: var(--action-md);
  padding: 12px 20px;
  border: 0;
  z-index: 10;
}
.skip-link:focus { left: 12px; top: 12px; }

/* =========================================================================
   Design-system components
   ========================================================================= */

/* ---- Mark / Logo ------------------------------------------------------ */
/* Two overlapping rings: solid disc left, outline ring right, each knocking a
   gap out of the other. The gap is a knockout of the surface BEHIND the mark,
   so every instance sets --mark-gap to that surface's exact colour, or the
   seam reads as a stripe. Flat, single colour: --mark-a/--mark-b are unset
   here so both shapes fall back to `color`, never red. */
.mark {
  display: block;
  flex: none;
  height: var(--mark-h, 32px);
  width: calc(var(--mark-h, 32px) * 1.359);
  color: var(--brand-ink);
}
.mark--paper { color: var(--brand-paper); }

.logo { display: flex; align-items: center; gap: 12px; }
.logo__word {
  font: 400 31px/0.98 var(--font-read);
  letter-spacing: -0.014em;
  color: var(--brand-ink);
  white-space: nowrap;
}

/* ---- Button ----------------------------------------------------------- */
/* Buttons are always pills, never rounded rectangles. Press is opacity, not
   scale or colour: paper does not compress. */
.btn {
  display: inline-block;
  text-align: center;
  cursor: pointer;
  font: var(--action-md);
  padding: 13px 22px;
  border-radius: var(--r-pill);
  transition: opacity var(--dur-fast) var(--ease);
}
.btn:hover  { opacity: 0.8; }
.btn:active { opacity: 0.65; }

.btn--lg { font: var(--action-lg); padding: 15px 22px; }
.btn--sm { font: var(--action-xs); padding: 6px 13px; border-radius: var(--r-pill-sm); }

.btn--ink     { background: var(--ink);        color: var(--ink-inverse); border: 1.5px solid var(--ink); }
.btn--paper   { background: var(--paper-page); color: var(--ink);         border: 1.5px solid var(--paper-page); }
.btn--outline { background: transparent;       color: var(--ink);         border: 1.5px solid var(--ink); }
.btn--block   { display: block; width: 100%; }

/* =========================================================================
   Page chrome — copied from index.html so the header and footer match
   ========================================================================= */
.shell { width: 100%; max-width: var(--shell); margin: 0 auto; }

.site-head { width: 100%; padding: 26px var(--gutter); }
.site-head__inner { display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.site-head__nav { display: flex; align-items: center; gap: 26px; }
.site-head__link {
  font: 500 14px var(--font-ui);
  color: var(--ink-a75);
  white-space: nowrap;
  border-bottom-color: var(--ink-a12);
}
.site-head__link:hover { color: var(--ink); }

.site-foot { width: 100%; background: var(--ink); padding: 0 var(--gutter) 44px; margin-top: 96px; }
.site-foot__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding-top: 26px;
  border-top: 1px solid var(--on-ink-a18);
}
.site-foot__text {
  font: var(--label-sm);
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  color: var(--on-ink-label);
}
.site-foot a { color: inherit; border-bottom-color: var(--on-ink-a18); }
.site-foot a:hover { color: var(--ink-inverse); border-bottom-color: var(--ink-inverse); }

.eyebrow {
  display: block;
  font: var(--label-md);
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  color: var(--label-quiet);
}

/* =========================================================================
   The document itself

   A legal page is prose, not a composition. One measured column, serif for
   reading, the same paper underneath. Nothing here animates.
   ========================================================================= */
.doc {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 8px var(--gutter) 0;
}

.doc__head { padding-bottom: 34px; border-bottom: 1px solid var(--ink-a12); }
.doc__title {
  font: 400 clamp(38px, 6vw, 50px)/1.04 var(--font-read);
  letter-spacing: -0.018em;
  margin-top: 14px;
}
.doc__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 20px;
  font: var(--metric-sm);
  color: var(--label-quiet);
}

/* The plain-English summary that opens the privacy policy. Raised sheet on
   the canvas, the same elevation rule the app uses. */
.doc__summary {
  margin-top: 34px;
  padding: 26px 28px;
  border-radius: var(--r-card);
  background: var(--paper-raised);
  border: 1px solid var(--border-hairline);
}
.doc__summary p { font: 400 16px/1.6 var(--font-ui); }
.doc__summary ul { margin: 14px 0 0; padding-left: 20px; }
.doc__summary li { font: 400 16px/1.6 var(--font-ui); margin-bottom: 10px; }
.doc__summary li:last-child { margin-bottom: 0; }

.doc__body { padding-top: 40px; }

.doc__body h2 {
  font: 400 27px/1.2 var(--font-read);
  letter-spacing: -0.01em;
  margin: 52px 0 14px;
}
.doc__body h2:first-child { margin-top: 0; }
.doc__body h3 {
  font: 500 18px/1.3 var(--font-read);
  margin: 30px 0 10px;
}
.doc__body p,
.doc__body li {
  font: 400 17px/1.62 var(--font-read);
  color: var(--ink-a75);
}
.doc__body p { margin-bottom: 16px; }
.doc__body strong { color: var(--ink); font-weight: 600; }
.doc__body ul, .doc__body ol { margin: 0 0 16px; padding-left: 22px; }
.doc__body li { margin-bottom: 9px; }

/* A pulled-out warning. Used for the "not therapy" section and the one about
   what a partner can see — the two places where reading past a paragraph
   actually matters.

   Emphasis comes from rules and full-strength ink, not from a tinted box. A
   card here fought the page: it read as a UI component dropped into prose,
   and the rounded corner against the accent bar made a shape the design
   system does not otherwise contain. */
.doc__note {
  margin: 30px 0 34px;
  padding: 24px 0;
  border-top: 1px solid var(--ink-a22);
  border-bottom: 1px solid var(--ink-a22);
}
.doc__note p {
  font: 400 18px/1.6 var(--font-read);
  color: var(--ink);
}
.doc__note p:last-child { margin-bottom: 0; }

/* Tables wrap to stacked rows on a phone rather than scrolling sideways. */
.doc__table { margin: 0 0 22px; width: 100%; border-collapse: collapse; }
.doc__table th, .doc__table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--ink-a10);
  font: 400 15.5px/1.55 var(--font-read);
  color: var(--ink-a75);
}
.doc__table th {
  font: var(--label-sm);
  letter-spacing: var(--label-tracking-tight);
  text-transform: uppercase;
  color: var(--label-quiet);
  border-bottom-color: var(--ink-a22);
  white-space: nowrap;
}

.doc__contact {
  margin-top: 52px;
  padding-top: 26px;
  border-top: 1px solid var(--ink-a12);
  font: 400 15px/1.6 var(--font-ui);
  color: var(--ink-a75);
}

@media (max-width: 620px) {
  :root { --gutter: 20px; }
  .site-head { padding: 18px var(--gutter); }
  .site-foot__inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .doc__summary { padding: 22px 20px; }

  .doc__table, .doc__table tbody, .doc__table tr, .doc__table td { display: block; width: 100%; }
  .doc__table thead { position: absolute; left: -9999px; }
  .doc__table tr { padding: 14px 0; border-bottom: 1px solid var(--ink-a10); }
  .doc__table td { border: 0; padding: 0 0 6px; }
  .doc__table td:first-child { font-weight: 600; color: var(--ink); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media print {
  .site-head__nav { display: none; }
  body { background: #fff; }
  .doc { max-width: none; }
}
