/* ==========================================================================
   Kelvin Mariner — estate planning
   Design tokens and base layer. Every value here is extracted from the
   approved mockups in design-reference/. Don't add new colors or type sizes;
   extend what is below.
   ========================================================================== */

:root {
  /* ---- color ---------------------------------------------------------- */
  --bg:          #FAF8F3;  /* page background, warm stone */
  --surface:     #FFFFFF;  /* cards */
  --sand:        #F0E9DA;  /* alternating section band */
  --sand-deep:   #EFE8D9;  /* photo frames, placeholder fills */
  --ink:         #1E2923;  /* primary text */
  --ink-soft:    #5C6862;  /* body copy */
  --ink-muted:   #8A9189;  /* captions, labels */
  --line:        #E3DED2;  /* borders, rules */
  --line-light:  #EEEAE0;  /* inner list dividers */
  --green:       #2E5C48;  /* primary accent, buttons, links */
  --green-deep:  #1E402F;  /* dark CTA bands, chat header */
  --green-pale:  #B5C4B9;  /* body text on dark bands */
  --cream:       #F6F2E8;  /* text and buttons on dark bands */
  --flag:        #B4553C;  /* "missing" markers only — never decorative */

  /* Values that appear in the mockups but not in the token table in
     CLAUDE.md. Extracted, not invented — same reason as the placeholder
     colors below. */
  --line-strong: #C9C2B2;  /* phone pill border in the nav */
  --ink-strong:  #4C574F;  /* the longer About paragraphs */
  --green-mid:   #8FB5A0;  /* icon strokes on the dark class card */
  --green-soft:  #9DB3A4;  /* secondary text on the dark CTA band */

  /* Placeholder art in the mockups: the empty portrait frame and its label. */
  --placeholder-stroke: #B6AE99;
  --placeholder-label:  #A49B85;

  /* From design-reference/survey-question.html. */
  --progress-track: #E9E4D8;  /* the unfilled part of the progress bar */
  --ink-faint:      #9AA096;  /* the privacy note under the check */

  /* From design-reference/chat-assistant.html. */
  --chat-log:         #FBFAF6;  /* behind the conversation */
  --chat-bubble:      #F0EDE4;  /* the assistant's bubbles */
  --chat-placeholder: #A9AFA6;  /* "Type your message..." */

  /* ---- type ----------------------------------------------------------- */
  --display: "Newsreader", Georgia, serif;
  --body: "Public Sans", system-ui, sans-serif;

  --size-h1:      57px;   /* hero */
  --size-h1-check: 44px;  /* a question in the check */
  --size-h2:      39px;   /* section */
  --size-h2-sm:   37px;   /* section, lower half of the 37–39px range */
  --size-h3:      20px;   /* card */
  --size-lede:    18.5px;
  --size-body:    17px;
  --size-card:    15.5px;
  --size-eyebrow: 12px;
  --size-caption: 14px;

  --lh-h1:   1.05;
  --lh-h2:   1.14;
  --lh-lede: 1.62;
  --lh-body: 1.6;
  --lh-card: 1.58;

  --track-h1:      -0.02em;
  --track-h2:      -0.015em;
  --track-eyebrow: 0.13em;

  /* ---- layout --------------------------------------------------------- */
  --measure:   1440px;  /* content column max */
  --gutter:    72px;    /* side padding, desktop */
  --gutter-sm: 20px;    /* side padding, mobile */
  --section-y: 70px;    /* section vertical padding */
  --grid-gap:  22px;    /* card grids */

  --radius-card:   9px;
  --radius-panel:  12px;
  --radius-button: 5px;
  --radius-pill:   999px;

  /* ---- elevation ------------------------------------------------------ */
  --shadow-card:   0 18px 40px -28px rgba(30, 41, 35, 0.45);
  --shadow-float:  0 20px 44px -26px rgba(30, 41, 35, 0.50);
  --shadow-widget: 0 30px 60px -30px rgba(30, 41, 35, 0.55);
  --shadow-button: 0 14px 30px -16px rgba(30, 64, 47, 0.75);

  /* ---- controls ------------------------------------------------------- */
  --tap-min: 44px;  /* minimum tap target; not negotiable on mobile */

  color-scheme: light;
}

@media (max-width: 760px) {
  :root {
    --size-h1:   34px;
    --size-h1-check: 30px;
    --size-h2:    28px;
    --size-h2-sm: 26px;
    --gutter:    var(--gutter-sm);
    --section-y: 48px;
  }
}

