/* ── Tokens ── */
:root {
  /* Gold – canonical from app AppColors */
  --gold-primary:   #C8A96E;
  --gold-highlight: #F5D78A;
  --gold-deep:      #A17A35;
  --gold-shadow:    #6B4E1A;

  /* Purple background – canonical from app AppColors */
  --bg-top:  #1B0A3E;
  --bg-mid:  #0D0525;
  --bg-edge: #050010;

  /* Surfaces */
  --surface:     rgba(13, 5, 37, 0.85);
  --border-gold: rgba(200, 169, 110, 0.25);

  /* Text */
  --text:       #f0e6d3;
  --text-muted: rgba(240, 230, 211, 0.62);

  /* Ember – chaos accent (orb scroller + "Burn the Table." only) */
  --ember:      #FF5A2A;
  --ember-deep: #C8341A;
  --ember-glow: rgba(255, 90, 42, 0.30);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img { display: block; max-width: 100%; }

body {
  font-family: 'Inter Tight', system-ui, sans-serif;
  color: var(--text);
  background-color: var(--bg-edge);
  overflow-x: hidden;
}

/* ── Fonts ── */
@font-face {
  font-family: 'Megadeth';
  src: url('/assets/fonts/Megadeth.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ── Typography utilities ── */
.megadeth {
  font-family: 'Megadeth', 'Inter Tight', sans-serif;
}

.gold-text {
  background: linear-gradient(
    135deg,
    var(--gold-deep)      0%,
    var(--gold-primary)  35%,
    var(--gold-highlight) 50%,
    var(--gold-primary)  65%,
    var(--gold-deep)     100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ember-text {
  color: var(--ember);
  -webkit-text-fill-color: var(--ember);
}

/* ── Ornamental divider ── */
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  color: var(--gold-primary);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
}
.ornament::before,
.ornament::after {
  content: '';
  width: 80px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold-primary));
}
.ornament::after {
  background: linear-gradient(to left, transparent, var(--gold-primary));
}
.ornament--wide::before,
.ornament--wide::after { width: 140px; }

/* ── Gold CTA button ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 2.2rem;
  background: linear-gradient(180deg, var(--gold-highlight) 0%, var(--gold-primary) 55%, var(--gold-deep) 100%);
  color: #0a0010;
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 0 var(--gold-shadow), 0 8px 24px rgba(200, 169, 110, 0.3);
  cursor: not-allowed;
  position: relative;
  white-space: nowrap;
  user-select: none;
  opacity: 0.7;
  text-decoration: none;
}
.btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.btn--active {
  opacity: 1;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}
.btn--active:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--gold-shadow), 0 12px 30px rgba(200, 169, 110, 0.45);
}
.btn--active:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 var(--gold-shadow), 0 4px 12px rgba(200, 169, 110, 0.3);
}

/* skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--bg-mid);
  color: var(--gold-primary);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  z-index: 999;
}
.skip-link:focus { top: 0; }

/* ═══════════════════════════════════════
   HERO
═══════════════════════════════════════ */
.hero {
  min-height: clamp(640px, 88vh, 860px);
  background:
    radial-gradient(ellipse at 50% -10%, var(--bg-top) 0%, transparent 65%),
    radial-gradient(ellipse at 20% 80%, rgba(27,10,62,0.6) 0%, transparent 55%),
    var(--bg-edge);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4rem 2rem 5rem;
  position: relative;
}

/* tighter gold glow behind tagline */
.hero::before {
  content: '';
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translateX(-50%);
  width: 380px;
  height: 380px;
  background: radial-gradient(ellipse, rgba(200, 169, 110, 0.10) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
  z-index: 1;
  max-width: 760px;
}

.hero-logo {
  width: min(440px, 78vw);
  height: auto;
  filter: drop-shadow(0 0 48px rgba(200, 169, 110, 0.5));
}

.hero-tagline {
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  line-height: 1.1;
  filter: drop-shadow(0 0 16px rgba(200, 169, 110, 0.25));
}

.hero-sub {
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-btns {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.5rem;
}

/* ═══════════════════════════════════════
   ORBS SCROLLER
═══════════════════════════════════════ */
.orbs {
  padding: 5rem 0;
  background: linear-gradient(180deg, var(--bg-mid) 0%, var(--bg-edge) 100%);
  border-top: 1px solid rgba(200, 169, 110, 0.1);
  border-bottom: 1px solid rgba(200, 169, 110, 0.1);
  text-align: center;
}

.orbs .ornament { margin-bottom: 1rem; }

.section-title {
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  margin-bottom: 0.6rem;
}

.orbs-sub {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  letter-spacing: 0.03em;
}

.orb-scroller {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 8vw;
  padding-inline: 8vw;
  padding-bottom: 1rem;
  /* edge fade */
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    #000 8vw,
    #000 calc(100% - 8vw),
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    #000 8vw,
    #000 calc(100% - 8vw),
    transparent
  );
  /* hide native scrollbar */
  scrollbar-width: none;
}
.orb-scroller::-webkit-scrollbar { display: none; }

.orb-card {
  flex: 0 0 clamp(280px, 32vw, 360px);
  aspect-ratio: 3 / 4;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  background: var(--bg-mid);
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  cursor: default;
  outline: none;
  transition: border-color 0.3s;
}

.orb-card:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
}

.orb-card__image {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.orb-card__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.6));
  transition: filter 0.4s;
}

