/* Palette and geometry are sampled from the source key art (3200x1800):
   wall face rgb(27,26,32), mortar rgb(16,15,20), brick 96x48 = 3% x 1.5% of width. */
:root {
  --wall: #1b1a20;
  --wall-lit: #201f26;
  --mortar: #100f14;
  --ink: #08080c;
  --gold: #f0c068;
  --gold-dim: #b3853a;
  --bone: #f2f0f6;
  --muted: #928da0;
  --moonvane: #7a63c9;
  --wyldroot: #6aa84f;
  --ironvow: #b8393f;
  --mothcourt: #6d8ec9;
  --gothic: "Jacquard 12", serif;
  --pixel: "Silkscreen", "Courier New", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--pixel);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; }

/* ---------- top bar ---------- */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(14px, 4vw, 40px);
  background: linear-gradient(180deg, rgba(6, 6, 11, .92), transparent);
}

.mark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--bone);
  font-family: var(--gothic);
  font-size: 24px;
  text-decoration: none;
}

.mark img { image-rendering: pixelated; }

.xlink {
  display: flex;
  padding: 6px;
  color: #cfcada;
  transition: color .2s;
}

.xlink:hover { color: var(--gold); }

/* ---------- scene ---------- */

.scene {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
}

.wall {
  position: absolute;
  inset: 0;
  z-index: -3;
  background-color: var(--wall);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='48'%3E%3Crect width='96' height='48' fill='%231b1a20'/%3E%3Cg fill='%23100f14'%3E%3Crect y='45' width='96' height='3'/%3E%3Crect y='21' width='96' height='3'/%3E%3Crect x='0' y='24' width='3' height='21'/%3E%3Crect x='48' y='0' width='3' height='21'/%3E%3C/g%3E%3Cg fill='%23201f26'%3E%3Crect x='3' y='24' width='93' height='2'/%3E%3Crect x='51' y='0' width='45' height='2'/%3E%3Crect x='0' y='0' width='48' height='2'/%3E%3C/g%3E%3C/svg%3E");
  background-size: max(44px, 3vw) max(22px, 1.5vw);
}

.wall::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(58% 46% at 50% 46%, rgba(120, 96, 60, .10), transparent 72%),
    radial-gradient(118% 96% at 50% 48%, transparent 32%, rgba(4, 4, 8, .94) 100%);
}

/* stone gate, traced from the silhouette in the key art */
.gate {
  position: absolute;
  z-index: -2;
  bottom: 0;
  left: 30.03%;
  width: 39.94%;
  height: 91%;
}

