:root {
  --bg: #060504;
  --bg-soft: #110d09;
  --panel: rgba(20, 14, 9, 0.82);
  --panel-strong: rgba(28, 18, 10, 0.94);
  --gold: #d9a441;
  --gold-bright: #ffd277;
  --gold-dark: #7a4d13;
  --cream: #f7ead1;
  --muted: #b8a88d;
  --line: rgba(217, 164, 65, 0.34);
  --shadow: rgba(217, 164, 65, 0.18);
  --danger: #6d1515;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  background:
    radial-gradient(circle at 20% 10%, rgba(122, 77, 19, 0.28), transparent 34rem),
    radial-gradient(circle at 82% 4%, rgba(109, 21, 21, 0.22), transparent 30rem),
    linear-gradient(135deg, #030202 0%, var(--bg) 42%, #120b07 100%);
  font-family: "Exo 2", system-ui, sans-serif;
  overflow-x: hidden;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  z-index: -2;
}

body::before {
  background-image:
    linear-gradient(rgba(217, 164, 65, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217, 164, 65, 0.05) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at center, black, transparent 72%);
}

body::after {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.82), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.82));
  z-index: 4;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.cursor-glow {
  position: fixed;
  left: var(--x, 50%);
  top: var(--y, 50%);
  width: 28rem;
  height: 28rem;
  pointer-events: none;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(217, 164, 65, 0.14), transparent 62%);
  filter: blur(6px);
  z-index: 1;
}

.site-header {
  position: fixed;
  top: 22px;
  left: 22px;
  z-index: 20;
  display: grid;
  width: 238px;
  height: calc(100vh - 44px);
  padding: 16px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(8, 6, 4, 0.76);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35), inset 0 0 20px rgba(217, 164, 65, 0.06);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold-bright);
  background: radial-gradient(circle, rgba(255, 210, 119, 0.2), rgba(0, 0, 0, 0.1));
  font-family: "Exo 2", system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  box-shadow: 0 0 30px var(--shadow);
}

.brand strong,
.brand small,
h1,
h2,
h3,
.eyebrow,
.doc-tab,
.rule-item span {
  font-family: "Exo 2", system-ui, sans-serif;
  letter-spacing: 0.025em;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1;
}

.brand strong {
  font-size: 1.05rem;
}

.brand small {
  margin-top: 3px;
  color: var(--gold);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.main-nav {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.main-nav a {
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: var(--muted);
  font-size: 0.9rem;
  transition: 220ms ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--gold-bright);
  border-color: rgba(217, 164, 65, 0.22);
  background: rgba(217, 164, 65, 0.1);
}

.main-nav .nav-cta {
  color: #120b07;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  font-weight: 800;
  text-align: center;
}

.nav-toggle {
  display: none;
  border: 0;
  background: transparent;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  margin: 5px 0;
  background: var(--gold-bright);
}

.sidebar-socials {
  display: grid;
  gap: 9px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(217, 164, 65, 0.2);
}

.sidebar-socials a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(217, 164, 65, 0.16);
  border-radius: 15px;
  color: var(--muted);
  background: rgba(217, 164, 65, 0.05);
  font-size: 0.86rem;
  font-weight: 700;
  transition: transform 220ms ease, color 220ms ease, border-color 220ms ease, background 220ms ease;
}

.sidebar-socials a:hover,
.sidebar-socials a:focus-visible {
  color: var(--gold-bright);
  border-color: rgba(255, 210, 119, 0.62);
  background: rgba(217, 164, 65, 0.12);
  transform: translateX(4px);
}

.sidebar-socials svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: currentColor;
  filter: drop-shadow(0 0 10px rgba(217, 164, 65, 0.18));
}

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

.content-section,
.hero,
.join-section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 42px;
  min-height: 100vh;
  padding: 176px 44px 70px;
  align-items: center;
  overflow: hidden;
}

.section-frame {
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(217, 164, 65, 0.11), transparent 28%),
    linear-gradient(180deg, rgba(20, 14, 9, 0.78), rgba(6, 5, 4, 0.64));
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(255, 210, 119, 0.07);
}

.section-frame::before,
.section-frame::after {
  position: absolute;
  width: 52px;
  height: 52px;
  border-color: var(--gold);
  opacity: 0.75;
  content: "";
}

