/* ==========================================================================
   StreamForge — lock-screen boot gate
   iOS-style lock screen: dark, glassy, single pink accent.
   Self-contained. Styles only .lockscreen / .ls-* (and sf-ls-* keyframes).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Shell — full-bleed opaque wallpaper
   -------------------------------------------------------------------------- */

.lockscreen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  padding: max(6vh, 44px) 24px max(4vh, 40px);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-font-smoothing: antialiased;
  color: var(--text);

  /* Opaque wallpaper: near-black base with a deep, quiet pink aurora.
     Off-center, restrained — never a loud centered mesh. */
  background:
    radial-gradient(
      120% 90% at 78% -12%,
      rgba(var(--accent-rgb), 0.13) 0%,
      rgba(var(--accent-rgb), 0.05) 34%,
      transparent 62%
    ),
    radial-gradient(
      90% 70% at 12% 108%,
      rgba(var(--accent-rgb), 0.09) 0%,
      rgba(var(--accent-rgb), 0.03) 38%,
      transparent 64%
    ),
    radial-gradient(
      140% 110% at 50% 50%,
      var(--bg-2) 0%,
      var(--bg) 68%
    ),
    var(--bg);
}

.lockscreen:active {
  cursor: grabbing;
}

/* Fine grain of tone across the wallpaper + soft vignette so the huge clock
   never sits on a flat field. Purely decorative, non-interactive. */
.lockscreen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.02) 0%,
      transparent 18%,
      transparent 74%,
      rgba(0, 0, 0, 0.28) 100%
    );
}

/* --------------------------------------------------------------------------
   Aurora glow — one slow, blurred accent blob behind everything
   -------------------------------------------------------------------------- */

.ls-glow {
  position: absolute;
  top: -22%;
  left: 50%;
  width: min(72vw, 760px);
  height: min(52vh, 520px);
  margin-left: calc(min(72vw, 760px) / -2);
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    50% 50% at 50% 50%,
    rgba(var(--accent-rgb), 0.16) 0%,
    rgba(var(--accent-rgb), 0.05) 52%,
    transparent 76%
  );
  filter: blur(64px);
  opacity: 0.8;
  animation: sf-ls-drift 26s var(--ease) infinite alternate;
  will-change: transform, opacity;
}

/* Keep all content above the glow */
.ls-top,
.ls-mid,
.ls-unlock {
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   Top — lock glyph, date, hero clock
   -------------------------------------------------------------------------- */

.ls-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: sf-ls-rise 0.7s var(--ease) 0.08s backwards;
  /* Frameless window: the clock cluster doubles as the drag handle on the lock screen. */
  -webkit-app-region: drag;
  align-self: stretch;
}

.ls-lock {
  font-size: 19px;
  line-height: 1;
  color: var(--muted);
  opacity: 0.7;
  margin-bottom: 14px;
}

.ls-date {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
  color: var(--muted);
}

.ls-time {
  font-size: clamp(72px, 13vw, 104px);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-shadow:
    0 0 44px rgba(var(--accent-rgb), 0.14),
    0 2px 28px rgba(0, 0, 0, 0.45);
}

/* --------------------------------------------------------------------------
   Middle — brand widget (iOS lock-screen widget card)
   -------------------------------------------------------------------------- */

/* No card around the brand — the logo floats free on the wallpaper,
   carried by its own glow. */
.ls-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: min(560px, calc(100% - 8px));
  animation: sf-ls-rise 0.7s var(--ease) 0.22s backwards;
}

.ls-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.ls-brand .brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: var(--r-md);
  font-size: 20px;
  line-height: 1;
  box-shadow:
    0 6px 18px -6px rgba(var(--accent-rgb), 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.ls-brand-name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}

.ls-tagline {
  margin: 0;
  max-width: 44ch;
  font-size: 13.5px;
  font-weight: 450;
  line-height: 1.55;
  letter-spacing: 0.005em;
  color: var(--muted);
  text-wrap: balance;
}

/* --------------------------------------------------------------------------
   Bottom — unlock affordance (button reset + iOS home indicator)
   -------------------------------------------------------------------------- */

.ls-unlock {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 24px 0;
  border-radius: var(--r-lg);
  outline: none;
  -webkit-tap-highlight-color: transparent;
  animation: sf-ls-rise 0.7s var(--ease) 0.36s backwards;
}

.ls-unlock:focus-visible {
  box-shadow: var(--focus-ring);
}

.ls-chevron {
  font-size: 22px;
  line-height: 1;
  color: rgba(var(--accent-rgb), 0.9);
  animation: sf-ls-bob 2.4s var(--spring-soft) infinite;
  will-change: transform;
}

.ls-hint {
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: var(--text);
  animation: sf-ls-hint 2.4s ease-in-out infinite;
}

.ls-sub {
  font-size: 11.5px;
  font-weight: 450;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--faint);
}

.ls-home {
  width: 140px;
  height: 5px;
  margin-top: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
}

/* --------------------------------------------------------------------------
   Keyframes (all sf-ls- prefixed)
   -------------------------------------------------------------------------- */

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

@keyframes sf-ls-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  32% {
    transform: translateY(-6px);
  }
  64% {
    transform: translateY(0);
  }
}

@keyframes sf-ls-hint {
  0%,
  100% {
    opacity: 0.92;
  }
  32% {
    opacity: 0.6;
  }
}

@keyframes sf-ls-drift {
  0% {
    transform: translate3d(-4%, 0, 0) scale(1);
    opacity: 0.7;
  }
  100% {
    transform: translate3d(5%, 4%, 0) scale(1.08);
    opacity: 0.9;
  }
}

/* --------------------------------------------------------------------------
   Accessibility
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .ls-glow,
  .ls-top,
  .ls-mid,
  .ls-unlock,
  .ls-chevron,
  .ls-hint {
    animation: none;
  }
}
