/* Cadence by Modula — site styles.
   Tokens follow the Modula design system (tokens.json v2). Light theme only for now. */

@font-face {
  font-family: "Fraunces Soft";
  src: url("/fonts/FrauncesSoft-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/fonts/Figtree-Variable.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("/fonts/DMMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  /* Color */
  --surface: #F7F2EA;
  --surface-raised: #FFFDF9;
  --line: #E2DAC9;
  --ink: #1A3B3E;
  --ink-muted: #4F6365;
  --brand: #4B959C;        /* Cadence teal: large shapes only */
  --brand-wash: #EEF6F6;   /* faintest teal, for large calm areas */
  --heading: #245054;      /* house teal as text: large titles only */
  --action: #2F6A70;       /* buttons, links, focus */
  --accent: #D6A04D;       /* ochre: website exception, the hero C and the filled buttons (dark ink text) */
  --accent-hover: #E2B467;
  --on-accent: #1A3B3E;    /* ink on ochre: 5.2:1 */
  --action-hover: #245054;
  --on-action: #F7F2EA;
  --danger: #A8412F;
  --success: #3E7447;

  /* Type */
  --font-cadence: "Fraunces Soft", Georgia, serif;
  --font-sans: Figtree, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Space and shape */
  --space-2: 8px;
  --space-4: 16px;
  --space-6: 24px;
  --space-10: 40px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --gutter: clamp(20px, 5vw, 64px);
  --section: clamp(64px, 8.5vw, 120px);
  --measure: 34rem;
  --header-h: 84px;        /* header height: 22px padding top and bottom around a 40px button */
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--font-cadence);
  font-weight: 500;
  font-optical-sizing: auto;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }
p + p { margin-top: 1em; }

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

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

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

.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  background: var(--action);
  color: var(--on-action);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 10;
}
.skip-link:focus { top: var(--space-4); }

/* Buttons and links */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 26px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--on-accent);
  font: 600 1rem/1.2 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease;
}
.button:hover { background: var(--accent-hover); color: var(--on-accent); }
.button--small { min-height: 40px; padding: 8px 18px; font-size: 0.9375rem; }

.text-link {
  font-weight: 600;
  font-size: 1rem;
}

/* Wordmark: "Cadence" in the Cadence face, "by Modula" in Figtree, ink-muted */

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark:hover { color: var(--ink); }
.wordmark__product {
  font-family: var(--font-cadence);
  font-weight: 500;
  font-size: 1.625rem;
  letter-spacing: -0.01em;
  line-height: 1;
}
.wordmark__endorse {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--ink-muted);
}

/* Header */

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: 22px;
}
.site-nav { display: flex; align-items: center; gap: var(--space-6); }
.site-nav .button, .wordmark { white-space: nowrap; }
.site-nav__link { color: var(--ink); text-decoration: none; font-size: 1rem; font-weight: 500; }
.site-nav__link:hover { color: var(--action); text-decoration: underline; }

/* Hero */

.hero { padding-top: clamp(28px, 4.5vw, 64px); }

/* Desktop: headline on the left, the rest beside it, so the wave fits on the first screen */
@media (min-width: 1000px) {
  .hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 0 clamp(48px, 6vw, 96px);
    align-items: center;
  }
  .hero__grid .hero__subhead { margin-top: 0; }
}

.hero__title {
  font-size: clamp(3.25rem, 9vw, 7.25rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  max-width: 11ch;
}

/* The product name in the headline, in Cadence teal. Allowed because it is display-size
   text (3.1:1 on cream passes the 3:1 large-text threshold); never use it for small text. */
.hero__brand { color: var(--brand); }

.hero__subhead {
  margin-top: clamp(20px, 3vw, 32px);
  max-width: 24ch;
  font-family: var(--font-cadence);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.8vw, 2.125rem);
  line-height: 1.22;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.hero__lede {
  margin-top: var(--space-6);
  max-width: var(--measure);
  color: var(--ink-muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-6);
  margin-top: var(--space-10);
}

.hero__wave {
  margin: clamp(36px, 4.5vw, 64px) 0 0;
  padding-inline: clamp(8px, 2vw, 32px);
}

/* Laptops and desktops: the hero fills one screen (up to a cap). The wave sits near the bottom,
   the text is centered in the space above it, and the next section starts below the fold. */
@media (min-width: 1000px) and (min-height: 640px) {
  .hero {
    display: flex;
    flex-direction: column;
    min-height: min(calc(100vh - var(--header-h)), 1240px);
    min-height: min(calc(100svh - var(--header-h)), 1240px);
    padding-top: 0;
    padding-bottom: clamp(24px, 4vh, 48px);
  }
  .hero__grid { flex: 1; align-content: center; padding-block: clamp(24px, 4vh, 56px); }
  .hero__wave { margin-top: 0; }
}

/* The hero wave: scattered marks settle, the line forms the Cadence C and carries on as a
   steady wave. Without JavaScript (or with reduced motion) it shows the finished picture;
   src/site.js animates it once on load. Every line is the same width. */
.hero-wave { display: block; width: 100%; height: auto; overflow: visible; }
.hw-line { fill: none; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.hw-ink { stroke: var(--ink); }
.hw-teal { stroke: var(--action); }
.hw-fill, .hw-brush { fill: var(--accent); }

/* The week between sessions */

/* Small mono label above a section title */
.kicker {
  margin-bottom: var(--space-4);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--action);
}

/* Section titles: the high optical size draws a finer, more refined display cut */
@media (min-width: 760px) {
  .gap__title, .how__title, .start__title, .hero__title { font-variation-settings: "opsz" 144; }
  .gap__title, .how__title, .start__title { letter-spacing: -0.005em; }
}

.gap { padding-block: var(--section) clamp(32px, 4vw, 56px); }

.gap__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-10) clamp(40px, 7vw, 112px);
  align-items: center;
}

