/* ============================================================
   NestScore — global stylesheet
   Loaded on every page. Contains design tokens, base typography,
   and chrome (nav + footer + fade-up animation) shared between
   index.html and how-it-works.html. The map page has no <nav>
   or <footer>, so those rules have no effect there.
   ============================================================ */

/* ── Tokens ── */
:root {
  --moss:          #1F4D3F;
  --moss-700:      #0E3328;
  --moss-300:      #5A8A7B;
  --moss-100:      #C9D9CF;
  --moss-050:      #DDE6DF;
  --paper:         #E8DFC9;
  --paper-dim:     #DDD2B5;
  --paper-lift:    #F0E8D2;
  --ink:           #0B1311;
  --ink-700:       #1E2A26;
  --ink-500:       #4E5953;
  --ink-300:       #888F8A;
  --border:        #C9BE9F;
  --border-strong: #B0A485;
  --brick:         #B14B30;
  --brick-100:     #E8C7B6;
  --score-90:      #1F4D3F;
  --score-80:      #4F8A6E;
  --score-70:      #B5A24B;
  --score-60:      #C8593B;
  --score-00:      #8C4231;
  --font-sans:     "Geist", ui-sans-serif, sans-serif;
  --font-mono:     "Geist Mono", ui-monospace, monospace;
  --font-serif:    "Instrument Serif", ui-serif, Georgia, serif;
  --shadow-1:      0 1px 2px rgba(11,19,17,.06), 0 2px 6px rgba(11,19,17,.07);
  --shadow-2:      0 2px 4px rgba(11,19,17,.08), 0 8px 20px rgba(11,19,17,.12);
  --shadow-3:      0 8px 16px rgba(11,19,17,.12), 0 24px 48px rgba(11,19,17,.20);
  --ease:          cubic-bezier(.2,.8,.2,1);
  --dur-base:      220ms;
  --list-w:        340px;
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--moss); color: var(--paper); }

/* ── Utilities ── */
.mono  { font-family: var(--font-mono); }
.serif { font-family: var(--font-serif); font-style: italic; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* ── Section heads (used by index + how-it-works; pages can override max-width) ── */
.section-eyebrow {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--moss);
  margin-bottom: 16px;
}
.section-headline {
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 600; letter-spacing: -0.025em; line-height: 1.1;
  color: var(--ink); margin-bottom: 20px;
}
.section-sub {
  font-size: 17px; line-height: 1.7; color: var(--ink-500);
}

/* ── Nav ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 60px;
  background: rgba(232,223,201,0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
}
.nav-inner {
  max-width: 1160px; margin: 0 auto; padding: 0 24px;
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-wordmark { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.nav-wordmark em { font-style: normal; color: var(--moss); }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--ink-500); text-decoration: none; transition: color 150ms var(--ease); }
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--moss); }
a.btn-nav {
  height: 36px; padding: 0 18px;
  background: var(--moss); color: var(--paper);
  border: none; border-radius: 8px;
  font-family: var(--font-sans); font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center;
  transition: background 150ms var(--ease);
}
.btn-nav:hover { background: var(--moss-700); }
.btn-nav.btn-nav-outline {
  background: transparent;
  color: var(--moss);
  border: 1.5px solid var(--moss);
}
.btn-nav.btn-nav-outline:hover {
  background: var(--moss);
  color: var(--paper);
}

/* ── Mobile nav (hamburger + drawer) ── */
.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--border-strong);
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 4px;
  transition: background 150ms var(--ease);
}
.nav-toggle:hover { background: var(--paper-lift); }
.nav-toggle span {
  display: block; width: 18px; height: 2px;
  background: var(--ink-700); border-radius: 2px;
  transition: transform 220ms var(--ease), opacity 180ms var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-drawer {
  position: fixed; top: 60px; right: 0; bottom: 0;
  width: min(320px, 88vw);
  background: var(--paper-lift);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-3);
  transform: translateX(100%);
  transition: transform 280ms var(--ease);
  z-index: 99;
  display: flex; flex-direction: column;
  padding: 20px 22px 24px;
  overflow-y: auto;
}
.nav-drawer.open { transform: translateX(0); }
.nav-drawer a {
  display: block; padding: 14px 4px;
  font-size: 16px; font-weight: 500;
  color: var(--ink-700); text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: color 150ms var(--ease);
}
.nav-drawer a:hover { color: var(--moss); }
.nav-drawer a.active { color: var(--moss); }
.nav-drawer a.btn-nav,
.nav-drawer a.btn-nav-outline {
  display: flex; align-items: center; justify-content: center;
  box-sizing: border-box;
  height: 50px; padding: 0 20px;
  border-bottom: none;
  flex-shrink: 0;
  width: 100%;
}
.nav-drawer a.btn-nav-outline {
  margin-top: 28px;
  /* Use an inset box-shadow instead of a border to draw the outline.
     iOS Safari can subpixel-clip the bottom edge of bordered elements,
     especially anchor tags. Box-shadow renders crisply on all four sides. */
  border: none;
  box-shadow: inset 0 0 0 2px var(--moss);
}
.nav-drawer a.btn-nav { margin-top: 24px; margin-bottom: 16px; }
.nav-drawer a.btn-nav { color: var(--paper); }
.nav-drawer a.btn-nav-outline { color: var(--moss); }

.nav-backdrop {
  position: fixed; inset: 0;
  background: rgba(11,19,17,.40);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity 220ms var(--ease);
  z-index: 98;
}
.nav-backdrop.open { opacity: 1; pointer-events: auto; }

body.nav-open { overflow: hidden; }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links { display: none; }
}

/* ── Footer ── */
footer {
  background: var(--ink);
  color: rgba(240,232,210,0.7);
  padding: 56px 24px 40px;
}
.footer-inner { max-width: 1160px; margin: 0 auto; }
.footer-top {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 48px;
  padding-bottom: 48px; border-bottom: 1px solid rgba(240,232,210,0.1);
  margin-bottom: 32px;
}
.footer-brand-wordmark { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; color: var(--paper); margin-bottom: 12px; }
.footer-brand-wordmark em { font-style: normal; color: var(--moss-300); }
.footer-tagline { font-size: 14px; line-height: 1.6; color: rgba(240,232,210,0.55); max-width: 240px; }
.footer-col-title { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(240,232,210,0.4); margin-bottom: 16px; font-family: var(--font-mono); }
.footer-col a { display: block; font-size: 14px; color: rgba(240,232,210,0.65); text-decoration: none; margin-bottom: 10px; transition: color 150ms; }
.footer-col a:hover { color: var(--paper); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-copy { font-size: 13px; color: rgba(240,232,210,0.35); font-family: var(--font-mono); }
.footer-maple { font-size: 13px; color: rgba(240,232,210,0.45); display: flex; align-items: center; gap: 6px; }

/* ── Fade-up animation (driven by assets/shared.js) ── */
.fade-up {
  opacity: 0; transform: translateY(24px);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ── Footer responsive (used wherever the footer renders) ── */
@media (max-width: 900px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 600px) {
  .footer-top { grid-template-columns: 1fr; }
}
