/* Root & Branch — Draft A, airy variant (taupe / moss / terra cotta, Montserrat headings)
   Based on Draft A "Beneath the Surface"
   The page is a cross-section of one tree: each band is a flat colour that deepens with depth.
   Type: Zodiak headings, Montserrat text. Sizes: 52–56 hero / 40 heading / 18 body / 14 small. */

:root {
  /* airy palette (Jaime's brief): taupe, moss green, terra cotta */
  --canopy: #F7F3EC;    /* warm off-white: page and rail */
  --cream: #F7F3EC;     /* light text on dark moss */
  --sage: #959B65;      /* logo olive: About band */
  --olive: #7F9C90;     /* logo sage-teal: Play therapy band */
  --taupe: #C49A6C;     /* logo tan: fees, insurance, contact */
  --copper: #A9583C;    /* terra cotta: buttons, borders (white text 5.1:1) */
  --terracotta-soft: #C2694A; /* drawn roots (decorative) */
  --deep: #3E4530;      /* deep moss: text, dark bars */
  --deeper: #343A28;    /* footer */
  --ink-dark: #25271E;  /* text on the logo-colour bands (5.1:1 or better) */

  --rail: 264px;
  --gutter: clamp(20px, 5vw, 72px);
  --ease: cubic-bezier(.22, 1, .36, 1);


  /* heading face: Montserrat Medium (client preference) */
  --font-head: Montserrat, system-ui, sans-serif;
  --head-weight: 500;
  --head-track: -.02em;
  /* hero tagline: up to 76px, and never wider than the column allows "Rooted in who you are." (≈11.2em in Montserrat Medium) to sit on one line */
  --fs-hero: min(72px, calc((100vw - var(--rail) - 2 * var(--gutter)) / 11.6));
  --fs-h2: clamp(30px, 3.2vw, 40px);
  --fs-body: 18px;

  /* large screens: content centres in the space right of the rail once there's room (no-op on laptops) */
  --wrap-max: calc(1180px + 2 * var(--gutter));
  --center: max(0px, (100vw - var(--rail) - var(--wrap-max)) / 2);
  --art-max: 1400px;
  --fs-small: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--canopy);
  color: var(--deep);
  font: 500 var(--fs-body)/1.65 Montserrat, system-ui, sans-serif;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
p { margin: 0 0 1.1em; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--deep); color: var(--cream); padding: 10px 16px; }
.skip:focus { left: 8px; }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small { font-size: var(--fs-small); line-height: 1.6; font-weight: 500; }
.h2 { font-family: var(--font-head); font-size: var(--fs-h2); font-weight: var(--head-weight); line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .9em; }
.h3 { font-family: var(--font-head); font-size: var(--fs-h2); font-weight: var(--head-weight); line-height: 1.15; letter-spacing: var(--head-track); margin: 0 0 .7em; }

/* ---------- buttons: fully round, decided once ---------- */
.btn {
  display: inline-block; border: 0; cursor: pointer;
  font: 600 var(--fs-small)/1 Montserrat, sans-serif; letter-spacing: .04em;
  padding: 16px 26px; border-radius: 999px; text-decoration: none;
  background: var(--deep); color: var(--cream);
  transition: transform .4s var(--ease), background-color .4s var(--ease), color .4s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn--copper { background: var(--copper); color: #fff; }

/* ---------- the depth rail ---------- */
.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail); z-index: 20;
  display: flex; flex-direction: column; gap: 40px;
  padding: 36px 28px 32px 32px;
  color: var(--deep); background: var(--canopy); /* stays light the whole way down */
}

.rail__logo { width: 172px; position: relative; display: block; }
.rail__logo img { width: 100%; }

.rail__nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rail__nav a { font-size: var(--fs-small); font-weight: 500; text-decoration: none; display: inline-block; padding: 6px 0; }
.rail__nav a:hover, .rail__nav a[aria-current="true"] { text-decoration: underline; }

.rail__actions { margin-top: auto; display: grid; gap: 14px; justify-items: start; }
/* bottom of the rail: plain underlined links (the phone underline says "tap to call") */
.rail__link { font-size: var(--fs-small); font-weight: 600; text-decoration: underline; text-underline-offset: .25em; }
.rail__link:hover { text-decoration-thickness: 2px; }
/* "opens in a new window" icon after the Client Portal links */
.ext { display: inline-block; vertical-align: baseline; margin-left: .35em; width: .8em; height: .8em; }
.rail__nav-portal { display: none; }
.rail__menu { display: none; }


.rail__phone-short { display: none; }

/* ---------- bands ---------- */
.band { position: relative; overflow: hidden; }
/* no-JS fallback for in-page links (a.js lands each heading exactly 100px from the top) */
[id] { scroll-margin-top: 100px; }
.wrap { margin-left: calc(var(--rail) + var(--center)); padding: 0 var(--gutter); max-width: var(--wrap-max); }
.mobile-logo { display: none; }


