/* Gold Merge Legend — dark alchemical theme (reference UI)
   Fonts: Cinzel (headings), DM Sans (UI/body)
*/

:root {
  --bg-deep: #050d0a;
  --bg-panel: #0a1612;
  --bg-elevated: #122018;
  --gold: #d4af37;
  --gold-dim: #9a7b2c;
  --gold-glow: rgba(212, 175, 55, 0.35);
  --rust: #c45c26;
  --rust-deep: #9a3f14;
  --text: #f4ecd8;
  --text-muted: #b8a88a;
  --blue-accent: #3b82f6;
  --border-gold: 1px solid rgba(212, 175, 55, 0.45);
  --radius-lg: 22px;
  --radius-md: 14px;
  --header-h: 64px;
  --dock-h: 72px;
  --font-serif: "Cinzel", Georgia, serif;
  --font-sans: "DM Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Anchor / in-page jumps: keep targets clear of sticky header + bottom dock */
  scroll-padding-top: var(--header-h);
  scroll-padding-bottom: calc(var(--dock-h) + 20px);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: radial-gradient(ellipse 120% 80% at 50% -10%, #1a3328 0%, var(--bg-deep) 55%);
  background-color: var(--bg-deep);
  padding-bottom: calc(var(--dock-h) + 16px);
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  z-index: 10000;
  padding: 0.75rem 1rem;
  background: var(--gold);
  color: var(--bg-deep);
  font-weight: 600;
  border-radius: var(--radius-md);
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.cursor-pointer {
  cursor: pointer;
}

/* --- Header --- */
.game-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: linear-gradient(180deg, rgba(10, 22, 18, 0.96), rgba(5, 13, 10, 0.92));
  border-bottom: var(--border-gold);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.game-header.is-scrolled {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 24px var(--gold-glow);
  border-bottom-color: rgba(212, 175, 55, 0.65);
}

.game-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand__sigil {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--gold);
  background: radial-gradient(circle at 30% 25%, rgba(212, 175, 55, 0.25), transparent 55%);
  box-shadow: inset 0 0 12px rgba(212, 175, 55, 0.15);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--gold);
}

