:root {
  --void: #000000;
  --ink: #070708;
  --paper: #e4dfd4;
  --ash: #7d7870;
  --line: #2c2a27;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: "Cormorant Garamond", serif;
  background: var(--ink);
  color: var(--paper);
  overflow-x: hidden;
}

body.awaiting {
  background: var(--void);
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: var(--void);
  cursor: pointer;
}

.gate-text,
.sig {
  font-family: "Special Elite", cursive;
  font-size: 0.92rem;
  letter-spacing: 0.42em;
  text-transform: lowercase;
  color: #f5f5f5;
  text-shadow:
    0 0 6px rgba(255, 255, 255, 0.55),
    0 0 18px rgba(255, 255, 255, 0.28),
    0 0 36px rgba(255, 255, 255, 0.12);
  animation: ember 3.2s ease-in-out infinite;
}

.gate.leaving {
  animation: fadeOut 0.7s ease forwards;
}

.stage {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.5rem 2rem;
  animation: rise 1.1s ease;
}

.theatre {
  width: 100%;
  max-width: 1080px;
}

.sig {
  position: absolute;
  top: 1.4rem;
  left: 0;
  right: 0;
  display: block;
  text-align: center;
  margin: 0;
}

.sig::after {
  content: "";
  display: block;
  width: 4.2rem;
  height: 1px;
  margin: 0.7rem auto 0;
  background: linear-gradient(90deg, transparent, rgba(228, 223, 212, 0.38), transparent);
}

.figures {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.4rem;
}

.figure {
  text-align: center;
}

.frame {
  position: relative;
  width: min(78%, 168px);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  overflow: visible;
  border: 1px solid var(--line);
  background: #101010;
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.02),
    0 16px 36px rgba(0, 0, 0, 0.4);
}

.frame img {
  border-radius: 50%;
}

.ticks {
  position: absolute;
  inset: -7px;
  pointer-events: none;
}

.ticks::before,
.ticks::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
}

.ticks::before {
  top: 0;
  left: 0;
  border-top: 1px solid rgba(228, 223, 212, 0.28);
  border-left: 1px solid rgba(228, 223, 212, 0.28);
}

.ticks::after {
  right: 0;
  bottom: 0;
  border-bottom: 1px solid rgba(228, 223, 212, 0.28);
  border-right: 1px solid rgba(228, 223, 212, 0.28);
}

.frame::before,
.frame::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  pointer-events: none;
  z-index: 2;
}

.frame::before {
  top: -7px;
  right: -7px;
  border-top: 1px solid rgba(228, 223, 212, 0.28);
  border-right: 1px solid rgba(228, 223, 212, 0.28);
}

.frame::after {
  bottom: -7px;
  left: -7px;
  border-bottom: 1px solid rgba(228, 223, 212, 0.28);
  border-left: 1px solid rgba(228, 223, 212, 0.28);
}

.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.9) contrast(1.04) brightness(0.92);
  transition: filter 0.4s ease;
}

.figure:hover .frame img {
  filter: saturate(1) contrast(1.08) brightness(0.98);
}

.figure h2 {
  margin-top: 0.8rem;
  font-weight: 500;
  font-size: 1.65rem;
  letter-spacing: 0.16em;
  text-transform: lowercase;
}

.figure h2::after {
  content: "";
  display: block;
  width: 1.8rem;
  height: 1px;
  margin: 0.45rem auto 0;
  background: repeating-linear-gradient(
    90deg,
    rgba(228, 223, 212, 0.32) 0 3px,
    transparent 3px 6px
  );
}

.deck {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  z-index: 5;
}

.knob {
  width: 36px;
  height: 36px;
  border: 1px solid #2c2a26;
  border-radius: 50%;
  background: rgba(10, 10, 12, 0.86);
  color: var(--paper);
  cursor: pointer;
  font-family: "Special Elite", cursive;
}

.cue {
  font-family: "Special Elite", cursive;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: var(--ash);
  min-width: 1.2rem;
  text-align: center;
}

.deck.quiet .bars i {
  animation: none;
  height: 3px;
}

.bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
  height: 14px;
}

.bars i {
  display: block;
  width: 2px;
  background: #ddd;
  animation: pulseBar 0.85s ease-in-out infinite alternate;
}

.bars i:nth-child(2) {
  animation-delay: 0.18s;
}

.bars i:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes ember {
  0%,
  100% {
    opacity: 0.92;
    text-shadow:
      0 0 6px rgba(255, 255, 255, 0.5),
      0 0 18px rgba(255, 255, 255, 0.22);
  }
  50% {
    opacity: 0.55;
    text-shadow:
      0 0 10px rgba(255, 255, 255, 0.7),
      0 0 28px rgba(255, 255, 255, 0.3);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pulseBar {
  from {
    height: 3px;
  }
  to {
    height: 14px;
  }
}

@media (max-width: 860px) {
  .figures {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .figures {
    grid-template-columns: 1fr;
    max-width: 240px;
    margin: 0 auto;
  }

  .deck {
    left: 1rem;
    right: 1rem;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gate-text,
  .sig,
  .bars i,
  .stage,
  .gate {
    animation: none;
  }
}
