/*
 * LightKey — Shared Stylesheet
 * Loaded by every page on this site.
 * New pages: just link this file and call components.js — everything below is automatic.
 */

/* ═══════════════════════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════════════════════ */
:root {
  /* ── Core Warm Palette ── */
  --stone: #8B7355;
  --stone-dark: #5C4D3A;
  --copper: #9A5530;
  --copper-hover: #7D4528;
  --copper-bg: rgba(154,85,48,0.08);

  /* ── Cool Accent (GlassCase bridge) ── */
  --teal: #3D7A8A;
  --teal-light: rgba(61,122,138,0.1);
  --teal-border: rgba(61,122,138,0.25);

  /* ── Strand Colours ── */
  --strand-right: #3D7A8A;
  --strand-right-bg: rgba(61,122,138,0.08);
  --strand-timeline: #9A5530;
  --strand-timeline-bg: rgba(154,85,48,0.08);
  --strand-decision: #8B7355;
  --strand-decision-bg: rgba(139,115,85,0.08);

  /* ── Surfaces ── */
  --bg: #F5F0E8;
  --surface: #EBE3D5;
  --surface-raised: #FFFFFF;

  /* ── Text ── */
  --text: #2A2118;
  --text-soft: #5A4E40;
  --text-muted: #8A7E70;

  /* ── Structure ── */
  --border: #D4C8B8;
  --done: #6A8A5A;

  /* ── Reading ── */
  --lh-body: 1.85;
  --ls-body: 0.01em;
  --ws-body: 0.03em;
  --fs-body: 17px;
}

body.reading-relaxed {
  --lh-body: 2.4;
  --ls-body: 0.12em;
  --ws-body: 0.16em;
  --fs-body: 18px;
}

/* ═══════════════════════════════════════════════════════
   RESET + BASE
   ═══════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: 'Lexend Deca', Verdana, Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  word-spacing: var(--ws-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: font-size 0.3s ease, line-height 0.3s ease, letter-spacing 0.3s ease, word-spacing 0.3s ease;
}

a {
  color: var(--teal);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--stone-dark); }

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ═══════════════════════════════════════════════════════
   SHARED NAV (injected by components.js)
   ═══════════════════════════════════════════════════════ */
.lk-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245,240,232,0.97);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(90,78,64,0.07);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  /* Hard-reset: prevent body relaxed-reading vars from leaking into nav */
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: normal;
  word-spacing: normal;
}

.lk-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
}

/* Brand */
.lk-brand-wrap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}
.lk-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.lk-brand svg { width: 28px; height: 28px; flex-shrink: 0; }
.lk-brand-name {
  font-family: 'Literata', Georgia, serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--stone-dark);
  line-height: 1.1;
  word-spacing: normal;
  letter-spacing: normal;
}

/* Future nav items — non-clickable, muted */
.lk-nav-future {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: default;
  opacity: 0.6;
}

.lk-nav-badge {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
  background: var(--teal-light);
  border: 1px solid var(--teal-border);
  border-radius: 4px;
  padding: 1px 5px;
  line-height: 1.6;
}

.lk-mobile-future {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.55;
  cursor: default;
}

/* Desktop nav links */
.lk-nav-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.lk-desktop-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.lk-desktop-nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}
.lk-desktop-nav a:hover { color: var(--copper); }

/* Accessibility toggle */
.lk-a11y-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Lexend Deca', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.lk-a11y-toggle:hover { border-color: var(--teal); color: var(--teal); }
.lk-a11y-toggle:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.lk-a11y-toggle[aria-pressed="true"] {
  background: var(--teal-light);
  border-color: var(--teal);
  color: var(--teal);
}

/* Mobile hamburger */
.lk-mobile-btn {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 101;
}
.lk-mobile-btn span {
  width: 24px;
  height: 2px;
  background: var(--text-soft);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
  display: block;
}
.lk-mobile-btn[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.lk-mobile-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.lk-mobile-btn[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg) translate(7px, -6px); }

/* Mobile menu */
.lk-mobile-menu {
  position: fixed;
  top: 0;
  left: -300px;
  width: 280px;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 24px rgba(90,78,64,0.15);
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 200;
  padding: 80px 28px 32px;
  overflow-y: auto;
}
.lk-mobile-menu.active { left: 0; }
.lk-mobile-menu-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.lk-mobile-menu-title {
  font-family: 'Literata', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--stone-dark);
  margin-bottom: 0.25rem;
}
.lk-mobile-menu nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.lk-mobile-menu nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
  border: 1px solid transparent;
}
.lk-mobile-menu nav a:hover {
  background: var(--bg);
  color: var(--copper);
  border-color: var(--border);
}
.lk-mobile-menu nav a.active { color: var(--copper); }
.lk-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(42,33,24,0.4);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 199;
}
.lk-mobile-overlay.active { opacity: 1; visibility: visible; }

@media (max-width: 640px) {
  .lk-mobile-btn { display: flex; }
  .lk-desktop-nav { display: none; }
  .lk-a11y-toggle span:not(.toggle-icon) { display: none; }
  .lk-nav-inner { padding: 0 1.25rem; }
}
@media (min-width: 641px) {
  .lk-mobile-btn { display: none; }
  .lk-mobile-menu, .lk-mobile-overlay { display: none !important; }
}

/* ═══════════════════════════════════════════════════════
   SHARED FOOTER (injected by components.js)
   ═══════════════════════════════════════════════════════ */
.lk-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 1.5rem;
  color: var(--text-muted);
  font-size: 13px;
}

.lk-footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: center;
}

.lk-footer-copyright {
  color: var(--stone-dark);
  font-weight: 500;
  font-size: 0.8125rem;
}
.lk-footer-copyright a { color: var(--teal); text-decoration: none; }
.lk-footer-copyright a:hover { color: var(--stone-dark); }

.lk-footer-disclaimer {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.6;
  opacity: 0.85;
}

/* ═══════════════════════════════════════════════════════
   LAYOUT UTILITIES
   ═══════════════════════════════════════════════════════ */
.lk-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
}

.lk-section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}
.lk-section:last-of-type { border-bottom: none; }

.lk-section-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--copper);
  margin-bottom: 10px;
  font-weight: 500;
}

.lk-section h2 {
  font-family: 'Literata', Georgia, serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 12px;
}

.lk-lead {
  font-size: 17px;
  color: var(--text-soft);
  max-width: 540px;
  margin-bottom: 40px;
  line-height: 1.8;
}
