:root {
  --black: #070707;
  --paper: #F7F1E8;
  --paper-deep: #F3EBE0;
  --gold: #C4A35A;
  --ink: #3B2F2F;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--black);
  color: var(--paper);
}

body {
  min-height: 100dvh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #070707;
}

/* Extremely subtle warm halo behind the panel — no blue or burgundy */
.glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(72vw, 760px);
  height: min(72vw, 760px);
  transform: translate(-50%, -52%);
  background: radial-gradient(circle, rgba(196, 163, 90, 0.11) 0%, rgba(196, 163, 90, 0.04) 38%, transparent 70%);
  filter: blur(8px);
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 75% 70% at 50% 48%, transparent 45%, rgba(0, 0, 0, 0.55) 100%);
}

.topbar {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  padding: calc(16px + var(--safe-top)) calc(18px + var(--safe-right)) 0 18px;
}

.menu-toggle {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(196, 163, 90, 0.32);
  border-radius: 13px;
  background: rgba(247, 241, 232, 0.08);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  color: var(--paper);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
  background: rgba(247, 241, 232, 0.14);
  border-color: rgba(196, 163, 90, 0.55);
  outline: none;
}

.menu-toggle:focus-visible {
  box-shadow: 0 0 0 3px rgba(196, 163, 90, 0.4);
}

.menu-toggle-bars {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 18px;
  height: 12px;
}

.menu-toggle-bars span {
  display: block;
  height: 1.5px;
  width: 100%;
  background: #F7F1E8;
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.menu-open .menu-toggle-bars span:nth-child(1) { transform: translateY(5.25px) rotate(45deg); }
.menu-open .menu-toggle-bars span:nth-child(2) { opacity: 0; }
.menu-open .menu-toggle-bars span:nth-child(3) { transform: translateY(-5.25px) rotate(-45deg); }

.menu {
  position: absolute;
  top: calc(16px + var(--safe-top) + 54px);
  right: calc(18px + var(--safe-right));
  min-width: 188px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(247, 241, 232, 0.1);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid rgba(196, 163, 90, 0.35);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.menu[hidden] { display: none; }

.menu-link {
  display: block;
  padding: 14px 16px;
  border-radius: 11px;
  color: #F7F1E8;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-align: left;
}

.menu-link:hover,
.menu-link:focus-visible {
  background: rgba(196, 163, 90, 0.18);
  outline: none;
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(80px + var(--safe-top)) 24px calc(48px + var(--safe-bottom));
}

.glass {
  width: min(560px, 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(22px, 4.2vw, 48px);
  border-radius: 32px;
  /* Warm parchment frosted glass — holds the dark brown art so it pops on black */
  background:
    linear-gradient(180deg, rgba(247, 241, 232, 0.92) 0%, rgba(243, 235, 224, 0.86) 100%);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  border: 1px solid rgba(196, 163, 90, 0.42);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 0 60px rgba(196, 163, 90, 0.08);
}

.emblem {
  display: block;
  width: min(480px, 82vw);
  height: auto;
  max-height: min(72vh, 640px);
  object-fit: contain;
}

@media (max-width: 430px) {
  .stage {
    padding: calc(76px + var(--safe-top)) 14px calc(36px + var(--safe-bottom));
  }

  .glass {
    width: 100%;
    border-radius: 24px;
    padding: 20px 16px;
  }

  .emblem {
    width: min(340px, 88vw);
    max-height: 68vh;
  }

  .menu { min-width: min(210px, calc(100vw - 32px)); }
}

@media (max-height: 700px) and (max-width: 430px) {
  .emblem { max-height: 62vh; }
}

@media (prefers-reduced-motion: reduce) {
  .menu-toggle-bars span { transition: none; }
}