/* ==========================================================================
   Base
   ========================================================================== */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--size-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--display);
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: var(--size-h1); font-weight: 500; line-height: var(--lh-h1); letter-spacing: var(--track-h1); }
h2 { font-size: var(--size-h2); font-weight: 500; line-height: var(--lh-h2); letter-spacing: var(--track-h2); }
h3 { font-size: var(--size-h3); font-weight: 600; }

p { margin: 0; color: var(--ink-soft); text-wrap: pretty; }

a { color: var(--green); text-underline-offset: 2px; }
a:hover { color: var(--green-deep); }

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

button { font: inherit; color: inherit; }

/* Keyboard focus is always visible. Pointer focus is not. */
:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Visually hidden, still read aloud. */
/* A `display` rule in this file would otherwise outrank the UA's own
   [hidden] rule, which the chat widget relies on to stay out of the way. */
[hidden] { display: none !important; }

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

/* Skip link: parked off-screen until focused. */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-button);
  padding: 12px 18px;
  font-weight: 600;
  text-decoration: none;
  transition: top 120ms ease-out;
}
.skip-link:focus { top: 12px; }

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

/* ==========================================================================
   Shared furniture
   ========================================================================== */

.shell {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  font-size: var(--size-eyebrow);
  font-weight: 600;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--green);
}

/* Anchor targets sit clear of the viewport edge when jumped to from the nav. */
main section[id] { scroll-margin-top: 24px; }

.caption { font-size: 14.5px; color: var(--ink-soft); }

.label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ==========================================================================
   Icons
   The sprite is parked out of flow; each glyph is drawn through <use>. Symbols
   set stroke="currentColor" and no stroke-width, so both are controlled here.
   ========================================================================== */

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon { flex: 0 0 auto; }

.icon--card        { width: 26px;  height: 26px;  stroke-width: 1.5;  color: var(--green); }
.icon--tick        { width: 18px;  height: 18px;  stroke-width: 1.8;  color: var(--green); }
.icon--state       { width: 17px;  height: 17px;  stroke-width: 1.9; }
.icon--class       { width: 19px;  height: 19px;  stroke-width: 1.6;  color: var(--green-mid); }
.icon--portrait    { width: 112px; height: 112px; stroke-width: 2;    color: var(--placeholder-stroke); }
.icon--portrait-sm { width: 62px;  height: 62px;  stroke-width: 2.4;  color: var(--placeholder-stroke); }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-min);
  padding: 17px 30px;
  border: 0;
  border-radius: var(--radius-button);
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease-out;
}

.btn--primary { background: var(--green); color: var(--bg); }
.btn--primary:hover { background: var(--green-deep); color: var(--bg); }

/* Sits on the dark green bands. */
.btn--cream { background: var(--sand); color: var(--green-deep); }
.btn--cream:hover { background: var(--cream); color: var(--green-deep); }

/* ==========================================================================
   Bands and sections
   A band paints the full-bleed background and owns the vertical rhythm; the
   .shell inside it owns the content column.
   ========================================================================== */

.band { padding-block: var(--section-y); }
.band--sand    { background: var(--sand); }
.band--surface { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band--green   { background: var(--green-deep); }

.section { display: flex; flex-direction: column; gap: 36px; }

.section__head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 680px;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header { border-bottom: 1px solid var(--line); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 22px;
}

.wordmark-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: inherit;
}

.wordmark {
  font-family: var(--display);
  font-size: 23px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.wordmark-sub {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 15px;
}

.site-nav a { color: var(--ink-soft); text-decoration: none; }
.site-nav a:hover { color: var(--green); text-decoration: underline; }

.nav-phone {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-button);
  padding: 10px 18px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}

/* The pill is a tel: link sitting inside .site-nav, whose link rule would
   otherwise win on colour and add an underline on hover. The pill keeps its
   own treatment: the border reacts, the text doesn't. */
.site-nav .nav-phone { color: var(--ink); text-decoration: none; }
.site-nav .nav-phone:hover { color: var(--green); border-color: var(--green); }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  display: flex;
  gap: 62px;
  align-items: center;
  padding-block: 64px;
}

.hero__copy {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 600px;
}

.hero__copy .lede {
  font-size: var(--size-lede);
  line-height: var(--lh-lede);
  max-width: 520px;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-top: 12px;
}

