/*
 * SyncEngine — core.css
 * Shared design system, aligned to the Synchronicity Engine app (see DESIGN.md):
 * cool zinc-void canvas, Inter for prose, JetBrains Mono for labels, an
 * indigo→purple→pink signature gradient as the single accent.
 *
 * Pages must include the Google Fonts link themselves:
 *
 *   <link rel="preconnect" href="https://fonts.googleapis.com">
 *   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
 *   <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@300;400;500&display=swap" rel="stylesheet">
 *
 * DO NOT include page-specific styles here (hero, atmosphere, progress bar,
 * nav-dots, profile card, token ceremony, shield visual, topology, heartbeat,
 * threat grid, timer, encounter code, bot compare, comparison table,
 * metabolism cards). Those live as inline styles on each page.
 *
 * NOTE: legacy token names (--moss*, --bg*, --s1..--s7) are retained as ALIASES
 * pointing at the new DESIGN.md palette so existing var() call sites keep working.
 * --moss* now resolves to the indigo primary accent — the green identity is retired.
 */

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

/* ═══ Design tokens ═══ */
:root {
  /* ── Surfaces (cool zinc-void; depth via layering, not shadow) ── */
  --void:   #09090b;   /* Deep Void — primary page background */
  --panel:  #111114;   /* Dark Surface — panels, sidebars, chrome */
  --card:   #151518;   /* Card Surface — card interiors, modals */
  --hover:  #1c1c20;   /* Hover Surface — interactive hover/active */
  /* legacy aliases */
  --bg:  var(--void);
  --bg2: var(--panel);
  --bg3: var(--card);
  --surface: var(--hover);

  /* ── Text (cool zinc scale — no warm grays) ── */
  --tx: #fafafa;   /* Pure Light — headings, high-emphasis */
  --t2: #a0a0ab;   /* Soft Gray — body / supporting prose */
  --t3: #52525b;   /* Muted Zinc — metadata, secondary labels */
  --dim: #3f3f46;  /* Ghost Zinc — faintest readable / chrome */

  /* ── Borders ── */
  --bd:  #27272a;  /* Border Primary — containers */
  --bd2: #1c1c20;  /* Border Subtle — internal row separators */

  /* ── Signature accent: indigo → purple → pink ── */
  --indigo: #818cf8;  --indigo-light: #a5b4fc;  --indigo-dim: #6366f1;
  --purple: #c084fc;
  --pink:   #f472b6;
  --gradient: linear-gradient(135deg, #818cf8, #c084fc, #f472b6);
  /* legacy violet/rose aliases → purple/pink */
  --violet: #c084fc;  --violet-light: #d8b4fe;
  --rose:   #f472b6;  --rose-light:   #f9a8d4;
  /* legacy moss/glow aliases → indigo primary + stage hues (green retired) */
  --moss: #818cf8;  --moss-light: #a5b4fc;  --moss-dim: #6366f1;
  --glow-green: #34d399;  /* Emerald / Service */
  --glow-amber: #fbbf24;  /* Amber / Attention */
  --glow-teal:  #6bcfff;  /* cool cyan (also Peace member) */

  /* ── Semantic ── */
  --pulse: #34d399;  --pulse-light: #6ee7b7;  /* Success / Service */
  --danger: #f87171;                          /* Error */

  /* ── Gift-cycle stage colors (drawn from the app palette only) ── */
  --s1: #818cf8;  /* indigo  */
  --s2: #6bcfff;  /* cyan    */
  --s3: #fbbf24;  /* amber   */
  --s4: #34d399;  /* emerald */
  --s5: #c084fc;  /* purple  */
  --s6: #f472b6;  /* pink    */
  --s7: #818cf8;  /* indigo — closes the loop */

  /* ── Member identity colors ── */
  --love:  #ff6b9d;  --joy:   #ffd93d;  --peace: #6bcfff;
  --grace: #b19cd9;  --hope:  #98d8aa;  --faith: #ffb347;

  /* ── Typography (Inter for all prose; JetBrains Mono for labels/code) ── */
  --display: 'Inter', -apple-system, system-ui, sans-serif;
  --body:    'Inter', -apple-system, system-ui, sans-serif;
  --mono:    'JetBrains Mono', monospace;

  /* ── Radius scale ── */
  --r-sharp:  4px;   /* inline code, kbd */
  --r-sm:     8px;   /* inputs, buttons */
  --radius:  12px;   /* Card — primary structural radius */
  --r-special: 14px; /* token / celebratory cards */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ═══ Base ═══ */
html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  background: var(--void);
  color: var(--tx);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* Account for fixed site-nav */
  padding-top: 56px;
}

/* ═══ Dot-grid texture — page-level only (DESIGN.md §6) ═══ */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background-image: radial-gradient(circle, rgba(129,140,248,0.05) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ═══ Typography ═══ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--display);
}

