/* MORIA — Khazad-dûm aesthetic */

:root {
  --stone-deep: #0c0b0a;
  --stone-mid: #1a1814;
  --gold: #c9a227;
  --gold-bright: #e8c547;
  --gold-dim: #8a7020;
  --mist: #9a9590;
  --rune-glow: rgba(201, 162, 39, 0.35);
  --font-display: "Cinzel", "Palatino Linotype", serif;
  --font-body: "Crimson Pro", "Georgia", serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
  color: #d8d2c8;
  background: var(--stone-deep);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(201, 162, 39, 0.08), transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(184, 92, 40, 0.06), transparent 50%),
    linear-gradient(180deg, var(--stone-deep) 0%, #12100e 50%, var(--stone-deep) 100%);
  min-height: 100vh;
}

body.page-home {
  background: var(--stone-deep);
}

.site-wallpaper {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.site-wallpaper img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  display: block;
}

.site-wallpaper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(12, 11, 10, 0.72) 0%,
    rgba(12, 11, 10, 0.58) 50%,
    rgba(12, 11, 10, 0.78) 100%
  );
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

a {
  color: var(--gold-bright);
  text-decoration: none;
  transition: color 0.2s, text-shadow 0.2s;
}

a:hover {
  color: #fff;
  text-shadow: 0 0 12px var(--rune-glow);
}

img {
  max-width: 100%;
  height: auto;
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  background: rgba(12, 11, 10, 0.92);
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
  backdrop-filter: blur(8px);
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  color: var(--gold);
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.nav-brand:hover {
  color: var(--gold-bright);
  text-shadow: none;
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mist);
}

.nav-links a:hover {
  color: var(--gold-bright);
}

.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem 4rem;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 162, 39, 0.12) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: pulse-glow 6s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}

.hero-logo {
  width: min(560px, 92vw);
  margin-bottom: 2rem;
  filter: drop-shadow(0 0 30px rgba(201, 162, 39, 0.25));
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 700;
  letter-spacing: 0.4em;
  margin: 0 0 0.5rem;
  color: var(--gold-bright);
  text-shadow:
    0 0 6px rgba(232, 197, 71, 0.6),
    0 0 18px rgba(201, 162, 39, 0.45),
    0 0 36px rgba(201, 162, 39, 0.28);
  animation: title-glow 4s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

@keyframes title-glow {
  0%, 100% {
    text-shadow:
      0 0 6px rgba(232, 197, 71, 0.6),
      0 0 18px rgba(201, 162, 39, 0.45),
      0 0 36px rgba(201, 162, 39, 0.28);
  }
  50% {
    text-shadow:
      0 0 8px rgba(232, 197, 71, 0.75),
      0 0 22px rgba(201, 162, 39, 0.55),
      0 0 44px rgba(201, 162, 39, 0.35);
  }
}

.hero-subtitle {
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--mist);
  margin: 0 0 1.5rem;
  position: relative;
  z-index: 1;
}

.hero-tagline {
  max-width: 36rem;
  font-style: italic;
  color: #a8a29a;
  margin: 0 0 2.5rem;
  position: relative;
  z-index: 1;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.btn {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.85rem 1.75rem;
  border: 1px solid var(--gold-dim);
  background: rgba(201, 162, 39, 0.08);
  color: var(--gold-bright);
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.btn:hover {
  background: rgba(201, 162, 39, 0.18);
  border-color: var(--gold);
  box-shadow: 0 0 20px var(--rune-glow);
}

.btn-primary {
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.25), rgba(138, 112, 32, 0.15));
  border-color: var(--gold);
}

.btn-sm {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.5rem 1rem;
}

.notebook-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 1.25rem !important;
}

.notebook-links code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.1em 0.4em;
}

main {
  position: relative;
  z-index: 1;
}

.section {
  max-width: 56rem;
  margin: 0 auto;
  padding: 5rem 2rem;
}

.section-divider {
  height: 1px;
  max-width: 12rem;
  margin: 0 auto 3rem;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

.section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
  margin: 0 0 0.75rem;
}

h2 .terminal-cmd {
  font-family: var(--font-mono);
  font-size: 0.72em;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: #c8e6c9;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(201, 162, 39, 0.15);
  padding: 0.2em 0.55em;
  border-radius: 3px;
  vertical-align: middle;
  white-space: nowrap;
}

h2 .terminal-cmd .prompt {
  color: var(--gold-dim);
  margin-right: 0.35em;
  user-select: none;
}

.section-lead {
  text-align: center;
  color: #faf6ef;
  max-width: 42rem;
  margin: 0 auto 3rem;
  font-size: 1.1rem;
  line-height: 1.75;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9), 0 0 24px rgba(0, 0, 0, 0.6);
}

.section > p {
  color: #e4dfd6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.optional {
  color: var(--mist);
  font-weight: 400;
}

.info-card {
  background: var(--stone-mid);
  border: 1px solid rgba(201, 162, 39, 0.15);
  padding: 2rem;
  overflow-x: auto;
  border-radius: 2px;
}

.pipeline-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.95rem;
  background: var(--stone-mid);
}

.pipeline-table th,
.pipeline-table td {
  width: 50%;
  padding: 1rem 2rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid rgba(201, 162, 39, 0.12);
  background: var(--stone-mid);
}

.pipeline-table th:last-child,
.pipeline-table td:last-child {
  padding-left: 2.5rem;
}

.pipeline-table th {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.pipeline-table td {
  color: #e4dfd6;
}

.pipeline-table code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--gold);
}

.quest-path {
  display: grid;
  gap: 1.25rem;
  counter-reset: step;
}

.quest-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: start;
  padding: 1.5rem;
  background: rgba(26, 24, 20, 0.92);
  border: 1px solid rgba(201, 162, 39, 0.12);
  border-left: 3px solid var(--gold-dim);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.quest-step:hover {
  border-left-color: var(--gold);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.quest-step::before {
  counter-increment: step;
  content: counter(step);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-dim);
  line-height: 1;
  min-width: 2rem;
}

.quest-step h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin: 0 0 0.35rem;
}

.quest-step p {
  margin: 0 0 0.5rem;
  color: #d8d2c8;
  font-size: 1rem;
}

.quest-step code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.1em 0.4em;
}

.install-card {
  background: rgba(26, 24, 20, 0.92);
  border: 1px solid rgba(201, 162, 39, 0.15);
  padding: 2rem;
}

.install-card p,
.install-card strong {
  color: #e4dfd6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.install-card pre {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(201, 162, 39, 0.1);
  padding: 1.25rem;
  overflow-x: auto;
  color: #c8e6c9;
  margin: 1rem 0 0;
}

.deps-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}

.deps-list li {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  background: rgba(201, 162, 39, 0.1);
  border: 1px solid rgba(201, 162, 39, 0.2);
  color: var(--gold);
}

.citation {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(180deg, transparent, rgba(201, 162, 39, 0.05));
  border-top: 1px solid rgba(201, 162, 39, 0.15);
}

.citation em {
  display: block;
  font-size: 1.15rem;
  color: #d8d2c8;
  margin-bottom: 0.75rem;
}

.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3rem 2rem;
  border-top: 1px solid rgba(201, 162, 39, 0.1);
  color: var(--mist);
  font-size: 0.9rem;
}

.footer-rune {
  font-family: var(--font-display);
  letter-spacing: 0.5em;
  color: var(--gold-dim);
  margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
  .nav {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
  }

  .nav-links {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero h1 {
    letter-spacing: 0.2em;
  }
}
