:root {
  --night: #16130f;
  --night-2: #221a16;
  --ink: #211a14;
  --parchment: #f4ead7;
  --parchment-2: #e9d8b8;
  --bone: #fff8ea;
  --ember: #c35f35;
  --gold: #d7a84b;
  --leaf: #3f8f6c;
  --aether: #54b9bd;
  --rose: #b65b72;
  --line-dark: rgba(255, 248, 234, 0.2);
  --line-light: rgba(33, 26, 20, 0.16);
  --shadow: 0 22px 70px rgba(8, 7, 5, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--night);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(215, 168, 75, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(215, 168, 75, 0.08) 1px, transparent 1px),
    linear-gradient(135deg, #17120f 0%, #241913 42%, #143d34 100%);
  background-size: 56px 56px, 56px 56px, auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 36%, rgba(215, 168, 75, 0.12) 36% 37%, transparent 37% 100%),
    linear-gradient(245deg, transparent 0 44%, rgba(84, 185, 189, 0.1) 44% 45%, transparent 45% 100%);
  opacity: 0.65;
}

a {
  color: inherit;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--night);
  color: var(--bone);
  transition: opacity 680ms ease, visibility 680ms ease;
}

.loading-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 54%, rgba(84, 185, 189, 0.28), transparent 34%),
    linear-gradient(180deg, rgba(22, 19, 15, 0.08), rgba(22, 19, 15, 0.9));
  z-index: 1;
}

.loading-world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.58;
  filter: saturate(1.08) contrast(1.06);
  transform: scale(1.04);
  animation: loading-drift 3800ms ease-in-out infinite;
}

.loading-vault {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(86vw, 420px);
  padding: 34px 24px;
  border: 1px solid rgba(215, 168, 75, 0.54);
  border-radius: 8px;
  background: rgba(22, 19, 15, 0.72);
  box-shadow: 0 0 80px rgba(84, 185, 189, 0.24), inset 0 0 46px rgba(215, 168, 75, 0.08);
  text-align: center;
}

.loading-vault::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px dashed rgba(84, 185, 189, 0.32);
  border-radius: 8px;
}

.loading-vault img {
  width: 104px;
  height: 104px;
  object-fit: contain;
  filter: drop-shadow(0 0 24px rgba(84, 185, 189, 0.48));
  animation: crest-float 2400ms ease-in-out infinite;
}

.loading-vault p {
  width: 100%;
  margin: 0;
  color: var(--bone);
  font-size: clamp(1.72rem, 7vw, 3.15rem);
  font-weight: 950;
  line-height: 1;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.loading-vault span {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body.is-loaded .loading-screen {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line-dark);
  background: rgba(22, 19, 15, 0.9);
  color: var(--bone);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--bone);
  font-weight: 900;
  text-decoration: none;
}

.brand img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(84, 185, 189, 0.36));
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-nav a {
  min-height: 38px;
  padding: 10px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(255, 248, 234, 0.82);
  text-decoration: none;
}

.site-nav a:hover {
  border-color: rgba(215, 168, 75, 0.48);
  color: var(--bone);
  background: rgba(255, 248, 234, 0.08);
}

.hero {
  position: relative;
  display: grid;
  min-height: 640px;
  align-items: start;
  justify-items: center;
  padding: clamp(34px, 5vw, 56px) clamp(18px, 5vw, 72px) 52px;
  text-align: center;
  overflow: hidden;
}

.hero-frame {
  position: relative;
  isolation: isolate;
  width: min(100%, 980px);
  padding: clamp(32px, 6vw, 64px);
  border: 1px solid rgba(215, 168, 75, 0.45);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 248, 234, 0.12), rgba(255, 248, 234, 0.04)),
    rgba(22, 19, 15, 0.78);
  box-shadow: var(--shadow);
  color: var(--bone);
  overflow: hidden;
  animation: guardian-rise 780ms ease-out both;
}

.hero-spell-art {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.2;
  filter: saturate(1.1) contrast(1.08);
  transform: scale(1.03);
  animation: image-breathe 8200ms ease-in-out infinite;
}

.hero-frame::before,
.hero-frame::after {
  content: "";
  position: absolute;
  inset: 16px;
  pointer-events: none;
  border: 1px solid rgba(84, 185, 189, 0.22);
}

.hero-frame::after {
  inset: 28px;
  border-color: rgba(195, 95, 53, 0.22);
  animation: frame-glow 2200ms ease-in-out 500ms both;
}