.orb-card__name {
  font-size: clamp(1.3rem, 2.2vw, 1.75rem);
  color: var(--gold-primary);
  transition: color 0.3s;
  line-height: 1.15;
}

.orb-card__desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 28ch;
}

/* scroll-driven active state — browsers supporting animation-timeline */
@supports (animation-timeline: scroll()) {
  .orb-card {
    animation: orb-activate linear both;
    animation-timeline: view(inline);
    animation-range: entry 20% cover 50%;
  }

  @keyframes orb-activate {
    from {
      border-color: var(--border-gold);
    }
    to {
      border-color: rgba(255, 90, 42, 0.55);
    }
  }

  .orb-card .orb-card__image img {
    animation: orb-glow linear both;
    animation-timeline: view(inline);
    animation-range: entry 20% cover 50%;
  }

  @keyframes orb-glow {
    from { filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.6)); }
    to   { filter: drop-shadow(0 8px 30px var(--ember-glow)) drop-shadow(0 0 12px rgba(255, 90, 42, 0.2)); }
  }

  .orb-card .orb-card__name {
    animation: orb-name-glow linear both;
    animation-timeline: view(inline);
    animation-range: entry 20% cover 50%;
  }

  @keyframes orb-name-glow {
    from { color: var(--gold-primary); -webkit-text-fill-color: var(--gold-primary); }
    to   { color: var(--ember);        -webkit-text-fill-color: var(--ember); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .orb-card,
  .orb-card .orb-card__image img,
  .orb-card .orb-card__name {
    animation: none;
  }
}

/* ═══════════════════════════════════════
   FEATURE ROWS
═══════════════════════════════════════ */
.features {
  background: linear-gradient(180deg, var(--bg-edge) 0%, var(--bg-mid) 50%, var(--bg-edge) 100%);
  border-top: 1px solid rgba(200, 169, 110, 0.1);
  border-bottom: 1px solid rgba(200, 169, 110, 0.1);
}

.feature {
  display: flex;
  align-items: center;
  gap: 5rem;
  padding: 6rem 6vw;
  max-width: 1200px;
  margin: 0 auto;
}

.feature + .feature {
  border-top: 1px solid rgba(200, 169, 110, 0.08);
}

.feature--rtl { flex-direction: row-reverse; }

.feature__art {
  flex: 0 0 auto;
  width: clamp(180px, 28vw, 280px);
  position: relative;
}

.feature__art::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 28px;
  border: 1px solid var(--border-gold);
  pointer-events: none;
  box-shadow: 0 0 30px rgba(200, 169, 110, 0.15);
}

.feature__art img {
  width: 100%;
  height: auto;
  border-radius: 22px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.65);
}

.feature__text { flex: 1; min-width: 0; }

.feature__text h2 {
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  margin-bottom: 1.1rem;
}

.feature__text p {
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 46ch;
}

/* ═══════════════════════════════════════
   GAME MODES
═══════════════════════════════════════ */
.modes {
  padding: 5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.modes > .section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.modes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.mode-card {
  position: relative;
  height: 420px;
  border-radius: 20px;
  border: 1px solid var(--border-gold);
  overflow: hidden;
  cursor: default;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(200, 169, 110, 0.08) inset;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@media (prefers-reduced-motion: no-preference) {
  .mode-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(200, 169, 110, 0.2);
  }
  .mode-card:hover .mode-card__bg {
    transform: scale(1.04);
  }
}

.mode-card__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  transition: transform 0.4s ease;
}

.mode-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(5, 0, 16, 0.1) 0%,
    rgba(5, 0, 16, 0.5) 50%,
    rgba(5, 0, 16, 0.92) 100%
  );
}

.mode-card__body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem;
}

.mode-card__body h3 {
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  margin-bottom: 0.6rem;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.8));
}

.mode-card__body p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 38ch;
}

/* ═══════════════════════════════════════
   BETA
═══════════════════════════════════════ */
.beta {
  padding: 6rem 2rem;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-edge) 0%, var(--bg-top) 50%, var(--bg-edge) 100%);
  border-top: 1px solid rgba(200, 169, 110, 0.18);
  border-bottom: 1px solid rgba(200, 169, 110, 0.12);
  position: relative;
  overflow: hidden;
}

.beta-heading {
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.75rem);
  margin-bottom: 0.75rem;
}

.beta-sub {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 2.5rem;
}

.beta-btns {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════
   FOOTER
═══════════════════════════════════════ */
.footer {
  background: var(--bg-edge);
  border-top: 1px solid rgba(200, 169, 110, 0.12);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.footer p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--gold-primary);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--gold-highlight); }

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 900px) {
  .modes-grid { grid-template-columns: 1fr; }
  .mode-card  { height: 360px; }

  .feature,
  .feature--rtl {
    flex-direction: column;
    gap: 2.5rem;
    padding: 4rem 2rem;
  }

  .feature__art { width: clamp(180px, 55vw, 260px); }
  .feature__text p { max-width: 100%; }

  .hero-tagline { font-size: clamp(2rem, 9vw, 3rem); }
}

@media (max-width: 600px) {
  .hero { padding-top: 3rem; }
  .hero-logo { width: min(320px, 85vw); }

  .hero-btns { flex-direction: column; align-items: stretch; }
  .hero-btns .btn { justify-content: center; }

  .orb-card {
    flex: 0 0 clamp(220px, 78vw, 280px);
  }

  .intro-band,
  .orbs,
  .beta { padding: 3.5rem 1.5rem; }

  .modes { padding: 3.5rem 1.5rem; }
}