.hero__portrait { flex: 0 0 516px; position: relative; }

/* ---- the bracketed photo placeholders ---------------------------------- */

.portrait-frame {
  background: var(--sand-deep);
  border-radius: var(--radius-panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 24px;
  text-align: center;
}

.portrait-frame .icon { margin-bottom: 13px; }

.portrait-frame--hero { height: 580px; }

.portrait-frame--about {
  flex: 0 0 250px;
  height: 300px;
  border-radius: var(--radius-card);
}

/* ---- the real photo, once it exists ------------------------------------ */

/* The frame keeps its size and radius at every breakpoint; the photo fills
   it and object-position keeps the faces in view where the frame is a
   different shape from the file (the about frame goes landscape on a phone). */
.portrait-frame--photo {
  display: block;
  padding: 0;
  overflow: hidden;
}

.portrait-frame__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The <picture> around each photo only chooses the file; it must not become a
   flex item of its own, or the image's 100% height has nothing to resolve
   against. */
.portrait-frame picture { display: contents; }

.portrait-frame__img--hero  { object-position: center 30%; }
.portrait-frame__img--about { object-position: center 20%; }

.portrait-frame__label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--placeholder-label);
}

.portrait-frame--about .portrait-frame__label { font-size: 11.5px; letter-spacing: 0.12em; }

.portrait-frame__hint { font-size: 13.5px; color: var(--placeholder-stroke); }

/* ---- the card tucked over the portrait --------------------------------- */

.name-card {
  position: absolute;
  left: -28px;
  bottom: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 17px 23px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: var(--shadow-float);
}

.name-card__name {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
}

.name-card__org {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.name-card__note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 5px;
  padding-top: 9px;
  border-top: 1px solid var(--line-light);
  font-size: var(--size-caption);
}

.dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
}

/* ==========================================================================
   Segment cards
   ========================================================================== */

.card-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  /* Three columns at desktop width. auto-fit folds to two and then one on the
     way down instead of crushing three cards into a phone. */
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--grid-gap);
}

.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.card p { font-size: var(--size-card); line-height: var(--lh-card); }

/* ==========================================================================
   Two-column sections (what you get, free class)
   ========================================================================== */

.split {
  display: flex;
  gap: 68px;
  align-items: center;
  padding-block: var(--section-y);
}

.split__copy {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 500px;
}

.split__lede { font-size: var(--size-body); line-height: var(--lh-lede); }

.split--class { gap: 60px; }
.split--class .split__copy { gap: 15px; max-width: 620px; }
.split--class h2 { font-size: var(--size-h2-sm); }

.tick-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tick-list li {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: var(--size-card);
  color: var(--ink-soft);
}

/* ---- results preview --------------------------------------------------- */
/* Named generically on purpose: the survey results in Phase 2 reuse the score
   bar and the check list. */

.results-card {
  flex: 0 0 410px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow-card);
}

.results-card__head { display: flex; flex-direction: column; gap: 9px; }

.results-card__score {
  font-family: var(--display);
  font-size: 27px;
  font-weight: 500;
  color: var(--ink);
}

.results-card .caption { font-size: var(--size-caption); line-height: 1.5; color: var(--ink-muted); }

.score-bar { display: flex; gap: 5px; }

.score-bar__seg {
  height: 6px;
  flex: 1 1 0;
  border-radius: 3px;
  background: var(--line);
}

.score-bar__seg.is-filled { background: var(--green); }

.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-block: 13px;
  border-top: 1px solid var(--line-light);
  font-size: var(--size-card);
  color: var(--ink);
}

.check-item:last-child { border-bottom: 1px solid var(--line-light); }

.check-item .icon--state { color: var(--green); }

/* A gap is the only thing that ever gets --flag. */
.check-item--gap { color: var(--ink-soft); }
.check-item--gap .icon--state { color: var(--flag); }

/* ==========================================================================
   About Kelvin
   ========================================================================== */

.about { display: flex; gap: 60px; align-items: flex-start; }

.about__copy {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 720px;
}

.about h2 { font-size: var(--size-h2-sm); }

.about__para { font-size: 17.5px; line-height: 1.65; color: var(--ink-strong); }

.pill-row {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: var(--size-caption);
  color: var(--ink-soft);
}

/* ==========================================================================
   Free class card
   ========================================================================== */

