/* ============================================
   HEARTBRIDGE COUNSELING — heartbridge.life
   Style System v1.0
   ============================================ */

/* Fonts load via <link> in each page head (parallel fetch, non-blocking) */

/* --- TOKENS --- */
:root {
  --cream:       #FAF7F2;
  --warm-white:  #FFFEFB;
  --stone:       #E8E2D9;
  --fog:         #D4CEC6;
  --bark:        #7C6A58;
  --umber:       #4A3728;
  --sage:        #8A9E8C;
  --dusty-rose:  #C4907A;
  --clay:        #8F5539; /* dusty rose deepened for text: ≥4.5:1 on warm-white, cream, and stone */
  --text-dark:   #2C2420;
  --text-mid:    #5C4F47;
  --text-light:  #8C7F78;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Jost', system-ui, sans-serif;

  --max-width: 1100px;
  --section-pad: 7rem 2rem;
  --radius: 2px;

  --transition: 0.3s ease;
}

/* --- RESET --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  background: var(--cream);
  color: var(--text-dark);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  color: var(--umber);
}

h1 { font-size: clamp(2.8rem, 6vw, 5rem); font-weight: 300; letter-spacing: -0.01em; }
h2 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 300; }
h3 { font-size: clamp(1.4rem, 2.5vw, 2rem); }
h4 { font-size: 1.2rem; font-weight: 500; }

h1, h2, h3 { text-wrap: balance; }

p { font-size: 1.05rem; color: var(--text-mid); max-width: 62ch; text-wrap: pretty; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--bark);
  outline-offset: 2px;
}

/* --- LAYOUT --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

section { padding: var(--section-pad); }

/* --- SECTION GRAMMAR: the split --- */
/* The signature layout move: a sticky label column (heading + hairline
   divider) beside a 1.8x scrolling body. For prose/list sections only;
   heroes and functional grids keep their own shapes. */
.split {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: 6rem;
  align-items: start;
}

.split-label {
  position: sticky;
  top: 8rem;
}

.split-label h2 {
  line-height: 1.15;
}

/* --- SKIP LINK --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 200;
  background: var(--umber);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.6rem 1.2rem;
}

.skip-link:focus {
  top: 0.75rem;
}

/* --- NAVIGATION --- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.4rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--transition), box-shadow var(--transition);
}

.site-nav.scrolled {
  background: rgba(250, 247, 242, 0.96);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 var(--stone);
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--umber);
  letter-spacing: 0.02em;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mid);
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--dusty-rose);
  transition: width var(--transition);
}

.nav-links a:hover { color: var(--umber); }
.nav-links a:hover::after { width: 100%; }

.nav-links a[aria-current="page"] { color: var(--umber); }
.nav-links a[aria-current="page"]::after { width: 100%; }

.nav-cta {
  background: var(--umber);
  color: var(--cream);
  padding: 0.6rem 1.4rem;
  letter-spacing: 0.1em;
}
.nav-cta:hover { background: var(--bark); }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--umber);
  transition: var(--transition);
}

/* Without JS the toggle does nothing; don't show a dead control */
html:not(.js) .nav-toggle {
  display: none;
}

/* --- BUTTONS --- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.9rem 2.2rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-sm {
  font-size: 0.72rem;
}

.btn-primary {
  background: var(--umber);
  color: var(--cream);
  border-color: var(--umber);
}
.btn-primary:hover {
  background: var(--bark);
  border-color: var(--bark);
}

.btn-outline {
  background: transparent;
  color: var(--umber);
  border-color: var(--umber);
}
.btn-outline:hover {
  background: var(--umber);
  color: var(--cream);
}

/* --- HERO --- */
.hero {
  min-height: auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  padding-top: 5rem;
  overflow: hidden;
  background: var(--warm-white);
}

.hero-content {
  padding: 6rem 4rem 6rem 2rem;
  max-width: 580px;
  margin-left: auto;
}

.hero h1 {
  margin-bottom: 1.5rem;
  line-height: 1.15;
}

.hero h1 em {
  font-style: italic;
  color: var(--clay);
}

.hero-sub {
  font-size: 1.15rem;
  line-height: 1.8;
  margin-bottom: 2.5rem;
  max-width: 48ch;
  color: var(--text-mid);
}

/* A framed portrait, not a full-bleed fill: the source photo is a
   narrow 675x1200; containing it at 3:4 shows ~75% of the frame
   instead of a heavily upscaled head crop. */
.hero-image {
  width: min(100%, 520px);
  aspect-ratio: 3 / 4;
  justify-self: center;
  margin: 3.5rem 2rem 3.5rem 0;
  overflow: hidden;
  border: 1px solid var(--fog);
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%; /* face in the upper third, shoulders in frame */
  filter: brightness(0.97) saturate(0.9) sepia(0.06) contrast(1.02);
}

