/* The foyer: inscription, monumental doors and the entering sequence. */

.entrance {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Dark marble hall lit from above. */
  background:
    radial-gradient(ellipse 70% 55% at 50% 0%, rgb(255 226 160 / 0.16), transparent 70%),
    radial-gradient(ellipse 120% 60% at 50% 110%, rgb(0 0 0 / 0.8), transparent 70%),
    repeating-linear-gradient(115deg, rgb(255 255 255 / 0.015) 0 2px, transparent 2px 140px),
    linear-gradient(180deg, #13201d, var(--color-night));
}

.entrance-tools {
  position: absolute;
  top: 0.75rem;
  right: var(--page-gutter);
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.entrance-tool {
  padding: 0.3rem 0.8rem;
  border: 1px solid rgb(201 154 59 / 0.4);
  background: transparent;
  color: var(--color-ink-muted);
  font-family: var(--font-label);
  font-size: 0.75rem;
  cursor: pointer;
}

.entrance-tool:hover:not(:disabled) {
  color: var(--color-gold-light);
  border-color: var(--color-gold);
}

.entrance-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.9rem, 2.4vh, 1.6rem);
  padding: clamp(2.5rem, 6vh, 4rem) var(--page-gutter) 1rem;
  text-align: center;
  transition: transform 0.8s cubic-bezier(0.55, 0, 0.75, 0.2), opacity 0.8s ease-in;
  transform-origin: 50% 62%;
}

.entrance-kicker {
  margin: 0;
  font-family: var(--font-label);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-gold);
}

/* The inscription appears line by line, as if the light finds it. */
.entrance-inscription {
  max-width: 40rem;
}

.inscription-line {
  margin: 0.35rem 0;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.3vw, 1.2rem);
  font-style: italic;
  color: var(--color-ink);
  opacity: 0;
  animation: inscription-reveal 1.4s ease-out forwards;
}

.inscription-line:nth-child(2) {
  animation-delay: 1.1s;
}

.inscription-line:nth-child(3) {
  animation-delay: 2.2s;
}

.inscription-challenge {
  margin-top: 0.9rem;
  font-style: normal;
  color: var(--color-gold-light);
}

@keyframes inscription-reveal {
  from {
    opacity: 0;
    transform: translateY(6px);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

/* Double doors. Perspective lets them swing open in 3D. */
.entrance-portal {
  position: relative;
  width: min(340px, 72vw);
  height: min(40vh, 360px);
  min-height: 220px;
  perspective: 1100px;
  border: 10px solid #3a2a1c;
  border-bottom: 0;
  border-radius: 170px 170px 0 0 / 120px 120px 0 0;
  box-shadow:
    0 0 0 3px var(--color-gold-dark),
    0 30px 60px rgb(0 0 0 / 0.6);
  background: #050807;
  overflow: hidden;
}

/* Warm light behind the doors; it is only seen once they open. */
.portal-light {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 50% 55%, #fff6dc, #f1c86a 35%, #a5701f 70%, #3a2412);
  transition: transform 0.8s ease-in, filter 0.8s ease-in;
}

.portal-door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background:
    linear-gradient(90deg, rgb(0 0 0 / 0.25), transparent 15%, transparent 85%, rgb(0 0 0 / 0.3)),
    repeating-linear-gradient(90deg, #4a3020 0 7px, #523624 7px 13px),
    #4a3020;
  box-shadow:
    inset 0 0 0 10px #3a2618,
    inset 0 0 0 12px rgb(201 154 59 / 0.35),
    inset 0 -90px 0 -60px rgb(0 0 0 / 0.2);
  transition: transform 1.1s cubic-bezier(0.6, 0, 0.3, 1);
}

.portal-door::after {
  /* Brass handle. */
  content: '';
  position: absolute;
  top: 55%;
  width: 12px;
  height: 46px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--color-gold-light), var(--color-gold-dark));
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.5);
}

.portal-door-left {
  left: 0;
  transform-origin: left center;
}

.portal-door-left::after {
  right: 14px;
}

.portal-door-right {
  right: 0;
  transform-origin: right center;
}

.portal-door-right::after {
  left: 14px;
}

.entrance-button {
  position: absolute;
  left: 50%;
  top: 34%;
  z-index: 1;
  transform: translateX(-50%);
  padding: 0.65rem 1.4rem;
  border: 1px solid var(--color-gold-dark);
  background: linear-gradient(180deg, var(--color-gold-light), var(--color-gold) 55%, var(--color-gold-dark));
  color: #2a1a08;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 6px 14px rgb(0 0 0 / 0.55), inset 0 1px 0 rgb(255 255 255 / 0.5);
  transition: opacity 0.4s ease, transform 0.25s ease;
}

.entrance-button:hover:not(:disabled) {
  transform: translateX(-50%) translateY(-2px);
}

.entrance-button:disabled {
  cursor: wait;
}

.entrance-note {
  margin: 0;
  font-family: var(--font-label);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--color-ink-muted);
}

.entrance .gallery-status {
  margin: 0;
  font-style: italic;
  color: var(--color-ink-muted);
}

.entrance .gallery-status:empty {
  display: none;
}

/* Entering sequence, step 1: the doors swing open. */
.entrance.is-opening .portal-door-left {
  transform: rotateY(-105deg);
}

.entrance.is-opening .portal-door-right {
  transform: rotateY(105deg);
}

.entrance.is-opening .entrance-button {
  opacity: 0;
}

/* Step 2: walk through the doorway into the light. */
.entrance.is-entering .entrance-inner {
  transform: scale(2.6);
  opacity: 0;
}

.entrance.is-entering .portal-light {
  transform: scale(3);
  filter: brightness(1.6);
}
