/* Retire Ready — Design System
 * Aesthetic: warm paper, deep moss, sage, clay accents.
 * Editorial spacing, generous whitespace, soft shadows, calm.
 */

:root {
  /* Surfaces — warm off-whites */
  --paper:        #F6F1E8;   /* page background */
  --paper-2:      #FBF7EF;   /* card surface */
  --paper-3:      #FFFFFF;   /* elevated surface */
  --paper-edge:   #ECE4D4;   /* hairline divider */

  /* Ink — deep moss/charcoal */
  --ink:          #1F2A24;   /* primary text */
  --ink-2:        #364840;   /* secondary text */
  --ink-3:        #6B7A72;   /* tertiary / meta */
  --ink-4:        #98A39B;   /* faint */

  /* Sage — supportive accent */
  --sage:         #6E8A78;
  --sage-2:       #8FA899;
  --sage-soft:    #DCE4DA;
  --sage-tint:    #EBF0E8;

  /* Moss — primary brand */
  --moss:         #2F4A3A;
  --moss-deep:    #233A2D;

  /* Clay — terracotta CTA */
  --clay:         #B96B4A;
  --clay-deep:    #9E5638;
  --clay-soft:    #F2D9CB;
  --clay-tint:    #F8E7DC;

  /* Status */
  --status-ok:    #5E8266;
  --status-warn:  #C28A3F;
  --status-risk:  #B5594A;

  /* Type */
  --serif:  "Fraunces", "Cormorant Garamond", "Georgia", "Times New Roman", serif;
  --sans:   "Inter", "Söhne", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:   "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Radii */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Shadows — soft, low-spread */
  --sh-1: 0 1px 2px rgba(31,42,36,0.04), 0 1px 1px rgba(31,42,36,0.03);
  --sh-2: 0 2px 6px rgba(31,42,36,0.05), 0 8px 24px -8px rgba(31,42,36,0.08);
  --sh-3: 0 4px 14px rgba(31,42,36,0.06), 0 24px 48px -16px rgba(31,42,36,0.12);

  /* Spacing rhythm */
  --gutter: clamp(20px, 4vw, 48px);
}

/* Reset-ish */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

/* Typography helpers */
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
.mono  { font-family: var(--mono); font-feature-settings: "tnum"; }
.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.lead {
  font-size: clamp(17px, 1.4vw, 19px);
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 60ch;
  text-wrap: pretty;
}

h1, h2, h3, h4 { margin: 0; font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; color: var(--ink); }
h1 { font-size: clamp(40px, 6vw, 80px); line-height: 1.02; }
h2 { font-size: clamp(28px, 3.4vw, 44px); line-height: 1.08; }
h3 { font-size: clamp(20px, 1.8vw, 26px); line-height: 1.2; }
h4 { font-size: 18px; line-height: 1.3; font-family: var(--sans); font-weight: 600; letter-spacing: -0.005em; }

p  { margin: 0; }

/* Layout */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container-narrow {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 22px;
  border-radius: var(--r-pill);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease, color .2s ease;
  white-space: nowrap;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--clay);
  color: #FBF7EF;
  box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 6px 18px -8px rgba(158,86,56,0.55);
}
.btn-primary:hover { background: var(--clay-deep); }
.btn-secondary {
  background: var(--moss);
  color: #F2EFE4;
}
.btn-secondary:hover { background: var(--moss-deep); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--paper-edge);
}
.btn-ghost:hover { background: var(--paper-2); border-color: #DCD2BD; }
.btn-link {
  height: auto; padding: 0; border-radius: 0;
  color: var(--moss); border-bottom: 1px solid currentColor;
  background: transparent; font-weight: 500;
}
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn-lg { height: 56px; padding: 0 26px; font-size: 16px; }

/* Cards */
.card {
  background: var(--paper-2);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.card-elev {
  background: var(--paper-3);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
}

/* Pills / badges */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: var(--sage-tint);
  color: var(--moss);
  border: 1px solid var(--sage-soft);
}
.pill-clay { background: var(--clay-tint); color: var(--clay-deep); border-color: var(--clay-soft); }
.pill-warn { background: #F7EBD2; color: #8C6021; border-color: #EFD9A8; }
.pill-risk { background: #F2DAD3; color: #8E3F2F; border-color: #E8C2B7; }
.pill-dot::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; display: inline-block;
}

/* Forms */
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.field-help {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.45;
}
.field-error {
  font-size: 13px;
  color: var(--clay-deep);
}
.input, .select, .textarea {
  width: 100%;
  height: 56px;
  padding: 0 18px;
  background: var(--paper-3);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-md);
  font-size: 16px;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.textarea { height: auto; padding: 14px 18px; min-height: 96px; }
.input:hover, .select:hover { border-color: #D7CCB4; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--moss);
  box-shadow: 0 0 0 4px rgba(47,74,58,0.10);
}
.input.has-error { border-color: var(--clay); box-shadow: 0 0 0 4px rgba(185,107,74,0.12); }
.input-prefix {
  position: relative;
}
.input-prefix .input { padding-left: 36px; }
.input-prefix .prefix {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3); font-size: 16px;
}
.input-suffix .input { padding-right: 60px; }
.input-suffix .suffix {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3); font-size: 14px;
}

