/* Shared foundation for every page: brand tokens, typography, nav,
 buttons, and footer. Page-specific styles stay with their page. */

:root {
  /* ---------- BRAND PALETTE ---------- */
  --deep-earth: #3F463D;   /* primary: headings, nav, footer, buttons */
  --pastel-sky: #A9C6D3;   /* signature accent: fills, soft buttons */
  --cream:      #F7F3EC;   /* main background */
  --terracotta: #C9856B;   /* warm accent, high-emphasis moments */
  --sage:       #A6AF96;   /* supporting accent, tags */
  --sandstone:  #DFD1BE;   /* cards, alternate backgrounds */
  --dusty-blue: #7899A8;   /* stronger blue accent */
  --soft-white: #FCFAF7;   /* elevated cards */
  --warm-gray:  #CAC4BA;   /* borders, muted UI */
  --charcoal:   #292C29;   /* body text */

  /* Text-weight cousins. The pastel accents can't carry glyphs on cream
     (Pastel Sky 1.6:1, Terracotta 2.7:1), so anything that has to be READ
     uses these; anything that's a FILL uses the pure brand color above. */
  --sky-ink:        #4A6B7A;  /* 5.2:1 on cream — links, small accent text */
  --terracotta-ink: #B26A4E;  /* 3.8:1 on cream — large emphasis only */
  --earth-deep:     #2F352E;  /* floor of the dark-section gradient */

  /* ---------- SEMANTIC ---------- */
  --bg: var(--cream);
  --bg-alt: #EFE8DC;              /* cream pulled toward sandstone */
  --surface: var(--soft-white);
  --ink: var(--deep-earth);
  --ink-body: var(--charcoal);
  --ink-secondary: #676E64;       /* 4.8:1 on cream */
  --hairline: var(--warm-gray);
  --on-dark: var(--cream);
  --on-dark-muted: rgba(247, 243, 236, 0.72);

  --serif: 'Source Serif 4', ui-serif, Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;

  --radius-card: 20px;
  --radius-btn: 10px;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-swift: cubic-bezier(0.32, 0.72, 0, 1);
  --nav-h: 56px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink-body);
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, blockquote {
  font-family: var(--serif);
  color: var(--ink);
  font-variant-ligatures: common-ligatures;
}

::selection { background: rgba(169, 198, 211, 0.5); }

a { color: var(--sky-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
a, button { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 2px solid var(--sky-ink);
  outline-offset: 3px;
  border-radius: 4px;
}
.btn:focus-visible { outline-offset: 4px; border-radius: calc(var(--radius-btn) + 2px); }
.quote a:focus-visible, .card--dark a:focus-visible { outline-color: var(--pastel-sky); }

.skip-link {
  position: absolute;
  top: 10px; left: 50%;
  transform: translate(-50%, -250%);
  z-index: 200;
  background: var(--deep-earth);
  color: var(--cream);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-btn);
  box-shadow: 0 2px 12px rgba(41, 44, 41, 0.25);
  transition: transform 0.3s var(--ease);
}
.skip-link:focus-visible { transform: translate(-50%, 0); }

.container {
  max-width: 1024px;
  margin: 0 auto;
  padding-left: max(22px, env(safe-area-inset-left));
  padding-right: max(22px, env(safe-area-inset-right));
}
.container--narrow { max-width: 760px; }

/* ---------- NAV ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: calc(var(--nav-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  background: rgba(247, 243, 236, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.nav.scrolled {
  background: rgba(247, 243, 236, 0.88);
  border-bottom-color: var(--hairline);
}
.nav-inner {
  max-width: 1024px;
  margin: 0 auto;
  height: var(--nav-h);
  padding-left: max(22px, env(safe-area-inset-left));
  padding-right: max(22px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-name {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--deep-earth);
}
.nav-name:hover { text-decoration: none; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-secondary);
  letter-spacing: -0.002em;
  transition: color 0.2s, opacity 0.2s;
  display: inline-flex;
  align-items: center;
  min-height: var(--nav-h);
  padding: 0 4px;
  margin: 0 -4px;
}
.nav-links a:hover { color: var(--deep-earth); text-decoration: none; }
.nav-links a:active { opacity: 0.6; }

/* ---------- BUTTONS ---------- */
/* Primary is Deep Earth on cream text — the pastel is too light to carry
   white or cream type, so it stays a surface, never a button fill with
   light text on it. */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--deep-earth);
  color: var(--cream);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.004em;
  padding: 12px 24px;
  border-radius: var(--radius-btn);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn:hover { background: var(--earth-deep); text-decoration: none; }
.btn:active { transform: scale(0.97); transition-duration: 0.1s; }

/* Outlined secondary: quiet border, Deep Earth type. */
.btn--outline {
  background: transparent;
  color: var(--deep-earth);
  border: 1.5px solid var(--dusty-blue);
  padding: 10.5px 22.5px;
}
.btn--outline:hover { background: rgba(169, 198, 211, 0.28); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  font-weight: 500;
  color: var(--sky-ink);
  padding: 12px 0;
  margin: -12px 0;
}
.link-arrow:active { opacity: 0.5; }
.link-arrow::after {
  content: '›';
  font-size: 17px;
  line-height: 1;
  transition: transform 0.2s var(--ease);
}
.link-arrow:hover { text-decoration: none; }
.link-arrow:hover::after { transform: translateX(2px); }

/* ---------- REVEAL ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  will-change: opacity, transform;
  transition: opacity 0.6s var(--ease), transform 0.9s var(--ease-swift);
}
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; will-change: auto; }
  .hero-stagger > * { animation: none !important; opacity: 1 !important; }
}


/* ---------- FOOTER ---------- */
/* Deep Earth footer grounds the page — the "20%" anchor from the guide. */
footer {
  background: var(--deep-earth);
  color: var(--on-dark-muted);
  padding: 30px 0 calc(30px + env(safe-area-inset-bottom));
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  letter-spacing: 0;
  color: var(--on-dark-muted);
}
.footer-inner a {
  color: var(--on-dark-muted);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  padding: 12px 4px;
  margin: -12px -4px;
}
.footer-inner a:hover { color: var(--on-dark); text-decoration: none; }
.footer-inner a:focus-visible { outline-color: var(--pastel-sky); }
.footer-links { display: flex; gap: 22px; }


/* ---------- NAV: HAMBURGER (mobile) ---------- */
/* Desktop keeps inline links. Below 735px they collapse into a dropdown
   panel under the nav bar, opened by the hamburger button. */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--deep-earth);
  transition: transform 0.25s var(--ease-swift), opacity 0.2s var(--ease);
}
/* Hamburger -> X */
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 734px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--hairline);
    box-shadow: 0 14px 28px rgba(41, 44, 41, 0.08);
    padding: 6px 0 10px;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    font-size: 16px;
    min-height: 48px;
    padding: 0 max(22px, env(safe-area-inset-left));
    margin: 0;
  }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 734px) {
  .footer-inner { flex-direction: column; }
}