.class-card {
  flex: 0 0 400px;
  background: var(--green-deep);
  border-radius: var(--radius-card);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---- the class signup ---------------------------------------------------
   No recurring schedule yet, so the card holds a short form rather than a
   date and a button. It sits on --green-deep, which is why the fields get a
   dark variant instead of the page's default. */

.class-card__lede {
  font-size: var(--size-card);
  line-height: 1.6;
  color: var(--green-pale);
}

.class-form { display: flex; flex-direction: column; gap: 18px; }

.fields--dark { gap: 14px; max-width: none; }

.fields--dark .field label { color: var(--cream); }
.fields--dark .field__optional,
.fields--dark .field__hint { color: var(--green-soft); }

.fields--dark .field input {
  min-height: var(--tap-min);
  padding: 11px 14px;
  font-size: 16px;   /* iOS zooms the page on focus below 16px */
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--cream);
}

.fields--dark .field input::placeholder { color: var(--green-soft); }

.fields--dark .field input:focus-visible {
  border-color: var(--cream);
  outline-color: var(--cream);
}

/* --flag is tuned for the light page and goes muddy on the dark card. */
.fields--dark .field input[aria-invalid="true"] { border-color: #E8A08C; }
.fields--dark .field__error,
.class-form__error { font-size: 14px; color: #E8A08C; }

.class-form__note { font-size: 13.5px; line-height: 1.5; color: var(--green-soft); }

.class-card__done {
  font-size: var(--size-card);
  line-height: 1.6;
  color: var(--cream);
}

.class-card__details {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.class-card__details li {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 16px;
  color: var(--cream);
}

/* ==========================================================================
   Closing CTA band
   ========================================================================== */

.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

.cta-band__copy { display: flex; flex-direction: column; gap: 11px; max-width: 640px; }
.cta-band h2 { font-size: var(--size-h2-sm); color: var(--cream); }
.cta-band__copy p { color: var(--green-pale); }

.cta-band__action { flex: 0 0 auto; display: flex; flex-direction: column; gap: 11px; }
.cta-band__action .btn { padding-inline: 32px; white-space: nowrap; }
.cta-band__alt { font-size: 14.5px; color: var(--green-soft); text-align: center; }
.cta-band__alt a { color: var(--cream); text-decoration: underline; }

/* Inline phone and email links in a line of text. Padding grows the tap area
   to 44px and the matching negative margin keeps the line where it was. */
.cta-band__alt a,
.site-footer__meta a {
  display: inline-block;
  padding-block: 13px;
  margin-block: -13px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  padding-block: 42px 50px;
}

.site-footer__id { display: flex; flex-direction: column; gap: 9px; }

.site-footer__name {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 500;
  color: var(--ink);
}

.site-footer__meta { font-size: 14.5px; color: var(--ink-muted); }

/* The Generation Living Trusts mark. It appears once on the site, here, because
   the footer is where people go looking for who is behind a page. The label
   sits beside it rather than above it so the two read as one lockup instead of
   a floating image, and it stays smaller than Kelvin's own name: his is the
   brand being chosen, this is the company standing behind it. Capped well under
   the source file's 300px so it stays sharp on a 2x screen. */
.site-footer__affil {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 2px;
}

.site-footer__logo { width: 96px; height: auto; }

.disclaimer {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-muted);
  max-width: 430px;
  text-align: right;
}

/* ==========================================================================
   Responsive
   The mockups are a fixed 1440px; everything below was built here.

   Two breakpoints, for two different reasons:

     1240px — the two-column rows give up. The hero's portrait (516px) and the
              results card (410px) are fixed widths, so the text column beside
              them absorbs every pixel lost. Measured: at 1140px it is down to
              418px, which wraps the hero heading to four lines and breaks the
              button label across two. Below ~880px it overflowed outright.
              1240px is where the text column still clears 500px.

      760px — phone. Type scales down through :root, gutters tighten, rows and
              buttons go full width, and every tap target clears 44px.
   ========================================================================== */

/* ---- tablet and down: the two-column rows stack ------------------------ */

@media (max-width: 1240px) {

  .hero {
    flex-direction: column;
    align-items: stretch;
    gap: 34px;
  }

  /* Stacked, these would otherwise run to the full content width, which is far
     too long a line for a 57px display face. */
  .hero__copy { max-width: 720px; }
  .hero__copy .lede { max-width: 620px; }

  .hero__portrait {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* The card comes out of the overlap and sits under the frame. */
  .name-card { position: static; }

  /* Keeps the frame's 516x580 shape instead of stretching it into a letterbox
     the width of the content column. */
  .portrait-frame--hero { max-width: 516px; }

  .split {
    flex-direction: column;
    align-items: stretch;
    gap: 32px;
  }

  .split__copy { max-width: 720px; }

  /* Same reasoning: full-width panels read as a different design. */
  .results-card,
  .class-card { flex: 1 1 auto; max-width: 560px; }
}

/* ---- phone ------------------------------------------------------------- */

@media (max-width: 760px) {

  .site-header__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .site-nav {
    flex-wrap: wrap;
    gap: 0 22px;
    width: 100%;
  }

  .site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap-min);
  }

  .nav-phone { min-height: var(--tap-min); }

  /* ---- hero ---- */
  .hero { padding-block: 40px var(--section-y); }

  .hero__cta {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .portrait-frame--hero { height: 360px; }
  .portrait-frame--hero .icon--portrait { width: 84px; height: 84px; }

  /* ---- sections ---- */
  .section { gap: 26px; }
  .card-grid { grid-template-columns: 1fr; }

  .results-card { padding: 22px; }
  .class-card { padding: 26px; }

  .about { flex-direction: column; gap: 28px; }
  .about__copy { max-width: none; }

  .portrait-frame--about {
    flex: 1 1 auto;
    width: 100%;
    height: 240px;
  }

  /* ---- closing band and footer ---- */
  .cta-band {
    flex-direction: column;
    align-items: stretch;
    gap: 26px;
  }

  .cta-band__copy { max-width: none; }
  .cta-band__action .btn { width: 100%; }

  .site-footer__inner {
    flex-direction: column;
    gap: 22px;
    padding-block: 32px 40px;
  }

  .disclaimer { max-width: none; text-align: left; }
}

/* ==========================================================================
   The Readiness Check (public/check.html)
   Question screens follow design-reference/survey-question.html. The contact
   gate and the results screen have no mockup; the results reuse the landing
   page's results card, score bar and check list.
   ========================================================================== */

/* The page is a column the height of the viewport, so the question sits in
   the middle of a phone screen and the footer stays at the bottom. */
.check-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.check-page .site-footer { margin-top: auto; }

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

.site-header--check .wordmark { font-size: 20px; }
.site-header--check .wordmark-sub { font-size: 10.5px; }

.step-counter {
  font-size: 14.5px;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* ---- progress ---------------------------------------------------------- */

.progress { height: 3px; background: var(--progress-track); }

.progress__fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--green);
  transition: width 240ms ease-out;
}

/* Driven by data attributes rather than an inline style, which the CSP would
   block. The number of questions depends on the first answer, so the bar is a
   pair: which question, out of how many.

   The widths are deliberately not linear. A meta-analysis of 32 randomised
   experiments (Villar, Callegaro & Yang 2013) found a constant-speed progress
   bar does nothing for drop-off, a bar that moves fast early and slows later
   reduces it, and a slow-then-fast bar makes it worse. So each step is
   (n / total) ^ 0.7: early progress feels quick, the last stretch is honest. */
.progress__fill[data-total="4"][data-step="1"] { width: 38%; }
.progress__fill[data-total="4"][data-step="2"] { width: 62%; }
.progress__fill[data-total="4"][data-step="3"] { width: 82%; }

.progress__fill[data-total="5"][data-step="1"] { width: 32%; }
.progress__fill[data-total="5"][data-step="2"] { width: 53%; }
.progress__fill[data-total="5"][data-step="3"] { width: 70%; }
.progress__fill[data-total="5"][data-step="4"] { width: 86%; }

.progress__fill[data-total="6"][data-step="1"] { width: 29%; }
.progress__fill[data-total="6"][data-step="2"] { width: 46%; }
.progress__fill[data-total="6"][data-step="3"] { width: 62%; }
.progress__fill[data-total="6"][data-step="4"] { width: 75%; }
.progress__fill[data-total="6"][data-step="5"] { width: 88%; }

/* The last question, the gate and the results all sit on a full bar. */
.progress__fill[data-total="4"][data-step="4"],
.progress__fill[data-total="5"][data-step="5"],
.progress__fill[data-total="6"][data-step="6"],
.progress__fill[data-step="gate"],
.progress__fill[data-step="done"] { width: 100%; }

/* ---- stage ------------------------------------------------------------- */

.check,
.check__form {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.check__stage {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px var(--gutter);
}

.step {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}

.step__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  max-width: 720px;
  text-align: center;
}

.step__title {
  font-size: var(--size-h1-check);
  line-height: 1.14;
  letter-spacing: -0.02em;
  font-weight: 500;
}

.step__hint {
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 560px;
}

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

.options {
  display: flex;
  flex-direction: column;
  gap: 13px;
  width: 100%;
  max-width: 620px;
}

.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--tap-min);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 21px 24px;
  font-size: 17px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 120ms ease-out, box-shadow 120ms ease-out;
}

