/*
  FeatureWorth — shared layout system (v2)
  Brand: #0e2f36 deep teal (ink), #eeff00 electric yellow, DM Sans.
  Light pages framed by a dark header and footer. On light surfaces, yellow is
  reserved for money (price gaps, savings). Class names from v1 are kept so
  older pages (privacy, contact, disclaimer) keep working.
*/

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

:root {
  --yellow:     #eeff00;
  --yellow-d:   #d4e600;
  --yellow-sl:  rgba(238,255,0,.16);
  --teal:       #0e2f36;
  --teal-m:     #163f4a;
  --teal-l:     #1e5060;
  --white:      #ffffff;
  --off:        #f6f7f2;
  --grey-l:     #eef0ea;
  --grey-m:     #8a9699;
  --grey-faint: #767676;
  --grey-d:     #3d5054;
  --black:      #0a0a0a;
  --green:      #1A6B3A;
  --green-pale: #EEF8F2;
  --green-line: #A8D5B8;
  --amber:      #8a5c00;
  --amber-pale: #FFF7E3;
  --amber-line: #EBD7A3;
  --red-dark:   #8B1A1A;
  --red-pale:   #FDF3F3;
  --red-line:   #E8AAAA;

  --ink:     var(--teal);
  --muted:   #5c6f73;               /* 5.3:1 on white */
  --line:    rgba(14,47,54,.10);
  --line-s:  rgba(14,47,54,.18);

  --radius:  12px;
  --radius-l: 18px;
  --shadow:   0 1px 2px rgba(14,47,54,.05), 0 6px 20px rgba(14,47,54,.06);
  --shadow-h: 0 2px 4px rgba(14,47,54,.06), 0 14px 36px rgba(14,47,54,.12);
  --ease:    cubic-bezier(.2,.7,.2,1);
  --trans:   all .2s var(--ease);
  --font:    'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-d:  var(--font);
  --nav-h:   64px;
  --wrap:    1152px;
}

/* Smooth page-to-page navigation (Chrome, Edge, Safari 18.2+; ignored elsewhere) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }

html { scroll-behavior: smooth; background: var(--white); }
body {
  font-family: var(--font);
  font-optical-sizing: auto;
  background: var(--white);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font); color: inherit; }
img { display: block; max-width: 100%; }
em { font-style: normal; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }

/* ── HEADER (dark frame) ──────────────────────────────────── */
.fw-header {
  position: sticky; top: 0; z-index: 1000;
  height: var(--nav-h);
  background: var(--teal);
  display: flex; align-items: center;
  view-transition-name: fw-header;
  transition: box-shadow .25s var(--ease);
}
.fw-header.is-scrolled { box-shadow: 0 1px 0 rgba(238,255,0,.12), 0 8px 24px rgba(14,47,54,.18); }
.fw-header :focus-visible { outline-color: var(--yellow); }

.fw-header-inner {
  width: 100%; max-width: calc(var(--wrap) + 48px);
  margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 36px;
}

.fw-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.fw-logo-mark {
  width: 32px; height: 32px;
  background: var(--yellow); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 15px; color: var(--teal); letter-spacing: -1px;
  flex-shrink: 0;
}
.fw-logo-text { font-size: 17px; font-weight: 700; color: var(--white); letter-spacing: -.3px; }
.fw-logo-text span { color: var(--yellow); }

.fw-nav { display: flex; align-items: center; gap: 6px; flex: 1; }
.fw-nav a {
  position: relative;
  font-size: 14px; font-weight: 500;
  color: rgba(255,255,255,.72);
  padding: 8px 12px; border-radius: 8px;
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.fw-nav a:hover { color: var(--white); background: rgba(255,255,255,.06); }
.fw-nav a.active { color: var(--white); }
.fw-nav a.active::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 2px;
  height: 2px; border-radius: 2px; background: var(--yellow);
}

.fw-header-cta {
  margin-left: auto; flex-shrink: 0;
  display: inline-flex; align-items: center;
  background: var(--yellow); color: var(--teal);
  font-size: 13px; font-weight: 700;
  padding: 9px 16px; border-radius: 8px;
  transition: background .15s, transform .15s var(--ease);
  white-space: nowrap;
}
.fw-header-cta:hover { background: var(--yellow-d); }
.fw-header-cta:active { transform: scale(.97); }

