/* Goodstead — partnership site.
   One typeface, three colors, one line. The line in the margin is the
   time between two appointments: bare, then kept, then still unwritten. */

:root {
  color-scheme: light;

  /* Brand (goodstead-site + patient app tokens) */
  --paper: #f9faf6;
  --ink: #183a30;
  --muted: #3d4c44;      /* AAA on paper, card and wash */
  --forest: #1c3b32;
  --lime: #dcebbb;
  --sage: #648b51;       /* wordmark dot, thread — decorative */
  --sage-ink: #56744a;   /* second tone of display type, 4.9:1 on paper */
  --line: #d3dbcd;
  --hairline: #dde3d8;
  --wash: #eef2e6;
  --bubble: #e9eedd;
  --card: #fff;
  --on-forest: #f5f7eb;
  --on-forest-muted: #c5d2c3;
  --forest-line: #3f5a4c;
  --thread-ahead: #9fb884;

  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Type */
  --h1: clamp(2.5rem, 6.1vw, 5rem);
  --h2: clamp(2rem, 4.1vw, 3.375rem);
  --h3: clamp(1.75rem, 2.9vw, 2.5rem);

  /* The rail: a label column, a gap, and the thread running down its middle */
  --label-w: 152px;
  --gap: 80px;
  --rail-x: calc(var(--label-w) + var(--gap) / 2);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 32px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

p, h1, h2, h3, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
::selection { background: var(--lime); color: var(--ink); }
[hidden] { display: none !important; }

a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 5px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: -100px; left: 20px;
  z-index: 10;
  background: var(--forest);
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: min(100% - 96px, 1200px);
  margin-inline: auto;
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 104px;
}

.wordmark {
  font-size: 2.05rem;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.065em;
}
.wordmark span { color: var(--sage); }

.site-header nav {
  display: flex;
  gap: 36px;
  font-size: 0.9375rem;
  font-weight: 500;
}
.site-header nav a {
  padding: 10px 0;
  text-decoration: underline transparent;
  text-underline-offset: 6px;
  transition: text-decoration-color 0.16s;
}
.site-header nav a:hover { text-decoration-color: currentColor; }

/* ---------- The rail ---------- */

.band { position: relative; }
.rail { position: relative; }

/* The thread itself. Each band draws its stretch; bands stack with no
   gaps so the line reads as one. */
.rail::before {
  content: "";
  position: absolute;
  left: var(--rail-x);
  top: 0; bottom: 0;
  width: 1px;
  margin-left: -0.5px;
  background: var(--line);
}

.row {
  position: relative;
  display: grid;
  grid-template-columns: var(--label-w) minmax(0, 1fr);
  column-gap: var(--gap);
}

.row-label {
  padding-top: var(--label-pt, 0px);
  text-align: right;
  font-size: 0.75rem;
  line-height: 1.5;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}
.label-sub {
  display: block;
  margin-top: 2px;
  letter-spacing: 0.02em;
  text-transform: none;
  font-weight: 500;
  font-size: 0.8125rem;
}

.knot {
  position: absolute;
  left: var(--rail-x);
  top: calc(var(--label-pt, 0px) + 3.5px);
  width: 11px; height: 11px;
  margin-left: -5.5px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid #7f8f84;
}
.knot--solid { background: var(--ink); border-color: var(--ink); }
.knot--day {
  border-color: var(--sage);
  transition: background-color 0.5s ease, box-shadow 0.5s ease;
}
.no-js .knot--day,
.day.lit .knot--day { background: var(--sage); box-shadow: 0 0 0 5px var(--paper); }
.no-js .knot--solid-day,
.day.lit .knot--solid-day { background: var(--ink); border-color: var(--ink); }

/* Where Goodstead joins: the companion mark sits on the thread. */
.knot--g {
  top: calc(var(--label-pt, 0px) + 9px - 19px);
  width: 38px; height: 38px;
  margin-left: -19px;
  display: grid;
  place-items: center;
  border: 0;
  background: #deebc7;
  color: #234034;
  box-shadow: 0 0 0 6px var(--paper);
  font-size: 1.3125rem;
  font-weight: 650;
  letter-spacing: -0.06em;
  line-height: 1;
  text-transform: none;
  padding-bottom: 2px;
}

/* The kept thread: drawn as you scroll, from the mark to day 30. */
.rail-fill {
  position: absolute;
  left: var(--rail-x);
  top: 0; bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--sage);
}
.js .rail-fill { bottom: auto; height: 0; }
.band--join .rail-fill { top: 9px; }

/* ---------- Type ---------- */

h1, .display {
  font-weight: 500;
  letter-spacing: -0.055em;
  text-wrap: balance;
}
h1 {
  font-size: var(--h1);
  line-height: 1.02;
  max-width: 12.5em;
}
.display {
  font-size: var(--h2);
  line-height: 1.06;
  max-width: 15em;
}
h1 span, .display span { color: var(--sage-ink); }
h1 span { display: block; }