.option:hover { border-color: var(--line-strong); }

.option__radio {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 120ms ease-out, border-color 120ms ease-out;
}

.icon--option {
  width: 13px;
  height: 13px;
  stroke-width: 2.4;
  color: var(--surface);
  opacity: 0;
}

/* The selected card: a 2px green border in place of the 1px one, padding
   pulled in by a pixel so the text does not shift. */
.option:has(.option__input:checked) {
  border: 2px solid var(--green);
  padding: 20px 23px;
  box-shadow: 0 10px 24px -20px rgba(30, 64, 47, 0.8);
  font-weight: 500;
}

.option:has(.option__input:checked) .option__radio {
  border-color: var(--green);
  background: var(--green);
}

.option:has(.option__input:checked) .icon--option { opacity: 1; }

/* The radio itself is visually hidden; keyboard focus shows on the card. */
.option:has(.option__input:focus-visible) {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

/* The household question takes more than one answer, so its control is a
   rounded square rather than a circle: the shape is how people tell "pick one"
   from "pick any" before they read a word of the hint. */
.option--multi .option__radio { border-radius: 7px; }

/* ---- actions and messages ---------------------------------------------- */

.step__actions {
  display: flex;
  align-items: center;
  gap: 26px;
}

.link-back {
  background: none;
  border: 0;
  padding: 10px 4px;
  min-height: var(--tap-min);
  font-size: 15.5px;
  color: var(--ink-muted);
  cursor: pointer;
}

.link-back:hover { color: var(--green); text-decoration: underline; }

.btn--next { padding: 16px 38px; }

.btn[disabled] { opacity: 0.7; cursor: progress; }

/* Validation messages. --flag marks something missing, which is exactly what
   these are. */
.step__error {
  font-size: 15px;
  color: var(--flag);
  text-align: center;
  max-width: 620px;
}

/* ---- contact gate ------------------------------------------------------ */

.fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 620px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}

