/* ═══════════════════════════════════════════════════════════════
   THE RITUAL — MOTH VIGIL
   a candlelit crypt you descend into.
   world by spencer nakamura — demonstration site.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --field: #070506;        /* surface at the crypt door */
  --void: #000000;         /* the floor of the crypt */
  --bone: #E5DCC8;         /* ink */
  --bone-dim: rgba(229, 220, 200, 0.55);
  --bone-faint: rgba(229, 220, 200, 0.22);
  --amber: #E8A24B;        /* candle */
  --amber-soft: rgba(232, 162, 75, 0.55);
  --amber-faint: rgba(232, 162, 75, 0.16);
  --blood: #4A0E0E;        /* undertone for hovers */
  --stone-hi: #171310;
  --stone-lo: #0C0908;
  --display: 'Pirata One', 'UnifrakturMaguntia', serif;
  --body: 'Cormorant Garamond', 'Georgia', serif;
  --rail-w: 64px;
  --depth: 0;              /* 0 at the door, 1 at the floor — set by JS */
}

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

html { scroll-behavior: smooth; }

body {
  background-color: var(--field); /* JS deepens this as you descend */
  color: var(--bone);
  font-family: var(--body);
  font-size: 19px;
  line-height: 1.55;
  overflow-x: hidden;
  min-height: 100vh;
}

body.gated { overflow: hidden; height: 100vh; }

::selection { background: var(--blood); color: var(--bone); }

img { max-width: 100%; display: block; }

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* small-caps label voice used across the crypt */
.hero-over, .chamber-depth, .chamber-foot, .tarot-sub, .tarot-note,
.stone-date, .stone-city, .stone-state, .stone-claim, .summon-sub,
.social, .rune-name, .relic figcaption, .floor-fine, .floor-fiction,
.crypt-exit, .gate-enter, .hero-descend span {
  font-family: var(--body);
  font-variant-caps: all-small-caps;
  letter-spacing: 0.22em;
  font-feature-settings: "smcp" 1, "c2sc" 1;
}

/* ═══════════ GRAIN ═══════════ */

body::after {
  content: "";
  position: fixed;
  inset: -60px;
  z-index: 900;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  animation: grain-shift 1.6s steps(4) infinite;
}

@keyframes grain-shift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-18px, 12px); }
  50%  { transform: translate(10px, -20px); }
  75%  { transform: translate(-8px, -10px); }
  100% { transform: translate(0, 0); }
}

/* ═══════════ THE GATE ═══════════ */

.gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
}

.gate-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 51%;
  background: var(--void);
  transition: transform 1.5s cubic-bezier(0.7, 0, 0.2, 1);
}

/* texture lives on a pseudo so the left door can mirror it —
   the two panels read as one symmetrical double door */
.gate-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(140% 90% at 50% 50%, rgba(20, 12, 8, 0.45), rgba(0, 0, 0, 0.86)),
    url("img/gate-door-texture.webp") center / cover no-repeat;
}

.gate-panel--left::before { transform: scaleX(-1); }

.gate-panel--left  { left: 0;  border-right: 1px solid rgba(232, 162, 75, 0.28); box-shadow: inset -60px 0 90px -60px rgba(232, 162, 75, 0.12); }
.gate-panel--right { right: 0; border-left: 1px solid rgba(232, 162, 75, 0.28);  box-shadow: inset 60px 0 90px -60px rgba(232, 162, 75, 0.12); }

.gate.opening .gate-panel--left  { transform: translateX(-102%); }
.gate.opening .gate-panel--right { transform: translateX(102%); }

.gate-heart {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.2rem;
  transition: opacity 0.6s ease;
}

.gate.opening .gate-heart { opacity: 0; pointer-events: none; }
.gate.gone { display: none; }

.gate-sigil-btn {
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--bone);
  width: min(38vmin, 240px);
  height: min(38vmin, 240px);
}

