html {
  background: #050608;
}

body {
  position: relative;
  background:
    radial-gradient(circle at 18% 6%, rgba(202,163,91,.12), transparent 30rem),
    radial-gradient(circle at 82% 18%, rgba(127,168,214,.10), transparent 28rem),
    linear-gradient(180deg, #050608 0%, #0b1017 50%, #050608 100%);
}

/* Site-wide epic fantasy backdrop. This sits behind the whole page. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, rgba(5,7,10,.90) 0%, rgba(5,7,10,.48) 24%, rgba(5,7,10,.28) 50%, rgba(5,7,10,.52) 76%, rgba(5,7,10,.92) 100%),
    linear-gradient(180deg, rgba(5,7,10,.62) 0%, rgba(5,7,10,.22) 34%, rgba(5,7,10,.92) 100%),
    url("../assets/images/qk-main-bg-epic.webp");
  background-size: 100% 100%, 100% 100%, cover;
  background-position: center, center, center;
  background-repeat: no-repeat;
  opacity: .86;
  filter: saturate(.92) contrast(1.04);
}

/* Subtle arcane grid above the epic backdrop. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(rgba(202,163,91,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(202,163,91,.021) 1px, transparent 1px);
  background-size: 86px 86px;
  -webkit-mask-image: radial-gradient(circle at 50% 28%, black, transparent 74%);
  mask-image: radial-gradient(circle at 50% 28%, black, transparent 74%);
}

main,
.main-wrap,
.section,
.footer {
  position: relative;
  z-index: 2;
}

.site-header {
  z-index: 10;
  padding: 14px clamp(16px, 3.5vw, 44px) 0;
  pointer-events: none;
}

/* Site-wide framed header: same epic background language, controlled in one place. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 112px;
  pointer-events: none;
  background-image:
    linear-gradient(180deg, rgba(5,7,10,.94) 0%, rgba(5,7,10,.74) 58%, rgba(5,7,10,0) 100%),
    linear-gradient(90deg, rgba(5,7,10,.92), rgba(5,7,10,.34) 50%, rgba(5,7,10,.92)),
    url("../assets/images/qk-main-bg-epic.webp");
  background-size: 100% 100%, 100% 100%, cover;
  background-position: center, center, center 22%;
  border-bottom: 1px solid rgba(202,163,91,.18);
  box-shadow: 0 24px 60px rgba(0,0,0,.34);
}

.header-inner {
  position: relative;
  width: min(1280px, 100%);
  min-height: 74px;
  margin: 0 auto;
  padding: 9px clamp(12px, 1.8vw, 20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  pointer-events: auto;
  overflow: hidden;
  border: 1px solid rgba(202,163,91,.34);
  border-radius: 24px;
  background-image:
    radial-gradient(circle at 18% 0%, rgba(231,207,146,.14), transparent 21rem),
    linear-gradient(90deg, rgba(4,6,9,.92), rgba(10,13,18,.78) 48%, rgba(4,6,9,.92));
  backdrop-filter: blur(18px);
  box-shadow:
    inset 0 0 0 1px rgba(231,207,146,.06),
    0 18px 50px rgba(0,0,0,.42);
}

.header-inner::before,
.header-inner::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(231,207,146,.70), transparent);
}

.header-inner::before { top: 7px; }
.header-inner::after { bottom: 7px; opacity: .58; }

.brand {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  flex: 0 0 auto;
}

.brand img {
  width: clamp(190px, 18vw, 246px);
  max-width: 48vw;
  height: auto;
  display: block;
  filter: drop-shadow(0 12px 26px rgba(0,0,0,.78));
}

.nav {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 8px;
  padding: 7px;
  border: 1px solid rgba(202,163,91,.22);
  border-radius: 999px;
  background: rgba(2, 4, 7, .54);
  backdrop-filter: blur(18px);
  box-shadow: inset 0 0 0 1px rgba(231,207,146,.04), 0 10px 34px rgba(0,0,0,.32);
}

.nav a {
  min-height: 35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border-radius: 999px;
  color: rgba(244,234,219,.74);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.nav a:hover {
  color: var(--ink);
  background: rgba(202,163,91,.10);
}

.page-frame { z-index: 8; }

@media (max-width: 920px) {
  .site-header { padding: 12px 16px 0; }
  .site-header::before { height: 98px; }
  .header-inner {
    min-height: 64px;
    padding: 8px 10px;
    border-radius: 20px;
    gap: 10px;
  }
  .brand img { width: 168px; max-width: 44vw; }
  .nav { gap: 4px; padding: 4px; }
  .nav a:not(.gold):not(.keep-mobile):not([aria-current="page"]) { display: none; }
  .nav a { min-height: 34px; padding: 0 10px; font-size: 10px; }
}

@media (max-width: 480px) {
  .brand img { width: 148px; max-width: 50vw; }
  .header-inner::before,
  .header-inner::after { left: 12px; right: 12px; }
}

/* Consistent active nav state. */
.nav a {
  text-decoration: none;
}

.nav a.gold,
.nav a[aria-current="page"] {
  color: #11100c;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  text-decoration: none;
}

/* Shared centre-panel artwork. */
.hero-panel:not(.detail-hero-with-cover),
.legal-hero,
.contact-page-main .form-panel {
  background-image:
    linear-gradient(90deg, rgba(4,6,9,.88) 0%, rgba(4,6,9,.66) 42%, rgba(4,6,9,.44) 100%),
    linear-gradient(180deg, rgba(4,6,9,.18), rgba(4,6,9,.90)),
    url("../assets/images/questkernel-detailed-header.jpg");
  background-size: 100% 100%, 100% 100%, cover;
  background-position: center, center, center;
  background-repeat: no-repeat;
}

.hero-panel > *,
.legal-hero > * {
  position: relative;
  z-index: 2;
}

.hero-panel::after,
.legal-hero::after {
  z-index: 3;
}
