/*
 * SyncEngine — core.css
 * Shared design system. Pages must include the Google Fonts link themselves:
 *
 *   <link rel="preconnect" href="https://fonts.googleapis.com">
 *   <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,500;0,8..60,600;1,8..60,300;1,8..60,400&family=IBM+Plex+Mono:wght@300;400;500&display=swap" rel="stylesheet">
 *
 * DO NOT include page-specific styles here (hero, atmosphere/orbs, 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.
 */

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

/* ═══ Design tokens ═══ */
:root {
  /* Surface / background */
  --bg:  #080a08;
  --bg2: #0f120f;
  --bg3: #141918;
  --card: #131813;
  --surface: #1a1f1a;

  /* Text */
  --tx: #eaede8;
  --t2: #b0b8a8;
  --t3: #8a9480;
  --dim: #5e6858;

  /* Borders */
  --bd:  #242e22;
  --bd2: #2e3a2c;

  /* Bioluminescent moss — gift cycle */
  --moss: #8aad6e;
  --moss-light: #a4c48a;
  --moss-dim: #5c7a48;
  --glow-green: #7ef0b8;
  --glow-amber: #f0c87e;
  --glow-teal:  #7edcf0;

  /* Indigo quantum — identity / security */
  --indigo: #818cf8;
  --indigo-light: #a5b4fc;
  --indigo-dim: #6366f1;

  /* Violet */
  --violet: #b48efa;
  --violet-light: #c4b5fd;

  /* Shared accents */
  --rose: #f07eb8;
  --rose-light: #f9a8d4;
  --pulse: #34d399;
  --pulse-light: #6ee7b7;
  --danger: #ef4444;

  /* Stage colors */
  --s1: #818cf8;
  --s2: #7eb8f0;
  --s3: #f0c87e;
  --s4: #8aad6e;
  --s5: #b48efa;
  --s6: #f07eb8;
  --s7: #7edcf0;

  /* Typography */
  --display: 'Outfit', sans-serif;
  --body:    'Source Serif 4', Georgia, serif;
  --mono:    'IBM Plex Mono', monospace;

  /* Misc */
  --radius: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--body);
  font-optical-sizing: auto;
  font-size: 17px;
  line-height: 1.75;
  background: var(--bg);
  color: var(--tx);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* Account for fixed site-nav */
  padding-top: 56px;
}

/* ═══ 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); }

.btn-moss   { background: var(--moss); color: var(--bg); }
.btn-amber  { background: var(--glow-amber); color: var(--bg); }
.btn-green  { background: var(--s4); color: var(--bg); }
.btn-indigo {
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  color: white;
  box-shadow: 0 4px 24px rgba(129,140,248,0.2);
}
.btn-rose {
  background: linear-gradient(135deg, var(--rose), var(--violet));
  color: white;
  box-shadow: 0 4px 24px rgba(240,126,184,0.2);
}
.btn-final {
  background: linear-gradient(135deg, var(--moss), var(--indigo), var(--violet));
  color: white;
  box-shadow: 0 4px 24px rgba(138,173,110,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(--display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  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(--display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  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(138,173,110,0.1);
}
.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(--moss);
  color: var(--moss-light);
  background: rgba(138,173,110,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(8,10,8,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;
}
.site-nav-logo {
  font-family: var(--display); font-weight: 800;
  font-size: 18px; color: var(--tx);
  text-decoration: none; letter-spacing: -0.02em;
}
.site-nav-logo em {
  font-style: normal;
  background: linear-gradient(135deg, var(--moss-light), var(--indigo-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.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(8,10,8,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; }
}
