/* ==========================================================================
   Warcraft 3 Fansite — custom theme layer
   Dark medieval fantasy. Tailwind (CDN) handles utilities; this file carries
   textures, ornaments, glow, and animations that Tailwind can't express cleanly.
   ========================================================================== */

:root {
  --ink:      #0c0a10;
  --stone:    #181521;
  --stone-2:  #211b30;
  --purple:   #2a1e46;
  --blue:     #16233f;
  --gold:     #d4af37;
  --brass:    #b8860b;
  --silver:   #c9c9d4;
  --parchment:#e7dcc0;

  --human:    #4c7fd6;
  --orc:      #c1442e;
  --nightelf: #3ea79b;
  --undead:   #7c5cc4;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--ink);
  color: #d8d3c4;
  font-family: 'EB Garamond', Georgia, serif;
  overflow-x: hidden;
  /* layered dark texture: subtle noise + radial vignette */
  background-image:
    radial-gradient(1200px 700px at 50% -10%, rgba(42,30,70,0.55), transparent 60%),
    radial-gradient(900px 600px at 100% 100%, rgba(22,35,63,0.45), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  background-attachment: fixed, fixed, fixed;
}

h1, h2, h3, .font-display {
  font-family: 'Cinzel', 'Trajan Pro', Georgia, serif;
  letter-spacing: 0.04em;
}

/* ---- Gold gradient text used for the site title / section headers -------- */
.gilded {
  background: linear-gradient(180deg, #f6e6a8 0%, var(--gold) 45%, #8a6a1c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 18px rgba(212,175,55,0.15);
}

/* ---- Section heading with flanking rules --------------------------------- */
.section-title { position: relative; }
.section-title::before,
.section-title::after {
  content: "";
  display: inline-block;
  width: clamp(24px, 8vw, 90px);
  height: 1px;
  vertical-align: middle;
  margin: 0 0.9rem;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
}

/* ---- Ornamented framed panel (stone + gold filigree corners) ------------- */
.rune-frame {
  position: relative;
  background:
    linear-gradient(180deg, rgba(33,27,48,0.92), rgba(12,10,16,0.94));
  border: 1px solid rgba(184,134,11,0.35);
  box-shadow: inset 0 0 30px rgba(0,0,0,0.6), 0 10px 30px rgba(0,0,0,0.5);
}
.rune-frame::before,
.rune-frame::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid var(--gold);
  opacity: 0.7;
}
.rune-frame::before { top: 6px; left: 6px; border-right: none; border-bottom: none; }
.rune-frame::after  { bottom: 6px; right: 6px; border-left: none; border-top: none; }

/* ---- Parallax hero banner ------------------------------------------------ */
.hero-banner {
  position: relative;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(42,30,70,0.9), rgba(12,10,16,1) 70%);
  overflow: hidden;
}
/* Cinematic banner background image (parallax layer) */
.hero-bg {
  position: absolute;
  top: -8%; left: 0; right: 0; bottom: -8%;
  background-image: url('../images/hero-background-warcraft3-reforged-cinematic2_1920x1080.jpg');
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  will-change: transform;
  pointer-events: none;
  z-index: 0;
}
/* Dark overlay for text contrast over the cinematic image */
.hero-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(12,10,16,0.55) 0%, rgba(12,10,16,0.65) 55%, var(--ink) 100%),
    radial-gradient(120% 90% at 50% 20%, rgba(42,30,70,0.35), rgba(12,10,16,0.75) 75%);
  pointer-events: none;
  z-index: 1;
}
/* Keep title and copy readable against the imagery */
.hero-banner h1,
.hero-banner p {
  text-shadow: 0 2px 12px rgba(0,0,0,0.75), 0 0 24px rgba(0,0,0,0.5);
}
.hero-embers {
  position: absolute; inset: 0;
  z-index: 2;
  background-image:
    radial-gradient(2px 2px at 20% 80%, rgba(212,175,55,0.5), transparent),
    radial-gradient(2px 2px at 70% 60%, rgba(212,175,55,0.35), transparent),
    radial-gradient(1.5px 1.5px at 40% 40%, rgba(200,200,212,0.3), transparent),
    radial-gradient(1.5px 1.5px at 85% 30%, rgba(212,175,55,0.4), transparent);
  will-change: transform;
  pointer-events: none;
}