.field__optional { font-weight: 400; color: var(--ink-muted); }

.field input {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font: inherit;
  font-size: 17px;
  color: var(--ink);
}

.field input:focus-visible {
  border-color: var(--green);
  border-radius: 8px;
  outline-offset: 0;
}

.field input[aria-invalid="true"] { border-color: var(--flag); }

.field__hint { font-size: 13.5px; color: var(--ink-muted); }

.field__error { font-size: 14px; color: var(--flag); }

/* The honeypot: off-screen, not display:none, so a bot that checks for
   hidden fields still sees a field to fill. */
.field--trap {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- results ----------------------------------------------------------- */

.results { max-width: 720px; gap: 32px; }

.results__summary {
  font-size: var(--size-lede);
  line-height: var(--lh-lede);
  color: var(--ink-soft);
  max-width: 620px;
}

/* The line matched to the closing question. Set quieter than the summary above
   it: it is context, not the headline. */
.results__stage-note {
  font-size: var(--size-body);
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: 620px;
}

.results-card--full {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
}

/* A results row with the "why it matters" line under the label. */
.check-item--stack {
  align-items: flex-start;
  padding-block: 16px;
}

.check-item--stack .icon--state { margin-top: 3px; }

.check-item__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.check-item__label {
  font-size: 16.5px;
  font-weight: 500;
  color: var(--ink);
}

.check-item__state {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.check-item--gap .check-item__state { color: var(--flag); }

.check-item__why {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-top: 4px;
}

.results__next {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding-top: 8px;
}

.results__heading { font-size: 26px; }

.results__ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 12px;
}

.btn--secondary {
  background: transparent;
  border: 1px solid var(--green);
  color: var(--green);
}

.btn--secondary:hover { background: var(--sand); color: var(--green-deep); }

/* The booking button until CALENDLY_URL exists: a visible placeholder, like
   every other piece of content Kelvin still owes. */
.btn--pending {
  background: var(--sand-deep);
  color: var(--placeholder-label);
  cursor: default;
}

.results__mail { color: var(--ink-muted); }

/* ---- the note under the form ------------------------------------------- */

.check__note {
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-faint);
  padding: 20px var(--gutter) 26px;
}