.gate__stone { fill: #211f28; }
.gate__void { fill: #17161d; }

.floor {
  position: absolute;
  z-index: -1;
  inset: auto 0 0 0;
  height: 24%;
  background: linear-gradient(180deg, transparent, rgba(4, 4, 8, .96) 78%);
}

/* ---------- banners ---------- */
/* left/width match the source art; each sprite carries its own rope, so top: 0 */

.banners { position: absolute; inset: 0; z-index: 2; pointer-events: none; }

.banner {
  position: absolute;
  top: 0;
  height: auto;
  image-rendering: pixelated;
  transform-origin: 50% 0;
  animation: sway 7s ease-in-out infinite;
}

.banner--moonvane  { left: 7.00%;  width: max(58px, 9.75%); }
.banner--wyldroot  { left: 16.25%; width: max(58px, 10.31%); animation-delay: -1.8s; }
.banner--ironvow   { left: 74.38%; width: max(58px, 9.69%);  animation-delay: -3.4s; }
.banner--mothcourt { left: 84.00%; width: max(58px, 10.06%); animation-delay: -5.1s; }

@keyframes sway {
  0%, 100% { rotate: -.7deg; }
  50% { rotate: .7deg; }
}

/* ---------- torches ---------- */

.torch {
  position: absolute;
  z-index: 2;
  top: 42%;
  width: max(22px, 2.34%);
}

.torch--left { left: 7.47%; }
.torch--right { left: 90.19%; }

.torch img {
  position: relative;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.torch__glow {
  position: absolute;
  left: 50%;
  top: 22%;
  width: 900%;
  aspect-ratio: 1;
  translate: -50% -50%;
  background: radial-gradient(circle, rgba(246, 178, 74, .30), rgba(246, 178, 74, .10) 34%, transparent 68%);
  animation: flicker 2.4s ease-in-out infinite;
}

@keyframes flicker {
  0%, 100% { opacity: 1; scale: 1; }
  28% { opacity: .82; scale: .96; }
  52% { opacity: 1.05; scale: 1.03; }
  74% { opacity: .88; scale: .98; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 0 clamp(16px, 6vw, 40px);
}

.hero__brand {
  margin: 0;
  font-family: var(--gothic);
  font-weight: 400;
  font-size: clamp(34px, 6vw, 76px);
  color: var(--bone);
  text-shadow: 3px 3px 0 rgba(0, 0, 0, .8);
}

.hero__headline {
  margin: clamp(6px, 1.4vh, 18px) 0 0;
  font-family: var(--gothic);
  font-weight: 400;
  font-size: clamp(56px, 14vw, 190px);
  line-height: .95;
  letter-spacing: .02em;
  background: linear-gradient(180deg, #ffe9b0, var(--gold) 48%, #c9863a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 26px rgba(242, 168, 60, .35)) drop-shadow(3px 4px 0 rgba(0, 0, 0, .55));
}

.hero__rule {
  width: min(560px, 74%);
  height: 2px;
  margin: clamp(14px, 3vh, 30px) auto clamp(12px, 2vh, 22px);
  background: linear-gradient(90deg, transparent, var(--gold-dim) 18%, var(--gold-dim) 82%, transparent);
}

.hero__tagline {
  margin: 0;
  font-size: clamp(10px, 1.5vw, 17px);
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(242, 168, 60, .35);
}

.hero__tagline span { color: var(--gold-dim); }

.hero__note {
  margin: clamp(16px, 3vh, 28px) 0 0;
  font-size: clamp(9px, 1.1vw, 12px);
  letter-spacing: .14em;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: clamp(18px, 3vh, 30px);
  padding: 13px 22px;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: var(--gold);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .6), inset 0 -3px 0 rgba(0, 0, 0, .18);
  transition: translate .12s, box-shadow .12s;
}

.btn:hover { translate: 2px 2px; box-shadow: 2px 2px 0 rgba(0, 0, 0, .6), inset 0 -3px 0 rgba(0, 0, 0, .18); }

/* ---------- factions ---------- */

.factions {
  position: relative;
  padding: clamp(60px, 12vh, 130px) clamp(16px, 6vw, 64px) clamp(40px, 8vh, 90px);
  background: #101015;
  border-top: 2px solid #23232c;
}

.section-title {
  margin: 0 0 clamp(28px, 5vh, 54px);
  text-align: center;
  font-family: var(--gothic);
  font-weight: 400;
  font-size: clamp(32px, 5vw, 60px);
  color: var(--bone);
}

.faction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: clamp(14px, 2vw, 24px);
  max-width: 1180px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.faction {
  padding: 30px 22px 32px;
  text-align: center;
  background: #16161d;
  border: 2px solid #23232c;
  transition: border-color .2s, translate .2s;
}

.faction:hover { translate: 0 -4px; }
.faction--moonvane:hover { border-color: var(--moonvane); }
.faction--wyldroot:hover { border-color: var(--wyldroot); }
.faction--ironvow:hover { border-color: var(--ironvow); }
.faction--mothcourt:hover { border-color: var(--mothcourt); }

.faction img {
  height: 56px;
  width: auto;
  margin: 0 auto 20px;
  image-rendering: pixelated;
}

.faction h3 {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--bone);
}

.faction p {
  margin: 0;
  font-size: 10px;
  line-height: 1.9;
  color: var(--muted);
}

.banner-art {
  max-width: 1180px;
  margin: clamp(40px, 7vh, 80px) auto 0;
}

.banner-art img {
  width: 100%;
  height: auto;
  border: 2px solid #23232c;
  image-rendering: pixelated;
}

/* ---------- footer ---------- */

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 30px 16px 40px;
  background: var(--ink);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer img { image-rendering: pixelated; opacity: .85; }
.footer p { margin: 0; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--gold); }

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .banner--wyldroot, .banner--ironvow { display: none; }
  .banner--moonvane { left: 3%; }
  .banner--mothcourt { left: auto; right: 3%; }
  .torch--left { left: 3%; }
  .torch--right { left: auto; right: 3%; }
  .gate { left: 15%; width: 70%; }
  .hero__tagline { letter-spacing: .26em; }
}

@media (prefers-reduced-motion: reduce) {
  .banner, .torch__glow { animation: none; }
}
