/* ═══════════════════════════════════════════
   XENOMYTHOLOGY.COM — Stylesheet
   ═══════════════════════════════════════════ */

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

/* ── THEME: DARK (default) ── */
:root {
  --bg-deep: #0a0b0f;
  --bg-section: #0e1017;
  --bg-card: #131620;
  --bg-card-hover: #181c28;
  --gold: #c9a84c;
  --gold-dim: #8a7234;
  --gold-bright: #e4c76b;
  --text-primary: #d4d0c8;
  --text-secondary: #8e8a7e;
  --text-muted: #5c5848;
  --accent-blue: #4a6fa5;
  --accent-teal: #3a7d7b;
  --border: rgba(201, 168, 76, 0.08);
  --border-hover: rgba(201, 168, 76, 0.18);
  --nav-bg: rgba(10, 11, 15, 0.85);
  --nav-bg-scrolled: rgba(10, 11, 15, 0.95);
  --mobile-menu-bg: rgba(10, 11, 15, 0.97);
  --hero-glow-1: rgba(201, 168, 76, 0.03);
  --hero-glow-2: rgba(74, 111, 165, 0.04);
  --hero-glow-3: rgba(58, 125, 123, 0.03);
  --definition-bg: rgba(201, 168, 76, 0.02);
  --cta-hover-bg: rgba(201, 168, 76, 0.08);
  --toggle-bg: rgba(201, 168, 76, 0.06);
  --toggle-border: rgba(201, 168, 76, 0.15);
  --toggle-icon-active: var(--gold);
  --toggle-icon-inactive: var(--text-muted);
}

/* ── THEME: LIGHT ── */
[data-theme="light"] {
  --bg-deep: #f4f1eb;
  --bg-section: #eee9e0;
  --bg-card: #ffffff;
  --bg-card-hover: #faf8f4;
  --gold: #8a6d1b;
  --gold-dim: #a8893a;
  --gold-bright: #6b5210;
  --text-primary: #1a1814;
  --text-secondary: #57534a;
  --text-muted: #8c8578;
  --accent-blue: #3b5e92;
  --accent-teal: #2d6664;
  --border: rgba(138, 109, 27, 0.1);
  --border-hover: rgba(138, 109, 27, 0.22);
  --nav-bg: rgba(244, 241, 235, 0.88);
  --nav-bg-scrolled: rgba(244, 241, 235, 0.96);
  --mobile-menu-bg: rgba(244, 241, 235, 0.98);
  --hero-glow-1: rgba(138, 109, 27, 0.04);
  --hero-glow-2: rgba(59, 94, 146, 0.04);
  --hero-glow-3: rgba(45, 102, 100, 0.03);
  --definition-bg: rgba(138, 109, 27, 0.04);
  --cta-hover-bg: rgba(138, 109, 27, 0.06);
  --toggle-bg: rgba(138, 109, 27, 0.06);
  --toggle-border: rgba(138, 109, 27, 0.18);
  --toggle-icon-active: var(--gold);
  --toggle-icon-inactive: var(--text-muted);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Questrial', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  transition: background 0.5s ease, color 0.4s ease;
}

::selection {
  background: rgba(201, 168, 76, 0.25);
  color: var(--gold-bright);
}
[data-theme="light"] ::selection {
  background: rgba(138, 109, 27, 0.18);
  color: var(--gold-bright);
}

/* ═══════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════ */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: all 0.4s ease;
}
nav.scrolled {
  padding: 0.7rem 2.5rem;
  background: var(--nav-bg-scrolled);
}
.nav-brand {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-transform: uppercase;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.3s;
}
.nav-links a:hover { color: var(--gold); }

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--toggle-bg);
  border: 1px solid var(--toggle-border);
  border-radius: 20px;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  transition: all 0.3s;
}
.theme-toggle:hover { border-color: var(--gold-dim); }
.theme-toggle svg {
  width: 14px; height: 14px;
  transition: all 0.3s;
}
.theme-toggle .icon-sun { color: var(--toggle-icon-inactive); }
.theme-toggle .icon-moon { color: var(--toggle-icon-active); }
[data-theme="light"] .theme-toggle .icon-sun { color: var(--toggle-icon-active); }
[data-theme="light"] .theme-toggle .icon-moon { color: var(--toggle-icon-inactive); }