.eyebrow {
  font-size: 0.75rem;
  line-height: 1.5;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}
.eyebrow + .display { margin-top: 20px; }

.lead {
  max-width: 34em;
  margin-top: 28px;
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--muted);
  text-wrap: pretty;
}

.fine {
  margin-top: 16px;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- Hero ---------- */

.band--start .rail {
  --pt: clamp(40px, 8vh, 96px);
  --label-pt: calc(var(--h1) * 0.54 - 9px);
  padding-block: var(--pt) clamp(104px, 16vh, 184px);
}
/* The thread starts at the appointment, not above it. */
.band--start .rail::before { top: calc(var(--pt) + var(--label-pt) + 9px); }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
  margin-top: 36px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  min-height: 54px;
  padding: 12px 24px;
  border-radius: 100px;
  background: var(--forest);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background-color 0.16s, transform 0.16s;
}
.button:hover { background: #315446; transform: translateY(-2px); }
.button:focus-visible { outline-color: var(--forest); outline-offset: 4px; border-radius: 100px; }
.button span { font-size: 1.15rem; line-height: 1; }

.text-link {
  padding-block: 6px;
  font-size: 0.9375rem;
  font-weight: 550;
  border-bottom: 1px solid #9cae8b;
  transition: border-color 0.16s;
}
.text-link:hover { border-color: var(--ink); }

.note {
  margin-top: 20px;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ---------- The in-between ---------- */

.band--bare .rail {
  --label-pt: calc(var(--h2) * 0.55 - 9px);
  padding-bottom: clamp(112px, 17vh, 192px);
}

.questions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 36px;
  max-width: 44em;
  margin-top: 44px;
  font-size: clamp(1.1875rem, 1.9vw, 1.5rem);
  line-height: 1.4;
  letter-spacing: -0.02em;
}
.questions li { color: var(--muted); }
.questions li:nth-child(3n + 1) { color: var(--ink); }
.questions li:nth-child(3n) { color: var(--sage-ink); }
.questions + .lead { margin-top: 44px; }

/* ---------- The partnership ---------- */

.band--join .rail { padding-bottom: clamp(104px, 15vh, 168px); }

.roles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  margin-top: 64px;
}
.roles article {
  padding-top: 22px;
  border-top: 1px solid #b9c8ad;
}
.roles h3 {
  margin-top: 14px;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.04em;
  font-weight: 550;
}
.roles article > p:last-child {
  margin-top: 12px;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--muted);
  text-wrap: pretty;
}

.boundary {
  max-width: 44em;
  margin-top: 48px;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--muted);
}

/* ---------- A month together ---------- */

.band--month .rail { padding-bottom: clamp(88px, 13vh, 152px); }
.month-intro { padding-bottom: clamp(72px, 11vh, 120px); }

.day {
  --label-pt: calc(var(--h3) * 0.55 - 9px);
  padding-bottom: clamp(72px, 12vh, 136px);
}
.day--last { padding-bottom: 0; }

.day-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}

.day-copy h3 {
  font-size: var(--h3);
  line-height: 1.1;
  letter-spacing: -0.05em;
  font-weight: 500;
}
.day-copy h3 + p {
  max-width: 28em;
  margin-top: 18px;
  color: var(--muted);
  text-wrap: pretty;
}

/* Vignettes speak the product's own language: the patient's words in a
   soft bubble, the companion in plain ink beside its mark, one card. */
.v {
  display: grid;
  gap: 16px;
  padding-top: 6px;
}
.v-you {
  justify-self: end;
  max-width: 88%;
  padding: 12px 17px;
  border-radius: 18px 18px 4px 18px;
  background: var(--bubble);
  line-height: 1.45;
}
.v-g {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  line-height: 1.5;
}
.v-g p { padding-top: 2px; }
.gmark {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #deebc7;
  color: #234034;
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.06em;
  line-height: 1;
  padding-bottom: 2px;
}
.dots {
  position: absolute;
  left: 42px; top: 11px;
  display: none;
  gap: 5px;
}
.dots i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--sage);
}

.v-card {
  margin-top: 4px;
  padding: 16px 18px;
  border: 1px solid var(--hairline);
  border-radius: 20px;
  background: var(--card);
}
.v-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}
.icon-tile {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 14px;
  background: var(--wash);
}
.icon-tile svg { width: 22px; height: 22px; }
.v-title { font-weight: 560; letter-spacing: -0.015em; line-height: 1.35; }
.v-sub { font-size: 0.9375rem; line-height: 1.45; color: var(--muted); }
.v-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}
.v-list { margin-top: 6px; }
.v-list > div { padding-block: 11px; }
.v-list > div + div { border-top: 1px solid var(--hairline); }
.v-list > div:last-child { padding-bottom: 2px; }
.v-list dt { font-weight: 560; letter-spacing: -0.015em; line-height: 1.35; }
.v-list dd { font-size: 0.9375rem; line-height: 1.45; color: var(--muted); }
.v-list--pairs > div {
  display: grid;
  grid-template-columns: 7.25em minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}
