/* =========================================================
   Preview gate — a curtain over the site until the password is entered.
   Not security: the site is still in the page source.
   ========================================================= */

html:not(.gate-open) body { overflow: hidden; }
html.gate-open .gate { display: none; }

.gate {
  position: fixed; inset: 0; z-index: 10000;
  display: grid; place-items: center;
  padding: 24px;
}

/* Two halves of the curtain */
.gate-panel {
  position: absolute; top: 0; bottom: 0; width: 50.5%;
  background:
    radial-gradient(ellipse at 100% 50%, rgba(176,116,69,.10), transparent 60%),
    #0f1720;
  transition: transform 1.1s cubic-bezier(.77, 0, .18, 1);
}
.gate-panel-left { left: 0; }
.gate-panel-right {
  right: 0;
  background:
    radial-gradient(ellipse at 0% 50%, rgba(176,116,69,.10), transparent 60%),
    #0f1720;
}
/* subtle seam */
.gate-panel-left::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 1px;
  background: linear-gradient(transparent, rgba(201,148,102,.35), transparent);
}

.gate-card {
  position: relative; z-index: 1;
  width: min(400px, 100%);
  text-align: center;
  color: #fff;
  transition: opacity .45s ease, transform .6s cubic-bezier(.2, .7, .2, 1);
}
.gate-logo { width: 230px; height: auto; margin: 0 auto 2.5rem; }
.gate-title {
  font-family: "Cormorant Garamond", Georgia, serif; font-weight: 500;
  font-size: 2.2rem; color: #fff; margin: 0 0 .4rem;
}
.gate-sub { color: rgba(255,255,255,.6); font-size: .95rem; margin: 0 0 1.75rem; }

.gate-field {
  display: flex; align-items: stretch;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 4px;
  background: rgba(255,255,255,.04);
  transition: border-color .2s, box-shadow .2s;
}
.gate-field:focus-within { border-color: #c99466; box-shadow: 0 0 0 3px rgba(201,148,102,.18); }
.gate-field input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: none;
  color: #fff; font: 400 16px "Inter", system-ui, sans-serif; letter-spacing: .04em;
  padding: 0 1.1rem; height: 54px;
}
.gate-field input::placeholder { color: rgba(255,255,255,.4); letter-spacing: .02em; }
.gate-field button {
  flex: none; width: 54px; border: 0; cursor: pointer;
  background: #b07445; color: #fff; border-radius: 0 3px 3px 0;
  display: grid; place-items: center; transition: background .2s;
}
.gate-field button:hover { background: #8b512e; }
.gate-field svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.gate-error { min-height: 1.4em; margin: .9rem 0 0; font-size: .88rem; color: #e8a08a; }

.gate.shake .gate-field { animation: gateShake .45s cubic-bezier(.36, .07, .19, .97); border-color: #e8a08a; }
@keyframes gateShake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

/* Opening: card fades, curtains part */
.gate.opening .gate-card { opacity: 0; transform: scale(.96); }
.gate.opening .gate-panel-left { transform: translateX(-100%); }
.gate.opening .gate-panel-right { transform: translateX(100%); }
.gate.opening { pointer-events: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .gate-panel, .gate-card { transition: opacity .3s ease; }
  .gate.opening .gate-panel-left, .gate.opening .gate-panel-right { transform: none; opacity: 0; }
}
