/* ============================================================
   Flourish & Thrive Counseling — Design System
   Palette + type derived from the client's brand guide:
   sage, warm ivory, taupe, terracotta, soft wood.
   ============================================================ */

:root {
  /* --- Color ------------------------------------------------ */
  --sage-900: #2f3a2c;
  --sage-800: #3d4a37;
  --sage-700: #4d5b44;
  --sage-600: #5f6e53;
  --sage-400: #8d9a80;
  --sage-200: #c3ccb8;
  --sage-100: #dfe4d8;
  --sage-50:  #eff1ea;

  --ivory:     #faf6f0;
  --ivory-2:   #f4ede3;
  --ivory-3:   #ece2d5;

  /* Text-weight taupe, darkened to clear WCAG AA on every ivory surface. */
  --taupe-600: #6e6353;
  --taupe-500: #8a7d6d;
  --taupe-400: #b3a695;
  --taupe-200: #d8cec1;

  /* --terracotta is the brand accent used for fills and text on light
     surfaces; --terracotta-bright stays available for decorative marks. */
  --terracotta:        #a8542f;
  --terracotta-bright: #c0653c;
  --terracotta-dark:   #8d4426;
  --terracotta-soft: #e3b49a;
  --blush:           #efc9b6;

  --wood: #e0c39c;
  --gold: #b28e50;

  --ink:      #2b2b26;
  --ink-soft: #55564d;
  --ink-mute: #65655b;

  /* Semantic */
  --bg:            var(--ivory);
  --bg-alt:        var(--ivory-2);
  --bg-deep:       var(--sage-800);
  --text:          var(--ink);
  --text-soft:     var(--ink-soft);
  --text-mute:     var(--ink-mute);
  --accent:        var(--terracotta);
  --accent-hover:  var(--terracotta-dark);
  --rule:          rgba(43, 43, 38, 0.12);
  --rule-soft:     rgba(43, 43, 38, 0.07);

  /* --- Type ------------------------------------------------- */
  --font-display: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Switzer', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --text-hero: clamp(2.75rem, 6.2vw, 5.25rem);
  --text-3xl:  clamp(2.25rem, 4.6vw, 3.75rem);
  --text-2xl:  clamp(1.9rem, 3.4vw, 2.75rem);
  --text-xl:   clamp(1.5rem, 2.3vw, 2rem);
  --text-lg:   1.1875rem;
  --text-base: 1.0625rem;
  --text-sm:   0.9375rem;
  --text-xs:   0.8125rem;
  --text-2xs:  0.75rem;

  /* --- Space ------------------------------------------------ */
  --s-1: 0.25rem;  --s-2: 0.5rem;   --s-3: 0.75rem;  --s-4: 1rem;
  --s-5: 1.5rem;   --s-6: 2rem;     --s-7: 2.5rem;   --s-8: 3rem;
  --s-9: 4rem;     --s-10: 5rem;    --s-12: 6.5rem;  --s-16: 9rem;

  --section-y: clamp(4rem, 9vw, 8rem);
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --maxw: 1200px;
  --maxw-narrow: 720px;

  --radius-sm: 6px;
  --radius: 14px;
  --radius-lg: 24px;
  --radius-arch: 240px 240px 20px 20px;

  --shadow-sm: 0 1px 2px rgba(61, 74, 55, 0.06), 0 4px 14px rgba(61, 74, 55, 0.05);
  --shadow: 0 2px 6px rgba(61, 74, 55, 0.07), 0 18px 44px rgba(61, 74, 55, 0.09);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --- Reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Clear the sticky header when jumping to an in-page anchor. */
  scroll-padding-top: clamp(88px, 9vh, 112px);
}
[id] { scroll-margin-top: clamp(88px, 9vh, 112px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.68;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

::selection { background: var(--sage-200); color: var(--sage-900); }

:focus-visible {
  outline: 2px solid var(--sage-700);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: absolute; left: var(--s-4); top: -60px; z-index: 200;
  background: var(--sage-800); color: var(--ivory);
  padding: var(--s-3) var(--s-5); border-radius: var(--radius-sm);
  font-size: var(--text-sm); text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: var(--s-4); }

/* --- Type styles ------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.012em;
  color: var(--sage-900);
  text-wrap: balance;
}
h1 { font-size: var(--text-hero); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); }
h4 {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
}
p { text-wrap: pretty; }

a { color: var(--sage-800); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-2xs);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--taupe-600);
  display: block;
  margin-bottom: var(--s-4);
}
.eyebrow--light { color: var(--sage-200); }

/* Give the deck room to breathe under a display heading. */
h1 + .lede, h2 + .lede, h3 + .lede { margin-top: var(--s-5); }

.lede {
  font-size: clamp(1.125rem, 1.6vw, 1.3125rem);
  line-height: 1.62;
  color: var(--text-soft);
  max-width: 60ch;
}

.prose p + p { margin-top: var(--s-4); }
.prose { color: var(--text-soft); max-width: 66ch; }

.serif-accent {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
}

/* --- Layout ------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: calc(var(--maxw-narrow) + var(--gutter) * 2); }
.wrap--wide { max-width: 1400px; }

.section { padding-block: var(--section-y); }
.section--alt { background: var(--bg-alt); }
.section--deep { background: var(--sage-800); color: var(--ivory-2); }
.section--deep h2, .section--deep h3 { color: var(--ivory); }
.section--deep p { color: rgba(244, 237, 227, 0.82); }
.section--deep a { color: var(--ivory); }

.section-head { max-width: 62ch; margin-bottom: var(--s-9); }
.section-head--center { margin-inline: auto; text-align: center; }

.rule { height: 1px; background: var(--rule); border: 0; }

/* Decorative sunrise divider, echoing the logo mark */
.divider {
  display: flex; align-items: center; justify-content: center;
  gap: var(--s-4); margin-block: var(--s-8); color: var(--terracotta-soft);
}
.divider::before, .divider::after {
  content: ''; height: 1px; flex: 1; max-width: 120px;
  background: linear-gradient(to var(--dir, right), transparent, var(--taupe-200));
}
.divider::before { --dir: left; }
.divider svg { width: 26px; height: 26px; flex: none; }

/* --- Buttons ------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s-2);
  font-family: var(--font-body);
  font-size: var(--text-sm); font-weight: 500; letter-spacing: 0.02em;
  padding: 0.92rem 1.75rem;
  border-radius: 100px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
              border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* Buttons own their colour contract. The `a.btn--x` selectors raise
   specificity so a section- or menu-level link colour can never win. */
.btn--primary, a.btn--primary { background: var(--sage-800); color: var(--ivory); }
.btn--primary:hover { background: var(--sage-900); color: var(--ivory); }

.btn--accent, a.btn--accent { background: var(--terracotta); color: #fff; }
.btn--accent:hover { background: var(--accent-hover); color: #fff; }

.btn--ghost, a.btn--ghost {
  background: transparent; color: var(--sage-800);
  border-color: var(--taupe-200);
}
.btn--ghost:hover { border-color: var(--sage-700); background: rgba(93,110,83,0.06); color: var(--sage-900); }

.btn--light, a.btn--light { background: var(--ivory); color: var(--sage-900); }
.btn--light:hover { background: #fff; color: var(--sage-900); }

.btn--outline-light, a.btn--outline-light {
  background: transparent; color: var(--ivory);
  border-color: rgba(250, 246, 240, 0.4);
}
.btn--outline-light:hover { border-color: var(--ivory); background: rgba(250,246,240,0.1); color: var(--ivory); }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 0.45em;
  font-size: var(--text-sm); font-weight: 500;
  color: var(--sage-800); text-decoration: none;
  border-bottom: 1px solid var(--taupe-200);
  padding-bottom: 2px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.link-arrow:hover { color: var(--accent); border-color: var(--accent); }
.link-arrow svg { width: 14px; height: 14px; transition: transform 0.25s var(--ease); }
.link-arrow:hover svg { transform: translateX(3px); }

/* --- Cards -------------------------------------------------- */
.card {
  background: #fff;
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: var(--s-6);
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.card--hover:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
  border-color: var(--sage-100);
}

.tag {
  display: inline-block;
  font-size: var(--text-2xs);
  letter-spacing: 0.06em;
  padding: 0.32rem 0.72rem;
  border-radius: 100px;
  background: var(--sage-50);
  color: var(--sage-700);
  border: 1px solid var(--sage-100);
  white-space: nowrap;
}
.tag--warm { background: #fbf0e8; color: var(--terracotta-dark); border-color: #f2ddd0; }
.tag-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* --- Header ------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 246, 240, 0.88);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--rule-soft); }

.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-5);
  min-height: 78px;
}
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; flex: none; }
.brand__mark { width: 34px; height: 34px; flex: none; color: var(--sage-800); }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name {
  font-family: var(--font-display);
  font-size: 1.28rem; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--sage-900); white-space: nowrap;
}
.brand__name em { font-style: italic; text-transform: lowercase; letter-spacing: 0.01em; font-size: 0.86em; }
.brand__sub {
  font-size: 0.5625rem; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--taupe-600); margin-top: 4px;
}