.gate-sigil {
  width: 100%;
  height: 100%;
  color: var(--bone);
  filter: drop-shadow(0 0 18px rgba(232, 162, 75, 0.25));
  animation: sigil-pulse 5s ease-in-out infinite;
}

.gate-sigil-btn:hover .gate-sigil,
.gate-sigil-btn:focus-visible .gate-sigil { color: var(--amber); }

@keyframes sigil-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.985); filter: drop-shadow(0 0 10px rgba(232, 162, 75, 0.15)); }
  50%      { opacity: 1;    transform: scale(1);     filter: drop-shadow(0 0 26px rgba(232, 162, 75, 0.35)); }
}

.gate-word {
  font-family: var(--display);
  font-size: clamp(1.4rem, 4vw, 2.3rem);
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: var(--bone);
  text-align: center;
}

.gate-enter {
  font-size: 1.05rem;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: var(--amber);
  background: none;
  border: 1px solid rgba(232, 162, 75, 0.45);
  padding: 0.9rem 3.2rem;
  cursor: pointer;
  transition: background 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}

.gate-enter:hover,
.gate-enter:focus-visible {
  background: var(--blood);
  color: var(--bone);
  box-shadow: 0 0 34px rgba(232, 162, 75, 0.25);
  outline: none;
}

/* ═══════════ EXIT LINK ═══════════ */

.crypt-exit {
  position: fixed;
  top: 1.1rem;
  left: 1.2rem;
  z-index: 800;
  color: var(--bone-dim);
  text-decoration: none;
  font-size: 0.95rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.8s ease 0.9s, transform 0.8s ease 0.9s, color 0.25s ease;
}

body.entered .crypt-exit { opacity: 1; pointer-events: auto; transform: none; }
.crypt-exit:hover, .crypt-exit:focus-visible { color: var(--amber); }

/* ═══════════ CANDLE CURSOR ═══════════ */

.candle {
  position: fixed;
  left: 0;
  top: 0;
  width: 360px;
  height: 360px;
  margin: -180px 0 0 -180px;
  z-index: 850;
  pointer-events: none;
  mix-blend-mode: screen;
  background: radial-gradient(circle,
    rgba(232, 162, 75, 0.17) 0%,
    rgba(232, 162, 75, 0.07) 38%,
    rgba(74, 14, 14, 0.05) 58%,
    transparent 72%);
  opacity: 0;
  will-change: transform, opacity;
}

body.entered .candle { opacity: 1; }
body.no-candle .candle { display: none; }

/* ═══════════ RUNE RAIL ═══════════ */

.rune-rail {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: var(--rail-w);
  z-index: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
  padding: 1.4rem 0;
  opacity: 0;
  transition: opacity 0.9s ease 1.1s;
}

body.entered .rune-rail { opacity: 1; }

.rune {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--bone-faint);
  transition: color 0.3s ease;
}

.rune svg { width: 21px; height: 21px; overflow: visible; }

.rune:hover, .rune:focus-visible { color: var(--amber); outline: none; }
.rune.active { color: var(--bone); }
.rune.active::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px 2px var(--amber-faint);
  transform: translateY(-50%);
}

.rune-name {
  position: absolute;
  right: calc(100% + 2px);
  top: 50%;
  transform: translateY(-50%) translateX(10px);
  font-size: 0.82rem;
  color: var(--amber);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.9);
}

.rune:hover .rune-name,
.rune:focus-visible .rune-name { opacity: 1; transform: translateY(-50%) translateX(0); }

/* ═══════════ DESCENT LAYOUT ═══════════ */

.descent {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 clamp(1.2rem, 4vw, 3rem);
  padding-right: calc(clamp(1.2rem, 4vw, 3rem) + var(--rail-w) * 0.5);
}

.chamber { padding: clamp(4rem, 9vh, 7rem) 0; text-align: center; }

.chamber-depth {
  font-size: 0.85rem;
  color: var(--amber-soft);
  margin-bottom: 0.8rem;
}