/* Choice cards (radio-as-card) */
.choice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  background: var(--paper-3);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all .15s ease;
  text-align: left;
  width: 100%;
}
.choice:hover { border-color: #D7CCB4; background: #FFFDF7; }
.choice.selected {
  border-color: var(--moss);
  background: var(--sage-tint);
  box-shadow: 0 0 0 3px rgba(47,74,58,0.08);
}
.choice .choice-mark {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid #C9BDA3;
  flex: 0 0 auto;
  margin-top: 2px;
  display: grid; place-items: center;
  background: var(--paper-3);
  transition: all .15s ease;
}
.choice.selected .choice-mark { border-color: var(--moss); background: var(--moss); }
.choice.selected .choice-mark::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--paper);
}
.choice-title { font-weight: 500; color: var(--ink); font-size: 15px; }
.choice-sub   { font-size: 13px; color: var(--ink-3); margin-top: 2px; line-height: 1.45; }

/* Segmented */
.segmented {
  display: inline-flex;
  background: var(--paper-2);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-pill);
  padding: 4px;
  gap: 4px;
}
.segmented button {
  height: 36px; padding: 0 16px; border-radius: var(--r-pill);
  color: var(--ink-2); font-size: 13px; font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.segmented button.active { background: var(--moss); color: #F2EFE4; }

/* Divider */
.divider { height: 1px; background: var(--paper-edge); border: 0; margin: 0; }

/* Utilities */
.row { display: flex; }
.col { display: flex; flex-direction: column; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.gap-48 { gap: 48px; }
.center { align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex-grow: 1; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.muted-2 { color: var(--ink-4); }
.tiny { font-size: 12px; }
.small { font-size: 13px; }
.right { text-align: right; }
.center-text { text-align: center; }

/* Section spacing */
.section { padding: clamp(56px, 8vw, 112px) 0; }
.section-tight { padding: clamp(40px, 5vw, 72px) 0; }

/* Nav */
.nav {
  position: sticky;
  top: 0; left: 0; right: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  background: rgba(246,241,232,0.82);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease;
}
.nav.scrolled { border-bottom-color: var(--paper-edge); }
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--moss);
}
.brand-mark {
  width: 28px; height: 28px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--sage-2), var(--moss) 70%);
  position: relative;
  flex: 0 0 auto;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 6px;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,0.55);
}
.nav-links { display: flex; gap: 28px; }
.nav-link {
  color: var(--ink-2); font-size: 14px; font-weight: 500;
  padding: 6px 0; border-bottom: 1.5px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.nav-link:hover { color: var(--moss); }
.nav-link.active { color: var(--moss); border-bottom-color: var(--moss); }

/* Footer */
.footer {
  margin-top: auto;
  padding: 56px 0 40px;
  border-top: 1px solid var(--paper-edge);
  background: var(--paper);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
}
.footer h5 {
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 16px; font-weight: 500;
}
.footer a { display: block; color: var(--ink-2); font-size: 14px; padding: 6px 0; }
.footer a:hover { color: var(--moss); }

/* Animations — no opacity-from-0 (so backgrounded iframes render content) */
@keyframes rise {
  from { transform: translateY(6px); }
  to   { transform: translateY(0); }
}
.rise { animation: rise .5s ease both; }

@keyframes fade {
  from { transform: translateY(2px); }
  to   { transform: translateY(0); }
}
.fade { animation: fade .25s ease both; }

/* Stat numbers */
.stat-num {
  font-family: var(--serif);
  font-size: clamp(36px, 4vw, 56px);
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
  font-feature-settings: "tnum";
}
.stat-label {
  font-size: 13px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

/* Texture: subtle paper grain */
.paper-grain {
  background-image:
    radial-gradient(rgba(31,42,36,0.025) 1px, transparent 1px),
    radial-gradient(rgba(31,42,36,0.018) 1px, transparent 1px);
  background-size: 3px 3px, 7px 7px;
  background-position: 0 0, 1px 2px;
}

/* Scroll behavior */
html { scroll-behavior: smooth; }

/* Focus */
:focus-visible {
  outline: 2px solid var(--moss);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Mobile tweaks */
@media (max-width: 720px) {
  h1 { font-size: 44px; }
  .nav-inner { height: 64px; }
}
