/* ============================================
   Letterbound — Private Access Gate (3.7)
   ============================================
   A minimal dark-warm unlock screen shown
   before ANY part of the experience is visible.
   The entire Letterbound app remains display:none
   until the correct credentials are entered.
   ============================================ */

.gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1100px 700px at 50% 28%, rgba(196, 168, 130, 0.07), transparent 62%),
    radial-gradient(700px 560px at 82% 92%, rgba(196, 168, 130, 0.045), transparent 55%),
    #171310;
  transition: opacity 0.75s ease;
}

/* Warm cinematic vignette */
.gate::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 42%, transparent 55%, rgba(10, 8, 6, 0.55) 100%);
}

.gate *,
.gate *::before,
.gate *::after {
  box-sizing: border-box;
}

/* Fade-out state applied by gate.js on unlock */
.gate--leaving {
  opacity: 0;
  pointer-events: none;
}

.gate[hidden] {
  display: none;
}

.gate__card {
  position: relative;
  width: 100%;
  max-width: 360px;
  padding: 40px 34px 34px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0) 40%),
    #1e1813;
  border: 1px solid rgba(196, 168, 130, 0.16);
  border-radius: 16px;
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.6),
    0 6px 18px -8px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Gentle shake on incorrect credentials */
.gate__card--shake {
  animation: gate-shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes gate-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

.gate__head {
  margin-bottom: 28px;
}

.gate__mark {
  width: 26px;
  height: 26px;
  color: #c9a96a;
  margin-bottom: 14px;
  opacity: 0.9;
}

.gate__wordmark {
  margin: 0 0 6px;
  font-family: 'Cormorant Garamond', 'Times New Roman', serif;
  font-weight: 500;
  font-size: 1.7rem;
  letter-spacing: 0.02em;
  color: #ecdfc3;
}

.gate__label {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #9d8e78;
}

/* Small gold rule under the label */
.gate__label::after {
  content: '';
  display: block;
  width: 26px;
  height: 1px;
  margin: 12px auto 0;
  background: linear-gradient(90deg, transparent, rgba(201, 169, 106, 0.55), transparent);
}

.gate__form {
  display: grid;
  gap: 14px;
  text-align: left;
}

.gate__field {
  display: grid;
  gap: 6px;
}

.gate__field-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #b3a48c;
}

.gate__input {
  width: 100%;
  padding: 12px 14px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.95rem;
  color: #f1e8d8;
  background: #17110d;
  border: 1px solid rgba(196, 168, 130, 0.22);
  border-radius: 9px;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.gate__input::placeholder {
  color: #6d6152;
}

.gate__input:hover {
  border-color: rgba(196, 168, 130, 0.34);
}

.gate__input:focus {
  border-color: rgba(201, 169, 106, 0.7);
  box-shadow: 0 0 0 3px rgba(201, 169, 106, 0.14);
}

.gate__error {
  min-height: 1.25em;
  margin: -2px 0 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.8125rem;
  color: #e09a82;
  text-align: left;
}

.gate__error:empty {
  visibility: hidden;
}

.gate__submit {
  margin-top: 6px;
  padding: 13px 16px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #211a12;
  background: linear-gradient(180deg, #d2b285, #c0a070);
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.25s ease, filter 0.25s ease;
  box-shadow: 0 10px 24px -10px rgba(201, 169, 106, 0.45);
}

.gate__submit:hover {
  filter: brightness(1.06);
  box-shadow: 0 14px 28px -10px rgba(201, 169, 106, 0.5);
}

.gate__submit:active {
  transform: translateY(1px);
}

.gate__submit:focus-visible {
  outline: 2px solid #d2b285;
  outline-offset: 3px;
}

/* ============================================
   Application reveal — the landing page fades
   in only after the gate is passed
   ============================================ */

#letterboundApp.letterbound-app--enter {
  opacity: 0;
}

#letterboundApp.letterbound-app--enter.letterbound-app--entered {
  opacity: 1;
  transition: opacity 0.9s ease;
}

/* ============================================
   Reduced motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .gate__card--shake {
    animation: none;
  }
  .gate--leaving,
  #letterboundApp.letterbound-app--enter.letterbound-app--entered {
    transition: none;
  }
}
