/* Ásgarðr — Nordische Mythologie im Web
   ================================================================
   Design tokens
   ================================================================ */

:root {
  --bg-deep:        #06091c;
  --bg-mid:         #0b1230;
  --bg-soft:        #131b3f;
  --ink-primary:    #ece4cf;
  --ink-secondary:  #b9b09a;
  --ink-muted:      #6e6a5e;
  --gold:           #d4a93a;
  --gold-bright:    #f0c558;
  --bronze:         #b07a36;
  --ice:            #88b8d8;
  --fire:           #e87a3c;
  --world-light:    #2b4068;
  --world-middle:   #3b3a5e;
  --world-dark:     #1d1830;
  --line:           rgba(212, 169, 58, 0.22);
  --line-strong:    rgba(212, 169, 58, 0.45);

  --font-display:   'Cinzel', 'Cormorant Garamond', serif;
  --font-serif:     'Cormorant Garamond', Georgia, serif;
  --font-body:      'Inter', system-ui, -apple-system, sans-serif;

  --shadow-glow:    0 0 24px rgba(212, 169, 58, 0.18);
  --shadow-card:    0 18px 48px rgba(0, 0, 0, 0.45);
  --radius:         4px;

  --maxw:           1120px;
}

/* ================================================================
   Base
   ================================================================ */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-deep);
  color: var(--ink-primary);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--gold);
  color: var(--bg-deep);
}

a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.18s, color 0.18s;
}
a:hover { border-bottom-color: var(--gold); }

em {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--gold-bright);
}

strong { color: var(--ink-primary); }

p { margin: 0 0 1.1em; }

ul {
  margin: 1em 0 1.3em;
  padding-left: 1.4em;
}
li { margin: 0.4em 0; }
li::marker { color: var(--gold); }

.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;
}

/* ================================================================
   Stars canvas (background)
   ================================================================ */

#stars {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.9;
}

/* ================================================================
   Hero
   ================================================================ */

.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 4rem 1.5rem 6rem;
  z-index: 1;
  overflow: hidden;
}

.aurora {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 30% 30%, rgba(122, 200, 160, 0.12), transparent 60%),
    radial-gradient(50% 40% at 70% 50%, rgba(232, 122, 60, 0.10), transparent 65%),
    radial-gradient(80% 50% at 50% 90%, rgba(136, 184, 216, 0.10), transparent 70%);
  filter: blur(8px);
  animation: aurora-drift 22s ease-in-out infinite alternate;
  z-index: -1;
}

@keyframes aurora-drift {
  0%   { transform: translate3d(-3%, -2%, 0) scale(1.0); }
  50%  { transform: translate3d( 2%,  1%, 0) scale(1.05); }
  100% { transform: translate3d(-1%,  3%, 0) scale(1.02); }
}

.hero-inner { max-width: 760px; }

.hero-eyebrow {
  font-family: var(--font-display);
  letter-spacing: 0.35em;
  font-size: 0.85rem;
  color: var(--gold);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.2rem, 8vw, 6.5rem);
  line-height: 1.0;
  margin: 0 0 1rem;
  color: var(--ink-primary);
  text-shadow:
    0 0 30px rgba(212, 169, 58, 0.35),
    0 0 60px rgba(212, 169, 58, 0.15);
}

.hero-subtitle {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  color: var(--ink-primary);
  margin: 0.5rem 0 1rem;
}

.hero-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-secondary);
  margin: 0 auto 2.5rem;
  max-width: 540px;
}

.hero-cta {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.9rem 1.6rem;
  border: 1px solid var(--line-strong);
  color: var(--gold-bright);
  border-radius: var(--radius);
  background: rgba(11, 18, 48, 0.4);
  backdrop-filter: blur(2px);
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
}
.hero-cta:hover {
  background: rgba(212, 169, 58, 0.12);
  border-color: var(--gold);
  transform: translateY(-1px);
  border-bottom-color: var(--gold);
}

/* ================================================================
   Section shell
   ================================================================ */

.section {
  position: relative;
  padding: 7rem 1.5rem;
  z-index: 1;
}

.section-inner {
  max-width: var(--maxw);
  margin: 0 auto;
}

.section-inner.narrow {
  max-width: 760px;
}

.section-eyebrow {
  font-family: var(--font-display);
  letter-spacing: 0.32em;
  font-size: 0.78rem;
  color: var(--gold);
  margin: 0 0 0.8rem;
}

h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  line-height: 1.1;
  color: var(--ink-primary);
  margin: 0 0 1.4rem;
}

.lede {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 1.6vw, 1.35rem);
  color: var(--ink-secondary);
  line-height: 1.55;
  margin-bottom: 1.6rem;
}

.subsection {
  font-family: var(--font-display);
  letter-spacing: 0.22em;
  font-size: 0.95rem;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin: 3rem 0 1.5rem;
  text-align: center;
}

/* ================================================================
   Yggdrasil section
   ================================================================ */

.section-yggdrasil {
  background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-mid) 100%);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

@media (max-width: 880px) {
  .split { grid-template-columns: 1fr; gap: 2.5rem; }
}

.yggdrasil-figure {
  margin: 0;
  display: grid;
  place-items: center;
}

.yggdrasil-svg {
  width: 100%;
  max-width: 520px;
  height: auto;
  filter: drop-shadow(0 0 20px rgba(212, 169, 58, 0.10));
}

/* Tree sway */
.trunk, .branch, .root {
  transform-origin: 300px 720px;
  animation: sway 9s ease-in-out infinite;
}
.trunk         { animation-duration: 9s; }
.branch        { animation-duration: 7s; }
.root          { animation-duration: 11s; animation-direction: alternate-reverse; }
.leaves        { transform-origin: center; animation: leaf-shimmer 6s ease-in-out infinite; }
.nidhogg       { animation: nidhogg-pulse 4s ease-in-out infinite; }