/* --- DIVIDER --- */
.divider {
  width: 48px;
  height: 1px;
  background: var(--dusty-rose);
  margin: 2rem 0;
}

/* --- WHO I WORK WITH --- */
.who {
  background: var(--cream);
  padding: var(--section-pad);
}

.who-body p {
  font-size: 1.1rem;
  line-height: 1.9;
  margin-bottom: 1.5rem;
  max-width: 58ch;
  color: var(--text-mid);
}

.who-body p:last-of-type { margin-bottom: 2rem; }

.who-body strong {
  font-weight: 500;
  color: var(--text-dark);
}

/* --- SPECIALTIES --- */
.specialties {
  background: var(--stone);
  padding: var(--section-pad);
}

.specialties-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5px;
  background: var(--fog);
}

.specialty-card {
  background: var(--cream);
  padding: 2.5rem 2rem;
  transition: background var(--transition);
}

.specialty-card:hover {
  background: var(--warm-white);
}

.specialty-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--umber);
  margin-bottom: 0.75rem;
}

.specialty-card p {
  font-size: 0.95rem;
  line-height: 1.75;
  max-width: none;
  color: var(--text-mid);
}

/* --- ABOUT TEASER (homepage) --- */
.about-teaser {
  background: var(--warm-white);
  padding: var(--section-pad);
}

.about-teaser-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: center;
}

.about-teaser-text h2 {
  margin-bottom: 1.5rem;
}

.about-teaser-text p {
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
  line-height: 1.85;
}

.about-teaser-text .btn {
  margin-top: 1rem;
}

.about-quote {
  padding: 3rem;
  background: var(--stone);
  position: relative;
}

.about-quote blockquote {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 300;
  font-style: italic;
  color: var(--umber);
  line-height: 1.5;
}

/* --- ABOUT PAGE --- */
.about-hero {
  padding-top: 8rem;
  background: var(--warm-white);
  padding-bottom: 0;
}

.about-hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 2rem 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: end;
}

.about-hero-text { padding-bottom: 4rem; }

.about-hero-text h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  margin-bottom: 1.5rem;
}

.about-hero-text p {
  font-size: 1.1rem;
  line-height: 1.85;
  margin-bottom: 1.2rem;
}

.about-photo {
  position: relative;
  height: 420px;
  overflow: hidden;
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%; /* crop centered on face, not forehead */
  filter: brightness(0.97) saturate(0.9);
}

.about-approach {
  background: var(--cream);
  padding: var(--section-pad);
}

.about-approach-inner p {
  font-size: 1.05rem;
  line-height: 1.9;
  margin-bottom: 1.4rem;
  max-width: none;
}

.modalities {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 3rem;
}

.modality {
  padding: 1.5rem;
  background: var(--stone);
  border-top: 2px solid var(--dusty-rose);
}

.modality h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--umber);
  margin-bottom: 0.5rem;
}

.modality p {
  font-size: 0.92rem;
  max-width: none;
  color: var(--text-mid);
}

/* --- RESOURCES PAGE --- */
.resources-hero {
  padding-top: 10rem;
  padding-bottom: 4rem;
  background: var(--warm-white);
}

.resources-hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.resources-hero h1 { margin-bottom: 1rem; }
.resources-hero p { font-size: 1.1rem; max-width: 52ch; }

/* --- PRACTICAL DETAILS --- */
.practical {
  background: var(--stone);
}

.practical-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 2.5rem;
}

.practical-item h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--umber);
  margin-bottom: 0.5rem;
}

.practical-item p {
  font-size: 0.98rem;
  line-height: 1.75;
  max-width: 52ch;
}

.resources-grid {
  background: var(--cream);
  padding: var(--section-pad);
}

.resources-grid-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  grid-template-areas:
    "form crisis"
    "form side";
  gap: 2rem 5rem;
  align-items: start;
}

.contact-block { grid-area: form; }
.crisis-block { grid-area: crisis; }
.resources-sidebar { grid-area: side; }

/* --- CONTACT FORM --- */
.contact-block h2 {
  font-size: clamp(1.4rem, 2.5vw, 2rem); /* keep the h3-scale size the layout was designed around */
  font-weight: 400;
  margin-bottom: 0.5rem;
}
.contact-block > p { margin-bottom: 2rem; font-size: 1rem; }

.form-group {
  margin-bottom: 1.4rem;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mid);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: var(--warm-white);
  border: 1px solid var(--text-light); /* fog fails the 3:1 non-text minimum against warm-white */
  padding: 0.85rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  color: var(--text-dark);
  border-radius: var(--radius);
  transition: border-color var(--transition);
  outline: none;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--bark);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-mid);
  opacity: 0.85; /* lighter than typed text, still ≥4.5:1 effective */
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* Restore the chevron removed by -webkit-appearance: none */
.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%237C6A58' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.75rem;
}

.form-success {
  display: none;
  background: var(--stone);
  padding: 1.5rem;
  border: 1px solid var(--sage);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--umber);
}