.nav__links { display: flex; align-items: center; gap: var(--s-6); list-style: none; padding: 0; }
.nav__links li { flex: none; }
.nav__links a {
  font-size: var(--text-sm); text-decoration: none; color: var(--text-soft);
  position: relative; padding-block: 4px; white-space: nowrap;
  transition: color 0.2s var(--ease);
}
.nav__links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform 0.28s var(--ease);
}
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--sage-900); }
.nav__links a:hover::after, .nav__links a[aria-current="page"]::after { transform: scaleX(1); }

.nav__cta { flex: none; }
.nav__cta .btn { white-space: nowrap; }
@media (min-width: 1061px) and (max-width: 1220px) {
  .nav__links { gap: var(--s-5); }
}

.nav__toggle {
  display: none; background: none; border: 0; padding: 8px;
  color: var(--sage-900); border-radius: var(--radius-sm);
}
.nav__toggle svg { width: 24px; height: 24px; }

.mobile-menu {
  display: none;
  position: fixed; inset: 78px 0 0; z-index: 99;
  background: var(--ivory);
  padding: var(--s-6) var(--gutter) var(--s-9);
  overflow-y: auto;
}
.mobile-menu.is-open { display: block; }
.mobile-menu ul { list-style: none; padding: 0; }
.mobile-menu li + li { border-top: 1px solid var(--rule-soft); }
.mobile-menu li a {
  display: block; padding: var(--s-4) 0;
  font-family: var(--font-display); font-size: 1.6rem;
  color: var(--sage-900); text-decoration: none;
}
.mobile-menu .btn { width: 100%; margin-top: var(--s-6); }
.mobile-menu a.btn--primary { color: var(--ivory); }

