/* ============================================================
   ÆtherCodex — cosmic void · glass athanor · hermetic gold
   Native macOS editor docs site. Served from docs/ via GitHub Pages.
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Syne:wght@400..800&family=Syne+Mono&family=Syne+Tactile&display=swap");
@import url("https://iosevka-webfonts.github.io/iosevka-curly/iosevka-curly.css");

:root {
  --mono: "Syne Mono", "Iosevka Curly", "Fira Code", monospace;
  --sans: "Syne", "General Sans", "Plus Jakarta Sans", "Inter", sans-serif;
  --sigil: "Fraunces Soft", "Syne", serif;

  --argonaut-cosmic: #4a90e2;
  --argonaut-mystic: #8e44ad;
  --void-black: #050505;
  --astral-gray: #121214;
  --ethereal-white: #f8f9fa;
  --hermetic-gold: #f39c12;
  --dimensional-purple: #6c5ce7;
  --arcane-teal: #17a2b8;
  --mystic-rose: #e74c3c;
  --ethereal-green: #27ae60;
  --divine-crimson: #dc2626;
  --astral-amber: #f59e0b;
  --void-violet: #7c3aed;

  --glass: rgba(26, 26, 28, 0.42);
  --glass-card: rgba(38, 38, 48, 0.28);
  --glass-card-hover: rgba(38, 38, 48, 0.44);
  --glass-edge: rgba(137, 152, 254, 0.08);
  --glass-edge-hover: rgba(137, 152, 254, 0.28);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: linear-gradient(135deg, var(--void-black) 0%, var(--astral-gray) 100%);
  color: var(--ethereal-white);
  min-height: 100vh;
  line-height: 1.65;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- floating companion drift ---------- */
#eyes-container {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
}
.eye {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  user-select: none;
  will-change: transform, opacity;
  line-height: 1;
}

/* ---------- layered glass ---------- */
.cosmic-void {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 1;
  position: relative;
}

nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding: 0.9rem 2rem;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  background: rgba(10, 10, 12, 0.55);
  border-bottom: 1px solid var(--glass-edge);
  flex-wrap: wrap;
}
nav a {
  color: var(--ethereal-white);
  text-decoration: none;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  opacity: 0.78;
  transition: opacity 0.3s ease, color 0.3s ease, text-shadow 0.3s ease;
}
nav a:hover {
  opacity: 1;
  color: var(--argonaut-cosmic);
  text-shadow: 0 0 12px var(--argonaut-cosmic);
}
nav .home-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  opacity: 1;
}
nav .nav-logo {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 0 6px rgba(74, 144, 226, 0.7));
}

/* ---------- header ---------- */
.oracle-header {
  text-align: center;
  padding: 5rem 2rem 3rem;
  background: radial-gradient(circle at center, rgba(74, 144, 226, 0.12) 0%, transparent 70%);
  position: relative;
}
.logo-container { max-width: 860px; margin: 0 auto; }
.logo {
  font-size: clamp(2.6rem, 7vw, 4.8rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  margin-bottom: 0.6rem;
}
.aether {
  color: var(--argonaut-cosmic);
  text-shadow: 0 0 34px var(--argonaut-cosmic);
}
.codex {
  color: var(--argonaut-mystic);
  text-shadow: 0 0 34px var(--argonaut-mystic);
}
.subtitle {
  font-size: 1.15rem;
  color: var(--hermetic-gold);
  font-style: italic;
  opacity: 0.92;
}

/* ---------- content shell ---------- */
.content {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

section { margin-bottom: 4rem; }

h2.section-header {
  font-size: 2rem;
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}
h2.cosmic-purple { color: var(--dimensional-purple); text-shadow: 0 0 16px rgba(108, 92, 231, 0.4); }
h2.mystic-rose { color: var(--mystic-rose); text-shadow: 0 0 16px rgba(231, 76, 60, 0.4); }
h2.arcane-teal { color: var(--arcane-teal); text-shadow: 0 0 16px rgba(23, 162, 184, 0.4); }
h2.hermetic-gold-h { color: var(--hermetic-gold); text-shadow: 0 0 16px rgba(243, 156, 18, 0.4); }

h3.subheadline {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ethereal-white);
  opacity: 0.62;
  margin-bottom: 1.2rem;
}

p.lead {
  font-size: 1.18rem;
  margin-bottom: 1rem;
  line-height: 1.7;
}

/* ---------- description / hero card ---------- */
.description {
  text-align: center;
  margin-bottom: 4rem;
  padding: 2.4rem 2rem;
  background: var(--glass);
  border-radius: 16px;
  border: 1px solid rgba(74, 144, 226, 0.28);
  backdrop-filter: blur(8px) saturate(130%);
  -webkit-backdrop-filter: blur(8px) saturate(130%);
}
.description h2 {
  color: var(--dimensional-purple);
  margin-bottom: 1rem;
  font-size: 1.9rem;
  text-shadow: 0 0 15px rgba(108, 92, 231, 0.4);
}
.enhanced-description {
  color: var(--ethereal-white);
  font-size: 1.15em;
  line-height: 1.75;
}

/* ---------- feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.4rem;
  margin-top: 2rem;
}
.feature-card {
  background: var(--glass-card);
  padding: 1.6rem 1.5rem;
  border-radius: 15px;
  border: 1px solid var(--glass-edge);
  border-left: 4px solid var(--hermetic-gold);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.feature-card:hover {
  transform: translateY(-5px);
  border-color: var(--glass-edge-hover);
  box-shadow: 0 16px 44px rgba(74, 144, 226, 0.35);
}
.feature-card .glyph { font-size: 1.7rem; display: block; margin-bottom: 0.5rem; }
.feature-card h3 {
  color: var(--ethereal-white);
  margin-bottom: 0.6rem;
  font-size: 1.2rem;
  font-weight: 600;
}
.feature-card p {
  color: var(--ethereal-white);
  opacity: 0.78;
  font-size: 0.95rem;
}

/* ---------- tool grid ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.2rem;
  margin-top: 2rem;
}
.tool-card {
  background: var(--glass-card);
  padding: 1.2rem 1.3rem;
  border-radius: 12px;
  border: 1px solid var(--glass-edge);
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--argonaut-mystic);
}
.tool-card h4 {
  font-family: var(--mono);
  font-size: 0.98rem;
  color: var(--argonaut-cosmic);
  margin-bottom: 0.5rem;
}
.tool-card p { opacity: 0.75; font-size: 0.92rem; }

/* ---------- front matter / black square ---------- */
.black-square-front {
  text-align: center;
  margin: 1rem auto 3rem;
  max-width: 520px;
}
.black-square-front img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  box-shadow: 0 0 90px rgba(124, 58, 237, 0.35), 0 0 18px rgba(74, 144, 226, 0.28);
  border: 1px solid rgba(248, 249, 250, 0.12);
}
.black-square-front .byline {
  color: var(--hermetic-gold);
  font-style: italic;
  font-size: 0.95rem;
  margin-top: 0.9rem;
}