/* ---- phone ------------------------------------------------------------- */

@media (max-width: 760px) {

  /* Just a wordmark and a counter: they fit on one row, unlike the full nav. */
  .site-header--check .site-header__inner {
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }

  .check__stage {
    justify-content: flex-start;
    padding: 28px var(--gutter) 32px;
  }

  .step { gap: 26px; }

  .option { padding: 16px 18px; font-size: 16.5px; }
  .option:has(.option__input:checked) { padding: 15px 17px; }

  .step__actions {
    flex-direction: column-reverse;
    align-items: stretch;
    width: 100%;
    gap: 6px;
  }

  .btn--next { width: 100%; }
  .link-back { align-self: center; }

  .results { gap: 26px; }
  .results__ctas { flex-direction: column; align-items: stretch; width: 100%; }
}

/* ==========================================================================
   The Assistant (public/js/chat.js)
   Follows design-reference/chat-assistant.html. The mockup shows the panel
   open on a 1440px page; the launcher, the teaser, and every mobile rule
   below were built here.

   The panel is `position: fixed` and inert until opened, so it costs the
   landing page nothing but a button until someone reaches for it.
   ========================================================================== */

.chat {
  position: fixed;
  right: 40px;
  bottom: 34px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  /* The bar is only as wide as its contents so the page stays clickable
     around it. */
  width: min(400px, calc(100vw - 32px));
}

/* ---- launcher and teaser ------------------------------------------------ */

.chat__teaser {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 100%;
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-float);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  text-align: left;
}

.chat__teaser-text {
  flex: 1 1 auto;
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

/* A small square so the dismiss target stays ≥44px without the bubble
   growing to match. */
.chat__teaser-close {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: -4px -4px 0 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 50%;
  color: var(--ink-muted);
  cursor: pointer;
}
.chat__teaser-close:hover { color: var(--ink); background: var(--sand); }

.chat__launcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap-min);
  padding: 12px 22px 12px 18px;
  background: var(--green-deep);
  border: 0;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-button);
  color: var(--cream);
  font-family: var(--body);
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 120ms ease-out;
}
.chat__launcher:hover { background: var(--green); }

.icon--chat  { width: 22px; height: 22px; stroke-width: 1.7; }
.icon--close { width: 18px; height: 18px; stroke-width: 1.8; }
.icon--send  { width: 17px; height: 17px; stroke-width: 1.8; }
.icon--x     { width: 14px; height: 14px; stroke-width: 1.9; }

/* ---- the panel ---------------------------------------------------------- */

.chat__panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: min(620px, calc(100dvh - 90px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-widget);
  overflow: hidden;
}

.chat__header {
  display: flex;
  align-items: center;
  gap: 13px;
  flex: 0 0 auto;
  padding: 17px 20px;
  background: var(--green-deep);
}

.chat__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--green);
  color: var(--cream);
}

.chat__id {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 0;
  min-width: 0;
}

.chat__title { font-size: 15.5px; font-weight: 600; color: var(--cream); }
.chat__status { font-size: 13px; color: var(--green-soft); }

.chat__close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: var(--tap-min);
  height: var(--tap-min);
  margin-right: -11px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 50%;
  color: var(--green-soft);
  cursor: pointer;
}
.chat__close:hover { color: var(--cream); }

/* ---- the conversation --------------------------------------------------- */