.brand__tagline {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.game-header__spacer {
  flex: 1;
  min-width: 0;
}

.game-header__hud {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

@media (min-width: 640px) {
  .game-header__hud {
    display: flex;
  }
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: var(--border-gold);
  background: rgba(5, 13, 10, 0.85);
  font-size: 0.75rem;
  color: var(--text);
}

.hud-icon {
  width: 14px;
  height: 14px;
  color: var(--gold);
}

.top-links {
  display: none;
  align-items: center;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .top-links {
    display: flex;
  }
}

.top-links__a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.top-links__a:hover,
.top-links__a:focus-visible {
  color: var(--gold);
}

.menu-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: var(--border-gold);
  background: var(--bg-elevated);
  color: var(--gold);
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
}

@media (min-width: 900px) {
  .menu-toggle {
    display: none;
  }
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
  background: rgba(5, 13, 10, 0.98);
}

.drawer-nav[hidden] {
  display: none;
}

.drawer-nav__a {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.drawer-nav__a:hover,
.drawer-nav__a:focus-visible {
  background: rgba(196, 92, 38, 0.25);
  color: var(--gold);
}

/* --- Hero --- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 2.5rem 1rem 3rem;
}

.hero__bokeh {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.08), transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(212, 175, 55, 0.06), transparent 35%),
    radial-gradient(circle at 60% 80%, rgba(196, 92, 38, 0.05), transparent 40%);
  animation: bokeh-drift 28s ease-in-out infinite alternate;
}

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

@keyframes bokeh-drift {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(-2%, 2%) scale(1.03);
  }
}

.hero__grid {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 960px) {
  .hero__grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr) minmax(0, 0.85fr);
    gap: 1.5rem 2rem;
  }
}

.hero__alchemist {
  position: relative;
  min-height: 200px;
  display: none;
}

@media (min-width: 960px) {
  .hero__alchemist {
    display: block;
  }
}

.alchemist-silhouette {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 3 / 5;
  margin: 0 auto;
  border-radius: 50% 50% 40% 40%;
  background: linear-gradient(165deg, rgba(18, 32, 24, 0.95), rgba(5, 13, 10, 0.3));
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.6), inset 0 -20px 40px rgba(0, 0, 0, 0.5);
  border: var(--border-gold);
}

.hero__rune-ring {
  position: absolute;
  inset: 10% -10% auto;
  height: 120px;
  border: 1px dashed rgba(212, 175, 55, 0.25);
  border-radius: 50%;
  animation: ring-pulse 6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .hero__rune-ring {
    animation: none;
  }
}

@keyframes ring-pulse {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

.hero__copy {
  text-align: center;
}

@media (min-width: 960px) {
  .hero__copy {
    text-align: left;
  }
}

.eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--rust);
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.hero h1,
.section-title,
.trove-title,
.download-title,
.modal__title {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(212, 175, 55, 0.2);
}

.hero h1 {
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  line-height: 1.15;
  margin: 0 0 1rem;
}

.lede {
  margin: 0 0 1.75rem;
  color: var(--text-muted);
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 960px) {
  .lede {
    margin-left: 0;
  }
}

.hero__cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

@media (min-width: 960px) {
  .hero__cta-row {
    justify-content: flex-start;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.35rem;
  border-radius: var(--radius-md);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--blue-accent);
  outline-offset: 3px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-icon {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: linear-gradient(180deg, var(--rust), var(--rust-deep));
  color: #fff;
  box-shadow: 0 8px 24px rgba(196, 92, 38, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 10px 32px rgba(196, 92, 38, 0.45);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--gold);
  border: var(--border-gold);
}

.btn-secondary:hover {
  background: rgba(18, 32, 24, 0.95);
}

.btn-block {
  width: 100%;
}

.hero__device {
  margin: 0;
  text-align: center;
}

.device-frame {
  display: inline-block;
  padding: 10px;
  border-radius: 36px;
  border: 2px solid var(--gold);
  background: linear-gradient(145deg, rgba(18, 32, 24, 0.95), #050d0a);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(212, 175, 55, 0.15);
}

.device-frame img {
  border-radius: 28px;
  display: block;
  max-height: min(70vh, 640px);
  max-width: min(100%, 360px);
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

.device-caption {
  margin-top: 0.75rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* --- Sections --- */
.section {
  padding: 3rem 1rem 3.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section__head {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 0.5rem;
}

.section-sub {
  margin: 0;
  color: var(--text-muted);
}

/* Hex-inspired cards: clip-path for differentiation */
.hex-cluster {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 720px) {
  .hex-cluster {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .hex-cluster {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}

.hex-card {
  position: relative;
  padding: 1.75rem 1.35rem;
  background: linear-gradient(165deg, rgba(18, 32, 24, 0.95), rgba(10, 22, 18, 0.88));
  border: var(--border-gold);
  border-radius: var(--radius-lg);
  clip-path: polygon(8% 0, 92% 0, 100% 8%, 100% 92%, 92% 100%, 8% 100%, 0 92%, 0 8%);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.hex-card:hover,
.hex-card:focus-visible {
  border-color: rgba(212, 175, 55, 0.85);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), 0 0 28px var(--gold-glow);
  transform: translateY(-3px);
  outline: none;
}

.hex-card__icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  border: var(--border-gold);
  background: radial-gradient(circle at 35% 30%, rgba(212, 175, 55, 0.2), transparent 60%);
  color: var(--gold);
}

.hex-card__icon-wrap svg {
  width: 26px;
  height: 26px;
}

.hex-card__title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--gold);
  margin: 0 0 0.5rem;
}

.hex-card__body {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Screenshot gallery */
.section--gallery {
  max-width: 1100px;
}

.gallery-strip {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .gallery-strip {
    grid-template-columns: repeat(3, 1fr);
  }
}

.gallery-card {
  margin: 0;
}

.gallery-card__open {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  border-radius: var(--radius-lg);
  background: transparent;
  overflow: hidden;
  border: var(--border-gold);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.gallery-card__open:hover,
.gallery-card__open:focus-visible {
  border-color: rgba(212, 175, 55, 0.9);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), 0 0 24px var(--gold-glow);
  transform: translateY(-2px);
  outline: none;
}

.gallery-card__open img {
  width: 100%;
  height: auto;
  display: block;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.75);
}

.lightbox__panel {
  position: relative;
  max-width: min(96vw, 720px);
  max-height: min(90vh, 960px);
  border-radius: var(--radius-lg);
  border: var(--border-gold);
  background: var(--bg-panel);
  padding: 0.5rem;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
}

.lightbox__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: var(--border-gold);
  background: var(--bg-elevated);
  color: var(--gold);
  display: grid;
  place-items: center;
}

.lightbox__close svg {
  width: 22px;
  height: 22px;
}

.lightbox__img {
  display: block;
  max-width: 100%;
  max-height: min(82vh, 860px);
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: calc(var(--radius-lg) - 6px);
  object-fit: contain;
}

/* Trove panel */
.section--world {
  max-width: 720px;
}

.trove-panel {
  position: relative;
  border-radius: var(--radius-lg);
  border: var(--border-gold);
  padding: 2px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.35), rgba(196, 92, 38, 0.15));
}

