html,
body {
  height: 100%;
}

body {
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 28% 42%, rgba(54, 84, 82, 0.24), transparent 62%),
    radial-gradient(80% 60% at 76% 80%, rgba(226, 173, 109, 0.07), transparent 60%),
    #070d0e;
}

.stage {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  width: min(1280px, 100%);
  height: 100%;
  margin: 0 auto;
  padding: 0 6vw;
}

.door-side {
  position: relative;
  height: 100%;
  min-height: 0;
}

#door-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  animation: scene-in 1.6s ease both;
}

@keyframes scene-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.copy {
  max-width: 360px;
  padding-left: 3vw;
  transition: opacity 0.7s ease, transform 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
  animation: copy-in 1.4s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.copy::before {
  content: "";
  display: block;
  width: 34px;
  height: 1px;
  margin-bottom: 30px;
  background: rgba(226, 173, 109, 0.32);
}

@keyframes copy-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

form {
  margin: 0;
}

label {
  display: block;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
  letter-spacing: 0.16em;
}

.field {
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  transition: border-color 0.3s ease;
}

.field:focus-within {
  border-color: rgba(226, 173, 109, 0.45);
}

input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 22px;
  letter-spacing: 0.3em;
  padding: 4px 0;
}

input::placeholder {
  color: #53605c;
  font-size: 14px;
  letter-spacing: 0.12em;
}

.field button {
  flex: none;
  padding: 5px 0 6px;
  color: var(--amber);
  font-size: 14px;
  letter-spacing: 0.22em;
  border-bottom: 1px solid rgba(226, 173, 109, 0.3);
  transition: color 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
}

.field button:hover,
.field button:focus-visible {
  color: #f4d2a1;
  border-color: rgba(244, 210, 161, 0.7);
  outline: none;
}

.field button:disabled {
  opacity: 0.45;
  cursor: default;
}

.error {
  min-height: 20px;
  margin: 12px 0 0;
  color: #d79a7e;
  font-size: 12px;
  letter-spacing: 0.06em;
}

body.opening .copy {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #04080f;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease;
}

body.opening::after {
  opacity: 1;
  transition-delay: 1.35s;
}

@media (max-width: 860px) {
  body {
    overflow-y: auto;
  }

  .stage {
    grid-template-columns: 1fr;
    grid-template-rows: 52vh auto;
    padding: 0 26px 40px;
  }

  .door-side {
    height: 52vh;
  }

  .copy {
    max-width: 100%;
    padding-left: 0;
    padding-top: 4vh;
  }

  .copy::before {
    margin-bottom: 22px;
  }
}

@media (max-width: 420px) {
  .stage {
    grid-template-rows: 46vh auto;
  }

  .door-side {
    height: 46vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  #door-canvas,
  .copy {
    animation: none;
  }

  .copy,
  body::after {
    transition-duration: 0.01s;
  }
}