/* ---- Buttons ------------------------------------------------------------- */
.btn-forged {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: #f4e9c6;
  padding: 0.7rem 1.6rem;
  background: linear-gradient(180deg, #3a2c1a, #1c150c);
  border: 1px solid var(--brass);
  box-shadow: inset 0 1px 0 rgba(255,220,150,0.2), 0 4px 14px rgba(0,0,0,0.5);
  transition: all .25s ease;
}
.btn-forged:hover {
  color: #fff8e0;
  border-color: var(--gold);
  box-shadow: inset 0 1px 0 rgba(255,220,150,0.35), 0 0 22px rgba(212,175,55,0.45);
  transform: translateY(-1px);
}

/* ---- Featured carousel --------------------------------------------------- */
.carousel-track { position: relative; min-height: 30rem; }
.carousel-slide {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transition: opacity .7s ease;
}
.carousel-slide.is-active { opacity: 1; visibility: visible; position: relative; }
.carousel-dot {
  width: 12px; height: 12px; transform: rotate(45deg);
  background: transparent; border: 1px solid var(--brass);
  transition: all .25s ease; cursor: pointer;
}
.carousel-dot.is-active { background: var(--gold); box-shadow: 0 0 10px var(--gold); }

/* ---- Hero showcase card flip / reveal ------------------------------------ */
.hero-card { position: relative; }
.hero-card .hero-lore {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem;
  background: linear-gradient(180deg, rgba(12,10,16,0.55), rgba(12,10,16,0.95));
  opacity: 0; transition: opacity .35s ease;
  font-size: 0.95rem; line-height: 1.5; color: var(--parchment);
}
.hero-card:hover .hero-lore,
.hero-card:focus-within .hero-lore { opacity: 1; }
.hero-card:hover { transform: translateY(-4px); }
.hero-card { transition: transform .3s ease; }

/* faction top-border accents */
.acc-human    { border-top: 3px solid var(--human); }
.acc-orc      { border-top: 3px solid var(--orc); }
.acc-nightelf { border-top: 3px solid var(--nightelf); }
.acc-undead   { border-top: 3px solid var(--undead); }

/* ---- Faction cards ------------------------------------------------------- */
.faction-card { transition: transform .3s ease, box-shadow .3s ease; }
.faction-card:hover { transform: translateY(-5px); }
.faction-card.f-human:hover    { box-shadow: 0 0 26px rgba(76,127,214,0.5); }
.faction-card.f-orc:hover      { box-shadow: 0 0 26px rgba(193,68,46,0.5); }
.faction-card.f-nightelf:hover { box-shadow: 0 0 26px rgba(62,167,155,0.5); }
.faction-card.f-undead:hover   { box-shadow: 0 0 26px rgba(124,92,196,0.5); }

/* ---- Unit filter buttons ------------------------------------------------- */
.filter-btn {
  font-family: 'Cinzel', serif; letter-spacing: .06em; font-size: .72rem;
  text-transform: uppercase; padding: .45rem 1rem;
  border: 1px solid rgba(184,134,11,0.4); color: #cdbf94;
  background: rgba(24,21,33,0.7); transition: all .2s ease; cursor: pointer;
}
.filter-btn:hover { border-color: var(--gold); color: #f4e9c6; }
.filter-btn.is-active {
  background: linear-gradient(180deg, #3a2c1a, #1c150c);
  border-color: var(--gold); color: #fff5db;
  box-shadow: 0 0 14px rgba(212,175,55,0.35);
}

/* unit rows */
.unit-row { transition: background .2s ease; }
.unit-row:hover { background: rgba(42,30,70,0.35); }
.unit-hidden { display: none; }

/* small faction dot */
.fdot { display:inline-block; width:9px; height:9px; border-radius:50%; margin-right:.4rem; vertical-align:middle;}

/* ---- Gallery ------------------------------------------------------------- */
.gallery-item { position: relative; overflow: hidden; }
.gallery-item img { transition: transform .5s ease; display: block; width: 100%; height: 100%; object-fit: cover; }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: .8rem 1rem;
  background: linear-gradient(180deg, transparent, rgba(12,10,16,0.9));
  font-family: 'Cinzel', serif; font-size: .8rem; letter-spacing: .05em;
  color: #e9dcb4;
}

/* ---- Scroll reveal ------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---- Nav ----------------------------------------------------------------- */
.nav-link {
  font-family: 'Cinzel', serif; letter-spacing: .08em; font-size: .78rem;
  text-transform: uppercase; color: #cbbf98; transition: color .2s ease; position: relative;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px;
  background: var(--gold); transform: scaleX(0); transform-origin: center; transition: transform .25s ease;
}
.nav-link:hover { color: #f4e9c6; }
.nav-link:hover::after { transform: scaleX(1); }

/* reduce motion */
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
  .hero-embers { display: none; }
}