.magic-motes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.magic-motes span {
  position: absolute;
  display: block;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(215, 168, 75, 0.85);
  background: rgba(84, 185, 189, 0.34);
  box-shadow: 0 0 22px rgba(84, 185, 189, 0.65);
  opacity: 0;
  transform: rotate(45deg);
  animation: mote-rise 2600ms ease-out both;
}

.magic-motes span:nth-child(1) {
  left: 14%;
  top: 72%;
  animation-delay: 120ms;
}

.magic-motes span:nth-child(2) {
  left: 28%;
  top: 84%;
  width: 7px;
  height: 7px;
  animation-delay: 360ms;
}

.magic-motes span:nth-child(3) {
  left: 72%;
  top: 78%;
  animation-delay: 220ms;
}

.magic-motes span:nth-child(4) {
  left: 84%;
  top: 64%;
  width: 6px;
  height: 6px;
  animation-delay: 520ms;
}

.magic-motes span:nth-child(5) {
  left: 50%;
  top: 88%;
  width: 8px;
  height: 8px;
  animation-delay: 680ms;
}

.sigil-ring {
  position: relative;
  display: grid;
  width: clamp(124px, 16vw, 166px);
  height: clamp(124px, 16vw, 166px);
  place-items: center;
  margin: 0 auto 18px;
  border: 1px solid rgba(215, 168, 75, 0.58);
  border-radius: 50%;
  box-shadow: inset 0 0 0 10px rgba(255, 248, 234, 0.04), 0 0 42px rgba(84, 185, 189, 0.28);
  animation: sigil-wake 1300ms ease-out 240ms both;
}

.sigil-ring span {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid var(--gold);
  transform: rotate(45deg);
  background: var(--night);
}

.sigil-ring span:nth-child(1) {
  top: -5px;
}

.sigil-ring span:nth-child(2) {
  right: -5px;
}

.sigil-ring span:nth-child(3) {
  bottom: -5px;
}

.sigil-ring span:nth-child(4) {
  left: -5px;
}

.hero-profile {
  position: relative;
  z-index: 1;
  width: 82%;
  height: 82%;
  object-fit: contain;
  transform: translateY(0);
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.34));
  animation: crest-float 3200ms ease-in-out 1000ms infinite;
}

.crest-line,
.section-kicker {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  color: var(--bone);
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 0.9;
  letter-spacing: 0;
  text-shadow: 0 5px 0 rgba(0, 0, 0, 0.24);
}

.hero-lede {
  max-width: 760px;
  margin: 0 auto;
  color: rgba(255, 248, 234, 0.84);
  font-size: clamp(1.1rem, 2vw, 1.42rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 32px;
}

.button,
.relic-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 8px;
  font-weight: 950;
  text-decoration: none;
}

.button {
  padding: 0 18px;
  border: 1px solid rgba(215, 168, 75, 0.52);
}

.button.primary {
  background: var(--gold);
  color: var(--night);
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.24);
}

.button.secondary {
  background: rgba(255, 248, 234, 0.08);
  color: var(--bone);
}

@keyframes guardian-rise {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes loading-drift {
  0%,
  100% {
    transform: scale(1.04) translateY(0);
  }
  50% {
    transform: scale(1.08) translateY(-10px);
  }
}

@keyframes image-breathe {
  0%,
  100% {
    transform: scale(1.02) translate3d(0, 0, 0);
    filter: saturate(1) brightness(1);
  }
  50% {
    transform: scale(1.06) translate3d(0, -6px, 0);
    filter: saturate(1.1) brightness(1.04);
  }
}

@keyframes image-drift {
  0%,
  100% {
    transform: scale(1.02) translate3d(0, 0, 0);
    filter: saturate(1) brightness(1);
  }
  50% {
    transform: scale(1.055) translate3d(-8px, -5px, 0);
    filter: saturate(1.12) brightness(1.05);
  }
}

@keyframes shield-pulse {
  0%,
  100% {
    transform: scale(1.02);
    filter: saturate(1) brightness(1);
  }
  50% {
    transform: scale(1.05);
    filter: saturate(1.16) brightness(1.08);
  }
}

@keyframes frame-glow {
  0% {
    box-shadow: inset 0 0 0 rgba(215, 168, 75, 0);
  }
  48% {
    box-shadow: inset 0 0 40px rgba(215, 168, 75, 0.18);
  }
  100% {
    box-shadow: inset 0 0 18px rgba(215, 168, 75, 0.08);
  }
}

@keyframes sigil-wake {
  from {
    opacity: 0;
    transform: scale(0.84) rotate(-10deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes crest-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

@keyframes mote-rise {
  0% {
    opacity: 0;
    transform: translateY(0) rotate(45deg) scale(0.7);
  }
  16% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-190px) rotate(135deg) scale(1.2);
  }
}

@keyframes rune-pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: translateY(0) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateY(-5px) scale(1.08);
  }
}