.chamber-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3rem, 9vw, 5.2rem);
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  line-height: 1;
  color: var(--bone);
  text-shadow: 0 0 60px rgba(232, 162, 75, 0.12);
  margin-bottom: 1.4rem;
}

.chamber-creed {
  font-size: 1.02rem;
  letter-spacing: 0.18em;
  color: var(--bone-dim);
  max-width: 46ch;
  margin: 0 auto 3.4rem;
}

.chamber-foot {
  margin-top: 3.2rem;
  font-size: 0.9rem;
  color: var(--bone-faint);
}

/* ═══════════ HERO ═══════════ */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  gap: 1.6rem;
  padding: 4rem 0;
}

.hero-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(120vmin, 780px);
  height: min(120vmin, 780px);
  transform: translate(-50%, -50%);
  color: var(--bone);
  opacity: 0.045;
  pointer-events: none;
  animation: watermark-turn 140s linear infinite;
}

@keyframes watermark-turn { to { transform: translate(-50%, -50%) rotate(360deg); } }

.hero-over { font-size: 0.9rem; color: var(--amber-soft); }

.hero-name {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(4rem, 14vw, 9.5rem);
  line-height: 0.95;
  letter-spacing: 0.08em;
  text-indent: 0.08em;
  color: var(--bone);
  text-shadow:
    0 0 22px rgba(232, 162, 75, 0.18),
    0 0 90px rgba(232, 162, 75, 0.10);
}

.hero-line {
  font-size: 1.05rem;
  letter-spacing: 0.28em;
  color: var(--bone-dim);
  max-width: 52ch;
}

.hero-descend {
  margin-top: 2.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  color: var(--amber);
  text-decoration: none;
  font-size: 0.95rem;
}

.hero-descend i {
  display: block;
  width: 1px;
  height: 64px;
  background: linear-gradient(to bottom, var(--amber), transparent);
  animation: descend-drip 2.6s ease-in-out infinite;
}

@keyframes descend-drip {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 0; }
  35%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); transform-origin: top; opacity: 0; }
}

/* ═══════════ DIVIDERS ═══════════ */

.rite-divider {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 0.6rem 0;
}

.rite-divider .line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--bone-faint), transparent);
}

.rite-divider svg {
  width: 30px;
  height: 30px;
  color: var(--amber-soft);
  opacity: 0.85;
}

/* ═══════════ RITES — TAROT ═══════════ */

.tarot-spread {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1.4rem, 3vw, 2.6rem);
}

.tarot {
  width: min(300px, 84vw);
  aspect-ratio: 5 / 8.6;
  perspective: 1400px;
  cursor: pointer;
  outline: none;
}

.tarot-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.9s cubic-bezier(0.5, 0, 0.15, 1);
}

.tarot:focus-visible .tarot-inner,
.tarot.flipped .tarot-inner { transform: rotateY(180deg); }

/* hover flip only where hover is real — on touch, a tap's sticky hover
   would otherwise hold the card flipped after .flipped is toggled off */
@media (hover: hover) {
  .tarot:hover .tarot-inner { transform: rotateY(180deg); }
}

.tarot-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(35, 24, 16, 0.55), transparent 60%),
    linear-gradient(170deg, #100C09 0%, #0A0706 55%, #070506 100%);
  border: 1px solid rgba(232, 162, 75, 0.34);
  box-shadow:
    inset 0 0 0 5px var(--void),
    inset 0 0 0 6px rgba(232, 162, 75, 0.22),
    0 18px 50px -18px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1.1rem 1.3rem;
}

.tarot:hover .tarot-face,
.tarot.flipped .tarot-face { border-color: rgba(232, 162, 75, 0.6); }

.tarot-back {
  transform: rotateY(180deg);
  justify-content: center;
  gap: 1rem;
  /* engraved card-back pattern, darkened so the tracklist stays legible */
  background:
    linear-gradient(rgba(7, 5, 6, 0.78), rgba(7, 5, 6, 0.86)),
    url("img/tarot-back-pattern.webp") center / cover no-repeat;
}

