/* ============================================================
   THE ADVONGER ARCHIVE — shared foundation
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=VT323&display=swap');

:root {
  --ink: #0c0a08;
  --ink-2: #14100b;
  --brass: #c9a35c;
  --brass-bright: #e8c987;
  --brass-dim: #8a6f3f;
  --bone: #efe6d4;
  --bone-dim: #b9ac93;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --display: 'Cinzel', 'Trajan Pro', serif;
  --mono: 'VT323', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--brass-dim); color: var(--ink); }

/* ---- film grain + vignette, laid over every page ---- */
.grain, .vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 90;
}
.grain {
  opacity: .07;
  background-image: 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='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
  animation: grain-shift 1.4s steps(3) infinite;
}
@keyframes grain-shift {
  0% { transform: translate(0,0); }
  33% { transform: translate(-6px,4px); }
  66% { transform: translate(4px,-6px); }
  100% { transform: translate(0,0); }
}
.vignette {
  background: radial-gradient(ellipse at 50% 42%, transparent 52%, rgba(0,0,0,.55) 100%);
}

/* ---- engraved section headings ---- */
.hall-heading {
  text-align: center;
  padding: 0 24px;
}
.hall-heading .over {
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: .55em;
  text-indent: .55em;
  color: var(--brass-dim);
  text-transform: uppercase;
  display: block;
  margin-bottom: 14px;
}
.hall-heading h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(26px, 4vw, 44px);
  letter-spacing: .14em;
  color: var(--bone);
  text-transform: uppercase;
}
.hall-heading .rule {
  width: 130px; height: 13px; margin: 18px auto 0;
  background:
    radial-gradient(circle 3px at 50% 50%, var(--brass) 40%, transparent 45%),
    linear-gradient(to right, transparent, var(--brass-dim) 20%, var(--brass-dim) 80%, transparent) 50% 50% / 100% 1px no-repeat;
}

/* ---- the brass return plaque (fixed, top-left) ---- */
.return-plaque {
  position: fixed; top: 22px; left: 22px; z-index: 80;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 18px 9px 12px;
  background: linear-gradient(160deg, #2a2114, #171208 60%);
  border: 1px solid rgba(201,163,92,.4);
  box-shadow: 0 4px 18px rgba(0,0,0,.6), inset 0 1px 0 rgba(232,201,135,.18);
  border-radius: 2px;
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--brass);
  cursor: pointer;
  transition: border-color .35s, color .35s, transform .35s;
}
.return-plaque:hover {
  border-color: var(--brass);
  color: var(--brass-bright);
  transform: translateY(-1px);
}
.return-plaque .arrow {
  font-family: var(--serif); font-size: 17px; letter-spacing: 0;
  transform: translateY(-1px);
  transition: transform .35s;
}
.return-plaque:hover .arrow { transform: translate(-3px, -1px); }

/* ---- shared trailer shells ---- */
.trailer-frame {
  position: relative;
  width: min(940px, 92vw);
  margin: 0 auto;
  aspect-ratio: 16 / 9;
}
.trailer-frame iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.trailer-link {
  margin-top: 16px;
  text-align: center;
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: .24em;
  text-indent: .24em;
  text-transform: uppercase;
}
.trailer-link a {
  color: inherit;
  border-bottom: 1px solid currentColor;
  opacity: .78;
  transition: opacity .25s, color .25s;
}
.trailer-link a:hover,
.trailer-link a:focus-visible {
  opacity: 1;
}

/* ---- shared steam shrine ---- */
.steam-shrine {
  width: min(760px, 92vw);
  margin: 0 auto;
}
.steam-widget {
  width: 100%; max-width: 646px; height: 200px;
  border: 0; display: block; margin: 0 auto;
}
.steam-note {
  text-align: center;
  font-size: 16px;
  font-style: italic;
  color: var(--bone-dim);
  margin-top: 14px;
}
.steam-note a {
  color: var(--brass);
  border-bottom: 1px solid rgba(201,163,92,.35);
  transition: color .3s, border-color .3s;
}
.steam-note a:hover { color: var(--brass-bright); border-color: var(--brass-bright); }

/* ---- shared lightbox ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5,4,2,.93);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .45s ease;
  cursor: zoom-out;
  padding: 4vh 4vw;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-width: 100%; max-height: 100%;
  box-shadow: 0 30px 90px rgba(0,0,0,.8);
  border: 1px solid rgba(201,163,92,.25);
}
.lightbox .lb-caption {
  position: absolute; bottom: 3vh; left: 0; right: 0;
  text-align: center;
  font-family: var(--display); font-size: 11px;
  letter-spacing: .4em; text-transform: uppercase;
  color: var(--brass-dim);
}

/* ---- scroll reveal primitives ---- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.1s cubic-bezier(.2,.6,.2,1), transform 1.1s cubic-bezier(.2,.6,.2,1);
}
.reveal.lit { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .12s; }
.reveal.d2 { transition-delay: .24s; }
.reveal.d3 { transition-delay: .36s; }

/* ---- archive footer / colophon ---- */
.colophon {
  padding: 90px 24px 70px;
  text-align: center;
}
.colophon img.mark {
  width: 68px; margin: 0 auto 20px; opacity: .8;
}
.colophon .curator {
  font-family: var(--display);
  font-size: 11px; letter-spacing: .5em; text-indent: .5em;
  text-transform: uppercase;
  color: var(--brass-dim);
}
.colophon .quiet {
  margin-top: 12px;
  font-style: italic; font-size: 16px;
  color: rgba(185,172,147,.55);
}

