:root {
  --bg: #0b0f14;
  --bg-elev: rgba(255, 255, 255, 0.04);
  --text: #e6e9ef;
  --muted: #9aa3b2;
  --accent1: #7aa7ff;
  --accent2: #8a5cff;
  --success: #46d18c;
  --shadow: 0 10px 30px 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%, rgba(138, 92, 255, 0.15), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(122, 167, 255, 0.15), 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: linear-gradient(to bottom, rgba(11, 15, 20, 0.7), rgba(11, 15, 20, 0.25));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.logo {
  border-radius: 8px;

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

/* Page content placeholder */
.page {
  max-width: 1060px;
  margin: 48px auto;
  padding: 0 24px;
  display: grid;
  gap: 24px;
}
.hero {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.hero h1 {
  margin: 0 0 8px;
  font-size: 28px;
}
.hero p {
  margin: 0;
  color: var(--muted);
}

/* Fullscreen Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: radial-gradient(900px 600px at 50% -10%, rgba(138, 92, 255, 0.25), transparent 60%),
    radial-gradient(800px 500px at 50% 120%, rgba(122, 167, 255, 0.2), transparent 60%), #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 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);
  }
}

.lock-icon {
  width: 60px;
  height: 80px;
}
.shackle {
  stroke: var(--text);
  stroke-width: 4;
  fill: none;
}
.body {
  fill: rgba(255, 255, 255, 0.75);
  stroke: var(--text);
  stroke-width: 2;
}
#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;
  }
}
