:root {
  --bg: var(--color-0b0f14);
  --bg-elev: var(--color-rgba-255-255-255-0-04);
  --text: var(--color-ffffff);
  --muted: var(--color-eeeeee);
  --accent1: var(--color-7aa7ff);
  --accent2: var(--color-8a5cff);
  --success: var(--color-46d18c);
  --shadow: 0 10px 30px var(--color-rgba-0-0-0-0-45);
  --radius: 18px;
}

/* Global reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background:
    radial-gradient(
      1200px 600px at 80% -10%,
      var(--color-rgba-138-92-255-0-15),
      var(--color-transparent) 60%
    ),
    radial-gradient(
      900px 500px at -10% 110%,
      var(--color-rgba-122-167-255-0-15),
      var(--color-transparent) 60%
    ),
    var(--bg);
  color: var(--text);
  font:
    18px/1.5 system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Ubuntu,
    Cantarell,
    Noto Sans,
    sans-serif;
  letter-spacing: 0.2px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  backdrop-filter: blur(10px);
  background-color: white;
  border-bottom: 1px solid;
}
.logo {
  border-radius: 8px;

  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--color-820ad1);
}
.brand {
  color: black;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.3px;
}

/* Page content placeholder */

/* Fullscreen Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(
      900px 600px at 50% -10%,
      var(--color-rgba-138-92-255-0-25),
      var(--color-transparent) 60%
    ),
    radial-gradient(
      800px 500px at 50% 120%,
      var(--color-rgba-122-167-255-0-2),
      var(--color-transparent) 60%
    ),
    var(--color-0b0f14);
  backdrop-filter: blur(8px);
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}
.modal-overlay[hidden] {
  opacity: 0;
  visibility: hidden;
}

.modal {
  margin: auto;
  width: min(560px, 92vw);

  padding: 28px 28px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.modal h2 {
  margin: 4px 0 6px;
  font-size: 32px;
  font-weight: 700;
}
.modal p {
  margin: 0 0 18px;
  color: var(--muted);
}

.modal-footer {
  margin-top: 20px;
  font-size: 15px;
  color: var(--muted);
}

/* Loading / Lock stage */
.stage {
  min-height: 140px;
  width: 100%;
  display: grid;
  place-items: center;
  position: relative;
}
.fade {
  opacity: 1;
  transform: scale(1);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}
.fade.out {
  opacity: 0;
  transform: scale(0.98);
}
.fade.in {
  opacity: 1;
  transform: scale(1);
}

.spinner {
  width: 88px;
  height: 88px;
  border: 6px solid var(--color-rgba-255-255-255-0-15);
  border-top-color: var(--accent1);
  border-right-color: var(--accent2);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 12px auto 6px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#lockStage {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 1000px;
}

#square-lock {
  width: 60px;
  height: 60px;
  position: absolute;
  top: calc(50% - 30px);
  left: calc(50% - 30px);
}

#arc-lock-container {
  width: 30px;
  height: 45px;
  top: calc(50% - 55px);
  left: calc(50% - 15px);
  position: absolute;
  perspective: 1000px;
}
#arc-lock {
  width: 30px;
  height: 45px;
  display: block;
  transform-origin: left center; /* петля слева */
  animation: lockOpen 1.5s ease forwards; /* анимация запускается сама */
  animation-delay: 3.6s;
}
@keyframes lockOpen {
  0% {
    transform: translateY(0) rotateY(0deg) rotateZ(0deg);
  }
  10% {
    transform: translateY(-10px) rotateY(0deg) rotateZ(0deg); /* опустился */
  }
  40% {
    transform: translateY(-10px) rotateY(0deg) rotateZ(0deg); /* вернулся */
  }
  100% {
    transform: translateY(-10px) rotateY(-180deg) rotateZ(0deg); /* открылся */
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 1ms;
  }
  .fade {
    transition: none;
  }
}
