@import url("/assets/tokens.css");

body {
  min-height: 100dvh;
  background:
    radial-gradient(120% 90% at 50% 8%, #16181f 0%, var(--ink-900) 58%),
    var(--ink-900);
  color: var(--paper);
  font-family: var(--sans);
  overflow: hidden;
}

/* Faint drifting grain so the black has texture instead of feeling flat. */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  pointer-events: none;
  opacity: 0.035;
  background-image: repeating-conic-gradient(#fff 0% 25%, transparent 0% 50%);
  background-size: 3px 3px;
  animation: drift 9s steps(4) infinite;
}
@keyframes drift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-1px, 1px); }
  50%  { transform: translate(1px, -1px); }
  75%  { transform: translate(-1px, -1px); }
  100% { transform: translate(0, 0); }
}

.mark {
  position: fixed;
  top: clamp(1rem, 2.5vw, 2rem);
  left: clamp(1rem, 2.5vw, 2rem);
  z-index: 3;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--brass);
  opacity: 0.5;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity var(--normal) var(--ease), transform var(--slow) var(--ease);
}
.mark:hover { opacity: 0.92; transform: rotate(24deg); }
.mark:focus-visible { outline: 1px solid var(--brass-dim); outline-offset: 6px; opacity: 0.92; }
.mark svg { width: 100%; height: 100%; display: block; }

.hero {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 2rem;
  text-align: center;
}

.wordmark {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--text-hero);
  line-height: 0.86;
  letter-spacing: -0.035em;
  display: grid;
  animation: rise var(--slow) var(--ease) both;
}
/* Second word set in brass and offset - hierarchy through contrast, not size alone. */
.wordmark span:nth-child(2) {
  color: var(--brass);
  font-style: italic;
  padding-left: 0.32em;
}

.tagline {
  margin: clamp(1.5rem, 4vw, 2.75rem) 0 0;
  font-family: var(--mono);
  font-size: var(--text-xs);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--paper-faint);
  animation: rise var(--slow) 120ms var(--ease) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── the gate ─────────────────────────────────────────── */

.veil {
  position: fixed;
  inset: 0;
  z-index: 8;
  background: rgba(4, 5, 7, 0.82);
  backdrop-filter: blur(7px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--normal) var(--ease);
}
body.gate-open .veil { opacity: 1; }

.gate {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.gate[hidden] { display: none; }

.gate-card {
  width: min(320px, 100%);
  padding: 1.75rem 1.5rem 1.5rem;
  background: linear-gradient(180deg, var(--ink-700), var(--ink-800));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.045);
  animation: pop var(--normal) var(--ease) both;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
body.shake .gate-card { animation: shake 380ms var(--ease); }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  30%, 70% { transform: translateX(4px); }
  50%      { transform: translateX(-4px); }
}

.gate-label {
  margin: 0 0 1.15rem;
  text-align: center;
  font-family: var(--mono);
  font-size: var(--text-xs);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--paper-faint);
}

.pips { display: flex; justify-content: center; gap: 0.85rem; margin-bottom: 0.9rem; }
.pips i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid var(--ink-500);
  background: transparent;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.pips i.on { background: var(--brass); border-color: var(--brass); transform: scale(1.18); }

.gate-error {
  margin: 0 0 0.9rem;
  min-height: 1.15em;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--bad);
}

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem; }
.keypad button {
  height: 54px;
  font-family: var(--mono);
  font-size: 1.2rem;
  color: var(--paper);
  background: var(--ink-600);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.keypad button:hover { background: var(--ink-500); border-color: var(--brass-dim); }
.keypad button:active { transform: scale(0.95); background: var(--brass-dim); }
.keypad button:focus-visible { outline: 1px solid var(--brass); outline-offset: 2px; }
.keypad .ghost { font-size: var(--text-xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper-faint); background: transparent; }
.keypad .ghost:hover { color: var(--paper); background: var(--ink-700); }
.keypad button[disabled] { opacity: 0.35; pointer-events: none; }
