/* ==========================================================================
   Loeb Family Therapy
   ========================================================================== */

:root {
  --orange: #AF4F2A;
  --orange-deep: #934020;
  --cream: #F9F5EE;
  --ink: #5C2814;          /* body copy on cream */
  --line: rgba(249, 245, 238, .35);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Instrument Sans", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1280px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* Keep `hidden` working on elements that set their own display (e.g. the contact form after submit) */
[hidden] { display: none !important; }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body {
  background: var(--orange);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 2px; }

/* Film grain over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .12;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow { font-size: .9375rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 13px 26px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: .95rem;
  line-height: 1.2;
  transition: background .3s, color .3s, border-color .3s;
}
.btn:hover, .btn[aria-current="page"] { background: var(--cream); border-color: var(--cream); color: var(--orange); }
.btn--sm { padding: 8px 18px; font-size: .9rem; }
.btn--solid { background: var(--cream); border-color: var(--cream); color: var(--orange); }
.btn--solid:hover { background: transparent; color: var(--cream); }

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 11vw, 150px) 0; }
.section--cream { background: var(--cream); color: var(--orange); }
.section--deep { background: var(--orange-deep); }
.page-body { padding-bottom: clamp(72px, 11vw, 150px); }

.split {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 3fr;
  gap: 32px clamp(32px, 5vw, 80px);
}
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }

.statement {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4vw, 3.5rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.quote {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  max-width: 16ch;
}
.quote em { font-style: italic; }
.prose { max-width: 62ch; }
.prose p + p { margin-top: 1.1em; }
.prose--lg { font-size: clamp(1.1rem, 1.5vw, 1.25rem); line-height: 1.6; }
.section--cream .body { color: var(--ink); }

/* Highlighted key phrases */
.hl {
  --hl-bg: var(--cream);
  --hl-fg: var(--orange);
  font-style: italic;
  padding: 0 .12em;
  margin: 0 -.04em;
  -webkit-box-decoration-break: clone;
          box-decoration-break: clone;
  background: linear-gradient(var(--hl-bg), var(--hl-bg)) no-repeat left center / 0% 88%;
  transition: background-size 1s cubic-bezier(.6, 0, .2, 1), color .5s ease .2s;
}
.section--cream .hl { --hl-bg: var(--orange); --hl-fg: var(--cream); }
.hl.is-on { background-size: 100% 88%; color: var(--hl-fg); }
.body .hl { font-family: var(--serif); font-size: 1.15em; line-height: 1; }

/* Gentle fade-up on scroll (only when JS is running) */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform .9s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Header / nav ---------- */
.site-header { position: relative; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 24px; padding-bottom: 24px; }
.logo { font-family: var(--serif); font-size: 1.45rem; line-height: 1; }
.nav__links { display: flex; align-items: center; gap: clamp(20px, 3vw, 40px); list-style: none; font-size: .95rem; }
.nav__links a:not(.btn) { position: relative; }
.nav__links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; bottom: -3px;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform .4s ease;
}
.nav__links a:not(.btn):hover::after,
.nav__links a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.menu-toggle {
  display: none;
  background: none; border: 0; color: inherit;
  font: inherit; font-size: .95rem; cursor: pointer;
  position: relative; z-index: 30;
}

@media (max-width: 760px) {
  .menu-toggle { display: block; }
  .nav__links {
    position: fixed;
    inset: 0;
    z-index: 25;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    padding: 0 var(--gutter);
    background: var(--orange);
    font-family: var(--serif);
    font-size: 2.75rem;
    line-height: 1.1;
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s ease, visibility .35s;
  }
  .nav__links .btn { font-family: var(--sans); font-size: 1rem; margin-top: 16px; }
  .menu-open .nav__links { opacity: 1; visibility: visible; }
  .menu-open { overflow: hidden; }
}

/* ---------- Display type (hero + page titles) ---------- */
.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.5rem, 10.5vw, 10rem);
  line-height: .92;
  letter-spacing: -0.02em;
}
.display em { font-style: italic; }
/* Each line masks the rise-in animation. The padding gives ascenders, descenders and
   italic overhangs room inside the mask; the negative margin cancels it out in the layout. */
.display .line { display: inline-block; overflow: hidden; padding: .12em .12em .24em; margin: -.12em -.12em -.24em; vertical-align: bottom; }
.display .line > span { display: inline-block; }
.js .display .line > span { transform: translateY(1.5em); animation: rise 1s var(--ease) forwards; }
.js .display .line:nth-child(2) > span { animation-delay: .1s; }
.js .display .line:nth-child(3) > span { animation-delay: .2s; }
@keyframes rise { to { transform: translateY(0); } }
@keyframes fade { to { opacity: 1; } }