.banner-section {
  padding: 0 clamp(18px, 5vw, 72px) 78px;
}

.banner-frame {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 12px;
  border: 1px solid rgba(215, 168, 75, 0.42);
  border-radius: 8px;
  background: rgba(255, 248, 234, 0.08);
  box-shadow: var(--shadow);
}

.main-banner {
  display: block;
  width: 100%;
  border-radius: 6px;
}

.banner-frame figcaption {
  margin: 10px 4px 0;
  color: rgba(255, 248, 234, 0.72);
  font-size: 0.9rem;
  text-align: center;
}

.content-band,
.rules-band,
.notice-band {
  padding: 76px clamp(18px, 5vw, 72px);
}

.quest-board {
  position: relative;
  background:
    linear-gradient(90deg, rgba(33, 26, 20, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(33, 26, 20, 0.07) 1px, transparent 1px),
    var(--parchment);
  background-size: 42px 42px, 42px 42px, auto;
  overflow: hidden;
}

.quest-board::before,
.rules-band::before {
  content: "";
  position: absolute;
  inset: 24px clamp(18px, 5vw, 72px);
  pointer-events: none;
  border: 1px dashed rgba(33, 26, 20, 0.18);
  border-radius: 8px;
}

.rune-row {
  display: flex;
  justify-content: center;
  gap: clamp(16px, 4vw, 44px);
  margin: 0 auto 28px;
  color: rgba(195, 95, 53, 0.74);
  font-size: clamp(1.15rem, 2vw, 1.8rem);
  line-height: 1;
}

.rune-row span {
  display: inline-block;
  animation: rune-pulse 2600ms ease-in-out infinite;
}

.rune-row span:nth-child(2),
.rune-row span:nth-child(4) {
  color: rgba(63, 143, 108, 0.72);
  animation-delay: 320ms;
}

.rune-row span:nth-child(3) {
  color: rgba(215, 168, 75, 0.82);
  animation-delay: 640ms;
}

.rune-row.dark {
  color: rgba(22, 19, 15, 0.62);
}

.section-heading {
  max-width: 820px;
  margin: 0 auto 36px;
  text-align: center;
}

h2 {
  margin-bottom: 14px;
  color: var(--ink);
  font-size: clamp(2.1rem, 4.6vw, 4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.section-heading p,
.feature-card p,
.relic-copy p,
.notice-band p,
.site-footer p {
  color: rgba(33, 26, 20, 0.74);
  line-height: 1.65;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 1120px;
  margin: 0 auto;
}

.feature-card {
  position: relative;
  min-height: 238px;
  overflow: hidden;
  padding: 0 24px 24px;
  border: 2px solid rgba(33, 26, 20, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 248, 234, 0.82), rgba(233, 216, 184, 0.68)),
    var(--bone);
  box-shadow: 0 12px 0 rgba(33, 26, 20, 0.12);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.card-art {
  display: block;
  width: calc(100% + 48px);
  height: 180px;
  margin: 0 -24px 22px;
  object-fit: cover;
  border-bottom: 1px solid rgba(33, 26, 20, 0.14);
  transform: scale(1.02);
  animation: image-breathe 9200ms ease-in-out infinite;
}

.feature-card:nth-child(2) .card-art {
  animation-delay: -2200ms;
}

.feature-card:nth-child(3) .card-art {
  animation-delay: -4400ms;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 0 rgba(33, 26, 20, 0.12);
}

.card-rank {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid rgba(33, 26, 20, 0.24);
  border-radius: 50%;
  background: var(--night);
  color: var(--gold);
  font-weight: 950;
}

h3 {
  margin-bottom: 12px;
  color: var(--deep, #173b35);
  font-size: 1.3rem;
}

.relic-band {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(360px, 0.9fr) minmax(280px, 0.62fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding: 58px clamp(18px, 5vw, 72px);
  background:
    linear-gradient(135deg, rgba(84, 185, 189, 0.16), rgba(215, 168, 75, 0.12)),
    var(--night-2);
  color: var(--bone);
  overflow: hidden;
}

.relic-band::before {
  content: "";
  position: absolute;
  inset: 26px;
  pointer-events: none;
  border: 1px solid rgba(215, 168, 75, 0.22);
  border-radius: 8px;
}

.portal-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.portal-lines span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(58vw, 620px);
  aspect-ratio: 1;
  border: 1px solid rgba(84, 185, 189, 0.16);
  transform: translate(-50%, -50%) rotate(45deg);
}

.portal-lines span:nth-child(2) {
  width: min(44vw, 470px);
  border-color: rgba(215, 168, 75, 0.18);
  transform: translate(-50%, -50%) rotate(12deg);
}

.portal-lines span:nth-child(3) {
  width: min(30vw, 320px);
  border-color: rgba(195, 95, 53, 0.18);
  transform: translate(-50%, -50%) rotate(72deg);
}

.relic-band h2,
.relic-band p {
  color: var(--bone);
}

.relic-panel,
.relic-visual {
  position: relative;
  z-index: 1;
}

.relic-panel {
  align-self: center;
  display: grid;
  gap: 20px;
}

.relic-copy {
  position: relative;
  z-index: 1;
}

.relic-visual {
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(215, 168, 75, 0.38);
  border-radius: 8px;
  background: rgba(255, 248, 234, 0.08);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.relic-visual img {
  display: block;
  width: 100%;
  min-height: 300px;
  object-fit: cover;
  border-radius: 6px;
  transform: scale(1.02);
  animation: image-drift 10500ms ease-in-out infinite;
}

.relic-link {
  min-height: 94px;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 28px;
  border: 1px solid rgba(215, 168, 75, 0.38);
  background: rgba(255, 248, 234, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 248, 234, 0.04);
  transition: transform 180ms ease, background 180ms ease;
}

.relic-link:hover {
  transform: translateX(6px);
  background: rgba(255, 248, 234, 0.13);
}

.relic-link span {
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  font-weight: 950;
  color: rgba(255, 248, 234, 0.72);
}

.relic-link strong {
  font-size: clamp(1rem, 1.5vw, 1.3rem);
  color: var(--gold);
}

.rules-band {
  position: relative;
  background: var(--bone);
  overflow: hidden;
}

.rule-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  counter-reset: rules;
}

.rule-art {
  max-width: 920px;
  margin: 30px auto 0;
  padding: 10px;
  border: 1px solid rgba(33, 26, 20, 0.16);
  border-radius: 8px;
  background: rgba(255, 248, 234, 0.72);
  box-shadow: 0 18px 0 rgba(33, 26, 20, 0.1);
  overflow: hidden;
}

.rule-art img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 6px;
  transform: scale(1.02);
  animation: shield-pulse 7800ms ease-in-out infinite;
}

.rule-list li {
  min-height: 160px;
  padding: 22px;
  border: 1px solid var(--line-light);
  border-radius: 8px;
  background: var(--parchment);
  line-height: 1.55;
  counter-increment: rules;
  box-shadow: inset 0 -4px 0 rgba(215, 168, 75, 0.16);
}

.rule-list li::before {
  content: "Rule " counter(rules);
  display: block;
  margin-bottom: 12px;
  color: var(--ember);
  font-size: 0.8rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.notice-band {
  background: var(--ember);
}

.notice-band p {
  max-width: 930px;
  margin: 0 auto;
  color: var(--bone);
  font-weight: 850;
  text-align: center;
}

.site-footer {
  display: grid;
  gap: 8px;
  padding: 38px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line-dark);
  background: var(--night);
  color: var(--bone);
  text-align: center;
}

.site-footer p {
  max-width: 920px;
  margin: 0 auto;
  color: rgba(255, 248, 234, 0.78);
}

.site-footer a {
  color: var(--gold);
  font-weight: 950;
}

@media (max-width: 940px) {
  .feature-grid,
  .rule-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .relic-band {
    grid-template-columns: 1fr;
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .relic-visual img {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

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

  .hero-frame {
    padding: 30px 18px;
  }

  .feature-grid,
  .rule-list {
    grid-template-columns: 1fr;
  }

  .feature-card,
  .rule-list li {
    min-height: auto;
  }

  .card-art {
    height: 150px;
  }
}

@media (max-width: 520px) {
  .site-nav {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button,
  .relic-link {
    width: 100%;
  }

  .relic-link {
    align-items: flex-start;
    flex-direction: column;
  }

  .loading-vault {
    width: min(92vw, 360px);
    padding: 30px 18px;
  }

  .loading-vault p {
    font-size: clamp(1.55rem, 9vw, 2.25rem);
  }
}

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

  .magic-motes {
    display: none;
  }

  .loading-world {
    animation: none;
  }

  .hero-spell-art,
  .card-art,
  .relic-visual img,
  .rule-art img {
    animation: none;
  }
}
