/* ============ LIFESURANCE DESIGN SYSTEM ============ */

:root {
  /* Brand */
  --forest: #0E3B2E;
  --forest-deep: #082019;
  --forest-mid: #1A5444;
  --forest-soft: #D8E5DF;
  --gold: #E8C547;
  --gold-warm: #D4A92E;
  --gold-soft: #F5E9B8;

  /* Neutrals */
  --ivory: #F5F1EA;
  --ivory-warm: #EDE6D8;
  --paper: #FAF7F1;
  --ink: #14201A;
  --ink-soft: #4A5953;
  --ink-muted: #7E8B85;
  --line: #DDD5C4;
  --line-soft: #EAE3D2;
  --white: #FFFFFF;

  /* Semantic */
  --bg: var(--paper);
  --fg: var(--ink);

  /* Type */
  --serif: 'Fraunces', 'GT Sectra', 'Tiempos', Georgia, serif;
  --sans: 'Inter', 'Söhne', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Radii */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.5;
}

/* Type scale */
.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.eyebrow-gold {
  color: var(--gold-warm);
}

h1, h2, h3, h4 { margin: 0; font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; }
.display {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(56px, 8vw, 112px);
  line-height: 0.96;
  letter-spacing: -0.035em;
}
.h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 5.5vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.025em;
}
.h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 3.6vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.lede {
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.5;
  color: var(--ink-soft);
}
.body { font-size: 16px; line-height: 1.6; color: var(--ink-soft); }
.italic { font-style: italic; }

/* Shell */
.page { min-height: 100vh; background: var(--paper); }
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 640px) {
  .container { padding: 0 20px; }
}

section { position: relative; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--forest);
  color: var(--paper);
}
.btn-primary:hover { background: var(--forest-deep); }
.btn-gold {
  background: var(--gold);
  color: var(--forest-deep);
}
.btn-gold:hover { background: var(--gold-warm); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--ivory); }
.btn-lg { padding: 18px 28px; font-size: 16px; }
.btn-sm { padding: 10px 16px; font-size: 14px; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 241, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  max-width: 1240px;
  margin: 0 auto;
}
.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}
.nav-link {
  font-size: 14.5px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 450;
  transition: color 0.15s ease;
}
.nav-link:hover { color: var(--forest); }
.nav-link.active { color: var(--forest); font-weight: 500; }
.nav-cta-group { display: flex; gap: 10px; align-items: center; }
@media (max-width: 880px) {
  .nav-links { display: none; }
}

/* Wordmark */
.wordmark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.025em;
  color: var(--forest);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.wordmark .seal {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--gold-soft), var(--gold) 40%, var(--gold-warm));
  position: relative;
  flex-shrink: 0;
}
.wordmark .seal::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 1.5px solid var(--forest);
  opacity: 0.5;
}
.wordmark span.dim { color: var(--gold-warm); font-style: italic; font-weight: 400; }

/* Footer */
.footer {
  background: var(--forest-deep);
  color: var(--ivory);
  padding: 80px 0 40px;
  margin-top: 120px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 60px;
  margin-bottom: 60px;
}
.footer h5 {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 20px;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.footer a { color: var(--ivory); text-decoration: none; opacity: 0.75; font-size: 15px; transition: opacity 0.15s ease; }
.footer a:hover { opacity: 1; }
.footer .footer-bottom {
  border-top: 1px solid rgba(245, 241, 234, 0.12);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  opacity: 0.6;
}
.footer .footer-mark {
  font-family: var(--serif);
  font-size: 28px;
  color: var(--paper);
  margin-bottom: 16px;
}
.footer .footer-tag {
  font-size: 14px;
  opacity: 0.7;
  max-width: 300px;
  line-height: 1.5;
}
@media (max-width: 800px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 32px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px -16px rgba(14, 59, 46, 0.18);
}
.card-forest {
  background: var(--forest);
  color: var(--ivory);
  border-color: transparent;
}
.card-forest .body, .card-forest .lede { color: rgba(245, 241, 234, 0.8); }

/* Tag */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--ivory-warm);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.tag-gold { background: var(--gold-soft); border-color: var(--gold); color: var(--forest-deep); }
.tag-forest { background: var(--forest); border-color: transparent; color: var(--gold-soft); }
.tag-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold-warm); }

/* Section spacing */
.section { padding: 100px 0; }
.section-tight { padding: 64px 0; }
.section-wide { padding: 140px 0; }

