/* Rungs site styles. Plain CSS, no build step — every page links this file.
   Palette and tone taken from the app's parent side (rungs/app/src/lib/parent/theme.ts):
   calm and document-like. No badges, no celebration, no dashboard energy — the
   parent looks at this a few times a year and needs to trust it. */

:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --border: #e6e2dc;
  --border-soft: #efece7;
  --text: #1b1a18;
  --muted: #6e6963;
  --faint: #9b958d;
  --accent: #2f5d50;
  --accent-soft: #e8f0ec;
  --warn: #8a5a2b;
  --warn-soft: #f6eee4;
  --locked: #c9c3ba;
  --shadow: 0 1px 2px rgba(27, 26, 24, 0.04), 0 10px 30px -22px rgba(27, 26, 24, 0.5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent-soft); }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 22px; }
.wrap.narrow { max-width: 720px; }

a { color: var(--accent); text-underline-offset: 3px; }

/* ---------- header ---------- */

header.site { padding: 28px 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mark {
  display: inline-flex; align-items: center; gap: 9px;
  text-decoration: none; color: var(--text);
  font-weight: 600; letter-spacing: -0.01em; font-size: 1.05rem;
}
.mark .ladder { width: 20px; height: 20px; flex: none; color: var(--accent); }
.crumb { color: var(--faint); font-size: 0.85rem; }
.crumb a { color: var(--faint); text-decoration: none; }
.crumb a:hover { color: var(--accent); }

/* ---------- type ---------- */

h1 { font-size: clamp(1.95rem, 5vw, 2.7rem); line-height: 1.14; letter-spacing: -0.025em; margin: 20px 0 16px; }
h2 { font-size: 1.4rem; letter-spacing: -0.01em; margin: 0 0 14px; }
h3 { font-size: 1.05rem; margin: 26px 0 6px; }
p { margin: 0 0 15px; }
.lead { font-size: 1.14rem; color: var(--muted); margin: 0 0 10px; max-width: 46ch; }
.muted { color: var(--muted); }
.tiny { font-size: 0.86rem; color: var(--faint); }

section { padding: 44px 0; border-top: 1px solid var(--border-soft); margin-top: 44px; }

/* ---------- buttons ---------- */

.btn {
  font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer;
  display: inline-block; text-decoration: none; text-align: center;
  padding: 13px 26px; border-radius: 10px;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
}
.btn:hover { filter: brightness(1.08); }
.btn.quiet { background: transparent; color: var(--text); border-color: var(--border); }
.btn.quiet:hover { border-color: var(--accent); color: var(--accent); filter: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0 0; }
.btn-note { color: var(--muted); font-size: 0.92rem; margin: 12px 0 0; }

/* ---------- form ---------- */

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px; box-shadow: var(--shadow);
}
.fields { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.field label { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--faint); border-radius: 9px; padding: 11px 12px;
}
.field textarea { min-height: 78px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent;
}
.field .hint { font-size: 0.82rem; color: var(--muted); margin: 6px 0 0; }
.fieldset-head {
  margin: 26px 0 0; padding-top: 20px; border-top: 1px solid var(--border);
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint);
}

.check { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; }
.check input { width: 18px; height: 18px; margin: 4px 0 0; flex: none; accent-color: var(--accent); }
.check label { font-weight: 400; font-size: 0.97rem; margin: 0; }
.check .why { display: block; color: var(--muted); font-size: 0.86rem; }

/* ---------- the agreement document ---------- */

.doc {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 40px 42px; margin-top: 26px;
  font-family: Georgia, "Times New Roman", serif;
  box-shadow: var(--shadow);
}
.doc h2 { font-family: Georgia, serif; font-size: 1.75rem; margin: 0 0 6px; letter-spacing: -0.01em; }
.doc .doc-sub { color: var(--muted); font-size: 0.98rem; margin: 0 0 26px; }
.doc h3 { font-family: Georgia, serif; font-size: 1.12rem; margin: 26px 0 10px; }
.doc ol { padding-left: 22px; margin: 0 0 16px; }
.doc ol li { margin: 0 0 12px; }
.doc .why { display: block; color: var(--muted); font-size: 0.92rem; margin-top: 3px; }

.ladder-table { width: 100%; border-collapse: collapse; margin: 6px 0 18px; font-size: 0.97rem; }
.ladder-table th, .ladder-table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); }
.ladder-table th { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.ladder-table .when { white-space: nowrap; color: var(--accent); font-weight: 600; }
.ladder-table tr.now .when { color: var(--text); }

.signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; margin-top: 34px; }
.sig-line { border-bottom: 1px solid var(--text); height: 40px; }
.sig-label { font-size: 0.86rem; color: var(--muted); margin-top: 7px; }

.doc-footer { margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--faint); font-size: 0.82rem; font-family: Inter, sans-serif; }

/* ---------- the ladder, drawn as steps ---------- */