@media (max-width: 1060px) {
  .nav__links, .nav__cta { display: none; }
  .nav__toggle { display: inline-flex; }
}

/* --- Footer ------------------------------------------------- */
.site-footer {
  background: var(--sage-900);
  color: rgba(244, 237, 227, 0.88);
  padding-block: var(--s-10) var(--s-6);
  font-size: var(--text-sm);
}
.site-footer h4 {
  font-family: var(--font-body);
  font-size: var(--text-2xs); letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--sage-200); font-weight: 500; margin-bottom: var(--s-4);
}
.site-footer a { color: rgba(244, 237, 227, 0.92); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
/* Crisis-note phone links must not rely on color alone (WCAG 1.4.1). */
.crisis-note a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
/* Comfortable thumb targets for the footer link columns on small screens. */
@media (max-width: 760px) {
  .site-footer nav a,
  .site-footer ul a { display: inline-block; padding-block: 7px; }
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: var(--s-8) var(--s-6);
  padding-bottom: var(--s-8);
  border-bottom: 1px solid rgba(244, 237, 227, 0.14);
}
.footer-grid ul { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
.footer-logo { width: 116px; margin-bottom: var(--s-4); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: var(--s-4);
  justify-content: space-between; align-items: center;
  padding-top: var(--s-5);
  font-size: var(--text-xs); color: rgba(244, 237, 227, 0.78);
}
.footer-bottom a { color: rgba(244, 237, 227, 0.86); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(244, 237, 227, 0.35); }
.footer-bottom a:hover { color: #fff; text-decoration-color: currentColor; }
.crisis-note {
  margin-top: var(--s-5);
  padding: var(--s-4) var(--s-5);
  border: 1px solid rgba(244, 237, 227, 0.18);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  line-height: 1.6;
  color: rgba(244, 237, 227, 0.78);
}
.crisis-note strong { color: var(--ivory); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* --- Reveal on scroll --------------------------------------- */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* --- Utilities ---------------------------------------------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.center { text-align: center; }
.mt-6 { margin-top: var(--s-6); }
.mt-8 { margin-top: var(--s-8); }
