/* LUMEN — app/css/gate.css */

.gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg, #faf8f5);
  color: var(--fg, #2d2823);
  font-family: var(--font-ui, system-ui, sans-serif);
  overflow: hidden;
}

.gate[hidden] {
  display: none;
}

.gate::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(55% 45% at 50% 0%, rgba(232, 168, 124, 0.32), transparent 60%),
    radial-gradient(50% 45% at 85% 90%, rgba(201, 118, 74, 0.14), transparent 65%);
  animation: gateAura 12s ease-in-out infinite alternate;
}

@keyframes gateAura {
  0% { opacity: 0.9; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.06); }
}

.gate-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 20px;
  animation: gateIn 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes gateIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.gate-logo {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 24px;
  margin-bottom: 18px;
  overflow: hidden;
  animation: gateLogoBreath 5s ease-in-out infinite;
  transform-origin: 50% 55%;
  will-change: transform, filter;
  isolation: isolate;
}

.gate-logo::after {
  content: "";
  position: absolute;
  inset: -20%;
  pointer-events: none;
  background: radial-gradient(
    50% 50% at 50% 50%,
    rgba(232, 168, 124, 0.55),
    rgba(201, 118, 74, 0.15) 45%,
    transparent 70%
  );
  filter: blur(14px);
  opacity: 0.7;
  animation: gateLogoGlow 5s ease-in-out infinite;
  z-index: -1;
}

.gate-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
  position: relative;
  z-index: 1;
  animation: gateLogoFloat 5s ease-in-out infinite;
  will-change: transform;
}

.gate-logo .gate-shine {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  overflow: hidden;
}

.gate-logo .gate-shine::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -60%;
  width: 60%;
  height: 200%;
  background: linear-gradient(
    115deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 35%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0.08) 65%,
    transparent 100%
  );
  filter: blur(2px);
  animation: gateShine 6s ease-in-out infinite;
  mix-blend-mode: screen;
}

@keyframes gateShine {
  0%   { transform: translateX(0) rotate(0.001deg); opacity: 0; }
  15%  { opacity: 0.9; }
  50%  { opacity: 0.9; }
  65%  { opacity: 0; }
  100% { transform: translateX(280%) rotate(0.001deg); opacity: 0; }
}

@keyframes gateLogoBreath {
  0%, 100% {
    box-shadow: 0 18px 40px -18px rgba(138, 68, 35, 0.4);
  }
  50% {
    box-shadow: 0 26px 60px -20px rgba(138, 68, 35, 0.55);
  }
}

@keyframes gateLogoFloat {
  0%, 100% {
    transform: translateY(0) rotate(-0.8deg) scale(1);
  }
  50% {
    transform: translateY(-3px) rotate(0.8deg) scale(1.025);
  }
}

@keyframes gateLogoGlow {
  0%, 100% {
    opacity: 0.55;
    transform: scale(1);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.15);
  }
}

.gate-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.2;
}

.gate-sub {
  font-size: 15px;
  color: var(--fg-2, #5a524a);
  line-height: 1.6;
  margin: 6px 0 0;
  max-width: 320px;
}

.gate-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  margin-top: 26px;
}

.gate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: transform 0.18s ease, box-shadow 0.22s ease, background 0.22s ease, color 0.22s ease, opacity 0.2s;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  border: 0;
  font-family: inherit;
}

.gate-btn:active {
  transform: translateY(1px) scale(0.99);
}

.gate-btn-primary {
  background: linear-gradient(135deg, #e8a87c, #c9764a 60%, #8a4423);
  color: #ffffff;
  box-shadow: 0 18px 40px -16px rgba(138, 68, 35, 0.55), 0 6px 16px -8px rgba(26, 23, 19, 0.2);
  position: relative;
  overflow: hidden;
}

.gate-btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 35%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 65%
  );
  transform: translateX(-120%);
  transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

.gate-btn-primary:hover::after {
  transform: translateX(120%);
}

.gate-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 46px -16px rgba(138, 68, 35, 0.6);
}

.gate-btn-primary[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.gate-btn-ghost {
  background: transparent;
  color: var(--fg-2, #5a524a);
  border: 1px solid var(--border, #e6dfd6);
}

.gate-btn-ghost:hover {
  color: #8a4423;
  border-color: rgba(201, 118, 74, 0.4);
}

.gate-note {
  margin: 18px 0 0;
  font-size: 12.5px;
  color: var(--fg-3, #948a7e);
  font-family: var(--font-mono, ui-monospace, monospace);
}

html.is-gated body {
  overflow: hidden;
}

html.is-gated .app {
  display: none !important;
}

html.is-gated .gate {
  display: flex;
}

html:not(.is-gated) .gate {
  display: none !important;
}

html.is-gated .install-banner {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .gate-inner,
  .gate::before,
  .gate-logo,
  .gate-logo::after,
  .gate-logo img,
  .gate-logo .gate-shine::before,
  .gate-btn-primary::after {
    animation: none;
  }
}