/* Utilities */
.row { display: flex; }
.col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; } .gap-8 { gap: 32px; } .gap-10 { gap: 40px; } .gap-12 { gap: 48px; }
.between { justify-content: space-between; }
.center { align-items: center; }
.text-center { text-align: center; }
.flex-1 { flex: 1; }
.bg-forest { background: var(--forest); color: var(--ivory); }
.bg-forest-deep { background: var(--forest-deep); color: var(--ivory); }
.bg-ivory { background: var(--ivory); }
.bg-paper { background: var(--paper); }
.bg-gold { background: var(--gold); color: var(--forest-deep); }
.bg-gold-soft { background: var(--gold-soft); }

.divider { height: 1px; background: var(--line-soft); width: 100%; }

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes drawLine {
  from { stroke-dashoffset: 1000; }
  to { stroke-dashoffset: 0; }
}
.fade-up { animation: fadeUp 0.6s ease-out both; }

/* ============ MOBILE RESPONSIVE ============ */

/* Catch-all grid collapse for inline-styled grids on common breakpoints */
@media (max-width: 880px) {
  .nav-inner { padding: 14px 18px; }
  .nav-cta-group .btn-ghost { display: none; }
  .nav-cta-group .btn-sm { padding: 8px 14px; font-size: 13px; }

  .section { padding: 64px 0; }
  .section-wide { padding: 80px 0; }
  .section-tight { padding: 48px 0; }

  .footer { padding: 56px 0 32px; margin-top: 64px; }
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 32px !important; margin-bottom: 40px; }
  .footer-bottom { flex-direction: column; gap: 12px; align-items: flex-start; }

  .marquee-track { gap: 48px; padding: 18px 24px; }
  .marquee-item { font-size: 17px; }
}

@media (max-width: 720px) {
  /* Force every multi-col inline grid to single column on mobile.
     This is broad — but every multi-col layout in the site benefits from stacking. */
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  /* Re-allow specific small-grid utilities that should stay multi-col on mobile */
  .a-states { grid-template-columns: repeat(4, 1fr) !important; }
  .a-options.cols-2 { grid-template-columns: 1fr !important; }
  .a-options.cols-4 { grid-template-columns: repeat(2, 1fr) !important; }

  /* Stat blocks shrink */
  .container { padding: 0 18px; }

  /* Display headlines need to breathe but stay impactful */
  .display { font-size: clamp(40px, 11vw, 56px) !important; line-height: 1.0 !important; }
  .h1 { font-size: clamp(32px, 8vw, 44px) !important; }
  .h2 { font-size: clamp(26px, 6.5vw, 36px) !important; }
  .h3 { font-size: clamp(20px, 5vw, 26px) !important; }
  .lede { font-size: 16px !important; }

  /* Cards padding compress */
  .card { padding: 24px !important; }

  /* Hide marquee on tiny screens to save space */
  .marquee-track { padding: 14px 20px; gap: 32px; }
  .marquee-item { font-size: 15px; }

  /* Buttons full-width on tiny screens when grouped */
  .btn-lg { padding: 14px 22px; font-size: 15px; }

  /* Footer: 1 col on phone */
  .footer-grid { grid-template-columns: 1fr !important; gap: 32px !important; }

  /* Big inline stat numbers — force smaller */
  .container [style*="font-family: var(--serif)"][style*="font-size: 64px"],
  .container [style*="fontSize: 64"],
  .container [style*="fontSize: 80"] {
    font-size: 48px !important;
  }
}

/* Hero animation — shrink container on mobile so it doesn't crowd headline */
@media (max-width: 720px) {
  section, .card { overflow: hidden; }
  .hero-anim-wrap { max-width: 380px !important; margin-top: 24px; }
  /* Stop sticky behavior on mobile — it traps content */
  [style*="position: sticky"] { position: static !important; }
  /* Compress side-by-side comparison cards to single col with gap */
  [style*="gridTemplateColumns: '1fr 1fr'"],
  [style*="grid-template-columns: '1fr 1fr'"] { grid-template-columns: 1fr !important; }
  /* Big calculator numbers smaller */
  [style*="font-size: clamp(60px"],
  [style*="font-size: clamp(72px"],
  [style*="font-size: clamp(56px"] { font-size: clamp(40px, 12vw, 64px) !important; }
  /* SVG charts — make them scale */
  svg { max-width: 100% !important; height: auto !important; }
}

