:root {
  --bg: #141312;
  --panel: rgba(29, 28, 26, 0.88);
  --line: #4a4640;
  --line-soft: #3a3733;
  --gold: #c9b48a;
  --gold-hi: #dccba6;
  --text: #ece8e1;
  --dim: #959089;
  --fire: #c2553f;
  --earth: #8b6a4c;
  --earth-green: #7f9558;
  --water: #5b86ad;
  --wind: #e6e4e0;
  --radius: 10px;
  --max: 1100px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 50% 700px, #1f1d1b 0%, transparent 70%);
  color: var(--text);
  font: 15px/1.6 Inter, system-ui, sans-serif;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; }
ul { margin: 0; padding: 0; list-style: none; }

/* Flanking characters, like the classic portal */
.side {
  position: absolute;
  top: 720px;
  width: 520px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, #000 70%, transparent);
}
.side-left { left: calc(50% - 550px - 440px); }
.side-right { right: calc(50% - 550px - 440px); }
.side-2 { top: 1900px; }
@media (max-width: 1500px) { .side { opacity: 0.2; } }
@media (max-width: 1200px) { .side { display: none; } }

/* Hero */
.hero {
  position: relative;
  height: 640px;
  overflow: hidden;
}
.hero-art {
  position: absolute;
  inset: 0;
  background: #081e3b url(/img/hero-bg.webp?v=6) right center / cover no-repeat;
}
/* One transparent PNG per character, so each can be swapped on its own */
/* A fixed 860x640 stage at the right edge; positions match the original single-image hero
   (Fire behind and highest, Earth front left, Water front right, Wind floating behind on the right). */
.hero-chars { position: absolute; z-index: 1; top: 0; right: 0; width: 860px; height: 640px; }
.char { position: absolute; width: auto; animation: float 7s ease-in-out infinite alternate; }
.char-fire { left: 157px; top: 7px; height: 600px; z-index: 1; animation-delay: -2s; }
.char-wind { left: 520px; top: 0; height: 520px; z-index: 1; animation-delay: -1s; }
.char-earth { left: 15px; top: 67px; height: 545px; z-index: 2; }
.char-water { left: 431px; top: 133px; height: 490px; z-index: 3; animation-delay: -4s; }
@keyframes float { from { transform: translateY(0); } to { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .char { animation: none; } }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(20, 19, 18, 0.75) 0%, rgba(20, 19, 18, 0.1) 45%, transparent 70%),
    linear-gradient(to bottom, transparent 55%, var(--bg) 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--max);
  margin: 0 auto;
  padding: 120px 16px 0;
}
.logo img { width: min(480px, 88vw); height: auto; filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.7)); }
.tagline {
  font-family: Cinzel, serif;
  font-size: 22px;
  letter-spacing: 0.08em;
  margin: 18px 0 28px;
  text-shadow: 0 2px 12px #000;
}
.btn-primary {
  display: inline-block;
  padding: 13px 30px;
  font-family: Cinzel, serif;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: #1a1306;
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 4px;
  box-shadow: none;
  transition: box-shadow 0.2s, transform 0.2s;
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.7; cursor: wait; transform: none; }

/* Waitlist in the hero: the page's one gold action */
.waitlist-hero { grid-template-columns: minmax(0, 300px) auto; max-width: 520px; gap: 10px; }
.waitlist-hero input[type="email"] { padding: 13px 14px; background: rgba(20, 19, 18, 0.6); border-color: var(--line); backdrop-filter: blur(6px); }
.waitlist-hero .btn-primary { font-size: 15px; cursor: pointer; }
.waitlist-hero .wl-msg { grid-column: 1 / -1; text-shadow: 0 1px 6px #000; }
.hero-links { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; margin-top: 6px; font-size: 14px; }
.hero-links a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; text-shadow: 0 1px 6px #000; }
.hero-links a:hover { text-decoration-color: var(--gold-hi); }

.status {
  display: inline-block;
  padding: 5px 14px;
  font-size: 13px;
  color: var(--dim);
  background: rgba(20, 19, 18, 0.7);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  backdrop-filter: blur(6px);
}
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--dim); }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(20, 19, 18, 0.88);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.6), 0 10px 30px rgba(0, 0, 0, 0.4);
}
.nav-links {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links a {
  padding: 15px 18px;
  font-family: Cinzel, serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  color: var(--text);
  opacity: 0.78;
  border-bottom: 2px solid transparent;
  transition: opacity 0.2s, border-color 0.2s;
}
.nav-links a:hover { opacity: 1; border-bottom-color: var(--line); }

/* Layout */
.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 24px auto 0;
  padding: 0 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}
.main, .side-col { display: grid; gap: 16px; }

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 20px 22px 22px;
  backdrop-filter: blur(8px);
  scroll-margin-top: 70px;
}
.panel::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.panel-title {
  font-family: Cinzel, serif;
  font-size: 20px;
  padding-bottom: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}