/* ornament corners */
.corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--amber-soft);
  pointer-events: none;
}
.corner::after {
  content: "";
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--amber);
  transform: rotate(45deg);
}
.c-tl { top: 9px; left: 9px; border-width: 1px 0 0 1px; }
.c-tl::after { top: 3px; left: 3px; }
.c-tr { top: 9px; right: 9px; border-width: 1px 1px 0 0; }
.c-tr::after { top: 3px; right: 3px; }
.c-bl { bottom: 9px; left: 9px; border-width: 0 0 1px 1px; }
.c-bl::after { bottom: 3px; left: 3px; }
.c-br { bottom: 9px; right: 9px; border-width: 0 1px 1px 0; }
.c-br::after { bottom: 3px; right: 3px; }

.numeral {
  font-family: var(--display);
  font-size: 1.7rem;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  color: var(--amber);
  margin-bottom: 0.9rem;
}

.numeral--small { font-size: 1.15rem; margin-bottom: 0; color: var(--amber-soft); }

.tarot-art {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(229, 220, 200, 0.16);
  position: relative;
}

.tarot-art::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 46px 14px rgba(0, 0, 0, 0.75);
  pointer-events: none;
}

.tarot-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9) contrast(1.05);
}

.tarot-name {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.45rem;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  margin-top: 1rem;
  color: var(--bone);
}

.tarot-sub { font-size: 0.82rem; color: var(--bone-dim); margin-top: 0.35rem; }

.tracklist {
  list-style: none;
  counter-reset: rite;
  width: 100%;
  max-width: 220px;
  text-align: left;
}

.tracklist li {
  counter-increment: rite;
  font-size: 0.98rem;
  letter-spacing: 0.14em;
  color: var(--bone);
  padding: 0.42rem 0;
  border-bottom: 1px solid rgba(229, 220, 200, 0.1);
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
}

.tracklist li::before {
  content: counter(rite, upper-roman);
  font-size: 0.75rem;
  color: var(--amber-soft);
  min-width: 2em;
}

.tarot-note {
  font-size: 0.78rem;
  color: var(--bone-faint);
  text-align: center;
  max-width: 24ch;
}

/* ═══════════ OMENS — HEADSTONES ═══════════ */

.graveyard {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(1.2rem, 2.6vw, 2.2rem);
}

.headstone {
  position: relative;
  width: min(230px, 78vw);
  min-height: 300px;
  padding: 3.2rem 1.3rem 1.6rem;
  background:
    linear-gradient(160deg, rgba(23, 19, 16, 0.62) 0%, rgba(12, 9, 8, 0.74) 70%, rgba(8, 6, 6, 0.82) 100%),
    url("img/stone-texture.webp") center / cover;
  clip-path: polygon(
    0% 30%, 1.5% 20%, 5% 12%, 10.5% 6%, 18% 2%,
    28% 0.4%, 50% 0%, 72% 0.4%, 82% 2%,
    89.5% 6%, 95% 12%, 98.5% 20%, 100% 30%,
    100% 100%, 0% 100%
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  text-align: center;
}

/* engraved type */
.headstone h3, .headstone p {
  color: rgba(229, 220, 200, 0.52);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9), 0 -1px 0 rgba(229, 220, 200, 0.07);
}

.stone-date { font-size: 0.8rem; letter-spacing: 0.26em; }

.stone-venue {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.65rem;
  letter-spacing: 0.1em;
  line-height: 1.1;
}

.stone-rite { font-size: 0.95rem; font-style: italic; letter-spacing: 0.12em; }

.stone-city { font-size: 0.75rem; color: rgba(229, 220, 200, 0.34); }

.stone-state {
  margin-top: auto;
  padding-top: 1rem;
  font-size: 0.78rem;
  color: rgba(229, 220, 200, 0.3);
}