/* ═══ Layout ═══ */
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 32px; }
.wrap-narrow { max-width: 780px; margin: 0 auto; padding: 0 24px; }
.page { position: relative; z-index: 10; }

/* ═══ Reveal animation system ═══ */
.r {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.r.v  { opacity: 1; transform: translateY(0); }
.r-d1 { transition-delay: 0.10s; }
.r-d2 { transition-delay: 0.22s; }
.r-d3 { transition-delay: 0.34s; }

/* ═══ Section base ═══ */
.sect {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 100px 0;
}
.sect-short { min-height: auto; padding: 80px 0; }

/* ═══ Stage labels ═══ */
.stage-num {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.stage-h {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(30px, 5vw, 56px);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 24px;
}
.stage-p {
  font-size: 17px;
  color: var(--t2);
  line-height: 1.9;
  font-weight: 300;
  margin-bottom: 40px;
}
.stage-p strong { color: var(--tx); font-weight: 500; }

/* ═══ Button system ═══ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 30px;
  border: none;
  border-radius: 12px;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}
.btn:hover { transform: translateY(-2px); }

/* Primary — indigo fill, dark text (DESIGN.md primary button) */
.btn-moss   { background: var(--indigo); color: var(--void); }
.btn-amber  { background: var(--glow-amber); color: var(--void); }
.btn-green  { background: var(--s4); color: var(--void); }
.btn-indigo {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 0 20px rgba(129,140,248,0.2);
}
.btn-rose {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff;
  box-shadow: 0 0 20px rgba(244,114,182,0.2);
}
/* Glow — the signature gradient, single highest-priority action */
.btn-final {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 0 20px rgba(129,140,248,0.2);
}

/* ═══ Card / panel base ═══ */
.panel {
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  padding: 32px;
  position: relative;
  overflow: hidden;
}
.panel-accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}

/* ═══ Sidebar note / aside ═══ */
.note {
  padding: 24px;
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: var(--radius);
}
.note-head {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 10px;
}
.note p { font-size: 15px; color: var(--t2); line-height: 1.85; }
.note p strong { color: var(--tx); font-weight: 500; }

.tech-aside {
  padding: 16px 20px;
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-left: 3px solid;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--t3);
  line-height: 1.8;
}
.tech-aside code {
  font-weight: 500;
  background: rgba(129,140,248,0.08);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ═══ Stacked layout (text + visual pairs) ═══ */
.two {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ═══ Feature layout (stacked) ═══ */
.feature-section {
  display: flex;
  flex-direction: column;
  gap: 36px;
}
.feature-section.reverse { /* no-op in stacked mode */ }

.feature-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.feature-h {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 18px;
}
.feature-p {
  font-size: 15px;
  color: var(--t2);
  line-height: 1.85;
  margin-bottom: 14px;
}
.feature-p strong { color: var(--tx); font-weight: 500; }

/* ═══ Form elements ═══ */
.fg { margin-bottom: 22px; }

.fl {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 8px;
}

.fi, .ft, .fs {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: 12px;
  color: var(--tx);
  font-family: var(--body);
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.fi:focus, .ft:focus, .fs:focus {
  border-color: var(--moss);
  box-shadow: 0 0 0 3px rgba(129,140,248,0.15);
}
.fi::placeholder, .ft::placeholder { color: var(--dim); }

.ft { min-height: 110px; resize: vertical; line-height: 1.65; }

.fs {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236e6e80' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
.fs option { background: var(--bg); color: var(--tx); }

/* ═══ Chips ═══ */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  padding: 8px 18px;
  border: 1px solid var(--bd);
  border-radius: 100px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 500;
  color: var(--t3);
  cursor: pointer;
  transition: all 0.25s;
  user-select: none;
}
.chip:hover { border-color: var(--bd2); color: var(--t2); }
.chip.on {
  border-color: var(--indigo);
  color: var(--indigo-light);
  background: rgba(129,140,248,0.08);
}

/* ═══ Expandable panels ═══ */
.hood {
  margin-top: 16px;
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  overflow: hidden;
}
.hood summary {
  padding: 14px 20px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--t3);
  cursor: pointer;
  list-style: none;
  transition: color 0.3s, background 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hood summary::before { content: '▸'; transition: transform 0.3s; display: inline-block; }
.hood[open] summary::before { transform: rotate(90deg); }
.hood summary:hover { color: var(--t2); background: var(--bg2); }

.hood-body {
  padding: 20px;
  background: var(--bg2);
  border-top: 1px solid var(--bd);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--t2);
  line-height: 1.7;
}

/* ═══ Site Nav ═══ */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 999; padding: 0 24px;
  background: rgba(9,9,11,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bd);
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
}
/* App-exact wordmark — values lifted verbatim from the app's .brand-wordmark.
   App topbar renders at 11px; scaled up here for the site nav, keeping
   letter-spacing in em so it stays proportional. */
.site-nav-logo {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: none;   /* keep natural "Synchronicity Engine" casing */
  white-space: nowrap;
  text-decoration: none;
  background: linear-gradient(135deg, #818cf8 0%, #c084fc 50%, #f472b6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;     /* non-WebKit fallback for the clip */
}
.se-wordmark__short { display: none; }

/* Responsive swap — identical breakpoint + behavior to the app. */
@media (max-width: 720px) {
  .se-wordmark__full  { display: none; }
  .se-wordmark__short { display: inline; }
}
.site-nav-links {
  display: flex; gap: 28px; align-items: center;
}
.site-nav-links a {
  font-family: var(--display); font-size: 13px; font-weight: 500;
  color: var(--t3); text-decoration: none;
  transition: color 0.2s;
}
.site-nav-links a:hover, .site-nav-links a.active { color: var(--tx); }

/* Hamburger toggle — hidden by default */
.site-nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--t3);
  font-size: 20px;
  padding: 4px 8px;
  transition: color 0.2s;
}
.site-nav-toggle:hover { color: var(--tx); }

/* ═══ Site Footer ═══ */
.site-footer {
  border-top: 1px solid var(--bd);
  padding: 48px 24px;
  text-align: center;
}
.site-footer-links {
  display: flex; justify-content: center; gap: 24px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.site-footer-links a {
  font-family: var(--display); font-size: 13px;
  color: var(--t3); text-decoration: none; transition: color 0.2s;
}
.site-footer-links a:hover { color: var(--tx); }
.site-footer-copy {
  font-family: var(--mono); font-size: 11px;
  color: var(--dim); letter-spacing: 0.04em;
}

/* ═══ Accessibility ═══ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

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

/* ═══ Responsive — 768px ═══ */
@media (max-width: 768px) {
  .sect { padding: 64px 0; }
  .sect-short { padding: 48px 0; }

  /* Mobile nav */
  .site-nav-links { display: none; }
  .site-nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: 56px; left: 0; right: 0;
    background: rgba(9,9,11,0.95); backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 16px 24px; gap: 16px;
    border-bottom: 1px solid var(--bd);
  }
  .site-nav-toggle { display: block; }
}

/* ═══ Reduced motion ═══ */
@media (prefers-reduced-motion: reduce) {
  .r {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .r-d1, .r-d2, .r-d3 { transition-delay: 0s; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