/* ---------- chapter links ---------- */
.chapter-list {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.6rem;
}
.chapter-link {
  display: block;
  padding: 1.1rem 1.4rem;
  background: var(--glass-card);
  border: 1px solid var(--glass-edge);
  border-left: 4px solid var(--void-violet);
  border-radius: 12px;
  color: var(--ethereal-white);
  text-decoration: none;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.chapter-link:hover {
  transform: translateX(4px);
  border-color: var(--void-violet);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.3);
}
.chapter-link .num {
  font-family: var(--mono);
  color: var(--hermetic-gold);
  margin-right: 0.6rem;
}
.chapter-link .desc {
  display: block;
  opacity: 0.6;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* ---------- prose (chapter pages) ---------- */
.prose {
  max-width: 760px;
  margin: 0 auto;
  line-height: 1.8;
}
.prose h1 {
  font-size: 2.4rem;
  margin: 1rem 0 0.6rem;
  letter-spacing: 0.01em;
}
.prose h2 {
  color: var(--argonaut-cosmic);
  margin: 2.2rem 0 0.8rem;
  font-size: 1.55rem;
}
.prose h3 {
  color: var(--dimensional-purple);
  margin: 1.8rem 0 0.6rem;
  font-size: 1.25rem;
}
.prose p { margin-bottom: 1.1rem; opacity: 0.92; }
.prose em { font-style: italic; color: var(--argonaut-mystic); }
.prose strong { color: color-mix(in srgb, var(--hermetic-gold) 40%, var(--ethereal-white)); }
.prose a {
  color: var(--argonaut-cosmic);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, text-shadow 0.3s ease;
}
.prose a:hover { border-bottom-color: var(--argonaut-mystic); text-shadow: 0 0 10px var(--argonaut-mystic); }
.prose blockquote {
  border-left: 3px solid var(--hermetic-gold);
  padding: 0.6rem 1.2rem;
  margin: 1.4rem 0;
  font-style: italic;
  opacity: 0.85;
}
.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(26, 26, 28, 0.7);
  padding: 0.12rem 0.4rem;
  border-radius: 5px;
  color: var(--arcane-teal);
}
.prose pre {
  background: rgba(5, 5, 5, 0.85);
  border: 1px solid var(--glass-edge);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  overflow-x: auto;
  margin: 1.4rem 0;
}
.prose pre code {
  background: none;
  padding: 0;
  color: var(--ethereal-white);
  font-size: 0.9rem;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4rem 0;
  font-size: 0.95rem;
}
.prose th, .prose td {
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--glass-edge);
}
.prose th { color: var(--hermetic-gold); }
.prose hr {
  border: none;
  border-top: 1px solid var(--glass-edge);
  margin: 2rem 0;
}
.prose ul, .prose ol { margin: 1rem 0 1rem 1.4rem; }
.prose li { margin-bottom: 0.5rem; }

/* ---------- installation ---------- */
pre.install {
  background: rgba(5, 5, 5, 0.85);
  border: 1px solid var(--glass-edge);
  border-left: 4px solid var(--arcane-teal);
  border-radius: 12px;
  padding: 1.3rem 1.5rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.92rem;
  margin: 1.4rem 0;
  line-height: 1.7;
}
.github-link { margin-top: 1.4rem; line-height: 2; }
.cosmic-link {
  color: var(--argonaut-cosmic);
  text-decoration: none;
  transition: all 0.3s ease;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.cosmic-link:hover {
  color: var(--argonaut-mystic);
  text-shadow: 0 0 10px var(--argonaut-mystic);
  border-bottom-color: var(--argonaut-mystic);
}

/* ---------- footer ---------- */
.oracle-footer {
  text-align: center;
  padding: 3rem 2rem;
  background: rgba(10, 10, 12, 0.6);
  border-top: 1px solid var(--glass-edge);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.oracle-footer p { font-style: italic; opacity: 0.75; margin-bottom: 0.8rem; }
.runes {
  font-family: var(--mono);
  letter-spacing: 0.5em;
  color: var(--hermetic-gold);
  opacity: 0.7;
  font-size: 1.1rem;
}

@media (max-width: 640px) {
  nav { padding: 0.7rem 1.2rem; gap: 0.9rem; }
  .content { padding: 1.2rem; }
  .logo { font-size: 2.4rem; }
}
