/* =========================================================
   Family Institute of Northern Utah
   Soft earth-tone one-page site
   ========================================================= */

:root {
  /* Palette */
  --linen: #F5EFE6;
  --linen-deep: #EFE7DA;
  --sand: #E9DDCA;
  --clay: #D8BFA4;
  --terra: #9A482B;        /* text-safe terracotta (4.5:1+ on linen & sand) */
  --terra-hover: #7F3A22;
  --terra-soft: #C07A55;   /* the trail line */
  --sage: #8C9878;
  --sage-soft: #CBD1BC;
  --moss: #48533E;
  --moss-deep: #3A4432;
  --ink: #2E2924;
  --muted: #675D52;
  --white: #FFFCF7;

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Figtree", "Avenir Next", "Segoe UI", sans-serif;

  /* Layout */
  --wrap: 1180px;
  --gutter: 24px;
  --section-y: clamp(88px, 11vw, 150px);
  --radius: 22px;
  --radius-lg: 36px;
  --header-h: 84px;
  --shadow: 0 1px 2px rgba(46, 41, 36, .06), 0 12px 32px -12px rgba(46, 41, 36, .18);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--linen);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--terra); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--terra-hover); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.12; margin: 0; color: var(--ink); font-variation-settings: "opsz" 96; }
h2 { font-size: clamp(34px, 4.6vw, 56px); letter-spacing: -0.015em; }
h3 { font-size: 24px; font-variation-settings: "opsz" 36; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }
:focus-visible { outline: 2px solid var(--terra); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(100% - var(--gutter) * 2, var(--wrap)); margin-inline: auto; position: relative; z-index: 2; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--ink); color: var(--white); padding: 10px 16px; border-radius: 10px; }
.skip:focus { top: 16px; color: var(--white); }

.eyebrow {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--terra);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.eyebrow--light { color: var(--clay); }
.lead { font-size: clamp(18px, 1.6vw, 21px); color: var(--muted); max-width: 34em; }

.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  border-radius: 999px;
  background: var(--terra); color: var(--white);
  font: 600 16px/1 var(--font-body);
  text-decoration: none;
  border: 1.5px solid var(--terra);
  transition: background .25s, color .25s, border-color .25s, transform .25s;
}
.btn:hover { background: var(--terra-hover); border-color: var(--terra-hover); color: var(--white); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: rgba(46, 41, 36, .28); }
.btn--ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--white); }
.btn--small { min-height: 44px; padding: 0 20px; font-size: 15px; }

/* ---------- Trail (scroll-drawn line + leaf) ---------- */
.trail {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}
.trail path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.trail__ghost { stroke: var(--terra-soft); stroke-width: 1.5; opacity: .16; stroke-dasharray: 2 7; }
.trail__line { stroke: var(--terra-soft); stroke-width: 2.25; opacity: .85; }
.trail__leaf path { fill: var(--terra-soft); stroke: none; }
.trail__leaf { transition: opacity .4s; }
.trail.is-idle .trail__leaf { opacity: 0; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center;
  transition: background .35s, box-shadow .35s, height .35s;
}
.site-header.is-scrolled {
  background: rgba(245, 239, 230, .9);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  backdrop-filter: saturate(1.2) blur(14px);
  box-shadow: 0 1px 0 rgba(46, 41, 36, .08);
  --header-h: 70px;
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand__leaf { width: 34px; height: 34px; fill: var(--terra-soft); transform: rotate(-12deg); flex-shrink: 0; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name { font-family: var(--font-display); font-style: italic; font-size: 23px; letter-spacing: -.01em; }
.brand__sub { font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: 5px; }
.brand--light, .brand--light:hover { color: var(--linen); }
.brand--light .brand__sub { color: var(--clay); }

.nav__menu { display: flex; align-items: center; gap: 6px; }
.nav__menu a:not(.btn) {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  color: var(--ink); text-decoration: none; font-size: 16px; font-weight: 500;
  border-radius: 999px; position: relative;
}
.nav__menu a:not(.btn)::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 8px; height: 1.5px;
  background: var(--terra-soft); transform: scaleX(0); transform-origin: left; transition: transform .3s;
}
.nav__menu a:not(.btn):hover::after, .nav__menu a.is-active::after { transform: scaleX(1); }
.nav__cta { margin-left: 10px; }
.nav__toggle { display: none; }

/* ---------- Hero ---------- */
.hero { padding: calc(var(--header-h) + clamp(40px, 6vw, 90px)) 0 var(--section-y); }
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(40px, 6vw, 90px); align-items: center; }
.hero__title { font-size: clamp(44px, 6.4vw, 84px); letter-spacing: -.025em; line-height: 1.02; margin-bottom: 28px; font-variation-settings: "opsz" 144; }
.hero__title em { font-style: italic; color: var(--terra); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.hero__media { position: relative; }
.hero__media img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: 999px 999px var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow);
}
.hero__badge {
  position: absolute; left: -36px; bottom: 44px;
  background: var(--white); border-radius: 18px; padding: 18px 22px;
  box-shadow: var(--shadow); max-width: 240px;
  display: flex; flex-direction: column; gap: 4px;
}
.hero__badge-kicker { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--terra); }
.hero__badge-text { font-family: var(--font-display); font-size: 19px; line-height: 1.25; }