.lead { margin: -6px 0 16px; color: var(--dim); }
.note { margin: 0 0 12px; color: var(--dim); font-size: 13px; }
.sub { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); margin: 18px 0 10px; }

/* Showcase */
.showcase { padding: 0; overflow: hidden; }
.showcase img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; }
.showcase-text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 60px 22px 18px;
  background: linear-gradient(transparent, rgba(20, 19, 18, 0.92));
}
.showcase-text h2 { font-family: Cinzel, serif; font-size: 26px; }
.showcase-text p { margin: 4px 0 0; max-width: 520px; color: #d9d4cc; }

/* Dev Log timeline */
.tl-month { margin: -4px 0 14px; font: 700 13px Cinzel, serif; letter-spacing: 0.1em; text-transform: uppercase; }
.timeline { position: relative; padding-left: 28px; display: grid; gap: 18px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: start; }
.timeline li::before { content: ""; position: absolute; left: -26px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--gold); }
.timeline li:first-child::before { background: var(--gold); box-shadow: none; }
.timeline img { width: 112px; aspect-ratio: 3 / 2; object-fit: cover; border: 1px solid var(--line-soft); border-radius: 4px; }
.timeline time { display: block; font-size: 12px; color: var(--dim); letter-spacing: 0.04em; }
.timeline h3 { font-size: 15px; color: var(--text); }
.timeline p { margin: 4px 0 0; font-size: 14px; color: #bdb8b0; }

/* Elements */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 0;
  font: 700 14px Cinzel, serif;
  letter-spacing: 0.08em;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-color: currentColor; }
.tab[data-el="fire"][aria-selected="true"] { color: var(--fire); }
.tab[data-el="earth"][aria-selected="true"] { color: var(--earth-green); }
.tab[data-el="water"][aria-selected="true"] { color: var(--water); }
.tab[data-el="wind"][aria-selected="true"] { color: var(--wind); }

