/* Entrada: preview gate. Tokens, paper and reduced-motion rules come from base.css */

html, .gate-page { height: 100%; }
.gate-page { overflow: hidden; -webkit-tap-highlight-color: transparent; }

#dust { position: fixed; inset: 0; pointer-events: none; }

/* ---------- Corners ---------- */
.corner {
  position: fixed; left: 0; right: 0; z-index: 3;
  display: flex; justify-content: space-between; gap: 16px;
  padding: var(--gutter);
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft);
}
.corner--top { top: 0; padding-top: max(var(--gutter), env(safe-area-inset-top)); }
.corner--bottom { bottom: 0; padding-bottom: max(var(--gutter), env(safe-area-inset-bottom)); }

/* ---------- Stage ---------- */
.stage {
  position: relative; z-index: 2;
  height: 100%;
  display: grid; place-items: center; align-content: center;
  gap: clamp(8px, 3vh, 32px);
  padding: 64px var(--gutter);
  perspective: 1100px;
}

/* ---------- Interactive logo (official lasso logo, extruded in the Avestruz colours) ---------- */
.logo {
  --size: min(72vw, 54vh, 560px);
  position: relative;
  width: var(--size); height: var(--size);
  border: 0; background: none; cursor: grab;
  transform-style: preserve-3d;
  will-change: transform;
  touch-action: manipulation;
}
.logo:active { cursor: grabbing; }
.logo:focus-visible { outline: none; }
.logo:focus-visible::after {
  content: ""; position: absolute; inset: 6%;
  border: 3px dashed var(--ink); border-radius: 50%;
}
.logo > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.logo__extrude { transform-style: preserve-3d; }
.logo__face { display: block; user-select: none; -webkit-user-drag: none; transform: translateZ(1px); }
.logo__extrude > i,
.logo__shadow {
  position: absolute; inset: 0;
  -webkit-mask: url("../assets/logo-03.png") center / contain no-repeat;
          mask: url("../assets/logo-03.png") center / contain no-repeat;
}
.logo__extrude > i { background: var(--accent-2); }
.logo__shadow { background: rgba(90, 40, 10, 0.28); filter: blur(10px); }

/* signature moment: the logo is stamped onto the paper.
   backwards fill only: opacity/scale must not linger, or the 3D stack flattens */
.logo { animation: stamp var(--t-slow) var(--ease-thud) backwards; }
@keyframes stamp {
  0% { opacity: 0; scale: 1.35; }
  60% { opacity: 1; }
  100% { scale: 1; }
}

/* ---------- Passcode form ---------- */
.gate {
  width: min(100%, 340px);
  display: grid; gap: 10px; justify-items: stretch;
  animation: rise var(--t-base) 0.5s var(--ease-out) backwards;
}
@keyframes rise { from { opacity: 0; } }
.gate[hidden] { display: none; }
.gate--open { justify-items: center; gap: 16px; }

.gate__title {
  font-size: 12px; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; text-align: center;
  color: var(--accent-deep);
}
.gate__row {
  display: flex; align-items: center;
  border-bottom: 2.5px solid var(--ink);
  transition: border-color var(--t-fast) var(--ease-out);
}
.gate__row:focus-within { border-color: var(--accent-deep); }
.gate__input {
  flex: 1; min-width: 0; min-height: 48px;
  padding: 12px 4px 10px;
  border: 0; background: transparent; outline: none;
  font: inherit; font-size: 20px; font-weight: 700;
  font-variation-settings: "wdth" 85; letter-spacing: 0.08em;
  color: var(--ink);
}
.gate__input::placeholder {
  color: rgba(27, 20, 16, 0.62);
  letter-spacing: 0.14em; text-transform: uppercase; font-size: 15px;
}
.gate__btn {
  flex: none; width: 48px; height: 48px;
  display: grid; place-items: center;
  border: 0; background: none; color: var(--ink); cursor: pointer; border-radius: 50%;
  transition: color var(--t-fast) var(--ease-out), translate var(--t-fast) var(--ease-out);
}
.gate__btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: square; }
.gate__btn:hover { color: var(--accent-deep); translate: 3px 0; }

.gate__msg {
  min-height: 2.8em;
  font-size: 14px; font-weight: 600; letter-spacing: 0.02em; line-height: 1.35;
  text-align: center; color: var(--ink-soft);
}
.gate.is-error .gate__msg { color: var(--accent-deep); }
.gate.is-error .gate__row { border-color: var(--accent-deep); animation: shake var(--t-base) var(--ease-out); }
@keyframes shake {
  25% { translate: -7px 0; }
  60% { translate: 5px 0; }
}

/* ---------- Exit transition ---------- */
.wipe {
  position: fixed; inset: 0; z-index: 10; pointer-events: none;
  background: var(--accent-2);
  clip-path: circle(0% at var(--x, 50%) var(--y, 45%));
}
.wipe.is-on {
  pointer-events: auto;
  transition: clip-path var(--t-slow) var(--ease-in);
  clip-path: circle(150% at var(--x, 50%) var(--y, 45%));
}

@media (max-width: 520px) {
  .corner { font-size: 11px; letter-spacing: 0.1em; }
  .logo { --size: min(86vw, 50vh); }
}