.section-frame::before {
  top: 16px;
  left: 16px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.section-frame::after {
  right: 16px;
  bottom: 16px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.moon {
  position: absolute;
  top: 120px;
  right: 16%;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 32%, #fff0c4, var(--gold-bright) 42%, #7f571e 72%);
  box-shadow: 0 0 90px rgba(255, 210, 119, 0.24);
  animation: floatMoon 8s ease-in-out infinite;
}

.spire {
  position: absolute;
  bottom: 0;
  width: 130px;
  background: linear-gradient(180deg, transparent, #050302 36%, #0c0704);
  clip-path: polygon(50% 0, 60% 22%, 76% 22%, 70% 38%, 100% 100%, 0 100%, 30% 38%, 24% 22%, 40% 22%);
  opacity: 0.64;
}

.spire-one {
  right: 8%;
  height: 440px;
}

.spire-two {
  right: 24%;
  height: 310px;
  opacity: 0.44;
}

.spire-three {
  left: 4%;
  height: 250px;
  opacity: 0.32;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--gold-bright);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 22px;
  font-size: clamp(3.3rem, 8vw, 7.8rem);
  line-height: 0.91;
  text-wrap: balance;
  text-shadow: 0 0 38px rgba(217, 164, 65, 0.18);
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(2.1rem, 4vw, 4.2rem);
  line-height: 1;
}

h3 {
  margin-bottom: 12px;
  color: var(--gold-bright);
  font-size: 1.18rem;
}

p,
li {
  color: var(--muted);
  line-height: 1.8;
}

.hero-copy {
  max-width: 680px;
  font-size: 1.08rem;
}

.hero-actions,
.join-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font: 800 0.92rem "Exo 2", system-ui, sans-serif;
  letter-spacing: 0.02em;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.btn::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  transform: translateX(-120%);
  transition: transform 700ms ease;
  content: "";
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 44px rgba(217, 164, 65, 0.18);
}

.btn:hover::before {
  transform: translateX(120%);
}

.btn.primary {
  color: #160f07;
  border-color: rgba(255, 210, 119, 0.64);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold) 48%, #9b6318);
}

.btn.ghost {
  color: var(--gold-bright);
  background: rgba(217, 164, 65, 0.08);
}

.server-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 620px;
  margin-top: 48px;
}

.server-stats div,
.hero-card,
.feature-card,
.doc-card,
.character-card,
.rule-item {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: inset 0 0 30px rgba(217, 164, 65, 0.05);
  backdrop-filter: blur(14px);
}

.server-stats div {
  padding: 17px;
  border-radius: 18px;
}

.server-stats strong,
.server-stats span {
  display: block;
}

.server-stats strong {
  color: var(--gold-bright);
  font-family: "Exo 2", system-ui, sans-serif;
}

.server-stats span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.8rem;
}

.hero-card {
  position: relative;
  padding: 34px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(28, 18, 10, 0.92), rgba(9, 7, 5, 0.84));
}

.hero-card::before {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(217, 164, 65, 0.24);
  border-radius: 20px;
  content: "";
}

.card-crown {
  display: grid;
  width: 62px;
  height: 62px;
  margin-bottom: 28px;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold-bright);
  font-size: 1.6rem;
  animation: pulseGold 2.8s ease-in-out infinite;
}

.hero-card a {
  position: relative;
  z-index: 1;
  color: var(--gold-bright);
  font-weight: 800;
}

.content-section {
  padding: 110px 0;
}

.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 34px;
}

.section-heading {
  max-width: 760px;
}

.section-heading.centered {
  margin: 0 auto 44px;
  text-align: center;
}

.about-panel {
  align-self: end;
  padding: 28px;
  border-left: 1px solid var(--line);
}

.feature-grid,
.character-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-column: 1 / -1;
  gap: 18px;
}

.feature-card,
.character-card,
.rule-item {
  position: relative;
  padding: 28px;
  overflow: hidden;
  border-radius: 24px;
  transition: transform 260ms ease, border-color 260ms ease, background 260ms ease;
}

.feature-card::after,
.character-card::after,
.rule-item::after {
  position: absolute;
  inset: auto -30% -42% auto;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(217, 164, 65, 0.12);
  filter: blur(16px);
  content: "";
}

.feature-card:hover,
.character-card:hover,
.rule-item:hover {
  transform: translateY(-7px);
  border-color: rgba(255, 210, 119, 0.72);
  background: var(--panel-strong);
}

.feature-card span {
  display: inline-block;
  margin-bottom: 32px;
  color: var(--gold);
  font-family: "Exo 2", system-ui, sans-serif;
  font-size: 2.4rem;
  opacity: 0.55;
}

.story-section,
.character-section,
.join-section {
  position: relative;
  padding: 80px 42px;
}

.timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.timeline::before {
  position: absolute;
  top: 34px;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  content: "";
}

.timeline-item {
  position: relative;
  padding: 76px 24px 24px;
}

.timeline-item::before {
  position: absolute;
  top: 20px;
  left: 24px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--gold-bright);
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 26px var(--shadow);
  content: "";
}