/* ---- transition veil (played when leaving a page) ---- */
.veil {
  position: fixed; inset: 0; z-index: 300;
  pointer-events: none;
  opacity: 0;
}
.veil.active { pointer-events: auto; }
.veil--archive {
  background:
    radial-gradient(ellipse 70% 58% at 50% 45%, rgba(232,201,135,.16), transparent 62%),
    radial-gradient(circle at 50% 52%, #23190d, #090604 72%);
}
.veil--archive.active { animation: archive-close .82s ease-in forwards; }
.veil--archive::before,
.veil--archive::after {
  content: '';
  position: absolute; left: 0; right: 0;
  height: 50%;
  background:
    linear-gradient(rgba(232,201,135,.08), rgba(0,0,0,.2)),
    repeating-linear-gradient(90deg, #120c05 0 54px, #1f160b 54px 58px, #120c05 58px 112px);
  box-shadow: inset 0 0 60px rgba(0,0,0,.85);
}
.veil--archive::before { top: 0; transform: translateY(-102%); }
.veil--archive::after { bottom: 0; transform: translateY(102%); }
.veil--archive.active::before { animation: archive-door-top .82s cubic-bezier(.5,0,.75,1) forwards; }
.veil--archive.active::after { animation: archive-door-bottom .82s cubic-bezier(.5,0,.75,1) forwards; }
.veil--gold { background: radial-gradient(circle at 50% 60%, #f3d489, #b07f2e 55%, #241503); }
.veil--gold.active { animation: veil-flood .85s ease-in forwards; }
.veil--ripple { background: radial-gradient(circle at 50% 45%, #2a1745, #0b0618 70%); }
.veil--ripple.active { animation: veil-flood .85s ease-in forwards; }
.veil--ripple::after {
  content: ''; position: absolute; left: 50%; top: 45%;
  width: 10px; height: 10px; border-radius: 50%;
  transform: translate(-50%,-50%);
  border: 2px solid rgba(190,160,255,.8);
  opacity: 0;
}
.veil--ripple.active::after { animation: ripple-ring .85s ease-out forwards; }
.veil--crt { background: #000; }
.veil--crt.active { animation: veil-flood .3s ease-in forwards; }
.veil--crt::after {
  content: ''; position: absolute; left: 0; right: 0; top: 50%;
  height: 3px; margin-top: -1px;
  background: #fff; box-shadow: 0 0 30px 6px rgba(255,255,255,.9);
  transform: scaleX(0);
}
.veil--crt.active::after { animation: crt-line .8s ease forwards; }
.veil--gate { background: transparent; }
.veil--gate::before {
  content: '';
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(90deg, #241708 0 26px, #3a2712 26px 34px, #241708 34px 60px),
    #241708;
  box-shadow: inset 0 -20px 50px rgba(0,0,0,.7);
  transform: translateY(-102%);
}
.veil--gate.active::before { animation: gate-drop .8s cubic-bezier(.6,0,.9,.6) forwards; }
.veil--gate.active { animation: veil-hold .85s forwards; }
.veil--paint { background: transparent; }
.veil--paint::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    #eab661 0 25%, #bda4e8 25% 50%, #ff6f5e 50% 75%, #aec873 75% 100%);
  transform: translateY(-103%);
}
.veil--paint::after {
  content: '';
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(90deg,
      transparent 0 6%, rgba(0,0,0,.16) 6% 7.4%, transparent 7.4% 11%,
      rgba(255,255,255,.12) 11% 12.2%, transparent 12.2% 17%),
    linear-gradient(rgba(0,0,0,0) 60%, rgba(0,0,0,.25));
  transform: translateY(-103%);
}
.veil--paint.active { animation: veil-hold .85s forwards; }
.veil--paint.active::before { animation: paint-pour .8s cubic-bezier(.55,.05,.8,.5) forwards; }
.veil--paint.active::after { animation: paint-pour .8s .07s cubic-bezier(.55,.05,.8,.5) forwards; }
@keyframes paint-pour { to { transform: translateY(0); } }
@keyframes archive-close { from { opacity: 0; } to { opacity: 1; } }
@keyframes archive-door-top { to { transform: translateY(0); } }
@keyframes archive-door-bottom { to { transform: translateY(0); } }
@keyframes veil-flood { from { opacity: 0; } to { opacity: 1; } }
@keyframes ripple-ring {
  0% { opacity: 1; box-shadow: 0 0 0 0 rgba(190,160,255,.5); }
  100% { opacity: 0; width: 130vmax; height: 130vmax; box-shadow: 0 0 0 40px rgba(190,160,255,.12); }
}
@keyframes crt-line {
  0% { transform: scaleX(0); opacity: 1; }
  45% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1) scaleY(.2); opacity: 0; }
}
@keyframes gate-drop { to { transform: translateY(0); } }
@keyframes veil-hold { 0%, 100% { opacity: 1; } }

/* arrival: every game page fades up from black */
.arrive-shade {
  position: fixed; inset: 0; z-index: 250;
  background: #000;
  pointer-events: none;
  animation: arrive 1.4s ease forwards;
}
@keyframes arrive { from { opacity: 1; } to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
}

@media (max-width: 640px) {
  body { font-size: 17px; }
  .return-plaque { top: 12px; left: 12px; padding: 7px 13px 7px 10px; font-size: 10px; }
}
