:root {
  --bg: #030508;
  --bg-dark: #010203;
  --panel: rgba(10, 14, 22, 0.45);
  --panel-solid: #090d14;
  --ink: #fcf9f2;
  --muted: #8c96a0;
  --subtle: #414b55;
  --line: rgba(194, 147, 61, 0.08);
  --line-active: rgba(44, 191, 174, 0.25);
  --gold: #b38530;
  --gold-soft: #e0ca97;
  --teal: #23a193;
  --violet: #6b3bc7;
  --shadow: 0 40px 90px rgba(0, 0, 1, 0.85);
  --radius: 2px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(194, 147, 61, 0.01) 1px, transparent 1px),
    linear-gradient(rgba(194, 147, 61, 0.008) 1px, transparent 1px),
    radial-gradient(circle at 10% 20%, rgba(107, 59, 199, 0.08), transparent 45%),
    radial-gradient(circle at 90% 10%, rgba(35, 161, 147, 0.05), transparent 40%),
    var(--bg);
  background-size: 60px 60px, 60px 60px, auto, auto, auto;
  font-family: Garamond, Baskerville, "Baskerville Old Face", "Hoefler Text", "Times New Roman", "PingFang SC", "Microsoft YaHei", serif;
}

button, input, textarea, select {
  font: inherit;
  background: none;
  border: none;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.site-shell {
  min-height: 100vh;
  overflow: hidden;
}

.site-header {
  position: fixed;
  top: 32px;
  left: 50%;
  z-index: 100;
  display: flex;
  width: min(1300px, calc(100% - 48px));
  height: 64px;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border: 1px solid rgba(194, 147, 61, 0.15);
  border-radius: var(--radius);
  background: rgba(3, 5, 8, 0.6);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transform: translateX(-50%);
  backdrop-filter: blur(24px) saturate(120%);
  transition: all 0.6s var(--ease-out);
}

.site-header.is-scrolled {
  top: 0;
  width: 100%;
  height: 56px;
  border-left: none;
  border-right: none;
  border-top: none;
  border-bottom: 1px solid rgba(35, 161, 147, 0.15);
  background: rgba(1, 2, 3, 0.94);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold-soft);
  font-weight: 400;
  font-size: 18px;
  font-family: Georgia, serif;
  background: var(--bg-dark);
  transition: all 0.5s var(--ease-out);
}

.brand:hover .brand-mark {
  border-color: var(--teal);
  color: #ffffff;
  text-shadow: 0 0 8px var(--teal);
  box-shadow: 0 0 16px rgba(35, 161, 147, 0.3);
}

.brand strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #ffffff;
}

.brand small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  display: inline-flex;
  height: 36px;
  align-items: center;
  padding: 0 16px;
  color: #a0aab4;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--gold-soft);
  background: radial-gradient(circle at bottom, rgba(194, 147, 61, 0.08) 0%, transparent 70%);
  box-shadow: inset 0 -1px 0 rgba(194, 147, 61, 0.3);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(194, 147, 61, 0.15);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 1px;
  margin: 5px auto;
  background: var(--ink);
  transition: all 0.3s var(--ease-out);
}

.nav-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 940px;
  padding: 120px max(48px, calc((100vw - 1260px) / 2)) 140px;
}

.hero-media,
.hero-vignette {
  position: absolute;
  inset: 0;
}

.hero-media {
  overflow: hidden;
  background: var(--bg-dark);
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.9) contrast(1.05);
  animation: portalDrift 40s cubic-bezier(0.16, 1, 0.3, 1) infinite alternate;
}

.hero-vignette {
  background:
    radial-gradient(circle at 25% 50%, rgba(1, 2, 3, 0.2) 0%, rgba(1, 2, 3, 0.8) 55%, var(--bg) 95%),
    linear-gradient(to right, rgba(3, 5, 8, 0.98) 0%, rgba(3, 5, 8, 0.6) 35%, transparent 100%),
    linear-gradient(to bottom, transparent 50%, rgba(3, 5, 8, 0.8) 85%, var(--bg) 100%);
}

.hero-content {
  position: relative;
  z-index: 10;
  width: min(620px, 100%);
}