/* The kicker sits above the title without counting toward its height, so the title itself
   centers on the three points beside it */
.gap__head { position: relative; }
@media (min-width: 901px) {
  .gap__head .kicker { position: absolute; bottom: 100%; left: 0; }
}

.gap__title {
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.gap__beats { margin: 0; }
.gap__beat {
  padding-block: var(--space-6);
  border-top: 1px solid var(--line);
}
.gap__beat:first-child { padding-top: 0; border-top: 0; }
.gap__beat dt {
  font-weight: 600;
  color: var(--action);
  margin-bottom: 4px;
}
.gap__beat dd { margin: 0; color: var(--ink-muted); }

/* The bridge: one line that turns the problem into the answer */
.bridge { padding-bottom: var(--section); text-align: center; }
.bridge__wave { width: 88px; height: auto; margin: 0 auto var(--space-6); display: block; }
.bridge__wave path { fill: none; stroke: var(--brand); stroke-width: 3; stroke-linecap: round; }
.bridge__text {
  max-width: 24ch;
  margin-inline: auto;
  font-family: var(--font-cadence);
  font-weight: 400;
  font-variation-settings: "opsz" 144;
  font-size: clamp(1.75rem, 3.6vw, 2.875rem);
  line-height: 1.16;
  letter-spacing: -0.015em;
  color: var(--heading);
  text-wrap: balance;
}

/* How it works: three steps on one continuous thread */

.how { padding-block: var(--section); background: var(--brand-wash); }
.how .thread__step::before { background: var(--brand-wash); }

.how__title {
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 18ch;
}

.thread {
  --dot: 16px;
  --line-w: 3px;
  list-style: none;
  margin: clamp(40px, 6vw, 72px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 56px);
  position: relative;
}
/* The thread itself */
.thread::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--dot) / 2 - var(--line-w) / 2);
  height: var(--line-w);
  background: var(--brand);
  border-radius: var(--line-w);
}
.thread__step {
  position: relative;
  padding-top: calc(var(--dot) + 28px);
  counter-increment: step;
}
.thread__step::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: var(--surface);
  border: var(--line-w) solid var(--action);
}
.thread__when {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--ink-muted);
}
.thread__when::before {
  content: counter(step, decimal-leading-zero) "  ";
  white-space: pre;
  color: var(--action);
}
.thread__step h3 {
  margin-top: var(--space-2);
  font-size: clamp(1.5rem, 2.2vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.thread__step h3 + p {
  margin-top: var(--space-4);
  color: var(--ink-muted);
}

/* Get started: the deep-teal band */

.start {
  background: var(--action);
  color: var(--on-action);
  padding-block: clamp(64px, 9vw, 120px);
}
.start :focus-visible { outline-color: var(--on-action); }

.start__title {
  color: var(--on-action);
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.start__paths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2.5vw, 32px);
  margin-top: clamp(32px, 5vw, 56px);
}

.path {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 48px);
}
.path h3 {
  font-size: clamp(1.625rem, 2.6vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.path p { color: var(--ink-muted); max-width: 32ch; }
.path p { margin-bottom: var(--space-6); }
.path .button { margin-top: auto; }
.path :focus-visible { outline-color: var(--action); }

/* Trust strip */

.trust { padding-block: clamp(56px, 8vw, 96px); }

.trust__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-10) clamp(28px, 4vw, 56px);
}
.trust__list li::before {
  content: "";
  display: block;
  width: 32px;
  height: 3px;
  border-radius: 3px;
  background: var(--brand);
  margin-bottom: var(--space-4);
}
.trust__list h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.4;
}
.trust__list p {
  margin-top: var(--space-2);
  color: var(--ink-muted);
  font-size: 1rem;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: var(--space-10) 32px;
  font-size: 1rem;
}
.site-footer__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-6);
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer__nav ul { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); }
.site-footer__crisis {
  margin-top: var(--space-10);
  max-width: 44rem;
  color: var(--ink);
}
.site-footer__crisis a { font-weight: 600; }
.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2) var(--space-6);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.9375rem;
}
.site-footer__legal ul { display: flex; gap: var(--space-6); }

