@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;500&display=swap');

/* Locked: gate visible, page hidden. Unlocked: gate hidden, page visible. */
html:not(.gate-unlocked):not(.gate-unlocking) #page-content { display: none; }
html.gate-unlocked #passcode-gate { display: none; }

#passcode-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  background: #faf4ec;
  opacity: 1;
  transition: opacity 0.85s ease, transform 0.85s ease;
  -webkit-font-smoothing: antialiased;
}
#passcode-gate.hidden { opacity: 0; pointer-events: none; transform: translateY(10px); }

/* ── Title: "A private invitation" ── */
.lock-eyebrow {
  background: url("title.png") no-repeat center / contain;
  width: min(360px, 78vw);
  height: 60px;
  display: block;
  margin: 0 auto clamp(70px, 11vh, 110px);
  text-indent: -9999px;
  white-space: nowrap;
  overflow: hidden;
}

.lock-names-img { display: none; }
.lock-rule      { display: none; }

/* ── Prompt: "Enter password" ── */
.lock-prompt {
  background: url("label.png") no-repeat center / contain;
  width: min(300px, 72vw);
  height: 52px;
  margin: 0 auto 30px;
  padding: 0;
  text-indent: -9999px;
  white-space: nowrap;
  overflow: hidden;
}

.text-input-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(18px, 2.6vh, 28px);
  width: 100%;
  max-width: 320px;
}

.field-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

/* Caveat fallback label, used for "Your name" until a handwritten PNG exists. */
.text-label {
  font-family: 'Caveat', cursive;
  font-style: normal;
  font-weight: 400;
  font-size: clamp(24px, 4vw, 28px);
  color: #4a3f33;
  margin: 0;
  text-align: center;
  line-height: 1;
}

/* ── Shared input base (handwritten typed text + underline) ── */
.pw-input,
.name-input {
  width: 100%;
  height: 64px;
  border: none;
  outline: none;
  background: url("underline.png") no-repeat center bottom / 100% auto;
  font-family: 'Caveat', cursive;
  font-style: normal;
  font-weight: 400;
  font-size: 28px;
  color: #4a3f33;
  text-align: center;
  letter-spacing: 0;
  padding: 0 0 18px;
}
.pw-input:focus,
.name-input:focus { outline: none; }

/* Each input adds a handwritten placeholder image on top of the underline.
   Two knobs per input:
     • WIDTH (e.g. "160px") — sets image width; height auto-scales to keep aspect ratio.
       Shrink if the placeholder clips into the underline.
     • VERTICAL OFFSET (e.g. "center 8px") — distance from the input's top edge.
       Smaller px → nudge up; larger px → nudge down. */
.pw-input {
  background:
    url("password-placeholder.png") no-repeat center 8px / 160px auto,
    url("underline.png") no-repeat center bottom / 100% auto;
}
.pw-input:not(:placeholder-shown) {
  background: url("underline.png") no-repeat center bottom / 100% auto;
}
.pw-input::placeholder { color: transparent; }

.name-input {
  background:
    url("fullname-placeholder.png") no-repeat center 4px / 130px auto,
    url("underline.png") no-repeat center bottom / 100% auto;
}
.name-input:not(:placeholder-shown) {
  background: url("underline.png") no-repeat center bottom / 100% auto;
}
.name-input::placeholder { color: transparent; }

/* ── Submit: hand-drawn rectangle + "Enter" baked in ── */
.pw-submit {
  background: url("enter-button.png") no-repeat center / contain;
  width: 200px;
  height: 72px;
  border: none;
  border-radius: 0;
  padding: 0;
  cursor: pointer;
  font-size: 0;        /* hide visible text; screen readers still read it */
  color: transparent;
  transition: opacity 0.2s, transform 0.15s;
}
.pw-submit:hover  { opacity: 0.7; }
.pw-submit:active { transform: scale(0.97); }

/* ── Error (kept in Caveat to match the handwritten ink) ── */
.error-msg {
  margin-top: 18px;
  font-family: 'Caveat', cursive;
  font-style: normal;
  font-size: 22px;
  color: #b04a3a;
  text-align: center;
  min-height: 24px;
  transition: opacity .3s;
  letter-spacing: 0;
}
.error-msg.invisible { opacity: 0; }

@keyframes shake {
  0%,100% { transform: translateX(0) }
  20% { transform: translateX(-7px) }
  40% { transform: translateX(7px) }
  60% { transform: translateX(-4px) }
  80% { transform: translateX(4px) }
}
.shake { animation: shake .42s ease; }