.eyebrow {
  margin: 0 0 20px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 5px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.hero h1 {
  margin: 0;
  font-size: clamp(40px, 7vw, 76px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.5px;
  color: #ffffff;
  font-family: inherit;
  text-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

.hero-lead {
  max-width: 500px;
  margin: 32px 0 0;
  color: #b2bbc5;
  font-size: 16px;
  line-height: 1.9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 48px;
}

.primary-action,
.ghost-action,
.season-panel a {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1.5px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.5s var(--ease-out);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.primary-action {
  gap: 24px;
  padding: 0 32px;
  color: #ffffff;
  background: var(--bg-dark);
  border: 1px solid var(--teal);
  box-shadow: 0 8px 32px rgba(35, 161, 147, 0.15);
}

.primary-action strong {
  padding-left: 24px;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 13px;
  font-weight: 400;
  color: var(--gold-soft);
  letter-spacing: 0.5px;
}

.ghost-action,
.season-panel a {
  padding: 0 32px;
  border: 1px solid rgba(194, 147, 61, 0.25);
  color: var(--gold-soft);
  background: rgba(10, 14, 22, 0.3);
  backdrop-filter: blur(12px);
}

.primary-action:hover {
  transform: translateY(-4px);
  background: var(--teal);
  color: #010203;
  box-shadow: 0 20px 40px rgba(35, 161, 147, 0.35);
}

.primary-action:hover strong {
  border-left-color: rgba(0, 0, 0, 0.15);
  color: #010203;
  font-weight: 700;
}

.ghost-action:hover,
.season-panel a:hover {
  transform: translateY(-4px);
  background: rgba(194, 147, 61, 0.05);
  border-color: var(--gold-soft);
  box-shadow: 0 15px 30px rgba(194, 147, 61, 0.1);
}

.realm-card {
  position: absolute;
  right: max(48px, calc((100vw - 1260px) / 2));
  bottom: 140px;
  z-index: 10;
  width: min(360px, calc(100% - 96px));
  padding: 40px 36px;
  border: 1px solid rgba(194, 147, 61, 0.15);
  border-radius: var(--radius);
  background: rgba(6, 9, 14, 0.85);
  box-shadow: var(--shadow);
  backdrop-filter: blur(32px);
  transition: all 0.5s var(--ease-out);
}

.realm-card:hover {
  transform: translateY(-6px);
  border-color: rgba(35, 161, 147, 0.3);
}

.realm-label {
  display: inline-flex;
  height: 22px;
  align-items: center;
  padding: 0 10px;
  color: var(--teal);
  border: 1px solid rgba(35, 161, 147, 0.3);
  background: rgba(35, 161, 147, 0.05);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.realm-card > strong {
  display: block;
  margin-top: 24px;
  font-size: 64px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -2px;
  color: #ffffff;
  font-family: Georgia, serif;
}

.realm-card b {
  font-weight: 400;
}

.realm-card small {
  margin: 0 6px;
  color: rgba(255, 255, 255, 0.15);
  font-size: 24px;
}

.realm-card dl {
  display: grid;
  gap: 1px;
  background: rgba(194, 147, 61, 0.12);
  margin: 36px 0 0;
}

.realm-card dl div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  background: none;
  border-bottom: 1px dashed rgba(194, 147, 61, 0.15);
}

.realm-card dl div:last-child {
  border-bottom: none;
}

.realm-card dt {
  color: var(--muted);
  font-size: 12px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.realm-card dd {
  margin: 0;
  font-weight: 600;
  color: var(--gold-soft);
  font-size: 13px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.section-block,
.season-panel {
  width: min(1260px, calc(100% - 48px));
  margin: 0 auto;
}

.section-block {
  padding: 140px 0;
}

.rune-strip {
  margin-top: -60px;
  padding-top: 0;
  position: relative;
  z-index: 20;
}

.rune-strip > div {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid rgba(194, 147, 61, 0.15);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.rune-stat {
  padding: 40px 36px;
  background: #06090e;
  border-right: 1px solid rgba(194, 147, 61, 0.08);
  transition: all 0.4s var(--ease-out);
}

.rune-stat:last-child {
  border-right: none;
}

.rune-stat:hover {
  background: #090d15;
}

.rune-stat strong {
  display: block;
  font-size: 28px;
  font-weight: 400;
  color: #ffffff;
  font-family: Georgia, serif;
}

.rune-stat span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.5px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.section-heading {
  max-width: 560px;
  margin-bottom: 64px;
}

.section-heading h2,
.season-panel h2,
.page-hero h1 {
  margin: 16px 0 0;
  font-size: clamp(30px, 4.5vw, 44px);
  font-weight: 400;
  line-height: 1.2;
  color: #ffffff;
}

.section-heading p:not(.eyebrow),
.season-panel p,
.page-hero p:not(.eyebrow) {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.split-section {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 80px;
  align-items: start;
}

.sticky-heading {
  position: sticky;
  top: 140px;
}

.class-grid,
.dungeon-grid,
.news-grid,
.codex-grid,
.rule-grid,
.timeline {
  display: grid;
  gap: 32px;
}

.class-grid { 
  grid-template-columns: repeat(2, 1fr); 
}

.dungeon-grid, .news-grid, .codex-grid, .rule-grid, .timeline { 
  grid-template-columns: repeat(3, 1fr); 
}

.class-card,
.dungeon-card,
.news-card,
.codex-card,
.rule-card,
.timeline article {
  position: relative;
  padding: 44px 36px;
  border-bottom: 2px solid rgba(194, 147, 61, 0.15);
  background: var(--panel);
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  transition: all 0.5s var(--ease-out);
}

.class-card::before,
.dungeon-card::before,
.news-card::before,
.codex-card::before,
.rule-card::before,
.timeline article::before {
  display: none;
}

.class-card:hover,
.dungeon-card:hover,
.news-card:hover,
.codex-card:hover,
.rule-card:hover,
.timeline article:hover {
  border-bottom-color: var(--teal);
  background: #080c14;
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

.class-card > *,
.dungeon-card > *,
.news-card > *,
.codex-card > *,
.rule-card > *,
.timeline article > * {
  position: relative;
  z-index: 1;
}

.class-mark,
.dungeon-card span,
.codex-card span,
.rule-card span,
.timeline span,
.news-card time {
  display: inline-flex;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  font-family: "Courier New", Courier, monospace;
  text-transform: uppercase;
  letter-spacing: 2px;
  border: none;
  background: none;
  padding: 0;
}

.class-card h3,
.dungeon-card h3,
.news-card h3,
.codex-card h2,
.rule-card h2,
.timeline h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 400;
  color: #ffffff;
}

.class-card strong {
  display: block;
  margin-top: 8px;
  color: var(--gold-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.class-card p,
.dungeon-card p,
.news-card p,
.codex-card p,
.rule-card p,
.timeline p {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.season-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 60px;
  padding: 64px 56px;
  border: 1px solid rgba(107, 59, 199, 0.2);
  background: radial-gradient(circle at top left, rgba(107, 59, 199, 0.06), transparent 60%), #05080d;
  box-shadow: var(--shadow);
}

.season-panel h2 {
  color: #ffffff;
}

.join-panel {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 80px;
  padding: 64px 56px;
  border: 1px solid rgba(194, 147, 61, 0.15);
  background: #05080d;
  box-shadow: var(--shadow);
}

.join-panel h2 {
  margin: 16px 0 0;
  font-size: clamp(28px, 4vw, 40px);
  color: #ffffff;
}

.join-steps {
  display: grid;
  gap: 24px;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.join-steps li {
  position: relative;
  padding: 0 0 0 56px;
  border: none;
  background: none;
  counter-increment: step;
}

.join-steps li::before {
  position: absolute;
  top: 2px;
  left: 0;
  display: grid;
  width: 32px;
  height: 24px;
  place-items: center;
  color: var(--subtle);
  border-bottom: 1px solid var(--subtle);
  background: none;
  content: counter(step, decimal-leading-zero);
  font-size: 13px;
  font-family: "Courier New", monospace;
}

.join-steps strong {
  font-size: 16px;
  font-weight: 400;
  color: #ffffff;
}

.join-steps p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.qr-card {
  display: grid;
  justify-items: center;
  align-self: start;
  padding: 0;
  border: none;
  background: none;
}

.qr-frame {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(194, 147, 61, 0.15);
  background: var(--bg-dark);
}

.qr-placeholder {
  padding: 8px 16px;
  border: 1px solid rgba(194, 147, 61, 0.2);
  color: var(--gold-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}

.qr-frame.has-image {
  border: 6px solid #ffffff;
}

.qr-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qr-card strong {
  margin-top: 24px;
  font-size: 15px;
  font-weight: 400;
  color: #ffffff;
  letter-spacing: 1px;
}

.qr-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.community-links {
  display: grid;
  width: 100%;
  gap: 12px;
  margin-top: 32px;
}

.community-links a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(194, 147, 61, 0.2);
  color: var(--gold-soft);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
}

.community-links a:hover {
  background: var(--gold-soft);
  color: var(--bg-dark);
}

.subpage-main {
  padding-top: 140px;
}

.page-hero {
  width: min(1260px, calc(100% - 48px));
  margin: 0 auto;
  padding: 80px 0 48px;
  border: none;
  border-bottom: 1px solid rgba(194, 147, 61, 0.15);
  background: none;
  box-shadow: none;
}

.crumb-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 24px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  border: none;
  background: none;
  padding: 0;
}

.crumb-link:hover {
  color: #ffffff;
  text-shadow: 0 0 4px var(--teal);
}

.site-footer {
  display: flex;
  width: min(1260px, calc(100% - 48px));
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 80px auto 0;
  padding: 40px 0 60px;
  color: var(--subtle);
  font-size: 13px;
  border-top: 1px solid rgba(194, 147, 61, 0.1);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.site-footer strong {
  color: #ffffff;
  font-weight: 600;
}

.site-footer span {
  margin-left: 12px;
}

.site-footer code {
  color: var(--gold-soft);
  font-family: "Courier New", monospace;
}

.site-footer a {
  color: var(--teal);
  font-weight: 600;
}

.toast {
  position: fixed;
  right: 40px;
  bottom: 40px;
  z-index: 200;
  padding: 18px 28px;
  color: #ffffff;
  background: var(--bg-dark);
  border: 1px solid var(--teal);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.section-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.2s var(--ease-out), transform 1.2s var(--ease-out);
}

.section-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes portalDrift {
  0% { transform: scale(1) translate3d(0, 0, 0); }
  100% { transform: scale(1.04) translate3d(-10px, -4px, 0); }
}

@media (max-width: 960px) {
  .site-header {
    top: 16px;
    height: 60px;
    padding: 0 20px;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    left: 0;
    display: grid;
    gap: 4px;
    padding: 20px;
    border: 1px solid rgba(194, 147, 61, 0.15);
    background: rgba(3, 5, 8, 0.98);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.4s var(--ease-out);
    backdrop-filter: blur(20px);
  }

  .site-nav.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .site-nav a {
    height: 44px;
    justify-content: center;
  }

  .hero {
    min-height: auto;
    padding-top: 140px;
  }

  .hero-vignette {
    background:
      linear-gradient(180deg, rgba(3, 5, 8, 0.4), rgba(3, 5, 8, 0.9) 50%, var(--bg) 100%);
  }

  .realm-card {
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    margin-top: 48px;
    padding: 32px 24px;
  }

  .rune-strip > div,
  .split-section,
  .class-grid,
  .dungeon-grid,
  .news-grid,
  .codex-grid,
  .rule-grid,
  .timeline,
  .season-panel,
  .join-panel {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .sticky-heading {
    position: static;
  }

  .rune-strip { margin-top: -32px; }
  .rune-stat { border-right: none; border-bottom: 1px solid rgba(194, 147, 61, 0.08); }
  .rune-stat:last-child { border-bottom: none; }
  .season-panel { flex-direction: column; align-items: stretch; text-align: center; padding: 44px 32px; }
}

@media (max-width: 640px) {
  .site-header {
    width: calc(100% - 24px);
  }

  .hero {
    padding-right: 24px;
    padding-left: 24px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .hero-lead {
    font-size: 15px;
  }

  .hero-actions,
  .primary-action,
  .ghost-action,
  .season-panel a {
    width: 100%;
  }

  .primary-action {
    min-height: 60px;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
  }

  .primary-action strong {
    padding-left: 0;
    border-left: none;
  }

  .section-block {
    padding: 80px 0;
  }

  .season-panel,
  .join-panel,
  .page-hero {
    padding: 40px 24px;
  }

  .subpage-main {
    padding-top: 110px;
  }

  .site-footer {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  .site-footer span { margin-left: 0; }
}