@font-face {
  font-family: "Cinzel";
  src: url("/gate/assets/cinzel.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
:root {
  --gold: #d4af37;
  --gold-hi: #f3d77a;
  --gold-lo: #8a6a1c;
  --dim: #6d5d38;
  --red: #c0392b;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; color: var(--gold); }
body {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: minmax(0, 1fr);
  padding: max(22px, env(safe-area-inset-top)) 22px max(26px, env(safe-area-inset-bottom));
  font-family: var(--mono);
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 60% 45% at 50% 42%, rgb(212 175 55 / .10), transparent 70%),
    #000;
}
/* faint scanlines */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgb(255 255 255 / .022) 0 1px, transparent 1px 3px);
}

.frame { position: fixed; inset: 0; pointer-events: none; }
/* corner brackets */
.frame i {
  position: fixed; width: 26px; height: 26px; border: 0 solid var(--gold-lo); opacity: .7;
}
.frame i:nth-child(1) { top: 12px; left: 12px; border-top-width: 1px; border-left-width: 1px; }
.frame i:nth-child(2) { top: 12px; right: 12px; border-top-width: 1px; border-right-width: 1px; }
.frame i:nth-child(3) { bottom: 12px; left: 12px; border-bottom-width: 1px; border-left-width: 1px; }
.frame i:nth-child(4) { bottom: 12px; right: 12px; border-bottom-width: 1px; border-right-width: 1px; }

.classif {
  justify-self: center;
  display: flex; gap: 10px; align-items: center;
  font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: var(--red);
  border: 1px solid rgb(192 57 43 / .55); padding: 6px 12px 6px 16px;
  max-width: 100%; white-space: nowrap;
}
.classif .sep { color: rgb(192 57 43 / .5); letter-spacing: 0; }

.gate {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(18px, 4vh, 40px);
  min-height: 0;
}
.eagle {
  width: min(620px, 92vw, 92vh);
  height: auto;
  mix-blend-mode: screen;   /* black JPEG-ish backdrop melts into the page */
  animation: rise 1.4s cubic-bezier(.2,.7,.2,1) both;
  user-select: none; -webkit-user-drag: none;
}

.form { width: min(320px, 100%); animation: fade 1s .5s both; }
.lbl {
  display: block; margin-bottom: 10px; text-align: center;
  font-size: 11px; letter-spacing: .4em; text-transform: uppercase; color: var(--dim);
  padding-left: .4em;
}
.field {
  display: flex; height: 50px;
  border: 1px solid var(--gold-lo);
  background: rgb(212 175 55 / .03);
  transition: border-color .2s, box-shadow .2s;
}
.field:focus-within { border-color: var(--gold); box-shadow: 0 0 0 1px rgb(212 175 55 / .25), 0 0 24px rgb(212 175 55 / .12); }
.field input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  color: var(--gold-hi); caret-color: var(--gold);
  font: 22px/1 var(--mono); letter-spacing: .5em; text-align: center;
  padding: 0 0 0 calc(.5em + 50px);
}
.field button {
  width: 50px; flex: none; border: 0; border-left: 1px solid var(--gold-lo);
  background: transparent; color: var(--gold); cursor: pointer;
  display: grid; place-items: center; transition: background .2s;
}
.field button:hover, .field button:focus-visible { background: rgb(212 175 55 / .1); outline: none; }
.field button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }

.msg {
  margin: 12px 0 0; min-height: 1.4em; text-align: center;
  font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--dim);
}
.msg::before { content: "▮ "; animation: blink 1.1s steps(1) infinite; }
.msg.err { color: var(--red); }
.msg.ok { color: var(--gold-hi); }
.form.shake { animation: shake .4s; }
.form.busy .field { opacity: .6; }

.brand {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  animation: fade 1.2s .2s both;
}
.brand h1 {
  margin: 0;
  font: 600 clamp(20px, 4.4vw, 34px)/1 "Cinzel", "Trajan Pro", Georgia, serif;
  letter-spacing: .28em; text-transform: uppercase; padding-left: .28em;
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 45%, var(--gold-lo) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap;
}
.brand .rule { height: 1px; flex: 0 1 90px; background: linear-gradient(90deg, transparent, var(--gold-lo)); }
.brand .rule:last-child { transform: scaleX(-1); }

body.granted .gate, body.granted .brand, body.granted .classif { animation: out .6s forwards; }

@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.97); filter: blur(4px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes out { to { opacity: 0; transform: scale(1.02); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes shake { 20%,60% { transform: translateX(-7px); } 40%,80% { transform: translateX(7px); } }

@media (max-width: 420px) {
  .classif { font-size: 9px; letter-spacing: .16em; gap: 6px; padding: 5px 8px 5px 10px; }
  .brand { gap: 10px; }
  .brand .rule { flex-basis: 18px; }
  .brand h1 { font-size: min(22px, 6.2vw); letter-spacing: .16em; padding-left: .16em; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}
