/* ==========================================================================
   authentication.css — passcode entry only (index.html)
   A deliberately separate visual world from the archive: near-black ground,
   a single ruled aperture, no imagery, no chrome.
   ========================================================================== */

:root {
  --gate-bg:     #100c14;
  --gate-fg:     #f4f0e8;
  --gate-dim:    rgba(244, 240, 232, 0.5);
  --gate-line:   rgba(244, 240, 232, 0.2);
  --gate-copper: #c68a57;
  --gate-warn:   #e0b573;
  --gate-error:  #e08f7a;
  --gate-ok:     #9dbd93;
  --gate-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --gate-sans:    "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --gate-mono:    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --gate-ease:    cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 5vw, 3rem);
  background: var(--gate-bg);
  color: var(--gate-fg);
  font-family: var(--gate-sans);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* a single, very quiet field of light behind the aperture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(58% 46% at 50% 40%, rgba(198, 138, 87, 0.14), transparent 68%),
    radial-gradient(80% 60% at 50% 108%, rgba(59, 33, 69, 0.5), transparent 70%);
  pointer-events: none;
}

::selection { background: var(--gate-copper); color: var(--gate-bg); }

:focus-visible { outline: 2px solid var(--gate-copper); outline-offset: 3px; }

.gate {
  position: relative;
  width: 100%;
  max-width: 460px;
}

.gate__shell {
  border: 1px solid var(--gate-line);
  padding: clamp(1.75rem, 6vw, 3.25rem);
  background: rgba(244, 240, 232, 0.022);
}

.gate__shell.is-refused { animation: gate-refuse 0.42s var(--gate-ease); }

@keyframes gate-refuse {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  45%      { transform: translateX(5px); }
  70%      { transform: translateX(-3px); }
}

.gate__rule {
  width: 2.5rem;
  height: 1px;
  background: var(--gate-copper);
  margin-bottom: 1.6rem;
}

.gate__kicker {
  margin: 0 0 0.9rem;
  font-family: var(--gate-mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gate-copper);
}

.gate__title {
  margin: 0 0 0.85rem;
  font-family: var(--gate-display);
  font-size: clamp(1.9rem, 6.5vw, 2.6rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
}

.gate__note {
  margin: 0 0 2.1rem;
  max-width: 34ch;
  font-size: 0.9375rem;
  line-height: 1.62;
  color: var(--gate-dim);
}

.gate__field { display: block; margin-bottom: 1.35rem; }

.gate__label {
  display: block;
  margin-bottom: 0.7rem;
  font-family: var(--gate-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gate-dim);
}

.gate__input {
  display: block;
  width: 100%;
  min-height: 54px;
  padding: 0.85rem 0;
  border: 0;
  border-bottom: 1px solid var(--gate-line);
  border-radius: 0;
  background: transparent;
  color: var(--gate-fg);
  font-family: var(--gate-mono);
  font-size: 1.0625rem;
  letter-spacing: 0.34em;
  transition: border-color 0.3s var(--gate-ease);
  -webkit-appearance: none;
  appearance: none;
}
.gate__input::placeholder { color: rgba(244, 240, 232, 0.24); letter-spacing: 0.2em; }
.gate__input:hover  { border-bottom-color: rgba(244, 240, 232, 0.38); }
.gate__input:focus  { outline: none; border-bottom-color: var(--gate-copper); }
.gate__input:focus-visible { outline: none; }
.gate__input[aria-invalid="true"] { border-bottom-color: var(--gate-error); }

/* keep browser autofill inside the design */
.gate__input:-webkit-autofill,
.gate__input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--gate-fg);
  -webkit-box-shadow: 0 0 0 1000px var(--gate-bg) inset;
  caret-color: var(--gate-fg);
}

.gate__submit {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  width: 100%;
  min-height: 54px;
  padding: 0.9rem 1.35rem;
  border: 1px solid var(--gate-fg);
  border-radius: 0;
  background: var(--gate-fg);
  color: var(--gate-bg);
  font-family: var(--gate-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.28s var(--gate-ease), color 0.28s var(--gate-ease), border-color 0.28s var(--gate-ease);
  -webkit-appearance: none;
  appearance: none;
}
.gate__submit::after { content: "\2192"; font-family: var(--gate-sans); font-size: 0.95rem; letter-spacing: 0; }
.gate__submit:hover, .gate__submit:focus-visible {
  background: var(--gate-copper);
  border-color: var(--gate-copper);
  color: var(--gate-bg);
}
.gate__submit:active { transform: translateY(1px); }

.gate__status {
  display: block;
  min-height: 1.5rem;
  margin-top: 1.15rem;
  font-family: var(--gate-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  line-height: 1.55;
  color: var(--gate-dim);
}
.gate__status[data-tone="error"] { color: var(--gate-error); }
.gate__status[data-tone="warn"]  { color: var(--gate-warn); }
.gate__status[data-tone="ok"]    { color: var(--gate-ok); }

.gate__fallback {
  margin: 1.5rem 0 0;
  font-family: var(--gate-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  line-height: 1.6;
  color: rgba(244, 240, 232, 0.42);
}

.gate__vh {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 380px) {
  .gate__shell { padding: 1.5rem 1.25rem; }
  .gate__input { letter-spacing: 0.22em; }
  .gate__submit { font-size: 0.66rem; letter-spacing: 0.16em; padding-inline: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