/* ---------- Home hero ---------- */
.hero {
  min-height: calc(100svh - 90px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 40px;
  padding-bottom: clamp(48px, 10vh, 120px);
}
.hero .eyebrow { margin-bottom: 20px; }
.hero__tagline {
  max-width: 40ch;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: clamp(1.15rem, 1.6vw, 1.35rem);
  line-height: 1.5;
}
.js .hero .eyebrow, .js .hero__tagline { opacity: 0; animation: fade .9s ease .5s forwards; }
.js .hero .eyebrow { animation-delay: .3s; }

/* ---------- Inner page hero ---------- */
.page-hero { padding-top: clamp(48px, 10vh, 120px); padding-bottom: clamp(56px, 8vw, 104px); }
.page-hero .display { font-size: clamp(3.25rem, 9vw, 8.5rem); }
.page-hero__lead { max-width: 46ch; margin-top: 32px; font-size: clamp(1.1rem, 1.5vw, 1.3rem); line-height: 1.55; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; list-style: none; }
.js .page-hero__lead, .js .page-hero .chips { opacity: 0; animation: fade .9s ease .4s forwards; }

/* ---------- Portrait ---------- */
.portrait {
  aspect-ratio: 4 / 5;
  border-radius: 999px 999px 0 0;
  overflow: hidden;
  background: #EBDCCB;
  color: var(--orange);
  display: grid;
  place-items: center;
  font-size: .85rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 40px clamp(40px, 7vw, 120px);
  align-items: center;
}
.intro-grid .portrait { max-width: 440px; width: 100%; }
@media (max-width: 800px) {
  .intro-grid { grid-template-columns: 1fr; }
  .intro-grid .portrait { max-width: 320px; }
}

/* ---------- Services ---------- */
.service__head { position: sticky; top: 32px; align-self: start; }
.service__name { font-family: var(--serif); font-weight: 400; font-size: clamp(2.75rem, 5vw, 4.5rem); line-height: 1; letter-spacing: -0.015em; }
.service__price { margin-top: 24px; font-size: .95rem; }
.service__price .eyebrow { display: block; margin-bottom: 4px; }
.service__price strong { font-family: var(--serif); font-weight: 400; font-size: 2rem; display: block; line-height: 1.1; }
@media (max-width: 800px) { .service__head { position: static; } }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--line); max-width: 900px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 28px 0;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.15;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--sans);
  font-size: 1.5rem;
  line-height: 1;
  transition: transform .35s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq__answer { padding: 0 0 32px; max-width: 62ch; }
.faq details[open] .faq__answer { animation: fade-down .45s ease; }
@keyframes fade-down { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- Contact ---------- */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 56px clamp(48px, 8vw, 128px);
  align-items: start;
}
.contact-details { display: grid; gap: 32px; padding-top: 32px; border-top: 1px solid var(--line); }
.contact-details .eyebrow { margin-bottom: 8px; opacity: .85; }
.contact-details a, .contact-details address { font-family: var(--serif); font-style: normal; font-size: clamp(1.4rem, 2vw, 1.75rem); line-height: 1.25; overflow-wrap: anywhere; }
.contact-details a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
@media (max-width: 860px) { .contact-layout { grid-template-columns: 1fr; } }

.contact-form { display: grid; gap: 28px; padding-top: 32px; border-top: 1px solid var(--line); }
.field { display: grid; gap: 10px; border: 0; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }
.field__note { text-transform: none; letter-spacing: 0; font-weight: 400; opacity: .75; }
.field legend { margin-bottom: 12px; padding: 0; }
.field input, .field textarea {
  width: 100%;
  padding: 14px 16px;
  background: rgba(249, 245, 238, .08);
  border: 1px solid rgba(249, 245, 238, .45);
  border-radius: 10px;
  color: var(--cream);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.4;
  transition: border-color .25s, background .25s;
}
.field textarea { resize: vertical; min-height: 160px; }
.field input:hover, .field textarea:hover { border-color: rgba(249, 245, 238, .7); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--cream); background: rgba(249, 245, 238, .14); }
.field input:focus-visible, .field textarea:focus-visible { box-shadow: 0 0 0 1px var(--cream); }

.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: inline-block;
  padding: 9px 20px;
  border: 1px solid var(--cream);
  border-radius: 999px;
  font-size: .95rem;
  transition: background .25s, color .25s;
}
.choice:hover span { background: rgba(249, 245, 238, .12); }
.choice input:checked + span { background: var(--cream); color: var(--orange); }
.choice input:focus-visible + span { outline: 2px solid var(--cream); outline-offset: 3px; }

.contact-form .btn { justify-self: start; font-family: inherit; font-size: .95rem; line-height: 1.2; cursor: pointer; }
.contact-form .btn:disabled { opacity: .6; cursor: progress; }
.form-success { padding-top: 32px; border-top: 1px solid var(--line); outline: none; }
.form-success p { font-family: var(--serif); font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.1; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Footer ---------- */
.site-footer { padding: 56px 0 28px; border-top: 1px solid var(--line); font-size: .9rem; }
.site-footer__inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 32px clamp(32px, 6vw, 96px);
  align-items: start;
}
.site-footer__contact { list-style: none; display: grid; gap: 6px; }
.site-footer__nav { display: grid; gap: 6px; }
.site-footer a:not(.logo):hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.site-footer__base { margin-top: 48px; font-size: .8rem; opacity: .7; }
@media (max-width: 760px) { .site-footer__inner { grid-template-columns: 1fr; } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .display .line > span,
  .js .hero .eyebrow, .js .hero__tagline,
  .js .page-hero__lead, .js .page-hero .chips { animation: none; transform: none; opacity: 1; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hl { transition: none; }
}