/* the fallen */
.headstone.dead {
  filter: grayscale(0.7) brightness(0.72);
  opacity: 0.78;
}
.tilt-l { transform: rotate(-2.6deg) translateY(10px); }
.tilt-r { transform: rotate(1.9deg) translateY(14px); }

.headstone.dead::after { /* crack */
  content: "";
  position: absolute;
  top: 8%;
  left: 58%;
  width: 1px;
  height: 34%;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.85) 30%, rgba(0, 0, 0, 0.85) 70%, transparent);
  transform: rotate(14deg);
}

/* the coming — candlelit */
.headstone.lit {
  background:
    radial-gradient(90% 55% at 50% 0%, rgba(232, 162, 75, 0.14), transparent 70%),
    linear-gradient(160deg, rgba(27, 22, 17, 0.6) 0%, rgba(16, 12, 9, 0.72) 70%, rgba(10, 8, 7, 0.8) 100%),
    url("img/stone-texture.webp") center / cover;
}

.headstone.lit h3 { color: var(--bone); }
.headstone.lit .stone-date { color: var(--amber); }
.headstone.lit .stone-rite { color: var(--bone-dim); }

.candle-dot {
  position: absolute;
  top: 1.35rem;
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow:
    0 0 8px 2px rgba(232, 162, 75, 0.8),
    0 0 26px 10px rgba(232, 162, 75, 0.25);
  animation: candle-breathe 3.2s ease-in-out infinite;
}

@keyframes candle-breathe {
  0%, 100% { box-shadow: 0 0 8px 2px rgba(232,162,75,.8), 0 0 26px 10px rgba(232,162,75,.25); opacity: 1; }
  38%      { box-shadow: 0 0 6px 1px rgba(232,162,75,.65), 0 0 18px 7px rgba(232,162,75,.18); opacity: .82; }
  62%      { box-shadow: 0 0 10px 3px rgba(232,162,75,.9), 0 0 34px 13px rgba(232,162,75,.3); opacity: 1; }
}

.stone-claim {
  margin-top: auto;
  padding: 0.5rem 1.1rem;
  font-size: 0.82rem;
  color: var(--amber);
  text-decoration: none;
  border: 1px solid rgba(232, 162, 75, 0.35);
  transition: background 0.3s ease, color 0.3s ease;
}

.stone-claim:hover, .stone-claim:focus-visible {
  background: var(--blood);
  color: var(--bone);
}

/* ═══════════ RELICS — PHOTO CRYPT ═══════════ */

.crypt-wall {
  columns: 3 260px;
  column-gap: 1.3rem;
  text-align: left;
}

.relic {
  break-inside: avoid;
  margin: 0 0 1.3rem;
  position: relative;
  border: 1px solid rgba(229, 220, 200, 0.1);
  background: var(--void);
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.relic img {
  width: 100%;
  object-fit: cover;
  filter: saturate(0.92);
  transition: opacity 0.35s ease;
}

.relic::before { /* vignette */
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 70px 18px rgba(0, 0, 0, 0.72);
  pointer-events: none;
  z-index: 1;
}

.relic:hover {
  border-color: rgba(232, 162, 75, 0.4);
  box-shadow: 0 0 0 1px var(--blood), 0 14px 44px -16px rgba(74, 14, 14, 0.8);
}

.relic figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 1.6rem 0.85rem 0.6rem;
  font-size: 0.72rem;
  color: var(--bone-dim);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88), transparent);
}

/* ═══════════ SUMMON ═══════════ */

.chamber--summon { padding-bottom: clamp(3rem, 6vh, 5rem); }

