/* =============================================================================
   Numbered — shared site chrome (header + footer + design tokens)
   Linked by every page so the nav and footer are identical site-wide.
   Load this AFTER a page's own <style> so its nav/footer rules win over any
   older inline styles. Page-specific content styling stays in each page.
   ============================================================================= */

:root {
  /* brand emerald — mirrors moroni/src/lib/theme/palette */
  --b50: #ecfdf5; --b100: #d1fae5; --b200: #a7f3d0; --b300: #6ee7b7;
  --b400: #34d399; --b500: #10b981; --b600: #059669; --b700: #047857;
  --b800: #065f46; --b900: #064e3b;
  --n50: #fafafa; --n100: #f5f5f5; --n200: #e5e5e5; --n300: #d4d4d4;
  --n400: #a3a3a3; --n500: #737373; --n600: #525252; --n700: #404040;
  --n800: #262626; --n900: #171717;

  /* semantic — light */
  --bg: #ffffff;
  --bg-alt: #f7f9f8;
  --surface: #ffffff;
  --fg: #15201b;
  --fg-muted: #5b6660;
  --fg-subtle: #8a938d;
  --border: #ececec;
  --border-strong: #e0e3e1;
  --brand: var(--b500);
  --brand-ink: var(--b700);
  --brand-deep: var(--b800);
  --halo: rgba(16, 185, 129, 0.16);

  --maxw: 70rem;
  --display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0e0d;
    --bg-alt: #111413;
    --surface: #171a19;
    --fg: #e9efec;
    --fg-muted: #9aa6a0;
    --fg-subtle: #6f7b75;
    --border: #232826;
    --border-strong: #2c322f;
    --brand: var(--b400);
    --brand-ink: var(--b300);
    --brand-deep: var(--b200);
    --halo: rgba(16, 185, 129, 0.22);
  }
}

/* ===== NAV ===== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4.25rem;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  box-shadow: none;
}
.nav-inner {
  width: 100%;
  max-width: var(--maxw);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.nav-logo .mark {
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 0.55rem;
  background: linear-gradient(150deg, var(--b400), var(--b600));
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 4px 12px -2px var(--halo);
}
.nav-logo .word { color: var(--brand-ink); }
.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-links a:hover,
.nav-links a[aria-current] { color: var(--fg); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.05rem;
  border-radius: 0.65rem;
  background: var(--fg);
  color: var(--bg) !important;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.4);
}
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fg);
  height: 2.75rem;
  width: 2.75rem;
  align-items: center;
  justify-content: center;
  margin-right: -0.6rem;
}
.nav-hamburger svg { width: 1.5rem; height: 1.5rem; }
.nav-drawer {
  display: none;
  position: fixed;
  top: 4.25rem;
  left: 0;
  right: 0;
  z-index: 99;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0.75rem 2rem 1.5rem;
  background: color-mix(in srgb, var(--bg) 97%, transparent);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 18px 30px -20px rgba(0, 0, 0, 0.3);
}
.nav-drawer.open { display: flex; }
.nav-drawer a {
  padding: 0.9rem 0;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.nav-drawer li:last-child a { border-bottom: none; }

/* ===== FOOTER ===== */
footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 3.5rem 0 2.5rem;
}
.foot-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  text-align: center;
}
.foot-logo {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-ink);
}
.foot-tag {
  font-family: var(--display);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--fg-subtle);
}
.foot-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0;
  padding: 0;
}
.foot-links a {
  font-size: 0.85rem;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.foot-links a:hover { color: var(--fg); }
.foot-fine {
  font-size: 0.78rem;
  color: var(--fg-subtle);
  max-width: 34rem;
  line-height: 1.5;
}
.foot-copy { font-size: 0.78rem; color: var(--fg-subtle); }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .nav-inner { padding: 0 1.25rem; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .foot-grid { padding: 0 1.25rem; }
}