@media (max-width: 480px) {
  .nav-inner { padding: 12px 16px; }
  .wordmark { font-size: 18px !important; }
  .wordmark .seal { width: 18px !important; height: 18px !important; }
  .nav-cta-group .btn-sm { padding: 7px 11px; font-size: 12px; }

  .container { padding: 0 16px; }

  .display { font-size: clamp(36px, 12vw, 48px) !important; }
  .h1 { font-size: clamp(28px, 9vw, 36px) !important; }

  .section { padding: 48px 0; }

  .card { padding: 20px !important; }
  .tag { font-size: 12px; padding: 5px 10px; }

  .a-top { padding: 14px 16px; flex-wrap: wrap; gap: 8px; }
  .a-progress-wrap { margin: 0 12px; min-width: 120px; }
  .a-bottom { padding: 14px 16px; flex-wrap: wrap; gap: 8px; }
  .a-bottom > div { display: none; }
  .a-q-title { font-size: clamp(28px, 8vw, 38px) !important; }
  .a-stage { padding: 24px 16px; }
  .a-card { padding: 0 !important; }
  .a-opt { padding: 16px 18px; font-size: 15px; }
  .a-states { grid-template-columns: repeat(3, 1fr) !important; }
  .a-input { padding: 14px 16px; font-size: 16px; }

  /* Calculator slider giant numbers */
  .container [style*="fontSize"][style*="180"],
  [style*="font-size: 180"] { font-size: 56px !important; }
}

/* Marquee */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper);
}
.marquee-track {
  display: inline-flex;
  gap: 80px;
  padding: 22px 40px;
  animation: marquee 40s linear infinite;
  align-items: center;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee-item {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink-muted);
  font-style: italic;
  display: inline-flex;
  align-items: center;
  gap: 18px;
}
.marquee-item::after {
  content: '✦';
  color: var(--gold-warm);
  font-style: normal;
}

/* ============ HOME HERO + QUALIFY (mobile-first tweaks) ============ */
.qualify-block { padding: 120px 0; }
.hide-on-mobile { display: inline; }

@media (max-width: 720px) {
  /* HERO — animation first, copy second; tighter so CTA sits above the fold */
  .home-hero { padding: 20px 0 48px !important; }
  .hero-grid { gap: 18px !important; row-gap: 18px !important; }
  .hero-visual { order: -1; max-width: 360px; margin: 0 auto; width: 100%; }
  .hero-visual .hero-anim-wrap { max-width: 100% !important; margin-top: 0 !important; }

  .hero-copy .tag { margin-bottom: 14px !important; }
  .hero-copy h1.display { margin-bottom: 14px !important; line-height: 0.98 !important; }
  .hero-copy .hero-lede { font-size: 15px !important; line-height: 1.5 !important; margin-bottom: 20px !important; }
  .hero-copy .hero-cta-row { gap: 10px !important; }
  .hero-copy .hero-cta-row .btn-lg { padding: 14px 20px !important; font-size: 15px !important; flex: 1 1 auto; justify-content: center; }
  .hero-copy .hero-trust-row { margin-top: 18px !important; gap: 6px 18px !important; font-size: 12.5px !important; }
  .hero-copy .hero-trust-row > div { white-space: nowrap; }

  /* QUALIFY ("I don't want my best people to leave") — much tighter */
  .qualify-block { padding: 56px 0 !important; }
  .qualify-block .qualify-eyebrow { margin-bottom: 12px !important; font-size: 11px !important; }
  .qualify-block .qualify-headline {
    font-size: clamp(24px, 7vw, 34px) !important;
    line-height: 1.15 !important;
    margin: 0 0 18px !important;
    padding: 0 4px;
  }
  .qualify-block .qualify-sub {
    font-size: 15px !important;
    line-height: 1.5 !important;
    margin: 0 auto 24px !important;
    padding: 0 6px;
  }
  .qualify-block .btn-gold.btn-lg { padding: 14px 22px !important; font-size: 15px !important; }
  .hide-on-mobile { display: none; }
}

@media (max-width: 480px) {
  .hero-copy .hero-trust-row { font-size: 12px !important; }
  .qualify-block { padding: 44px 0 !important; }
  .qualify-block .qualify-headline { font-size: clamp(22px, 6.6vw, 30px) !important; }
}