.form-error {
  background: var(--stone);
  border: 1px solid var(--bark);
  padding: 1.25rem 1.5rem;
  margin-top: 1.25rem;
}

.form-error p {
  max-width: none;
  color: var(--text-dark);
  font-size: 0.98rem;
}

.form-error a {
  color: var(--umber);
  font-weight: 500;
  border-bottom: 1px solid var(--bark);
}

/* --- SIDEBAR RESOURCES --- */
.resources-sidebar { padding-top: 0.5rem; }

.resource-block {
  padding: 2rem;
  background: var(--stone);
  margin-bottom: 1.5rem;
}

.resource-block h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--umber);
  margin-bottom: 0.75rem;
}

.resource-block p {
  font-size: 0.95rem;
  max-width: none;
  margin-bottom: 1rem;
  line-height: 1.7;
}

.resource-block .mailto-fallback {
  font-size: 0.85rem;
  color: var(--text-mid);
  margin: 0.85rem 0 0;
}

.resource-block .mailto-fallback a {
  color: var(--umber);
  font-weight: 500;
  border-bottom: 1px solid var(--bark);
}

.crisis-block {
  background: var(--warm-white);
  border: 1px solid var(--fog);
  padding: 2rem;
}

.crisis-block h3 {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

.crisis-block p {
  font-size: 0.92rem;
  max-width: none;
  line-height: 1.7;
}

.crisis-block strong {
  color: var(--text-dark);
  font-weight: 500;
}

.crisis-block a {
  color: var(--text-dark);
  font-weight: 500;
  border-bottom: 1.5px solid var(--bark);
}

/* --- FOOTER --- */
.site-footer {
  background: var(--umber);
  color: var(--stone);
  padding: 3rem 2rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4rem;
  align-items: start;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--cream);
  margin-bottom: 0.5rem;
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--fog);
  max-width: none;
}

.footer-crisis {
  font-size: 0.8rem;
  color: var(--fog);
  margin-top: 0.75rem;
  max-width: none;
}

.footer-crisis a {
  color: var(--stone);
  font-weight: 500;
  border-bottom: 1px solid rgba(212, 206, 198, 0.5);
}

.footer-legal {
  font-size: 0.78rem;
  line-height: 1.8;
  color: var(--fog);
  max-width: none;
}

.footer-legal a {
  color: var(--stone);
  border-bottom: 1px solid rgba(212,206,198,0.3);
  transition: border-color var(--transition);
}

.footer-legal a:hover { border-color: var(--stone); }

/* Bark is invisible on umber; footer focus needs a light outline */
.site-footer a:focus-visible {
  outline-color: var(--stone);
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-bottom p {
  font-size: 0.75rem;
  color: var(--fog);
  max-width: none;
}

/* --- ENTRANCE: one settle per page --- */
/* The Exhale doctrine: no scroll-triggered reveals anywhere. Each main
   page's opening block settles once on load; everything below is still.
   Animations run only under html.js + no reduced-motion preference, so
   content is at rest (fully visible) for blocked scripts and
   motion-sensitive readers. */
@keyframes settle-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@keyframes breathe-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  .js .settle {
    animation: settle-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  }

  .js .settle-image {
    animation: breathe-in 0.9s ease-out 0.1s backwards;
  }
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .hero-image {
    order: -1;
    width: min(78vw, 400px);
    margin: 2.5rem auto 0;
  }
  .hero-content {
    padding: 3rem 2rem 5rem;
    max-width: 100%;
    margin: 0;
  }

  .split { grid-template-columns: 1fr; gap: 2rem; }
  .split-label { position: static; }

  .about-teaser-inner { grid-template-columns: 1fr; gap: 3rem; }
  .about-hero-inner { grid-template-columns: 1fr; gap: 0; }
  .about-photo { height: 380px; }

  /* Crisis info first when the columns stack — findable without
     scrolling past the form */
  .resources-grid-inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "crisis"
      "form"
      "side";
    gap: 3rem;
  }

  .modalities { grid-template-columns: 1fr; }

  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 600px) {
  :root { --section-pad: 4.5rem 1.25rem; }
  .specialties-grid { grid-template-columns: 1fr; }

  /* Solid bar on mobile: brand, CTA, and toggle stay legible over the
     hero photo, and the conversion path never leaves the bar */
  .site-nav {
    padding: 0.75rem 1rem;
    background: rgba(250, 247, 242, 0.96);
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 0 var(--stone);
  }
  .nav-right { gap: 0.75rem; }
  .nav-links { display: none; flex-direction: column; position: fixed; inset: 0; top: 68px; background: var(--cream); padding: 3rem 2rem; gap: 2rem; align-items: flex-start; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .nav-cta { padding: 0.55rem 0.9rem; font-size: 0.68rem; letter-spacing: 0.08em; }
  body.menu-open { overflow: hidden; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
}
