/* ============================================================
   Flourish in Midlife — Design System
   Field & Stone: Archivo + Source Sans 3
   Forest / Stone / Slate / Brass palette
   ============================================================ */

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }

/* ── TOKENS ── */
:root {
  --forest:          #1E3A2F;
  --deep-forest:     #14271F;
  --stone:           #ECE8DF;
  --slate:           #2E3B40;
  --brass:           #D9A441;
  --dark-brass:      #7A5A12;
  --ink:             #18241F;
  --body-on-stone:   #2F3D37;
  --on-forest:       #FAF8F3;
  --on-forest-body:  #E4E8DF;
  --on-forest-small: #C9D1C4;
  --on-slate-body:   #E1E6E3;
  --white:           #FAF8F3;

  /* Legacy aliases kept for in-page style blocks that use old names */
  --paper:  var(--stone);
  --sand:   var(--stone);
  --muted:  var(--body-on-stone);
  --ember:  var(--dark-brass);
  --ember-h:#5C4209;
  --rule:   rgba(0,0,0,0.12);

  --sp-xs:  0.5rem;
  --sp-sm:  1rem;
  --sp-md:  1.75rem;
  --sp-lg:  3rem;
  --sp-xl:  5rem;
  --sp-2xl: 8rem;

  --max-w:        1120px;
  --max-w-narrow: 740px;
}

/* ── BASE ── */
html { scroll-behavior: smooth; }

body {
  font-family: 'Source Sans 3', sans-serif;
  background: var(--stone);
  color: var(--ink);
  font-size: 20px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ── SKIP LINK ── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--forest);
  color: var(--white);
  padding: 10px 20px;
  font-weight: 600;
  z-index: 10000;
}
.skip-link:focus { left: 0; }

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 {
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}

h1 {
  font-size: clamp(2.7rem, 5.4vw, 4.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.04;
}

h2 {
  font-size: clamp(1.9rem, 3.2vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

p { color: var(--body-on-stone); line-height: 1.65; }
p:not(:last-child) { margin-bottom: 1rem; }

.prose p { max-width: 64ch; }

.eyebrow {
  display: block;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dark-brass);
  margin-bottom: 1rem;
}

/* ── FOCUS ── */
:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 2px;
}

/* On light backgrounds use forest outline */
.bg-stone :focus-visible,
.bg-white :focus-visible {
  outline-color: var(--forest);
}

/* ── BUTTONS ── */

/* Primary on dark backgrounds: brass bg, deep-forest text */
.btn-primary,
.btn-ember {
  display: inline-block;
  background: var(--brass);
  color: var(--deep-forest);
  padding: 14px 32px;
  min-height: 48px;
  border-radius: 4px;
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s ease;
  line-height: 1.4;
  vertical-align: middle;
}
.btn-primary:hover, .btn-primary:focus-visible,
.btn-ember:hover, .btn-ember:focus-visible {
  background: #c4922d;
  color: var(--deep-forest);
}

/* Primary on light backgrounds: forest bg, white text */
.btn-forest {
  display: inline-block;
  background: var(--forest);
  color: var(--white);
  padding: 14px 32px;
  min-height: 48px;
  border-radius: 4px;
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s ease;
  line-height: 1.4;
  vertical-align: middle;
}
.btn-forest:hover, .btn-forest:focus-visible { background: #162c24; color: var(--white); }

/* White button (on dark sections) */
.btn-white {
  display: inline-block;
  background: var(--white);
  color: var(--deep-forest);
  padding: 14px 32px;
  min-height: 48px;
  border-radius: 4px;
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.18s ease;
  line-height: 1.4;
  vertical-align: middle;
}
.btn-white:hover, .btn-white:focus-visible { opacity: 0.88; }

/* Outline variant (light backgrounds) */
.btn-ember-outline {
  display: inline-block;
  background: transparent;
  color: var(--forest);
  padding: 13px 30px;
  min-height: 48px;
  border-radius: 4px;
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
  border: 2px solid var(--forest);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
  line-height: 1.4;
  vertical-align: middle;
}
.btn-ember-outline:hover, .btn-ember-outline:focus-visible {
  background: var(--forest);
  color: var(--white);
}

/* Outline variant for dark backgrounds (slate, forest, deep-forest) — brass border + text */
.btn-brass-outline {
  display: inline-block;
  background: transparent;
  color: var(--brass);
  padding: 13px 30px;
  min-height: 48px;
  border-radius: 4px;
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
  border: 2px solid var(--brass);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
  line-height: 1.4;
  vertical-align: middle;
}
.btn-brass-outline:hover, .btn-brass-outline:focus-visible {
  background: var(--brass);
  color: var(--deep-forest);
}

/* ── RULE ── */
hr.ds-rule {
  border: none;
  border-top: 1px solid rgba(0,0,0,0.12);
  margin: 0;
}
hr.ds-rule-dark {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.12);
  margin: 0;
}
hr.ds-rule-brass {
  border: none;
  border-top: 2px solid var(--brass);
  width: 48px;
  margin: 1.5rem 0;
}

/* ── NAV ── */
.ds-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--deep-forest);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 0 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  transition: box-shadow 0.2s ease;
}
.ds-nav.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.3); }