.canopy__img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.js .canopy__img { transform: scale(1.08); transition: transform 2.4s var(--ease); }
.is-loaded .canopy__img { transform: none; }

.band--trunk { background: var(--sage); color: var(--ink-dark); padding: clamp(88px, 13vh, 150px) 0; }
.about { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); }
.about__body { max-width: 720px; }
.headshot {
  width: 200px; aspect-ratio: 1; border-radius: 50%; background: var(--deep); color: var(--cream);
  display: grid; place-items: center; text-align: center; font-size: var(--fs-small); margin-bottom: 28px;
}
.quote { margin: 1.6em 0 0; }
.quote p { font-family: var(--font-head); font-size: var(--fs-h2); font-weight: var(--head-weight); line-height: 1.3; letter-spacing: -.01em; margin: 0; }

.band--topsoil { background: var(--olive); color: var(--ink-dark); padding-top: clamp(88px, 13vh, 150px); }
.play { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.play__photo { margin: 0; }
.play__photo img { width: 100%; }
.video { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: center; margin-top: 12px; font-size: var(--fs-small); font-weight: 600; }
.video img { width: 150px; }

/* the tree/roots drawing is capped (source art is 1600px) and centred under the content */
.ground { --art-side: max(var(--gutter), (100vw - var(--rail) - var(--art-max)) / 2); margin-left: calc(var(--rail) + var(--art-side)); margin-right: var(--art-side); -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
/* the source drawing is cropped at the top: its canopy tucks behind the playroom photo (which hides the cut edge),
   and under the text column it fades in only below the text */
.play { position: relative; z-index: 1; align-items: stretch; }
.play__photo img { height: 100%; object-fit: cover; }
.play__text { padding-bottom: clamp(40px, 4.5vw, 64px); }
.ground--tree {
  --tuck: clamp(24px, 3vw, 44px);
  aspect-ratio: 1600 / 417; margin-top: calc(var(--tuck) * -1); position: relative; z-index: 0; pointer-events: none; background: var(--deep);
  -webkit-mask-image: url(../assets/tree-above-mask.webp),
    linear-gradient(to bottom, transparent 0, #000 calc(var(--tuck) + 40px)),
    linear-gradient(to right, #000 50%, transparent 53%);
  -webkit-mask-composite: source-in, source-over;
  mask-image: url(../assets/tree-above-mask.webp),
    linear-gradient(to bottom, transparent 0, #000 calc(var(--tuck) + 40px)),
    linear-gradient(to right, #000 50%, transparent 53%);
  mask-composite: intersect, add;
}
/* the roots fade out toward the bottom instead of ending on the drawing's hard edge */
.ground--roots {
  aspect-ratio: 1600 / 489; margin-top: -1px; background: var(--terracotta-soft); opacity: .75; pointer-events: none;
  -webkit-mask-image: url(../assets/roots-below-mask.webp), linear-gradient(to bottom, #000 45%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: url(../assets/roots-below-mask.webp), linear-gradient(to bottom, #000 45%, transparent 100%);
  mask-composite: intersect;
}

.band--roots { background: var(--taupe); color: var(--ink-dark); padding-bottom: clamp(88px, 13vh, 150px); }
.fees { margin-top: clamp(40px, 6vh, 72px); }

.picker { border: 0; padding: 0; margin: 0 0 48px; display: flex; flex-wrap: wrap; gap: 10px; }
.picker legend { font-size: var(--fs-small); font-weight: 600; margin-bottom: 14px; padding: 0; }
.picker label {
  position: relative; cursor: pointer; font-size: var(--fs-small); font-weight: 600;
  padding: 12px 20px; border: 1px solid var(--ink-dark); border-radius: 999px;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
.picker input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.picker label:has(input:checked) { background: var(--copper); color: #fff; }
.picker label:has(input:focus-visible) { outline: 2px solid var(--ink-dark); outline-offset: 3px; }

/* "Who is this for?" result: the visit sequence, each step with its own fee */
.plan { max-width: 1000px; margin: 0 0 56px; border: 1px solid var(--ink-dark); padding: clamp(24px, 3vw, 40px); }
.plan__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; }
.plan__step { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 8px 32px; align-items: baseline; }
.plan__step + .plan__step { padding-top: 28px; border-top: 1px solid rgba(169, 88, 60, .35); }
.plan__when { font-size: var(--fs-small); font-weight: 600; color: var(--ink-dark); }
.plan__what { margin: 0; }
.plan__fee { font-family: var(--font-head); font-size: var(--fs-h2); font-weight: var(--head-weight); line-height: 1; color: var(--ink-dark); }
.plan__fee small { display: block; font-family: Montserrat, sans-serif; font-size: var(--fs-small); font-weight: 500; color: var(--ink-dark); margin-top: 6px; text-align: right; }
.plan__note { grid-column: 2 / -1; margin: 0; font-size: var(--fs-small); }
.js .plan:not([hidden]) { animation: plan-in .7s var(--ease); }
@keyframes plan-in { from { opacity: 0; transform: translate3d(0, 12px, 0); } }

.fees-table { width: 100%; max-width: 1000px; border-collapse: collapse; }
.fees-table caption { text-align: left; font-size: var(--fs-small); font-weight: 600; padding-bottom: 12px; }
.fees-table th, .fees-table td { text-align: left; font-weight: 500; padding: 16px 16px 16px 0; border-bottom: 1px solid rgba(169, 88, 60, .35); }
.fees-table thead th { font-size: var(--fs-small); font-weight: 600; padding-top: 0; }
.fees-table td:last-child, .fees-table thead th:last-child { text-align: right; padding-right: 0; }
.fees-table td:last-child { color: var(--ink-dark); font-weight: 600; }
.fees-note { max-width: 1000px; margin-top: 16px; }

.insurance { margin-top: clamp(88px, 12vh, 140px); }
.insurance p { max-width: 1000px; }

.contact { margin-top: clamp(88px, 12vh, 140px); }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 40px; max-width: 1000px; }
.field { display: grid; gap: 6px; }
.field--wide { grid-column: 1 / -1; }
.field label { font-size: var(--fs-small); font-weight: 600; }
.field input, .field textarea {
  font: inherit; color: var(--ink-dark); background: transparent;
  border: 0; border-bottom: 1px solid var(--ink-dark); border-radius: 0; padding: 10px 0;
}
.field textarea { resize: vertical; border: 1px solid var(--ink-dark); padding: 12px; }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--ink-dark); outline-offset: 2px; }
.form__privacy { margin: 0; }
.form__status { margin-left: 16px; }

.footer { background: var(--deeper); color: var(--cream); padding: 72px 0 40px; }
.footer__inner { display: grid; grid-template-columns: 200px 1fr auto; gap: 40px 64px; align-items: start; }
.footer__logo { width: 180px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: var(--fs-small); }
.footer__legal { grid-column: 1 / -1; margin: 24px 0 0; }

/* ---------- hero: full-height photo beside the rail, headline and intro over a dark fade ---------- */
.hero { padding: 0; margin-left: var(--rail); position: relative; height: max(640px, 100vh); background: var(--deep); }
.hero__media { position: absolute; inset: 0; overflow: hidden; margin: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(40, 44, 30, .85) 0%, rgba(40, 44, 30, .62) 42%, rgba(40, 44, 30, 0) 80%);
}
.hero__text { position: absolute; left: 0; right: 0; bottom: 0; color: #fff; padding: 0 var(--gutter) clamp(48px, 8vh, 88px) calc(var(--gutter) + var(--center)); }
.hero__inner { max-width: 1000px; }
.hero__h1 { font-family: var(--font-head); font-size: var(--fs-hero); font-weight: var(--head-weight); line-height: 1.12; letter-spacing: var(--head-track); margin: 0; }
.hero__h1 .line { display: block; text-wrap: balance; }
.hero__h1 .line:first-child { white-space: nowrap; }
.hero__h1 .line:nth-child(2) { transition-delay: .14s; }
.hero__lede { font-size: 20px; font-weight: 500; line-height: 1.5; color: #fff; margin: 28px 0 0; max-width: 34em; transition-delay: .28s; }
.hero__cta { margin-top: 36px; font-size: 17px; padding: 22px 40px; transition-delay: .4s; }

/* the practice's idea as a wide statement across the top of the About band */
.intro { margin-bottom: clamp(64px, 10vh, 112px); }
.intro__statement { font-family: var(--font-head); font-size: var(--fs-h2); font-weight: var(--head-weight); line-height: 1.3; letter-spacing: var(--head-track); max-width: 26em; margin: 0; }

/* ---------- entrances (Sage Hill recipe: one fade, 32px rise, once) ---------- */
.js .reveal { opacity: 0; transform: translate3d(0, 32px, 0); transition: opacity 1.1s var(--ease), transform 1.3s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .plan:not([hidden]) { animation: none; }
  .js .reveal, .js .canopy__img { opacity: 1; transform: none; transition: none; }
}

/* ---------- phones & small tablets: rail becomes a bottom bar ---------- */
@media (max-width: 1023px) {
  :root { --rail: 0px; }
  body { padding-bottom: 76px; }
  .rail {
    inset: auto 0 0 0; width: auto; height: auto; padding: 12px var(--gutter);
    flex-direction: row; align-items: center; gap: 12px;
    background: var(--deep); color: var(--cream);
  }
  .rail__logo { display: none; }
  .rail__actions { margin: 0; width: 100%; grid-template-columns: auto 1fr auto; align-items: center; }
  /* phone bottom bar: Request Appointment stays a copper button */
  .rail__request { order: 3; text-decoration: none; background: var(--copper); color: #fff; padding: 14px 20px; border-radius: 999px; white-space: nowrap; }
  .rail__menu { display: inline-block; order: 1; font: 600 var(--fs-small)/1 Montserrat, sans-serif; color: var(--cream); background: none; border: 1px solid var(--cream); border-radius: 999px; padding: 13px 18px; cursor: pointer; }
  .rail__phone { order: 2; justify-self: center; }
  .rail__phone-long { display: none; }
  .rail__phone-short { display: inline; }
  .rail__nav { position: absolute; left: 0; right: 0; bottom: 100%; background: var(--deep); padding: 20px var(--gutter) 8px; display: none; }
  .rail.is-open .rail__nav { display: block; }
  .rail__nav a { font-size: var(--fs-body); }
  .mobile-logo { display: block; width: 168px; margin-bottom: 48px; }
  /* phones: the hero grows with its text instead of letting it ride up under the logo */
  .hero { margin-left: 0; height: auto; min-height: 92vh; display: flex; flex-direction: column; justify-content: flex-end; }
  .hero .hero__text { position: relative; padding-top: 150px; }
  .hero__media::after { background: linear-gradient(to top, rgba(40, 44, 30, .88) 0%, rgba(40, 44, 30, .72) 55%, rgba(40, 44, 30, .55) 100%); }
  .mobile-logo--light { position: absolute; z-index: 2; top: 28px; left: var(--gutter); width: 140px; margin: 0; }
  .hero__lede { margin-top: 20px; font-size: 17px; }
  .rail__portal { display: none; }
  .rail__nav-portal { display: list-item; }
  .about, .play, .form, .footer__inner { grid-template-columns: minmax(0, 1fr); }
  .plan__step { grid-template-columns: minmax(0, 1fr) auto; }
  .plan__when { grid-column: 1 / -1; }
  .plan__note { grid-column: 1 / -1; }
  .fees-table th, .fees-table td { padding-right: 10px; font-size: 16px; }
  .headshot { width: 150px; }
  .ground { margin-left: var(--gutter); }
  .ground--tree { --tuck: 0px; margin-top: 32px;
    -webkit-mask-image: url(../assets/tree-above-mask.webp), linear-gradient(to bottom, transparent 0, #000 45%); -webkit-mask-composite: source-in;
    mask-image: url(../assets/tree-above-mask.webp), linear-gradient(to bottom, transparent 0, #000 45%); mask-composite: intersect; }
  .fees { margin-top: 32px; }
}

/* ---------- very large screens: type steps up a notch ---------- */
@media (min-width: 1800px) {
  :root {
    --fs-body: 19px;
    --fs-h2: 48px;
    --fs-hero: min(84px, calc((100vw - var(--rail) - 2 * var(--gutter)) / 11.6));
  }
  .hero__lede { font-size: 22px; }
}

/* Montserrat Medium reads larger and heavier than the serif: long statements one step down */
.intro__statement, .quote p { font-size: clamp(22px, 2.3vw, 30px); line-height: 1.4; }
@media (min-width: 1800px) { .intro__statement, .quote p { font-size: 34px; } }

/* Jaime: one complete tree drawing (trunk and surface roots) in light moss, standing at the foot of the
   Play therapy band; its canopy sits behind the content, so the green is kept light for legible text */
.band--topsoil { padding-bottom: 0; }
.old-tree {
  position: relative; z-index: 0; pointer-events: none;
  width: min(1000px, calc(100% - 2 * var(--gutter))); aspect-ratio: 1800 / 1706;
  margin: -24% auto 0 calc(var(--rail) + var(--center) + var(--gutter) + max(0px, (min(100vw - var(--rail), var(--wrap-max)) - 2 * var(--gutter) - 1000px) / 2));
  background: #A3B8AF; /* light tint of the band's logo sage-teal */
  -webkit-mask: url(../assets/old-tree-mask.webp) center bottom / contain no-repeat;
  mask: url(../assets/old-tree-mask.webp) center bottom / contain no-repeat;
}
.play { position: relative; z-index: 1; }
.band--roots { padding-top: clamp(88px, 13vh, 150px); }
.fees { margin-top: 0; }
@media (max-width: 1023px) {
  .old-tree { width: calc(100% - 2 * var(--gutter)); margin: 24px var(--gutter) 0; }
  .fees { margin-top: 0; }
}
