/* =============================================================
   A Chapter Together — shared design system
   Palette: warm ivory / deep sage / muted terra rose accent
   Type: Fraunces display serif + Inter body
   Signature: "chapter mark" eyebrows on section headings
   ============================================================= */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap');

/* --- Tokens --- */
:root {
  --ink:        #1A2620;
  --ink-soft:   #3A4640;
  --muted:      #68766C;   /* AA 4.58:1 on --bg (was #6B7A6F, 4.34:1) */
  --line:       #D9D3C4;
  --bg:         #FBFAF7;
  --bg-warm:    #F5EFE0;   /* used on grief page */
  --card:       #FFFFFF;
  --sage:       #2C4A3E;
  --sage-deep:  #1F3529;
  --sage-soft:  #EAF0EC;
  --rose:       #B87968;   /* accent, use sparingly */
  --rose-soft:  #F4E5DF;
  --focus:      #C89B44;   /* keyboard focus ring */

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(28,38,32,0.04), 0 2px 8px rgba(28,38,32,0.04);
  --shadow-md: 0 4px 12px rgba(28,38,32,0.06), 0 8px 24px rgba(28,38,32,0.06);
}

/* --- Reset & base --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;         /* larger default for older readers */
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; height: auto; }
/* The branching intake form relies on [hidden]. Make it authoritative so a
   future `display` on .form-field can't silently reveal both branches. */
[hidden] { display: none !important; }
a { color: var(--sage); text-decoration: none; }
a:hover { color: var(--rose); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}
:target { scroll-margin-top: 100px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}

/* --- Type --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.4rem, 5vw, 3.75rem); line-height: 1.08; font-weight: 500; }
h2 { font-size: clamp(1.75rem, 3vw, 2.4rem); line-height: 1.15; }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.3; }
p  { margin: 0 0 1em; max-width: 68ch; }
strong { font-weight: 600; color: var(--ink); }

/* --- Chapter mark eyebrow (signature) --- */
.chapter-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: 20px;
}
.chapter-mark::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--rose);
}

/* --- Layout --- */
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 0 24px; }
section { padding: 80px 0; }
@media (max-width: 700px) { section { padding: 56px 0; } }

/* --- Navigation --- */
.nav-outer {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,250,247,0.92);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
nav {
  max-width: 1140px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  min-height: 68px;
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.nav-logo:hover { color: var(--sage); }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}
.nav-links a:hover { color: var(--sage); }
.nav-links a.current { color: var(--sage); border-bottom-color: var(--sage); }
.nav-cta {
  background: var(--sage);
  color: #fff !important;
  padding: 10px 20px !important;
  border-radius: 999px;
  font-weight: 600 !important;
  border-bottom: 0 !important;
}
.nav-cta:hover { background: var(--sage-deep); color: #fff !important; }

/* Nav dropdown
   Behaviour lives in nav.js. JS owns the open/close state so that a tap on a
   touch device can't fight a CSS :hover rule. The html:not(.js) rules below
   are the fallback for when the script hasn't loaded. */
.nav-dd { position: relative; }

/* The trigger is a <button>, not a link — it opens a menu, it doesn't go
   anywhere. These rules make it match the sibling nav links exactly. */
.nav-dd .dd-trigger {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 6px 0;
  margin: 0;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: color 120ms ease, border-color 120ms ease;
}
.nav-dd .dd-trigger:hover { color: var(--sage); }
.nav-dd .dd-trigger.current { color: var(--sage); border-bottom-color: var(--sage); }
.dd-caret {
  width: 10px; height: 10px; flex: none;
  transition: transform 160ms ease;
}
.nav-dd.open .dd-caret { transform: rotate(180deg); }

.nav-dd-menu {
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%) translateY(6px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
  padding-top: 12px;
}
.nav-dd.open > .nav-dd-menu,
html:not(.js) .nav-dd:hover > .nav-dd-menu,
html:not(.js) .nav-dd:focus-within > .nav-dd-menu {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-dd-inner {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  min-width: 264px; padding: 8px;
}
.nav-dd-inner a {
  display: block; padding: 10px 14px; border-radius: 6px;
  white-space: nowrap;
  border-bottom: 0 !important;
}
.nav-dd-inner a:hover { background: var(--sage-soft); color: var(--sage); }
.nav-dd-inner a.current { background: var(--sage-soft); color: var(--sage); }
.nav-dd-inner .dd-all {
  margin-top: 4px; padding-top: 12px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 6px 6px;
  font-weight: 600;
}

/* Mobile menu */
.nav-toggle {
  display: none;
  background: none; border: 0; cursor: pointer;
  padding: 8px; color: var(--ink);
}
.nav-toggle svg { width: 26px; height: 26px; }
.mobile-menu {
  display: none;
  background: #fff; border-top: 1px solid var(--line);
  padding: 12px 24px 24px;
  max-height: calc(100vh - 68px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block; padding: 12px 0;
  color: var(--ink); font-weight: 500;
  border-bottom: 1px solid var(--line);
}
.mobile-menu a.current { color: var(--sage); }
.mobile-menu .nav-cta { display: inline-block; margin-top: 16px; border-bottom: 0; }

/* Mobile sub-menu — the dropdown's contents, reachable on a phone */
.mobile-sub-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: 12px 0;
  background: none; border: 0;
  border-bottom: 1px solid var(--line);
  font: inherit; font-size: 18px; font-weight: 500;
  color: var(--ink); text-align: left; cursor: pointer;
}
.mobile-sub-toggle:hover { color: var(--sage); }
.mobile-sub-toggle[aria-expanded="true"] { color: var(--sage); }
.mobile-sub-toggle[aria-expanded="true"] .dd-caret { transform: rotate(180deg); }
.mobile-sub {
  display: none;
  margin: 8px 0 8px 2px;
  padding-left: 16px;
  border-left: 2px solid var(--line);
}
.mobile-sub.open { display: block; }
.mobile-sub a {
  font-size: 0.98rem;
  font-weight: 400;
  color: var(--ink-soft);
  padding: 11px 0;
  border-bottom: 0;
}
.mobile-sub a:hover, .mobile-sub a.current { color: var(--sage); }

@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* --- Hero --- */
.hero {
  padding: 100px 0 90px;
  position: relative;
}
.hero-eyebrow {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: 24px;
}
.hero h1 { max-width: 20ch; margin-bottom: 24px; }
.hero-lede {
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 56ch;
  margin-bottom: 36px;
}
.hero-actions {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
}
.hero-note {
  margin-top: 28px;
  font-size: 0.95rem;
  color: var(--muted);
}
@media (max-width: 700px) {
  .hero { padding: 60px 0 50px; }
  .hero-lede { font-size: 1.1rem; }
}

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 26px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 150ms ease;
  text-align: center;
}
.btn-primary {
  background: var(--sage); color: #fff;
}
.btn-primary:hover { background: var(--sage-deep); color: #fff; transform: translateY(-1px); }
.btn-secondary {
  background: transparent; color: var(--sage); border-color: var(--sage);
}
.btn-secondary:hover { background: var(--sage); color: #fff; }
.btn-quiet {
  background: transparent; color: var(--ink-soft); padding: 14px 8px;
}
.btn-quiet:hover { color: var(--sage); }

/* --- Sections --- */
.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head p { font-size: 1.1rem; color: var(--ink-soft); }
.bg-sage-soft { background: var(--sage-soft); }
.bg-warm { background: var(--bg-warm); }
.bg-card { background: var(--card); }

/* --- Cards / grid --- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.card h3 { margin-bottom: 12px; }
.card p { color: var(--ink-soft); margin-bottom: 20px; font-size: 1rem; }
.card-link {
  font-weight: 600;
  color: var(--sage);
  display: inline-flex; align-items: center; gap: 6px;
}
.card-link::after { content: '→'; transition: transform 150ms ease; }
.card-link:hover::after { transform: translateX(3px); }

/* Feature card with numeric marker */
.feature {
  padding: 8px 0;
}
.feature-num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--rose);
  margin-bottom: 8px;
}

/* --- Prose article --- */
.prose { max-width: 68ch; margin: 0 auto; }
.prose p { font-size: 1.125rem; line-height: 1.75; color: var(--ink-soft); }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }
.prose ul { padding-left: 1.4em; margin-bottom: 1.4em; }
.prose li { margin-bottom: 0.5em; color: var(--ink-soft); }
.prose blockquote {
  border-left: 3px solid var(--rose);
  padding: 4px 0 4px 24px;
  margin: 32px 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-style: italic;
  color: var(--ink);
  line-height: 1.4;
}