.ds-nav-brand img { height: 48px; display: block; }

.ds-nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}
.ds-nav-links a {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--on-forest);
  transition: color 0.15s;
}
.ds-nav-links a:hover, .ds-nav-links a:focus-visible { color: var(--brass); }

/* Mobile hamburger */
#ds-ham {
  display: none;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10001;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}
#ds-ham span { display: block; width: 26px; height: 2px; background: var(--on-forest); border-radius: 2px; }

#ds-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--deep-forest);
  z-index: 10000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
}
#ds-mobile-overlay.open { display: flex; }
#ds-mobile-overlay a {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--on-forest);
  transition: color 0.15s;
}
#ds-mobile-overlay a:hover { color: var(--brass); }
#ds-mobile-overlay a.mobile-cta {
  background: var(--brass);
  color: var(--deep-forest);
  padding: 14px 40px;
  border-radius: 4px;
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  min-height: 48px;
}
#ds-mobile-overlay a.mobile-cta:hover { background: #c4922d; }
#ds-mobile-close {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.6);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 10px 28px;
  border-radius: 4px;
  margin-top: 8px;
}

@media (max-width: 900px) {
  #ds-ham { display: flex !important; }
  .ds-nav-links { display: none !important; }
  .ds-nav-cta { display: none !important; }
  .ds-nav { padding: 0 20px; height: 64px; }
  .ds-nav-brand img { height: 40px; }
}

/* ── SECTION / LAYOUT ── */
.ds-section { padding: var(--sp-xl) 56px; }
.ds-section-narrow { padding: var(--sp-xl) 56px; }
.ds-inner { max-width: var(--max-w); margin: 0 auto; }
.ds-inner-narrow { max-width: var(--max-w-narrow); margin: 0 auto; }

@media (max-width: 900px) {
  .ds-section, .ds-section-narrow { padding: var(--sp-lg) 24px; }
}

/* ── BACKGROUND VARIANTS ── */
.bg-stone  { background: var(--stone); }
.bg-paper  { background: var(--stone); }  /* alias */
.bg-sand   { background: var(--stone); }  /* alias */
.bg-white  { background: var(--white); }
.bg-forest { background: var(--forest); }
.bg-slate  { background: var(--slate); }
.bg-ink    { background: var(--deep-forest); }

/* Text overrides on dark backgrounds */
.bg-forest h1, .bg-forest h2, .bg-forest h3, .bg-forest h4 { color: var(--on-forest); }
.bg-forest p { color: var(--on-forest-body); }
.bg-forest .eyebrow { color: var(--brass); }

.bg-slate h1, .bg-slate h2, .bg-slate h3, .bg-slate h4 { color: var(--on-forest); }
.bg-slate p { color: var(--on-slate-body); }
.bg-slate .eyebrow { color: var(--brass); }

.bg-ink h1, .bg-ink h2, .bg-ink h3, .bg-ink h4 { color: var(--on-forest); }
.bg-ink p { color: var(--on-forest-body); }
.bg-ink .eyebrow { color: var(--brass); }

/* ── SCROLL REVEAL ── */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ── FOOTER ── */
.ds-footer {
  background: var(--deep-forest);
  padding: var(--sp-xl) 56px var(--sp-lg);
}
.ds-footer-inner { max-width: var(--max-w); margin: 0 auto; }
.ds-footer-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-lg);
  padding-bottom: var(--sp-lg);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: var(--sp-lg);
  align-items: start;
}
.ds-footer-brand img { height: 44px; display: block; margin-bottom: var(--sp-sm); }
.ds-footer-tagline {
  font-family: 'Source Sans 3', sans-serif;
  font-style: italic;
  font-size: 1rem;
  font-weight: 400;
  color: var(--on-forest-small);
  margin-bottom: 0.75rem;
}
.ds-footer-contact a {
  font-size: 1rem;
  color: var(--on-forest-small);
  transition: color 0.15s;
}
.ds-footer-contact a:hover { color: var(--brass); }
.ds-footer-contact span { color: rgba(255,255,255,0.2); margin: 0 0.5rem; }

.ds-footer-nav { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; }
.ds-footer-nav a {
  font-size: 1rem;
  color: var(--on-forest-body);
  transition: color 0.15s;
}
.ds-footer-nav a:hover { color: var(--brass); }

.ds-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-sm);
  font-size: 0.9rem;
  color: var(--on-forest-small);
}
.ds-footer-legal { display: flex; gap: var(--sp-md); }
.ds-footer-legal a { color: var(--on-forest-small); font-size: 0.9rem; transition: color 0.15s; }
.ds-footer-legal a:hover { color: var(--brass); }
.ds-footer-retirement {
  margin-top: var(--sp-sm);
  font-size: 0.9rem;
  color: rgba(255,255,255,0.3);
}
.ds-footer-retirement a { color: var(--on-forest-small); text-decoration: underline; }

@media (max-width: 700px) {
  .ds-footer { padding: var(--sp-lg) 24px; }
  .ds-footer-top { grid-template-columns: 1fr; }
}