.chat__log {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 20px;
  background: var(--chat-log);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.bubble {
  max-width: 88%;
  padding: 12px 15px;
  font-size: 14.8px;
  line-height: 1.5;
  /* Someone will paste an account number or a long URL in here. */
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.bubble--assistant {
  align-self: flex-start;
  background: var(--chat-bubble);
  border-radius: 13px 13px 13px 3px;
  color: var(--ink);
}

.bubble--visitor {
  align-self: flex-end;
  max-width: 80%;
  background: var(--green);
  border-radius: 13px 13px 3px 13px;
  color: var(--cream);
}

/* Trouble on our end, not something either side said. */
.bubble--note {
  align-self: stretch;
  max-width: 100%;
  background: none;
  border: 1px dashed var(--line);
  border-radius: var(--radius-card);
  color: var(--ink-soft);
  font-size: 14px;
}

/* Three dots while the model is answering. */
.chat__typing {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 14px 16px;
  background: var(--chat-bubble);
  border-radius: 13px 13px 13px 3px;
}

.chat__typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-muted);
  animation: chat-blink 1.3s infinite ease-in-out both;
}
.chat__typing span:nth-child(2) { animation-delay: 0.16s; }
.chat__typing span:nth-child(3) { animation-delay: 0.32s; }

@keyframes chat-blink {
  0%, 80%, 100% { opacity: 0.25; }
  40%           { opacity: 1; }
}

/* ---- quick replies ------------------------------------------------------ */

.chat__chips {
  align-self: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  margin-top: 2px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 15px;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
  font-family: var(--body);
  font-size: 13.8px;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease-out, border-color 120ms ease-out;
}
.chip:hover { background: var(--sand); }

.chip--primary { border-color: var(--green); color: var(--green); font-weight: 600; }
.chip--primary:hover { background: var(--sand); color: var(--green-deep); }

/* ---- the composer ------------------------------------------------------- */

.chat__composer {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex: 0 0 auto;
  padding: 13px 16px;
  background: var(--surface);
  border-top: 1px solid var(--progress-track);
}

.chat__input {
  flex: 1 1 0;
  min-width: 0;
  /* Grows with the message; chat.js sets the height, this is the first row. */
  height: 24px;
  max-height: 96px;
  padding: 0;
  background: none;
  border: 0;
  resize: none;
  font-family: var(--body);
  font-size: 14.8px;
  line-height: 1.5;
  color: var(--ink);
}
.chat__input::placeholder { color: var(--chat-placeholder); }
.chat__input:focus { outline: none; }
/* The composer takes the focus ring, since the textarea has no border. */
.chat__composer:focus-within { box-shadow: inset 0 0 0 2px var(--green); }

.chat__send {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  background: var(--green);
  border: 0;
  border-radius: 50%;
  color: var(--cream);
  cursor: pointer;
  transition: background-color 120ms ease-out;
}
.chat__send:hover:not(:disabled) { background: var(--green-deep); }
.chat__send:disabled { background: var(--line-strong); cursor: default; }

.chat__disclaimer {
  flex: 0 0 auto;
  padding: 0 16px 12px;
  background: var(--surface);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-faint);
}

/* --------------------------------------------------------------------------
   Phones. The mockup's 400px panel is wider than a 390px screen, so below
   this the panel becomes a sheet: full width, anchored to the bottom, tall
   enough to read but short enough to still see the page behind it.
   -------------------------------------------------------------------------- */

@media (max-width: 760px) {
  .chat {
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
  }

  /* On a phone the launcher sits right over the hero's primary button, so it
     stays out of the way until that button has scrolled off. chat.js sets
     the class; the teaser waits with it. */
  .chat--tucked:not(.chat--open) {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }
  .chat { transition: opacity 160ms ease-out, visibility 160ms; }

  .chat--open {
    right: 0;
    left: 0;
    bottom: 0;
    gap: 0;
  }

  .chat--open .chat__panel {
    max-height: min(86dvh, calc(100dvh - 44px));
    border-width: 1px 0 0;
    border-radius: var(--radius-panel) var(--radius-panel) 0 0;
  }

  .chat__log { padding: 16px; }

  .bubble { max-width: 90%; }
  .bubble--visitor { max-width: 85%; }

  /* Thumb-sized, one-handed. */
  .chip { min-height: var(--tap-min); padding: 11px 16px; }
  .chat__send { width: var(--tap-min); height: var(--tap-min); }

  /* The dismiss target grows to the minimum without the bubble growing with
     it: the negative margins let it overhang the padding it sits in. */
  .chat__teaser-close {
    width: var(--tap-min);
    height: var(--tap-min);
    margin: -13px -13px -13px 0;
  }
  .chat__composer { padding: 10px 12px 10px 16px; }
  .chat__disclaimer { padding: 0 16px 10px; }

  /* 16px keeps iOS from zooming the page when the field takes focus. */
  .chat__input { font-size: 16px; height: 26px; }
}