/* --- Testimonials --- */
.quote {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
}
.quote-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: 20px;
}
.quote-attr {
  font-size: 0.95rem;
  color: var(--muted);
}
.quote-attr strong { color: var(--ink); font-weight: 600; }

/* --- Pricing band --- */
.price-band {
  background: var(--sage);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
}
.price-band .chapter-mark { color: rgba(255,255,255,0.7); }
.price-band .chapter-mark::before { background: rgba(255,255,255,0.4); }
.price-band h2 { color: #fff; margin-bottom: 12px; }
.price-band p { color: rgba(255,255,255,0.85); margin-inline: auto; }
.price-band .btn-primary {
  background: #fff; color: var(--sage);
}
.price-band .btn-primary:hover { background: var(--bg); color: var(--sage-deep); }

/* --- FAQ --- */
.faq-item {
  border-bottom: 1px solid var(--line);
  padding: 24px 0;
}
.faq-item summary {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--ink);
  padding-right: 8px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--sage);
  transition: transform 200ms ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p {
  padding-top: 16px;
  color: var(--ink-soft);
  margin: 0;
}

/* --- Form --- */
.form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px;
}
.form-field { margin-bottom: 20px; }
.form-field label {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
}
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  /* --line is only 1.43:1 on --bg — below the 3:1 WCAG 1.4.11 floor for
     interactive controls, and effectively invisible to older eyes. --muted
     is 4.58:1 and already in the palette. Decorative borders keep --line. */
  border: 1.5px solid var(--muted);
  border-radius: var(--radius-md);
  transition: border-color 150ms ease;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--sage);
}
.form-field textarea { min-height: 120px; resize: vertical; }

/* --- Footer --- */
footer {
  background: var(--sage-deep);
  color: #C4D0C6;
  padding: 72px 0 40px;
  margin-top: 40px;
}
footer .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
footer h4 {
  color: #fff;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}
footer a { color: #C4D0C6; display: block; padding: 4px 0; font-size: 0.95rem; }
footer a:hover { color: #fff; }
footer .footer-brand p { font-size: 0.95rem; color: #A6B4A9; max-width: 32ch; }
footer .footer-brand .logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
  display: block;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 56px;
  padding-top: 24px;
  font-size: 0.85rem;
  color: #8A9A8C;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
@media (max-width: 820px) {
  footer .wrap { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  footer .wrap { grid-template-columns: 1fr; }
}

/* --- Small util --- */
.center { text-align: center; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-0 { margin-bottom: 0; }
.chip {
  display: inline-block;
  padding: 4px 12px;
  background: var(--sage-soft);
  color: var(--sage);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