.element { display: grid; grid-template-columns: 260px 1fr; gap: 20px; animation: fade 0.35s ease; }
.element[hidden] { display: none; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.element img { border-radius: 6px; border: 1px solid var(--line-soft); aspect-ratio: 1; object-fit: cover; }
.element h3 { font-family: Cinzel, serif; font-size: 26px; }
.element h3 span { font: 500 13px Inter, sans-serif; color: var(--dim); margin-left: 8px; letter-spacing: 0.06em; text-transform: uppercase; }
.el-fire h3 { color: var(--fire); }
.el-earth h3 { color: var(--earth-green); }
.el-water h3 { color: var(--water); }
.el-wind h3 { color: var(--wind); }
.element .style { color: var(--dim); font-style: italic; margin: 4px 0 6px; }
.element p { margin: 0 0 6px; }
.element dl { margin: 14px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 14px; }
.element dt { color: var(--dim); }
.element dd { margin: 0; }

/* World */
.world { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.world figure { margin: 0; }
.world img { border-radius: 6px; border: 1px solid var(--line-soft); aspect-ratio: 16 / 10; object-fit: cover; }
.world h3 { font-family: Cinzel, serif; font-size: 18px; margin-top: 10px; }
.world p { margin: 2px 0 0; font-size: 14px; color: #bdb8b0; }

/* Features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 24px; }
.features li { padding-top: 12px; border-top: 1px solid var(--line-soft); }
.features h3 { font-size: 14px; color: var(--text); margin-bottom: 2px; }
.features p { margin: 0; font-size: 13px; color: #bdb8b0; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.gallery a { display: block; overflow: hidden; border-radius: 4px; border: 1px solid var(--line-soft); }
.gallery img { aspect-ratio: 16 / 10; object-fit: cover; transition: transform 0.3s; }
.gallery a:hover img { transform: scale(1.06); }

/* Sidebar */
.hall { padding-top: 16px; }
.hall-title {
  font-family: Cinzel, serif;
  font-size: 22px;
  text-align: center;
  color: var(--gold);
  padding: 10px 0;
  margin-bottom: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: radial-gradient(closest-side, rgba(201, 180, 138, 0.10), transparent);
}
.factions { display: grid; gap: 10px; margin-bottom: 12px; }
.factions li { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 10px; }
.factions i { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 10px currentColor; background: currentColor; }
.c-fire { color: var(--fire); }
.c-earth { color: var(--earth-green); background: linear-gradient(135deg, var(--earth), var(--earth-green)) !important; }
.c-water { color: var(--water); }
.c-wind { color: var(--wind); }
.factions span { color: var(--dim); font-size: 13px; }

.rows { display: grid; gap: 4px; font-size: 14px; }
.rows + .rows { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.rows li { display: flex; justify-content: space-between; }
.rows li span:last-child { color: var(--dim); }

.tribes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 14px; }

.btn-muted {
  width: 100%;
  padding: 11px;
  font: 700 14px Cinzel, serif;
  letter-spacing: 0.08em;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  cursor: not-allowed;
}
.req { font-size: 13px; color: #bdb8b0; display: grid; gap: 10px; }
.req li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; }
.req svg { width: 20px; height: 20px; color: var(--dim); }

/* Footer */
.footer {
  position: relative;
  z-index: 1;
  margin-top: 40px;
  padding: 28px 16px 40px;
  text-align: center;
  background: #100f0e;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--dim);
}
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-bottom: 10px; }
.footer-links a { text-decoration: none; color: var(--text); }
.footer-links a:hover { color: var(--gold-hi); }
.footer p { margin: 0; }

/* Lightbox */
.lightbox { padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #000; max-width: 94vw; max-height: 90vh; }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.85); }
.lightbox img { max-height: 88vh; width: auto; }
.lightbox button { position: absolute; top: 6px; right: 10px; font-size: 28px; color: #fff; background: none; border: 0; cursor: pointer; }

/* Responsive */
@media (max-width: 900px) {
  .wrap { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .hero { height: 690px; }
  .hero-art { background-position: 70% center; }
  .hero-chars { right: auto; left: 27px; top: 310px; transform: scale(0.6); transform-origin: 0 0; }
  .hero::after { background: linear-gradient(to bottom, transparent 75%, var(--bg) 100%); }
  .hero-inner { padding-top: 60px; text-align: center; }
  .waitlist-hero { grid-template-columns: 1fr; margin: 0 auto; }
  .hero-links { justify-content: center; }
  .logo img { margin: 0 auto; width: min(320px, 82vw); }
  .tagline { margin-left: 0; font-size: 18px; }
  .btn-primary { margin-left: 0; }
  .nav-links { justify-content: flex-start; }
  .nav-links a { padding: 13px 12px; font-size: 13px; }
  .panel { padding: 16px; }
  .element { grid-template-columns: 1fr; }
  .element img { aspect-ratio: 16 / 10; object-position: center 40%; }
  .tab { font-size: 12px; letter-spacing: 0.04em; }
  .showcase-text { position: static; padding: 14px 16px 16px; background: none; }
  .world { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .timeline { padding-left: 24px; }
  .timeline li { grid-template-columns: 80px 1fr; gap: 12px; }
  .timeline li::before { left: -22px; }
  .timeline::before { left: 5px; }
  .timeline img { width: 80px; }
}

/* Keyboard focus */
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; border-radius: 3px; }

@media (max-width: 640px) {
  .nav-links { -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }
  .nav-links a:last-child { padding-right: 40px; }
  .features { gap: 14px; }
}

.tab img { width: 28px; height: 28px; opacity: 0.55; transition: opacity 0.2s; }
.tab:hover img, .tab[aria-selected="true"] img { opacity: 1; }
.element h3 { display: flex; align-items: center; gap: 10px; }
.el-icon { width: 40px; height: 40px; }
@media (max-width: 640px) {
  .tab { flex-direction: column; gap: 4px; }
}

/* Element wheel */
.wheel { display: block; width: 100%; max-width: 520px; margin: 0 auto 20px; }
.wheel .quad { cursor: pointer; outline: none; }
.wheel .quad path { transition: filter 0.2s; }
.wheel .quad:hover path, .wheel .quad:focus-visible path { filter: brightness(1.15); }
.wheel .quad:focus-visible path { stroke: var(--gold-hi); stroke-width: 3; }
.wheel .wc { font: 700 18px Cinzel, serif; fill: #fff; text-anchor: middle; letter-spacing: 0.06em; }
.wheel .wc-dark { fill: #3a3733; }
.wheel .wl text { font: 600 15px Inter, sans-serif; fill: var(--text); text-anchor: middle; }

/* Waitlist */
.sr-only, .hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.waitlist { display: grid; gap: 8px; }
.waitlist input[type="email"] {
  width: 100%;
  padding: 11px 12px;
  font: 14px Inter, sans-serif;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}
.waitlist input[type="email"]::placeholder { color: var(--dim); }
.waitlist input[type="email"]:focus { outline: none; border-color: var(--line); background: rgba(255, 255, 255, 0.06); }
.waitlist input[aria-invalid="true"] { border-color: var(--fire); }
.btn-secondary {
  width: 100%;
  padding: 11px;
  font: 700 14px Cinzel, serif;
  letter-spacing: 0.08em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--gold); }
.btn-secondary:disabled { opacity: 0.6; cursor: wait; }
.wl-msg { margin: 0; min-height: 1.2em; font-size: 13px; color: var(--dim); }
.wl-msg.error { color: #e6a596; }
.waitlist.done input, .waitlist.done button { display: none; }
.waitlist.done .wl-msg { color: var(--text); }