@keyframes sway {
  0%, 100% { transform: rotate(-0.6deg); }
  50%      { transform: rotate(0.6deg); }
}
@keyframes leaf-shimmer {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 0.55; }
}
@keyframes nidhogg-pulse {
  0%, 100% { opacity: 0.5; r: 5; }
  50%      { opacity: 1.0; r: 7; }
}

/* World nodes */
.world circle {
  fill: var(--world-middle);
  stroke: var(--line-strong);
  stroke-width: 1.2;
  transition: fill 0.25s, transform 0.25s, stroke-width 0.25s;
  transform-origin: center;
  cursor: pointer;
}
.world text {
  font-family: var(--font-display);
  font-size: 12px;
  fill: var(--ink-primary);
  letter-spacing: 0.06em;
  pointer-events: none;
}

.world:hover circle,
.world:focus circle {
  fill: var(--world-light);
  stroke: var(--gold);
  stroke-width: 2;
}

/* ================================================================
   World cards (the nine worlds, in detail)
   ================================================================ */

.world-grid {
  margin-top: 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}

.world-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s;
}
.world-card:hover {
  transform: translateY(-2px);
  border-left-color: var(--gold);
  box-shadow: var(--shadow-glow);
}
.world-card[data-tone="light"]  { border-left-color: var(--ice); }
.world-card[data-tone="middle"] { border-left-color: var(--bronze); }
.world-card[data-tone="dark"]   { border-left-color: var(--fire); }

.world-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 0.4rem;
  color: var(--gold-bright);
  letter-spacing: 0.04em;
}
.world-card p { margin: 0; color: var(--ink-secondary); font-size: 0.97rem; }

/* ================================================================
   Gods grid
   ================================================================ */

.section-goetter {
  background: var(--bg-mid);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.god-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.4rem;
}

.god-card {
  background: linear-gradient(180deg, var(--bg-soft), var(--bg-deep));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.4rem 1.2rem;
  position: relative;
  transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s;
  overflow: hidden;
}
.god-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity 0.25s;
}
.god-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: var(--shadow-card);
}
.god-card:hover::before { opacity: 1; }

.god-card h4 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 0 0 0.2rem;
  color: var(--ink-primary);
  letter-spacing: 0.04em;
}
.god-card .role {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--gold-bright);
  margin: 0 0 0.7rem;
}
.god-card p:not(.role) {
  font-size: 0.95rem;
  color: var(--ink-secondary);
  margin: 0;
}

/* ================================================================
   Prose sections (Schöpfung, Ragnarök)
   ================================================================ */

.section-prose {
  background: var(--bg-deep);
}
.section-ragnarok {
  background:
    radial-gradient(60% 50% at 50% 30%, rgba(232, 122, 60, 0.10), transparent 65%),
    var(--bg-deep);
}
.section-nornen {
  background: var(--bg-mid);
  border-top: 1px solid var(--line);
}

.section-prose p {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--ink-primary);
  line-height: 1.7;
}
.section-prose ul {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--ink-secondary);
}

/* ================================================================
   Rune stones
   ================================================================ */

.rune-stones {
  display: grid;
  gap: 1.2rem;
  margin: 0;
}

.rune-stone {
  background: linear-gradient(180deg, var(--bg-soft), var(--bg-deep));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.2rem;
  text-align: center;
  transition: transform 0.22s, box-shadow 0.22s;
}
.rune-stone:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.rune-glyph {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--gold-bright);
  line-height: 1;
  display: block;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 18px rgba(212, 169, 58, 0.35);
}

.rune-label {
  display: block;
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  color: var(--ink-primary);
  font-size: 1rem;
  margin-bottom: 0.2rem;
}
.rune-meaning {
  display: block;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-secondary);
  font-size: 0.92rem;
}

/* ================================================================
   Sources section
   ================================================================ */

.section-quellen {
  background: var(--bg-deep);
}

.source-list {
  list-style: none;
  padding: 0;
}
.source-list li {
  border-left: 2px solid var(--bronze);
  padding: 0.5rem 0 0.5rem 1.1rem;
  margin-bottom: 1.1rem;
  color: var(--ink-secondary);
  font-family: var(--font-serif);
  font-size: 1.1rem;
}
.source-list strong {
  color: var(--gold-bright);
  font-family: var(--font-display);
  letter-spacing: 0.04em;
}

.note {
  font-size: 0.95rem;
  color: var(--ink-muted);
  font-style: italic;
  font-family: var(--font-serif);
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  margin-top: 2rem;
}

/* ================================================================
   Footer
   ================================================================ */

.site-footer {
  position: relative;
  background: var(--bg-deep);
  border-top: 1px solid var(--line);
  padding: 3rem 1.5rem 4rem;
  text-align: center;
  z-index: 1;
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
}

.footer-mark {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--gold);
  letter-spacing: 0.4em;
  margin: 0 0 1rem;
}

.footer-inner p {
  margin: 0.4rem 0;
  font-family: var(--font-serif);
  color: var(--ink-secondary);
}
.footer-meta {
  color: var(--ink-muted);
  font-size: 0.9rem;
}

/* ================================================================
   Reveal animation
   ================================================================ */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ================================================================
   Responsive
   ================================================================ */

@media (max-width: 720px) {
  body { font-size: 16px; }
  .section { padding: 5rem 1.2rem; }
  .god-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .world-grid { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .god-grid { grid-template-columns: 1fr; }
}