.timeline-item time {
  color: var(--gold);
  font-family: "Exo 2", system-ui, sans-serif;
  font-weight: 800;
}

.doc-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
}

.doc-tabs {
  display: grid;
  gap: 12px;
  align-content: start;
}

.doc-tab {
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(217, 164, 65, 0.05);
  cursor: pointer;
  text-align: left;
  transition: 220ms ease;
}

.doc-tab.active,
.doc-tab:hover {
  color: #160f07;
  border-color: var(--gold-bright);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
}

.doc-card {
  min-height: 370px;
  padding: 34px;
  border-radius: 28px;
}

.doc-content {
  display: none;
  animation: fadeSlide 360ms ease both;
}

.doc-content.active {
  display: block;
}

.doc-content ul {
  padding-left: 20px;
}

.doc-content li::marker {
  color: var(--gold);
}

.character-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portrait {
  height: 220px;
  margin: -8px -8px 24px;
  border: 1px solid rgba(217, 164, 65, 0.24);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 26%, rgba(255, 210, 119, 0.58), transparent 12%),
    linear-gradient(150deg, rgba(217, 164, 65, 0.22), rgba(109, 21, 21, 0.18)),
    linear-gradient(180deg, #211407, #050302);
  clip-path: polygon(0 0, 100% 0, 100% 86%, 50% 100%, 0 86%);
}

.portrait.noble {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 210, 119, 0.62), transparent 13%),
    linear-gradient(135deg, #32200c, #080504 72%);
}

.portrait.outlaw {
  background:
    radial-gradient(circle at 50% 18%, rgba(217, 164, 65, 0.5), transparent 13%),
    linear-gradient(135deg, #250707, #050302 72%);
}

.portrait.medic {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 228, 167, 0.58), transparent 13%),
    linear-gradient(135deg, #232018, #060504 72%);
}

.portrait.detective {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 210, 119, 0.45), transparent 13%),
    linear-gradient(135deg, #101721, #050302 72%);
}

.rules-list {
  display: grid;
  gap: 16px;
}

.rule-item {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 22px;
  align-items: center;
}

.rule-item span {
  color: var(--gold-bright);
  font-size: 1.25rem;
}

.rule-item p {
  margin-bottom: 0;
}

.join-section {
  margin-bottom: 84px;
  text-align: center;
}

.join-section p {
  max-width: 650px;
  margin-right: auto;
  margin-left: auto;
}

.join-actions {
  justify-content: center;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
  border-top: 1px solid var(--line);
}

@media (min-width: 981px) and (max-width: 1500px) {
  .hero-content,
  .about-grid > .section-heading,
  .about-panel {
    padding-left: 250px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

.site-footer p,
.site-footer a {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--gold-bright);
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 700ms ease, transform 700ms ease;
}

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

.delay-1 {
  transition-delay: 120ms;
}

.delay-2 {
  transition-delay: 220ms;
}

.delay-3 {
  transition-delay: 320ms;
}

@keyframes floatMoon {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-18px);
  }
}

@keyframes pulseGold {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(217, 164, 65, 0);
  }
  50% {
    box-shadow: 0 0 34px rgba(217, 164, 65, 0.36);
  }
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .site-header {
    top: 18px;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1180px, calc(100% - 32px));
    height: auto;
    padding: 12px 14px;
    transform: translateX(-50%);
    border-radius: 28px;
  }

  .nav-toggle {
    display: block;
  }

  .sidebar-socials {
    display: none;
  }

  .main-nav {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    display: grid;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(8, 6, 4, 0.94);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: 220ms ease;
  }

  .content-section,
  .hero,
  .join-section,
  .site-footer {
    width: min(1180px, calc(100% - 32px));
    margin-right: auto;
    margin-left: auto;
  }

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

  .hero,
  .about-grid,
  .doc-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 154px 24px 54px;
  }

  .hero-card {
    max-width: 520px;
  }

  .feature-grid,
  .timeline,
  .character-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .content-section {
    padding: 78px 0;
  }

  .hero {
    width: 100%;
    min-height: auto;
    padding: 142px 18px 44px;
    border-right: 0;
    border-left: 0;
  }

  .moon {
    top: 118px;
    right: -24px;
    width: 108px;
    height: 108px;
  }

  h1 {
    font-size: clamp(3rem, 18vw, 4.7rem);
  }

  .server-stats,
  .feature-grid,
  .timeline,
  .character-grid,
  .rule-item {
    grid-template-columns: 1fr;
  }

  .story-section,
  .character-section,
  .join-section {
    padding: 58px 20px;
  }

  .timeline::before {
    display: none;
  }

  .doc-card {
    padding: 24px;
  }

  .site-footer {
    display: grid;
    gap: 12px;
  }
}

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