.summon-link {
  display: inline-block;
  font-family: var(--display);
  font-size: clamp(1.5rem, 5.4vw, 3.1rem);
  letter-spacing: 0.1em;
  color: var(--amber);
  text-decoration: none;
  padding: 1.2rem clamp(1.2rem, 4vw, 3rem);
  border: 1px solid rgba(232, 162, 75, 0.4);
  box-shadow: inset 0 0 0 4px var(--void), inset 0 0 0 5px rgba(232, 162, 75, 0.2);
  transition: background 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.summon-link:hover, .summon-link:focus-visible {
  background: var(--blood);
  color: var(--bone);
  box-shadow: inset 0 0 0 4px rgba(0,0,0,0.4), inset 0 0 0 5px rgba(232, 162, 75, 0.35), 0 0 60px rgba(232, 162, 75, 0.18);
}

.summon-sub { margin-top: 1.6rem; font-size: 0.9rem; color: var(--bone-dim); }

.socials {
  margin-top: 2.6rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.social {
  font-size: 0.85rem;
  color: var(--bone-dim);
  text-decoration: none;
  padding: 0.55rem 1.25rem;
  border: 1px solid rgba(229, 220, 200, 0.16);
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.social:hover, .social:focus-visible {
  color: var(--amber);
  border-color: rgba(232, 162, 75, 0.45);
  background: rgba(74, 14, 14, 0.35);
}

/* ═══════════ FOOTER ═══════════ */

.crypt-floor {
  text-align: center;
  padding: 3.5rem 0 5rem;
  border-top: 1px solid rgba(229, 220, 200, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}

.floor-sigil { width: 44px; height: 44px; color: var(--amber-soft); opacity: 0.8; }

.floor-fiction { font-size: 0.82rem; color: var(--bone-faint); }

.floor-maker {
  font-family: var(--display);
  font-size: clamp(1.05rem, 3vw, 1.5rem);
  letter-spacing: 0.14em;
  color: var(--bone);
  text-decoration: none;
  border-bottom: 1px solid rgba(232, 162, 75, 0.35);
  padding-bottom: 0.3rem;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.floor-maker:hover, .floor-maker:focus-visible { color: var(--amber); border-color: var(--amber); }

.floor-fine { font-size: 0.72rem; color: var(--bone-faint); }

/* ═══════════ REVEAL ON DESCENT ═══════════ */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.reveal.surfaced { opacity: 1; transform: none; }

body.no-reveal .reveal { opacity: 1; transform: none; transition: none; }

/* ═══════════ MOBILE — the rail sinks to the floor ═══════════ */

@media (max-width: 719px) {
  :root { --rail-w: 0px; }

  .descent { padding-right: clamp(1.2rem, 4vw, 3rem); padding-bottom: 86px; }

  .rune-rail {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    transform: none;
    flex-direction: row;
    justify-content: center;
    gap: clamp(1.6rem, 8vw, 3.2rem);
    padding: 0.55rem 0 0.7rem;
    background: rgba(4, 3, 3, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(229, 220, 200, 0.1);
  }

  .rune { flex-direction: column; width: auto; height: auto; gap: 0.25rem; }

  .rune-name {
    position: static;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    font-size: 0.62rem;
    color: var(--bone-faint);
  }

  .rune.active .rune-name, .rune:focus-visible .rune-name { color: var(--amber); }
  .rune.active::after { display: none; }

  .crypt-exit { font-size: 0.8rem; }

  .tilt-l, .tilt-r { transform: rotate(-1.6deg); }
  .tilt-r { transform: rotate(1.4deg); }

  .graveyard { align-items: stretch; }

  .crypt-wall { columns: 2 150px; column-gap: 0.8rem; }
  .relic { margin-bottom: 0.8rem; }
}

@media (max-width: 420px) {
  .crypt-wall { columns: 1; }
}

/* ═══════════ REDUCED MOTION — the crypt holds still ═══════════ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  body::after { animation: none; }

  .gate-panel { transition: none; }
  .gate-heart { transition: opacity 0.2s linear; }
  .gate-sigil { animation: none; opacity: 0.9; }

  .hero-watermark { animation: none; }
  .hero-descend i { animation: none; transform: none; opacity: 0.7; }

  .candle-dot { animation: none; }

  .tarot-inner { transition: none; }

  .reveal { opacity: 1; transform: none; transition: none; }

  .crypt-exit, .rune-rail { transition: none; }
}
