/* ==========================================================================
   Boyles Benefits Group — base.css
   Tokens, reset, typography, layout primitives.
   Brand tokens are derived from the 2026 BBG circular monogram (navy + sage).
   ========================================================================== */

:root {
  /* Brand palette — from the BBG logo */
  --navy:        #16345A;  /* logo navy — primary brand */
  --navy-deep:   #0F2440;  /* hero gradient start, footer */
  --navy-soft:   #2C517D;  /* hero gradient end, mid surfaces */
  --sage:        #8A9A6B;  /* logo green — THE accent (replaces gold) */
  --sage-light:  #C3CFAE;
  --sage-pale:   #EDF1E4;  /* tinted section background */
  --sand:        #F6F4EF;  /* warm neutral section background */
  --light-gray:  #E6E9EE;
  --gray:        #52627A;  /* secondary body text — AA on white and on --sand */
  --text:        #14263B;  /* primary body text */
  --white:       #ffffff;

  /* Derived aliases so component rules stay readable */
  --navy-mid: #2C517D;
  --navy-ink: #14263B;
  --sage-soft: rgba(138, 154, 107, 0.35);
  --border: #E6E9EE;

  /* Type */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  /* Spacing / layout */
  --nav-h: 100px;
  --maxw: 1200px;
  --maxw-prose: 760px;
  --pad-x: 5%;
  --section-y: 6rem;
  --radius: 6px;
  --radius-sm: 2px;

  /* Shadows */
  --shadow-card: 0 8px 30px rgba(22, 52, 90, 0.10);
  --shadow-card-hover: 0 16px 44px rgba(22, 52, 90, 0.18);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--white);
  font-size: 1rem;
  line-height: 1.7;
  font-weight: 400;
  overflow-x: hidden;
  padding-top: var(--nav-h);
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--navy-deep); }
table { border-collapse: collapse; width: 100%; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 2000;
  background: var(--white);
  color: var(--navy);
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  border: 2px solid var(--navy);
}
.skip-link:focus { left: 1rem; top: 0.5rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Typography ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--navy); line-height: 1.2; font-weight: 700; }

h1 { font-size: clamp(2.1rem, 4vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.15rem, 1.6vw, 1.4rem); font-weight: 600; }
h4 { font-size: 1.05rem; font-weight: 600; }

p { margin-bottom: 1.15rem; }
p:last-child { margin-bottom: 0; }

strong { font-weight: 600; color: var(--text); }
em { font-style: italic; }

.eyebrow {
  /* sage is the rule colour; navy keeps the small caps AA-legible on light bg */
  display: inline-block;
  color: var(--navy);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 1rem;
  border-left: 3px solid var(--sage);
  padding-left: 0.75rem;
}
.eyebrow.light { color: var(--sage-light); border-left-color: var(--sage); }

.section-title { margin-bottom: 1.25rem; }
.section-title.light { color: var(--white); }

.lede {
  color: var(--gray);
  font-size: 1.05rem;
  line-height: 1.8;
  max-width: 64ch;
}
.lede.light { color: rgba(255, 255, 255, 0.88); }

.text-center { text-align: center; }
.center-block { margin-left: auto; margin-right: auto; }

/* ── Layout primitives ───────────────────────────────────────────────────── */
.section { padding: var(--section-y) var(--pad-x); }
.section--tight { padding-top: 3.5rem; padding-bottom: 3.5rem; }
.section--cream { background: var(--sand); }   /* legacy alias → warm sand */
.section--sand  { background: var(--sand); }
.section--sage  { background: var(--sage-pale); }
.section--light { background: var(--sage-pale); }
.section--navy { background: var(--navy); color: rgba(255, 255, 255, 0.9); position: relative; }
.section--navy h2, .section--navy h3 { color: var(--white); }
.section--navy::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(195, 207, 174, 0.16) 0%, transparent 62%);
  pointer-events: none;
}
.section--navy > * { position: relative; z-index: 1; }

.wrap { max-width: var(--maxw); margin: 0 auto; }
.wrap-prose { max-width: var(--maxw-prose); margin: 0 auto; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.grid-split { display: grid; grid-template-columns: 1fr 1fr; gap: 4.5rem; align-items: center; }

.stack > * + * { margin-top: 1.15rem; }
.mt-1 { margin-top: 0.75rem; }
.mt-2 { margin-top: 1.5rem; }
.mt-3 { margin-top: 2.25rem; }
.mt-4 { margin-top: 3rem; }

/* Prose blocks (article + policy body copy) */
.prose { color: var(--text); font-size: 1.02rem; line-height: 1.85; }
.prose h2 { font-size: clamp(1.45rem, 2.2vw, 1.9rem); margin: 2.75rem 0 1rem; }
.prose h3 { font-size: 1.2rem; margin: 2rem 0 0.75rem; }
.prose p { color: var(--text); }
.prose ul, .prose ol { margin: 0 0 1.3rem 0; }
.prose ul li, .prose ol li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.6rem;
}
.prose ul li::before {
  content: '';
  position: absolute; left: 0; top: 0.72em;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--sage);
}
.prose ol { counter-reset: pl; }
.prose ol li { counter-increment: pl; }
.prose ol li::before {
  content: counter(pl) '.';
  position: absolute; left: 0; top: 0;
  color: var(--navy); font-weight: 600;
}
.prose a { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--navy-deep); }

/* ── Reveal animation ────────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.from-left { transform: translateX(-40px); }
.reveal.from-right { transform: translateX(40px); }
.reveal.visible { opacity: 1; transform: translate(0, 0); }
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }
.reveal-d4 { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --nav-h: 84px; --section-y: 4.5rem; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-split { grid-template-columns: 1fr; gap: 2.5rem; }
}

@media (max-width: 700px) {
  :root { --section-y: 3.5rem; --pad-x: 1.25rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .lede { font-size: 1rem; }
}