.fw-hamburger {
  display: none; position: relative;
  width: 40px; height: 40px; margin-left: auto;
  background: none; border: none; border-radius: 8px;
}
.fw-hamburger span {
  position: absolute; left: 9px; width: 22px; height: 2px;
  background: var(--white); border-radius: 2px;
  transition: transform .25s var(--ease), opacity .2s;
}
.fw-hamburger span:nth-child(1) { top: 13px; }
.fw-hamburger span:nth-child(2) { top: 19px; }
.fw-hamburger span:nth-child(3) { top: 25px; }
.fw-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.fw-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.fw-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.fw-mobile-nav {
  position: fixed; top: var(--nav-h); left: 0; right: 0; bottom: 0; z-index: 999;
  background: var(--teal);
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 20px 32px; overflow-y: auto;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .22s var(--ease), transform .22s var(--ease), visibility 0s linear .22s;
}
.fw-mobile-nav.open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.fw-mobile-nav a {
  font-size: 18px; font-weight: 600;
  color: rgba(255,255,255,.85);
  padding: 14px 4px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.fw-mobile-nav a.active { color: var(--yellow); }
.fw-mobile-nav .fw-header-cta { margin: 20px 0 0; justify-content: center; padding: 14px; font-size: 15px; border: none; }
.fw-mobile-section-lbl { font-size: 13px; font-weight: 600; color: rgba(238,255,0,.7); padding: 8px 4px 4px; }
.fw-mobile-divider { height: 12px; }

/* ── FOOTER (dark frame) ──────────────────────────────────── */
.fw-footer {
  background: var(--teal);
  color: rgba(255,255,255,.65);
  padding: 56px 0 28px;
  margin-top: 96px;
}
.fw-footer :focus-visible { outline-color: var(--yellow); }
.fw-footer-inner {
  max-width: calc(var(--wrap) + 48px); margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px;
}
.fw-footer-brand .fw-logo { margin-bottom: 14px; }
.fw-footer-brand p { font-size: 14px; line-height: 1.7; max-width: 30ch; color: rgba(255,255,255,.62); }
.fw-footer-col h4 { font-size: 13px; font-weight: 700; color: var(--white); margin-bottom: 12px; }
.fw-footer-col a { display: block; font-size: 14px; color: rgba(255,255,255,.65); padding: 5px 0; transition: color .15s; }
.fw-footer-col a:hover { color: var(--yellow); }
.fw-footer-bottom {
  max-width: calc(var(--wrap) + 48px); margin: 40px auto 0; padding: 20px 24px 0;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.fw-footer-bottom p { font-size: 12.5px; color: rgba(255,255,255,.55); }
.fw-footer-bottom-links { display: flex; gap: 18px; flex-wrap: wrap; }
.fw-footer-bottom a { font-size: 12.5px; color: rgba(255,255,255,.6); transition: color .15s; }
.fw-footer-bottom a:hover { color: var(--white); }

/* ── PAGE HEAD (light) ────────────────────────────────────── */
.fw-hero { background: var(--white); padding: 56px 24px 8px; position: relative; }
.fw-hero-inner { max-width: var(--wrap); margin: 0 auto; position: relative; }
.fw-hero-eyebrow { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.fw-hero h1 {
  font-size: clamp(32px, 4.4vw, 48px);
  font-weight: 800; letter-spacing: -.03em; line-height: 1.06;
  color: var(--ink); margin-bottom: 14px;
  max-width: 22ch; text-wrap: balance;
}
.fw-hero p { font-size: 17px; color: var(--muted); max-width: 58ch; line-height: 1.6; text-wrap: pretty; }

/* ── CONTAINERS ───────────────────────────────────────────── */
.fw-tool-wrap { max-width: calc(var(--wrap) + 48px); margin: 0 auto; padding: 32px 24px 24px; }

/* Legacy section label, now sentence case */
.fw-section-label { font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 16px; }

/* Money marker: the one place yellow appears on light surfaces.
   It draws in like a highlighter pen when it appears. */
@keyframes fw-marker { from { background-size: 0% 100%; } to { background-size: 100% 100%; } }
.fw-money {
  background: linear-gradient(transparent 58%, var(--yellow) 58%, var(--yellow) 92%, transparent 92%) no-repeat left / 100% 100%;
  animation: fw-marker .7s var(--ease) .2s both;
  color: inherit; padding: 0 .06em;
  white-space: nowrap;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  font-variant-numeric: tabular-nums;
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.fw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 700;
  padding: 13px 22px; border-radius: 10px; border: 1px solid transparent;
  transition: background .15s, border-color .15s, transform .15s var(--ease), box-shadow .15s;
  cursor: pointer; font-family: var(--font);
}
.fw-btn:active { transform: scale(.98); }
.fw-btn svg { transition: transform .2s var(--ease); }
.fw-btn:hover svg { transform: translateX(2px); }
.fw-btn-primary { background: var(--teal); color: var(--white); }
.fw-btn-primary:hover { background: var(--teal-l); box-shadow: 0 6px 18px rgba(14,47,54,.2); }
.fw-btn-secondary { background: var(--white); color: var(--teal); border-color: var(--line-s); }
.fw-btn-secondary:hover { border-color: var(--teal); }
.fw-btn-ghost { background: transparent; color: var(--teal); }
.fw-btn-ghost:hover { background: var(--off); }
.fw-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── LEGACY COMPONENTS (kept for older pages) ─────────────── */
.fw-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.fw-card:hover { border-color: var(--line-s); box-shadow: var(--shadow); }
.fw-badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; }
.fw-badge-yellow { background: var(--yellow); color: var(--teal); }
.fw-badge-teal { background: var(--grey-l); color: var(--teal); }
.fw-stats-bar { background: var(--off); border-bottom: 1px solid var(--line); padding: 10px 0; }
.fw-stats-bar-inner { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; display: flex; gap: 32px; overflow-x: auto; scrollbar-width: none; }
.fw-stat { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.fw-stat-num { font-size: 14px; font-weight: 700; }
.fw-stat-lbl { font-size: 13px; color: var(--muted); }
.fw-stat-dot { display: none; }

/* Reveal on scroll (driven by fw-shell.js). Only hides content when scripts run. */
.fw-js [data-reveal] {
  opacity: 0; transform: translateY(22px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.fw-js [data-reveal].is-in { opacity: 1; transform: none; }
.fw-js [data-reveal]:not(.is-in) .fw-money { animation-play-state: paused; }
@media print { .fw-js [data-reveal] { opacity: 1; transform: none; } }

@keyframes fw-fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.fw-fade-up { animation: fw-fade-up .4s var(--ease) both; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 860px) {
  .fw-nav, .fw-header .fw-header-cta { display: none; }
  .fw-hamburger { display: block; }
  .fw-footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; }
  .fw-footer-brand { grid-column: 1 / -1; }
  .fw-hero { padding: 36px 20px 4px; }
  .fw-tool-wrap { padding: 24px 20px 16px; }
}
@media (min-width: 861px) { .fw-mobile-nav { display: none; } }
@media (max-width: 480px) {
  .fw-footer-inner { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