/* Inner pages */

.page-head { padding-block: clamp(40px, 7vw, 96px) clamp(32px, 4vw, 48px); }
.page-head h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
}
.page-head p {
  margin-top: var(--space-6);
  max-width: var(--measure);
  color: var(--ink-muted);
}

/* Contact */

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--space-10) clamp(40px, 7vw, 112px);
  align-items: start;
  padding-bottom: var(--section);
}

.notice {
  border: 1px solid var(--line);
  background: var(--surface-raised);
  border-radius: var(--radius-md);
  padding: var(--space-4) 20px;
  font-size: 1rem;
}
.notice strong { font-weight: 600; }

.form { display: grid; gap: var(--space-6); margin-top: var(--space-6); }
.field { display: grid; gap: var(--space-2); }
.field label, .field legend {
  font-weight: 600;
  font-size: 1rem;
  padding: 0;
}
.field .hint { font-size: 0.9375rem; color: var(--ink-muted); }
.field input[type="text"],
.field input[type="email"],
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface-raised);
  border: 1.5px solid #788A88; /* control border: 3.2:1 on cream, 3.6:1 on raised */
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.field textarea { min-height: 168px; resize: vertical; line-height: 1.5; }
.field input:focus-visible, .field textarea:focus-visible { outline-offset: 1px; border-color: var(--action); }

fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.choices { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); margin-top: var(--space-2); }
.choices label { display: inline-flex; align-items: center; gap: 10px; font-weight: 400; cursor: pointer; }
.choices input { width: 20px; height: 20px; accent-color: var(--action); margin: 0; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { font-size: 1rem; }
.form-status:empty { display: none; }
.form-status[data-state="error"] { color: var(--danger); font-weight: 600; }
.form-status[data-state="sent"] {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-4) 20px;
}
.form-status[data-state="sent"] strong { color: var(--success); }

.contact__aside h2 {
  font-size: 1.5rem;
  line-height: 1.2;
}
.contact__aside > * + h2 { margin-top: var(--space-10); }
.contact__aside p { margin-top: var(--space-2); color: var(--ink-muted); font-size: 1rem; }
.contact__aside .button { margin-top: var(--space-4); }

/* Legal pages */

.legal { padding-bottom: var(--section); }
.legal .prose { max-width: 42rem; }
.prose h2 { font-size: 1.75rem; line-height: 1.2; margin-top: 2.2em; }
.prose h3 { font-family: var(--font-sans); font-weight: 600; font-size: 1.125rem; margin-top: 1.8em; }
.prose p, .prose ul, .prose ol { margin-top: 1em; }
.prose li + li { margin-top: 0.4em; }
.prose .updated { font-family: var(--font-mono); font-size: 0.875rem; color: var(--ink-muted); }

/* Responsive */

@media (max-width: 900px) {
  .gap__grid { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; }
  .trust__list { grid-template-columns: 1fr; gap: var(--space-6); }
}

@media (max-width: 760px) {
  .thread {
    grid-template-columns: 1fr;
    gap: var(--space-10);
    padding-left: calc(var(--dot) + 24px);
  }
  .thread::before {
    left: calc(var(--dot) / 2 - var(--line-w) / 2);
    right: auto;
    top: 0;
    bottom: 0;
    width: var(--line-w);
    height: auto;
  }
  .thread__step { padding-top: 0; }
  .thread__step::before { left: calc(-1 * (var(--dot) + 24px)); top: 2px; }
  .start__paths { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .site-nav__link { display: none; } /* Contact stays in the footer */
  .hero__actions { flex-direction: column; align-items: stretch; gap: 12px; }
  .hero__actions .button { width: 100%; }
  .hero__actions .text-link { align-self: center; padding-block: 6px; } /* centered under the full-width button */
  .hero__wave { padding-inline: 0; }
}
