/* =============================================================
   GLOBAL.CSS — Citizens Reverse Mortgage
   Base styles: reset, color system, typography, spacing tokens.
   Design tokens sourced from the approved wireframe design system,
   extended with a modern depth / motion / accent layer.
   ============================================================= */

/* ── DESIGN TOKENS ───────────────────────────────────────── */
:root {
  /* Color system */
  --navy:        #1B2D5B; /* Founding Navy — primary brand */
  --navy-mid:    #243875;
  --navy-deep:   #101E42;
  --navy-ink:    #0B1530;
  --gold:        #B8943A; /* California Gold — accent */
  --gold-light:  #D4A94F;
  --gold-soft:   #E7C977;
  --gold-dim:    rgba(184, 148, 58, 0.12);
  --teal:        #3D7A8A; /* Coastal Teal — secondary accent */
  --teal-light:  #4E8F9F;
  --white:       #FFFFFF; /* Estate White */
  --bg:          #F6F7FB; /* Pacific Gray — page background */
  --off-white:   #F2F4FB;
  --warm-mist:   #EDF1FB; /* Senior-comfort surface */
  --cool-gray:   #E3E8F2;
  --text-dark:   #1B2D5B; /* headings */
  --text-body:   #46506A; /* Slate Text — body copy */
  --text-mid:    #8995B0; /* Mid Navy — captions/meta */
  --line:        #E3E8F2;

  /* Gradients */
  --grad-gold:  linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  --grad-navy:  linear-gradient(150deg, var(--navy) 0%, var(--navy-mid) 55%, var(--navy-deep) 100%);
  --grad-hero:  linear-gradient(155deg, var(--navy-ink) 0%, var(--navy) 50%, var(--navy-mid) 100%);

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
  --font-mono:    'Roboto Mono', monospace;

  /* Spacing scale */
  --space-xs:  8px;
  --space-sm:  16px;
  --space-md:  24px;
  --space-lg:  40px;
  --space-xl:  72px;
  --space-2xl: 112px;

  /* Layout */
  --container: 1440px;
  --radius-sm: 10px;
  --radius:    18px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --radius-btn: 6px;  /* button radius — matches wireframe header buttons */

  /* Elevation */
  --shadow-sm: 0 2px 8px rgba(16, 30, 66, 0.06);
  --shadow-md: 0 14px 38px rgba(16, 30, 66, 0.10);
  --shadow-lg: 0 30px 70px rgba(16, 30, 66, 0.18);
  --shadow-gold: 0 16px 34px rgba(184, 148, 58, 0.30);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── RESET ───────────────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 20px;            /* senior-accessible: enlarged base body copy for elderly readers */
  line-height: 1.7;           /* generous line-height per design principles */
  color: var(--text-body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--teal); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--navy); }

::selection { background: var(--gold); color: #fff; }

/* ── TYPOGRAPHY ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.4em;
  color: var(--text-dark);
  line-height: 1.1;
  font-weight: 700;
}

/* H1 / H2 — Cormorant Garamond display */
h1 {
  font-family: var(--font-display);
  font-size: clamp(46px, 5.6vw, 78px);
  font-weight: 700;
  letter-spacing: -0.015em;
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.2vw, 50px);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* H3 / H4 / card headings — Source Sans 3 */
h3 {
  font-family: var(--font-body);
  font-size: clamp(20px, 2.4vw, 25px);
  font-weight: 700;
  letter-spacing: -0.01em;
}
h4 {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
}

p { margin: 0 0 1em; }

/* Eyebrow / section label — Roboto Mono, California Gold */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-sm);
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--grad-gold);
  border-radius: 2px;
}
.eyebrow--center { justify-content: center; }

/* ── LAYOUT HELPERS ──────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 56px);
}

.section { position: relative; padding-block: var(--space-2xl); }
.section--tight { padding-block: var(--space-xl); }
.section--bg     { background: var(--bg); }
.section--mist   { background: var(--warm-mist); }
.section--navy   { background: var(--grad-navy); color: #fff; }
.section--navy h1,
.section--navy h2,
.section--navy h3 { color: #fff; }

.section-head { max-width: 720px; margin-bottom: var(--space-xl); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head p { font-size: 22px; color: var(--text-body); }

.section-foot { margin-top: var(--space-xl); }
.section-foot--center { text-align: center; }

/* ── GRID UTILITIES ──────────────────────────────────────── */
.grid { display: grid; gap: var(--space-md); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 980px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* ── SCROLL REVEAL ───────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }

/* Accessibility */
.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

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

@media (max-width: 768px) {
  .section { padding-block: var(--space-xl); }
  .section-head { margin-bottom: var(--space-lg); }
}