/* Mobile nav */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span {
  display: block; width: 22px; height: 1.5px;
  background: var(--text-secondary); margin: 5px 0;
  transition: all 0.3s;
}

/* ═══════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 6rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 800px 600px at 50% 30%, var(--hero-glow-1) 0%, transparent 70%),
    radial-gradient(ellipse 400px 400px at 20% 80%, var(--hero-glow-2) 0%, transparent 70%),
    radial-gradient(ellipse 500px 300px at 80% 60%, var(--hero-glow-3) 0%, transparent 70%);
  pointer-events: none;
}
.hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(3rem, 7vw, 6.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 1s 0.3s forwards;
}
.hero h1 em {
  font-style: italic;
  color: var(--gold);
  font-weight: 400;
}
.hero-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  color: var(--text-secondary);
  max-width: 680px;
  line-height: 1.6;
  margin-bottom: 3.5rem;
  opacity: 0;
  animation: fadeUp 1s 0.5s forwards;
}
.hero-line {
  width: 60px;
  height: 1px;
  background: var(--gold-dim);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 1s 0.7s forwards;
}
.hero-scroll {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0;
  animation: fadeUp 1s 0.9s forwards;
}
.hero-scroll::after {
  content: '';
  display: block;
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, var(--gold-dim), transparent);
  margin: 1rem auto 0;
}

/* ═══════════════════════════════════════════
   SECTIONS — General
   ═══════════════════════════════════════════ */
section {
  padding: 7rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}
.section-label {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 300;
  font-size: 0.7rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 1.5rem;
}
.section-heading {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 2rem;
  max-width: 700px;
}
.section-text {
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.85;
  max-width: 660px;
  margin-bottom: 1.5rem;
}
.section-text em {
  color: var(--text-primary);
  font-style: normal;
}
.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 0 auto;
  max-width: 1100px;
}

/* ═══════════════════════════════════════════
   DEFINITION BLOCK
   ═══════════════════════════════════════════ */
.definition-block {
  border-left: 2px solid var(--gold-dim);
  padding: 2rem 2.5rem;
  margin: 3rem 0;
  background: var(--definition-bg);
}
.definition-block .term {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.6rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.definition-block .etymology {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}
.definition-block p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.85;
}

/* ═══════════════════════════════════════════
   PULL QUOTE
   ═══════════════════════════════════════════ */
.pull-quote {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 3rem 0;
  padding-left: 1.5rem;
  border-left: 1px solid var(--gold-dim);
}
.pull-quote cite {
  display: block;
  font-style: normal;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.8rem;
  letter-spacing: 0.1em;
}

/* ═══════════════════════════════════════════
   CARD GRID
   ═══════════════════════════════════════════ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 2rem;
  transition: all 0.35s ease;
  text-decoration: none;
  display: block;
}
[data-theme="light"] .card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}
.card-type {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 0.8rem;
}
.card-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 0.6rem;
}
.card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.card-meta span { color: var(--text-secondary); }

/* ═══════════════════════════════════════════
   LINK LIST
   ═══════════════════════════════════════════ */
.link-list {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.link-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.3s;
}
.link-item:hover { border-color: var(--border-hover); }
.link-item:hover .link-title { color: var(--gold); }
.link-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  color: var(--text-primary);
  transition: color 0.3s;
  flex: 1;
  padding-right: 1rem;
}
.link-detail {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════
   SCHOLARS GRID
   ═══════════════════════════════════════════ */
.scholars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.scholar-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: border-color 0.3s;
}
[data-theme="light"] .scholar-card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.scholar-card:hover { border-color: var(--border-hover); }
.scholar-name {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}
.scholar-field {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ═══════════════════════════════════════════
   WHAT'S NEXT — Horizon items
   ═══════════════════════════════════════════ */
.horizon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.horizon-card {
  padding: 2rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all 0.35s;
}
[data-theme="light"] .horizon-card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.horizon-card:hover {
  border-color: var(--border-hover);
}
.horizon-card .h-number {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: var(--gold-dim);
  margin-bottom: 0.8rem;
}
.horizon-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 0.7rem;
}
.horizon-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* ═══════════════════════════════════════════
   SF LABORATORY — Cards & Layout
   ═══════════════════════════════════════════ */