.trove-panel__glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.12), transparent 55%);
  pointer-events: none;
}

.trove-panel__inner {
  position: relative;
  border-radius: calc(var(--radius-lg) - 2px);
  background: var(--bg-panel);
  padding: 2rem 1.5rem;
}

.trove-title {
  font-size: 1.65rem;
  margin: 0 0 0.75rem;
  text-align: center;
}

.trove-copy {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  text-align: center;
}

.trove-subcard {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(212, 175, 55, 0.25);
  background: rgba(5, 13, 10, 0.65);
}

.trove-icon {
  width: 120px;
  height: 120px;
  border-radius: 18px;
  border: 2px solid var(--gold);
  flex-shrink: 0;
  object-fit: contain;
  background: rgba(5, 13, 10, 0.5);
}

.trove-label {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--gold);
}

.trove-sublabel {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Download */
.section--download {
  padding-bottom: 4rem;
  scroll-margin-bottom: calc(var(--dock-h) + 24px);
}

.download-cta {
  text-align: center;
  padding: 2.5rem 1.5rem;
  border-radius: var(--radius-lg);
  border: var(--border-gold);
  background: linear-gradient(180deg, rgba(18, 32, 24, 0.9), rgba(5, 13, 10, 0.95));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.download-title {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  margin: 0 0 0.5rem;
}

.download-lede {
  margin: 0 auto 1.75rem;
  max-width: 28rem;
  color: var(--text-muted);
}

.download-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
  max-width: 400px;
  margin: 0 auto;
}

.btn-transmute {
  background: linear-gradient(180deg, #f0c14b, #d4a017);
  color: var(--bg-deep);
  font-size: 1rem;
  padding: 1rem 1.5rem;
  border-radius: 999px;
  box-shadow: 0 10px 36px rgba(240, 193, 75, 0.35);
}

.btn-transmute:hover {
  box-shadow: 0 12px 44px rgba(240, 193, 75, 0.5);
}

.btn-outline-gold {
  background: transparent;
  color: var(--gold);
  border: var(--border-gold);
  border-radius: 999px;
}

.btn-outline-gold:hover {
  background: rgba(212, 175, 55, 0.1);
}

/* Footer */
.site-footer {
  padding: 2rem 1rem 0;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
  background: rgba(5, 13, 10, 0.9);
  scroll-margin-bottom: calc(var(--dock-h) + 16px);
}

.footer__inner {
  max-width: 900px;
  margin: 0 auto;
  padding-bottom: 2.5rem;
  text-align: center;
}

.footer__copy {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer__links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: center;
}

.footer__a {
  color: var(--gold);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer__a:hover,
.footer__a:focus-visible {
  color: #fff;
}

/* Bottom dock */
.dock {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 950;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.45rem 0.6rem;
  border-radius: 999px;
  border: var(--border-gold);
  background: rgba(5, 13, 10, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  max-width: calc(100% - 24px);
}

.dock__item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.45rem 0.35rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.04em;
  transition: background 0.2s ease, color 0.2s ease;
}

.dock__item svg {
  width: 20px;
  height: 20px;
}

.dock__item:hover,
.dock__item:focus-visible {
  color: var(--gold);
  outline: none;
}

.dock__item--active {
  background: linear-gradient(180deg, var(--rust), var(--rust-deep));
  color: #fff;
}

.dock__item--active svg {
  color: #fff;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.modal__panel {
  position: relative;
  width: min(100%, 400px);
  padding: 2rem 1.5rem 1.5rem;
  border-radius: var(--radius-lg);
  border: var(--border-gold);
  background: var(--bg-panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: var(--border-gold);
  background: var(--bg-elevated);
  color: var(--gold);
  display: grid;
  place-items: center;
}

.modal__close svg {
  width: 20px;
  height: 20px;
}

.modal__title {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
}

.modal__body {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
}