.ladder-preview { margin: 22px 0 8px; }
.rungs { list-style: none; padding: 0; margin: 0 0 16px; counter-reset: rung; }
.rung {
  display: flex; gap: 16px; align-items: baseline;
  padding: 13px 0 13px 20px;
  border-left: 2px solid var(--border);
  position: relative;
}
.rung::before {
  content: ""; position: absolute; left: -6px; top: 20px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.rung:first-child::before { background: var(--accent); }
.rung-age {
  flex: 0 0 5.6em; font-weight: 600; color: var(--accent);
  font-variant-numeric: tabular-nums; font-size: 0.95rem;
}
.rung-what { color: var(--text); }

@media (max-width: 560px) {
  .rung { flex-direction: column; gap: 3px; }
  .rung-age { flex: none; }
}

/* ---------- callouts ---------- */

.note {
  background: var(--accent-soft); border-radius: 12px;
  padding: 18px 20px; margin: 22px 0; font-size: 0.97rem;
}
.note p:last-child { margin-bottom: 0; }
.note.warn { background: var(--warn-soft); }

/* ---------- cards ---------- */

.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.card {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px 22px;
}
a.card:hover { border-color: var(--accent); }
.card b { display: block; margin-bottom: 4px; }
.card span { color: var(--muted); font-size: 0.93rem; }

.sources { list-style: none; padding: 0; margin: 0; }
.sources li { margin: 0 0 15px; }
.sources b { display: block; font-weight: 600; }
.sources .what { display: block; color: var(--muted); font-size: 0.92rem; margin-top: 3px; }

/* ---------- footer ---------- */

footer.site {
  border-top: 1px solid var(--border-soft); margin-top: 44px;
  padding: 26px 0 52px; color: var(--faint); font-size: 0.88rem;
}
footer.site a { color: var(--faint); text-decoration: none; margin-right: 18px; }
footer.site a:hover { color: var(--accent); }

/* Recovery page: the four phases read as a timeline, one card per stretch of weeks */
.phase {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 24px 18px; margin: 18px 0; box-shadow: var(--shadow);
}
.phase h3 { margin: 2px 0 12px; }
.phase-when {
  margin: 0; color: var(--accent); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.phase-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 26px; align-items: start; }
.phase-cols ul { margin: 0 0 10px; padding-left: 1.1em; }
.phase-cols li { margin: 2px 0; font-size: 0.95rem; }
.phase-head { margin: 0 0 4px; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.phase-why { margin: 6px 0 0; padding-top: 12px; border-top: 1px solid var(--border-soft); color: var(--muted); font-size: 0.95rem; }
.options li { margin: 8px 0; }

/* A line meant to be said out loud, word for word */
.say {
  margin: 20px 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent);
  font-family: Georgia, "Times New Roman", serif; font-size: 1.1rem; line-height: 1.55;
}

/* Waitlist: one field, one optional question, one promise */
.waitlist {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 24px; margin: 22px 0 8px; box-shadow: var(--shadow);
}
.wl-label { display: block; font-weight: 600; margin-bottom: 10px; }
.wl-row { display: flex; gap: 10px; flex-wrap: wrap; }
.wl-row input {
  flex: 1 1 240px; min-width: 0; font: inherit; padding: 11px 14px;
  border: 1px solid #8f8a83; border-radius: 10px; background: var(--surface); color: var(--text);
}
.wl-row input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.wl-row .btn { flex: 0 0 auto; }
.wl-phone { border: 0; padding: 0; margin: 16px 0 0; }
.wl-phone legend { padding: 0; font-size: 0.93rem; color: var(--muted); margin-bottom: 6px; }
.wl-phone legend span { color: var(--faint); }
.wl-phone label { display: inline-flex; align-items: center; gap: 6px; margin-right: 18px; font-size: 0.95rem; cursor: pointer; }
.wl-note { margin: 12px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--warn-soft); font-size: 0.93rem; }
.wl-note.wl-info { background: var(--accent-soft); }
.wl-status { margin: 10px 0 0; min-height: 1.2em; font-size: 0.93rem; color: var(--warn); }
.wl-status:empty { display: none; }
.wl-done { margin: 0; }
/* the honeypot: out of sight and out of the tab order, never display:none
   (some bots skip hidden fields) */
.wl-honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 620px) {
  .doc { padding: 26px 22px; }
  .signatures { grid-template-columns: 1fr; gap: 26px; }
  .phase-cols { grid-template-columns: 1fr; }
  .phase { padding: 18px 18px 14px; }
}

/* ---------- print: the whole point is that this comes out as a document ---------- */

@media print {
  @page { margin: 18mm; }
  body { background: #fff; font-size: 11.5pt; }
  .no-print { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .doc {
    border: 0; border-radius: 0; padding: 0; margin: 0;
    box-shadow: none; background: #fff;
  }
  .doc h3 { page-break-after: avoid; }
  .doc ol li, .ladder-table tr { page-break-inside: avoid; }
  .signatures { page-break-inside: avoid; margin-top: 28pt; }
  .note { border: 1px solid #ccc; background: #fff; }
  a { color: inherit; text-decoration: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