/* ---------- Bands ---------- */
.band { padding: var(--section-y) 0; }
.band--sand { background: var(--sand); }
.band--moss { background: var(--moss); color: var(--linen); }
.band--moss h2 { color: var(--white); }

.section-head { margin-bottom: clamp(44px, 5vw, 72px); max-width: 720px; }
.section-head--split { max-width: none; display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: end; }
.section-head__note { color: var(--muted); font-size: 19px; margin: 0; max-width: 28em; }

/* ---------- Who we help ---------- */
.needs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.need {
  background: var(--linen); border-radius: var(--radius);
  padding: 28px 24px 26px; min-height: 176px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 22px;
  font-family: var(--font-display); font-size: 21px; line-height: 1.28;
  transition: transform .3s, box-shadow .3s;
}
.need:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.need__icon { width: 28px; height: 28px; fill: none; stroke: var(--terra); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- About ---------- */
.about { padding: var(--section-y) 0; }
.about__grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(40px, 7vw, 110px); align-items: center; }
.about__media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius-lg) var(--radius-lg) 999px 999px; }
.about__copy h2 { margin-bottom: 28px; }
.about__copy > p { color: var(--muted); }
.about__sub { font-size: 22px; margin: 40px 0 8px; font-style: italic; color: var(--terra); }
.commitments li { display: grid; grid-template-columns: 56px 1fr; gap: 8px; padding: 20px 0; border-bottom: 1px solid rgba(46, 41, 36, .12); font-size: 19px; }
.commitments li:last-child { border-bottom: 0; }
.commitments__num { font-family: var(--font-display); font-style: italic; color: var(--sage); font-size: 22px; line-height: 1.3; }

/* ---------- Photo band ---------- */
.photo-band { position: relative; min-height: clamp(420px, 60vw, 640px); display: flex; align-items: flex-end; overflow: hidden; background: var(--moss-deep); }
.photo-band img { position: absolute; inset: -8% 0; width: 100%; height: 116%; object-fit: cover; will-change: transform; }
.photo-band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(40, 34, 28, .72), rgba(40, 34, 28, .05) 65%); }
.photo-band__inner { padding-bottom: clamp(48px, 7vw, 96px); z-index: 3; }
.photo-band__quote { margin: 0; max-width: 780px; }
.photo-band__quote p { font-family: var(--font-display); font-style: italic; font-size: clamp(30px, 4vw, 52px); line-height: 1.15; color: var(--white); margin: 0; letter-spacing: -.01em; }