.sf-category-heading {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 1.4rem;
  color: var(--gold);
  margin-top: 4.5rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
}
.sf-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 1rem;
}
.sf-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: border-color 0.35s;
  overflow: hidden;
}
[data-theme="light"] .sf-card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.sf-card:hover { border-color: var(--border-hover); }
.sf-card-header {
  padding: 1.5rem 2rem 1rem;
  border-bottom: 1px solid var(--border);
}
.sf-card-author {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 0.3rem;
}
.sf-card-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--text-primary);
  line-height: 1.3;
}
.sf-card-body {
  padding: 1.5rem 2rem 1.8rem;
}
.sf-card-body p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1.2rem;
}
.sf-card-body p em {
  color: var(--text-primary);
  font-style: normal;
}
.sf-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.sf-card-tags span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.25rem 0.65rem;
  border-radius: 2px;
  transition: border-color 0.3s;
}
.sf-card:hover .sf-card-tags span {
  border-color: var(--border-hover);
}

/* Two-column for primary texts */
@media (min-width: 769px) {
  .sf-grid { grid-template-columns: 1fr 1fr; }
  .sf-grid .sf-card:only-child { grid-column: 1 / -1; }
}

/* ═══════════════════════════════════════════
   BIO SECTION
   ═══════════════════════════════════════════ */
.bio-section {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 4rem;
  align-items: start;
  margin-top: 2.5rem;
}
.bio-aside {
  position: sticky;
  top: 6rem;
}
.bio-name {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 1.8rem;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}
.bio-title-text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--gold-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}
.bio-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.5rem;
}
.bio-links a {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.bio-links a:hover { color: var(--gold); }
.bio-links a::before {
  content: '→';
  font-size: 0.75rem;
  color: var(--gold-dim);
}

/* ═══════════════════════════════════════════
   CTA BAND
   ═══════════════════════════════════════════ */
.cta-band {
  text-align: center;
  padding: 5rem 2rem;
  max-width: 700px;
  margin: 0 auto;
}
.cta-band .section-heading { margin: 0 auto 1.5rem; }
.cta-link {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  border: 1px solid var(--gold-dim);
  padding: 0.9rem 2.5rem;
  transition: all 0.35s;
  margin-top: 1rem;
}
.cta-link:hover {
  background: var(--cta-hover-bg);
  border-color: var(--gold);
}

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
footer {
  padding: 4rem 2rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.footer-left {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.footer-right {
  display: flex;
  gap: 2rem;
}
.footer-right a {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: color 0.3s;
}
.footer-right a:hover { color: var(--gold-dim); }

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.reveal {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  nav { padding: 0.8rem 1.2rem; }
  nav.scrolled { padding: 0.6rem 1.2rem; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--mobile-menu-bg);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .nav-right { gap: 1rem; }
  section { padding: 4.5rem 1.5rem; }
  .bio-section { grid-template-columns: 1fr; gap: 2.5rem; }
  .bio-aside { position: static; }
  .card-grid { grid-template-columns: 1fr; }
  .horizon-grid { grid-template-columns: 1fr; }
  .sf-grid { grid-template-columns: 1fr; }
  .scholars-grid { grid-template-columns: 1fr 1fr; }
  footer { flex-direction: column; }
  .hero { padding: 5rem 1.5rem 3rem; }
  .definition-block { padding: 1.5rem 1.5rem; }
}
@media (max-width: 480px) {
  .scholars-grid { grid-template-columns: 1fr; }
}