.v-list--pairs > div:last-child { padding-bottom: 11px; }
.v-foot {
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ---------- What's ahead ---------- */

.band--ahead {
  background: var(--forest);
  color: var(--on-forest);
}
.band--ahead .rail { padding-block: clamp(96px, 14vh, 160px) clamp(64px, 9vh, 104px); }

/* Unwritten days: the thread goes dashed and runs on. */
.band--ahead .rail::before {
  width: 2px;
  margin-left: -1px;
  background: repeating-linear-gradient(to bottom, var(--thread-ahead) 0 5px, transparent 5px 13px);
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent);
  mask-image: linear-gradient(to bottom, #000 78%, transparent);
}
.band--ahead .knot--open {
  background: var(--forest);
  border-color: var(--thread-ahead);
}
.band--ahead .row-label,
.band--ahead .eyebrow,
.band--ahead .lead,
.band--ahead .fine { color: var(--on-forest-muted); }
.band--ahead .display span { color: var(--lime); }

.horizon { --label-pt: 34px; }
.horizon:first-of-type { margin-top: 0; }
.row + .horizon { margin-top: clamp(56px, 8vh, 88px); }
.horizon + .horizon { margin-top: 0; }
.horizon-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px clamp(32px, 6vw, 96px);
  align-items: baseline;
  padding-block: 28px 30px;
  border-top: 1px solid var(--forest-line);
}
.horizon-body h3 {
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.04em;
  font-weight: 500;
  text-wrap: balance;
}
.horizon-body p {
  line-height: 1.65;
  color: var(--on-forest-muted);
  text-wrap: pretty;
}

.partners {
  padding-block: 40px clamp(72px, 10vh, 112px);
  border-top: 1px solid var(--forest-line);
}
.partners-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px clamp(32px, 6vw, 96px);
  margin-top: 28px;
}
.partners h3 {
  font-size: 1.3125rem;
  line-height: 1.3;
  letter-spacing: -0.03em;
  font-weight: 500;
}
.partners article p {
  max-width: 30em;
  margin-top: 10px;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--on-forest-muted);
}
.partners .fine { margin-top: 32px; }

/* ---------- Request access ---------- */

.header-cta {
  padding: 10px 20px !important;
  border: 1px solid #b9c8ad;
  border-radius: 100px;
  text-decoration: none !important;
  transition: background-color 0.16s;
}
.header-cta:hover { background: #e9efdf; }

.access {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
  gap: 48px clamp(40px, 8vw, 128px);
  align-items: start;
  padding-block: clamp(88px, 13vh, 152px) 0;
}

.access-form { display: grid; gap: 22px; }

.roles-pick {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}
.roles-pick legend,
.field label {
  padding: 0;
  margin-bottom: 8px;
  font-size: 0.9375rem;
  font-weight: 560;
  letter-spacing: -0.01em;
}
.field label { display: block; }
.roles-pick label { position: relative; display: block; cursor: pointer; }
.roles-pick input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.roles-pick span {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 12px 18px;
  border: 1px solid #7f8f84;
  border-radius: 16px;
  background: var(--card);
  transition: background-color 0.16s, border-color 0.16s;
}
.roles-pick span::before {
  content: "";
  flex: none;
  box-sizing: border-box;
  width: 18px; height: 18px;
  border: 1.5px solid #7f8f84;
  border-radius: 50%;
  background: var(--card);
}
.roles-pick label:hover span { background: var(--wash); }
/* Lime marks the selection, as in the app. */
.roles-pick input:checked + span { background: var(--lime); border-color: var(--ink); font-weight: 560; }
.roles-pick input:checked + span::before { border: 5.5px solid var(--ink); }
.roles-pick input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }

.field input,
.field textarea {
  display: block;
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border: 1px solid #7f8f84;
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  line-height: 1.4;
}
.field textarea { resize: vertical; }
.field input:focus-visible,
.field textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.field :is(input, textarea)[aria-invalid="true"] { border-color: #8a2a1c; box-shadow: 0 0 0 1px #8a2a1c; }
.optional { margin-left: 6px; font-weight: 400; font-size: 0.8125rem; color: var(--muted); }
.hint { margin-top: 8px; font-size: 0.8125rem; color: var(--muted); }
.trap { position: absolute; left: -9999px; }

.access-form .button { justify-self: start; border: 0; font-family: inherit; cursor: pointer; }
.access-form .button[disabled] { opacity: 0.6; cursor: default; transform: none; }
.form-status { min-height: 1.6em; font-size: 0.9375rem; color: #8a2a1c; }

.access-done {
  padding: 32px;
  border: 1px solid var(--hairline);
  border-radius: 20px;
  background: var(--card);
}
.access-done h3 { margin-top: 18px; font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.04em; font-weight: 550; }
.access-done p { margin-top: 8px; color: var(--muted); }
.access-done:focus { outline: none; }

.footer-meta a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Footer ---------- */

.site-footer { padding-block: clamp(88px, 13vh, 152px) 44px; }

.closing {
  font-size: var(--h2);
  line-height: 1.06;
  letter-spacing: -0.055em;
  font-weight: 500;
}
.closing span { color: var(--sage-ink); }

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 32px;
  margin-top: clamp(72px, 11vh, 128px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.footer-meta {
  text-align: right;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--muted);
}
.footer-meta p + p { margin-top: 6px; }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero > * { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero > :nth-child(2) { animation-delay: 0.12s; }
  .hero > :nth-child(3) { animation-delay: 0.2s; }
  .hero > :nth-child(4) { animation-delay: 0.26s; }

  .js .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .js .reveal.in { opacity: 1; transform: none; }

  /* The journal writes back: your words, a pause, the reply, what's kept. */
  .js .v > *,
  .js .v-g > p { opacity: 0; }
  .js .v-you { transform: translateY(8px); }
  .js .dots { display: flex; opacity: 0; }

  .js .lit .v-you { animation: rise-sm 0.5s ease 0.1s both; }
  .js .lit .v-g { animation: fade 0.4s ease 0.55s both; }
  .js .lit .dots { animation: compose 1.1s ease 0.7s both; }
  .js .lit .dots i { animation: breathe 1.1s ease-in-out 0.7s both; }
  .js .lit .dots i:nth-child(2) { animation-delay: 0.85s; }
  .js .lit .dots i:nth-child(3) { animation-delay: 1s; }
  .js .lit .v-g > p { animation: fade 0.6s ease 1.75s both; }
  .js .lit .v-card { animation: rise-sm 0.6s ease 2.25s both; }
}

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes rise-sm { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes compose { 0% { opacity: 0; } 18%, 82% { opacity: 1; } 100% { opacity: 0; } }
@keyframes breathe { 0%, 100% { transform: none; opacity: 0.45; } 50% { transform: translateY(-3px); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .rail-fill { bottom: 0; height: auto; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  :root { --label-w: 112px; --gap: 64px; }
  .wrap { width: calc(100% - 64px); }
  .roles { gap: 28px; }
  .day-body { grid-template-columns: minmax(0, 1fr) minmax(0, 360px); }
}

/* The thread moves to the left edge; labels sit above what they mark. */
@media (max-width: 880px) {
  :root { --rail-x: 6px; }
  .band .rail,
  .band .day,
  .band .horizon { --label-pt: 0px; }

  .display span { display: block; }
  .row { display: block; padding-left: 38px; }
  .row-label { text-align: left; margin-bottom: 16px; }
  .row-label:empty { margin: 0; }
  .label-sub { display: inline; margin: 0 0 0 8px; }

  .knot--g { top: -10px; }
  .band--join .rail-fill { top: 9px; }
  .band--join .row-label { margin-bottom: 26px; padding-left: 0; }

  .band--start .rail::before { top: calc(var(--pt) + 9px); }

  .roles { grid-template-columns: 1fr; gap: 32px; margin-top: 48px; }
  .day-body { grid-template-columns: 1fr; gap: 28px; }
  .v { max-width: 420px; }

  .horizon-body { grid-template-columns: 1fr; gap: 10px; padding-block: 24px 26px; }
  .horizon .knot { top: 31px; }
  .horizon .row-label { margin: 0; height: 0; }
  .partners-grid { grid-template-columns: 1fr; }
  .access { grid-template-columns: 1fr; }
  .site-header nav { gap: 24px; }
}

@media (max-width: 640px) {
  body { font-size: 1rem; }
  .wrap { width: calc(100% - 40px); }
  .site-header { min-height: 82px; }
  .wordmark { font-size: 1.75rem; }
  .site-header nav a:not(.header-cta) { display: none; }
  .row { padding-left: 30px; }
  .lead { font-size: 1.0625rem; margin-top: 22px; }
  .actions { margin-top: 28px; }
  .questions { gap: 8px 24px; margin-top: 32px; }
  .questions + .lead { margin-top: 32px; }
  .v-you, .v-g { font-size: 1.0625rem; }
  .footer-row { flex-direction: column; align-items: start; }
  .footer-meta { text-align: left; }
}
