/* Passcode gate — deliberately minimal */
@font-face {
  font-family: 'Hanken Grotesk';
  src: url('../fonts/hanken-grotesk.woff2') format('woff2');
  font-weight: 400 600;
  font-display: swap;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  background: #F5F1E8;
  color: #241C21;
  font-family: 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.gate {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

/* thin burgundy frame with an inner antique-gold hairline */
.gate::before,
.gate::after {
  content: '';
  position: fixed;
  pointer-events: none;
}
.gate::before { inset: 14px; border: 1px solid #4B1722; }
.gate::after { inset: 20px; border: 1px solid rgba(180, 147, 90, 0.55); }

.gate__form {
  position: relative;
  z-index: 1;
  width: min(100%, 360px);
  text-align: center;
}

.gate__label {
  display: block;
  margin-bottom: 22px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #4B1722;
}

.gate__label::after {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  margin: 14px auto 0;
  background: #B4935A;
}

.gate__field {
  display: flex;
  border-bottom: 1px solid #241C21;
  transition: border-color 0.2s ease;
}

.gate__field:focus-within { border-color: #4B1722; box-shadow: 0 1px 0 #4B1722; }

.gate__field input {
  flex: 1;
  min-width: 0;
  padding: 14px 4px;
  border: 0;
  background: transparent;
  color: #241C21;
  font: inherit;
  font-size: 1.125rem;
  letter-spacing: 0.24em;
  text-align: center;
  outline: none;
}

.gate__field button {
  flex: none;
  min-width: 88px;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  background: #4B1722;
  color: #F5F1E8;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.gate__field button:hover { background: #241C21; }

.gate__field button:focus-visible {
  outline: 2px solid #4B1722;
  outline-offset: 3px;
}

.gate__error {
  margin: 18px 0 0;
  font-size: 0.875rem;
  color: #4B1722;
}

.is-wrong .gate__field { animation: gate-shake 0.36s ease; }

@keyframes gate-shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

@media (prefers-reduced-motion: reduce) {
  .is-wrong .gate__field { animation: none; }
  .gate__field, .gate__field button { transition: none; }
}