/* ---------- Services ---------- */
.services { padding: var(--section-y) 0; }
.therapy { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-bottom: 26px; }
.card { background: var(--white); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 1px 2px rgba(46, 41, 36, .05); }
.card img { width: 100%; aspect-ratio: 16 / 11; object-fit: cover; }
.card__body { padding: 26px 28px 30px; }
.card__body h3 { margin-bottom: 10px; }
.card__body p { color: var(--muted); margin: 0; font-size: 17px; }

.programs { display: grid; grid-template-columns: 1fr 2fr; gap: 22px; }
.programs__col { background: var(--linen-deep); border-radius: var(--radius); padding: 34px 34px 30px; border: 1px solid rgba(46, 41, 36, .08); }
.programs__title { font-size: 26px; margin-bottom: 18px; }
.ticks li { position: relative; padding: 10px 0 10px 32px; border-top: 1px solid rgba(46, 41, 36, .1); }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: 19px; width: 12px; height: 7px;
  border-left: 1.8px solid var(--terra); border-bottom: 1.8px solid var(--terra); transform: rotate(-45deg);
}
.ticks--two { columns: 2; column-gap: 34px; }
.ticks--two li { break-inside: avoid; }

/* ---------- Insurance ---------- */
.insurance { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(40px, 6vw, 90px); align-items: center; }
.insurance h2 { margin-bottom: 20px; }
.insurance p { color: #DCD6C8; max-width: 26em; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 12px; }
.chips li { padding: 12px 20px; border-radius: 999px; border: 1px solid rgba(245, 239, 230, .3); color: var(--linen); font-weight: 500; background: rgba(255, 255, 255, .04); }

/* ---------- Team ---------- */
.team { padding: var(--section-y) 0; }
.people { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.person { background: var(--white); border-radius: var(--radius); padding: 30px 30px 32px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 2px rgba(46, 41, 36, .05); }
.person__mono {
  width: 72px; height: 72px; border-radius: 50%; margin-bottom: 16px;
  display: grid; place-items: center;
  background: var(--sand); color: var(--terra);
  font-family: var(--font-display); font-style: italic; font-size: 26px;
}
.person__name { font-size: 23px; }
.person__role { color: var(--muted); font-size: 16px; margin: 0; }
.person__tag { margin: 10px 0 0; align-self: flex-start; font-size: 14px; font-weight: 600; color: var(--moss); background: var(--sage-soft); padding: 5px 12px; border-radius: 999px; }

/* ---------- Resources ---------- */
.resources { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px; }
.resources__title { font-size: 21px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid rgba(46, 41, 36, .15); }
.resources li { margin-bottom: 12px; font-size: 16px; line-height: 1.45; }
.resources a { color: var(--ink); text-decoration-color: rgba(154, 72, 43, .4); }
.resources a:hover { color: var(--terra); text-decoration-color: currentColor; }

/* ---------- Contact ---------- */
.contact { padding: var(--section-y) 0; }
.contact__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 90px); align-items: start; }
.contact__copy h2 { margin-bottom: 20px; }
.contact__phone { display: flex; flex-direction: column; gap: 4px; margin: 36px 0 28px; text-decoration: none; color: var(--ink); }
.contact__phone:hover { color: var(--terra); }
.contact__label, .contact__list dt { font-size: 13px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.contact__big { font-family: var(--font-display); font-size: clamp(38px, 5vw, 60px); line-height: 1.05; letter-spacing: -.02em; }
.contact__list { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; margin: 0 0 32px; padding: 26px 0; border-top: 1px solid rgba(46, 41, 36, .14); border-bottom: 1px solid rgba(46, 41, 36, .14); }
.contact__list dd { margin: 6px 0 0; font-size: 17px; }
.crisis { margin-top: 32px; font-size: 15px; color: var(--muted); background: var(--linen-deep); padding: 16px 20px; border-radius: 14px; }
.contact__media { display: grid; gap: 18px; }
.contact__photo { width: 100%; aspect-ratio: 16 / 11; object-fit: cover; border-radius: var(--radius-lg) var(--radius-lg) var(--radius) var(--radius); }
.contact__map { border-radius: var(--radius); overflow: hidden; background: var(--sand); aspect-ratio: 16 / 10; }
.contact__map iframe { width: 100%; height: 100%; border: 0; filter: sepia(.25) saturate(.8); }

/* ---------- Footer ---------- */
.site-footer { background: var(--moss-deep); color: #D4CDBE; padding: 56px 0; font-size: 15px; position: relative; }
.site-footer__inner { display: grid; grid-template-columns: auto 1fr auto; gap: 40px; align-items: center; }
.site-footer__meta { margin: 0; }
.site-footer__meta a { color: var(--linen); }
.site-footer__copy { margin: 0; }

/* ---------- Floating call pill ---------- */
.float-call {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 22px 0 18px; border-radius: 999px;
  background: var(--moss); color: var(--white); text-decoration: none; font-weight: 600;
  box-shadow: 0 12px 30px -10px rgba(46, 41, 36, .5);
  opacity: 0; transform: translateY(20px); pointer-events: none;
  transition: opacity .35s, transform .35s, background .25s;
}
.float-call.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.float-call:hover { background: var(--terra); color: var(--white); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.2, .7, .2, 1); }
.reveal.is-in { opacity: 1; transform: none; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1080px) {
  .needs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resources { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .people { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --header-h: 72px; --gutter: 20px; }
  .nav__toggle {
    display: grid; place-items: center; width: 48px; height: 48px;
    border: 1px solid rgba(46, 41, 36, .2); border-radius: 50%; background: var(--linen); cursor: pointer;
  }
  .nav__toggle-bars, .nav__toggle-bars::before, .nav__toggle-bars::after {
    display: block; width: 18px; height: 1.5px; background: var(--ink); position: relative; transition: transform .3s, background .3s;
  }
  .nav__toggle-bars::before, .nav__toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav__toggle-bars::before { top: -6px; }
  .nav__toggle-bars::after { top: 6px; }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bars { background: transparent; }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bars::before { transform: translateY(6px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

  .nav__menu {
    position: fixed; inset: var(--header-h) 12px auto; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--white); border-radius: 22px; padding: 12px; box-shadow: var(--shadow);
    opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity .25s, transform .25s;
  }
  .nav__menu.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .nav__menu a:not(.btn) { min-height: 52px; font-size: 18px; padding: 0 16px; }
  .nav__menu a:not(.btn)::after { display: none; }
  .nav__cta { margin: 8px 0 0; }
  .nav__cta .btn { width: 100%; justify-content: center; min-height: 52px; }

  .hero__grid, .about__grid, .insurance, .contact__grid, .section-head--split { grid-template-columns: 1fr; }
  .section-head--split { gap: 16px; }
  .hero__media { max-width: 520px; }
  .hero__badge { left: 16px; bottom: 16px; }
  .about__media { max-width: 460px; }
  .therapy { grid-template-columns: 1fr; }
  .programs { grid-template-columns: 1fr; }
  .site-footer__inner { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 600px) {
  :root { --gutter: 16px; }
  body { font-size: 17px; }
  .needs { gap: 12px; }
  .need { min-height: 150px; padding: 22px 18px; font-size: 18px; }
  .people, .resources { grid-template-columns: 1fr; }
  .ticks--two { columns: 1; }
  .contact__list { grid-template-columns: 1fr; }
  .programs__col { padding: 26px 22px; }
  .hero__actions .btn { flex: 1 1 100%; justify-content: center; }
  .brand__name { font-size: 20px; }
  .brand__sub { font-size: 10px; }
  .trail__line { stroke-width: 1.75; }
  .float-call span { display: none; }
  .float-call { padding: 0; width: 56px; height: 56px; justify-content: center; }
  .float-call .icon { width: 22px; height: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .photo-band img { transform: none !important; }
}
