:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  background: #000000;
  overflow: hidden;
}

body {
  position: fixed;
  inset: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.site-universe {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  background: #000000;
}

.sleep-timer {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 0px) + 8px);
  right: max(12px, env(safe-area-inset-right, 0px) + 8px);
  z-index: 14;
  pointer-events: auto;
}

.sleep-toggle {
  width: clamp(26px, 2vw, 34px);
  height: clamp(26px, 2vw, 34px);
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.28);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: color 180ms ease, transform 180ms ease, background-color 180ms ease;
}

.sleep-toggle:hover,
.sleep-toggle:focus-visible,
.sleep-toggle.active {
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.04);
  outline: none;
}

.sleep-toggle:active {
  transform: scale(0.96);
}

.sleep-icon {
  font-size: clamp(15px, 1.25vw, 22px);
  line-height: 1;
}

.sleep-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 176px;
  max-width: min(240px, 78vw);
  border-radius: 12px;
  padding: 10px;
  background: rgba(4, 6, 10, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.sleep-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.sleep-label {
  display: block;
  font-family: "Avenir Next", "SF Pro Display", "Helvetica Neue", sans-serif;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 6px;
}

.sleep-select {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.65);
  color: rgba(255, 255, 255, 0.9);
  font-family: "Avenir Next", "SF Pro Display", "Helvetica Neue", sans-serif;
  font-size: 13px;
  padding: 8px 10px;
  outline: none;
}

.sleep-select:focus-visible {
  border-color: rgba(255, 255, 255, 0.42);
}

.sleep-status {
  margin: 7px 0 0;
  min-height: 16px;
  font-family: "Avenir Next", "SF Pro Display", "Helvetica Neue", sans-serif;
  font-size: 11px;
  color: rgba(232, 236, 244, 0.7);
  letter-spacing: 0.02em;
}

.rss-panel {
  position: fixed;
  right: max(0px, env(safe-area-inset-right, 0px));
  bottom: max(0px, env(safe-area-inset-bottom, 0px));
  width: clamp(270px, 24vw, 410px);
  height: clamp(190px, 31vh, 360px);
  overflow: hidden;
  z-index: 7;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.92) 22%, rgba(0, 0, 0, 0.92) 78%, rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.92) 22%, rgba(0, 0, 0, 0.92) 78%, rgba(0, 0, 0, 0) 100%);
}

.rss-panel.off {
  display: none;
}

.rss-track {
  display: flex;
  flex-direction: column;
  gap: 18px;
  transform: translateY(0);
  will-change: transform;
}

.rss-copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rss-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: rgba(188, 196, 206, 0.62);
  font-family: "Avenir Next", "SF Pro Display", "Helvetica Neue", sans-serif;
  line-height: 1.22;
}

.rss-channel {
  font-weight: 700;
  font-size: clamp(11px, 1vw, 14px);
  color: rgba(212, 220, 230, 0.7);
  letter-spacing: 0.02em;
}

.rss-title {
  font-weight: 500;
  font-size: clamp(12px, 1.12vw, 17px);
  color: rgba(200, 208, 218, 0.68);
}

.rss-desc {
  font-weight: 400;
  font-size: clamp(11px, 0.98vw, 15px);
  color: rgba(176, 186, 198, 0.55);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.clock-stage {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(18px, 3vh, 36px);
  padding: clamp(14px, 3.5vw, 40px);
  pointer-events: none;
  opacity: 1;
  transition: opacity 460ms ease;
}

.clock-stage.faded {
  opacity: 0;
}

.clock-layout {
  width: min(1400px, 100%);
  display: grid;
  grid-template-columns: minmax(220px, 430px) minmax(340px, 1fr);
  align-items: center;
  gap: clamp(26px, 5vw, 72px);
}

.clock-stage.analog-off .analog-clock {
  display: none;
}

.clock-stage.analog-off .clock-layout {
  grid-template-columns: 1fr;
  justify-items: center;
  gap: clamp(22px, 4.5vw, 34px);
}

.clock-stage.analog-off .digital-wrap {
  justify-content: center;
}

.analog-clock {
  display: grid;
  place-items: center;
}

.analog-face {
  position: relative;
  width: clamp(200px, 28vw, 420px);
  aspect-ratio: 1 / 1;
}

.analog-tick {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 19%;
  transform-origin: 50% 100%;
  transform: translate(-50%, -100%) rotate(var(--deg));
  z-index: 1;
}

.analog-tick::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 2%;
  width: clamp(4px, 0.55vw, 8px);
  height: clamp(34px, 5vw, 70px);
  transform: translateX(-50%);
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.06);
  box-shadow:
    0 0 18px rgba(0, 0, 0, 0.9),
    0 8px 12px rgba(0, 0, 0, 0.78);
}

.analog-tick.major::before {
  width: clamp(5px, 0.65vw, 10px);
  height: clamp(44px, 6vw, 82px);
  background: rgba(255, 255, 255, 0.12);
}

.hand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: 0 50%;
  border-radius: 999px;
  will-change: transform;
  z-index: 3;
}

.hour-hand {
  width: 34%;
  height: clamp(8px, 0.9vw, 13px);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.97), rgba(237, 237, 237, 0.93));
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.18);
}

.minute-hand {
  width: 44%;
  height: clamp(6px, 0.7vw, 11px);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(230, 230, 230, 0.88));
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.18);
}

.second-hand {
  width: 42%;
  height: clamp(3px, 0.38vw, 5px);
  background: linear-gradient(90deg, rgba(255, 118, 136, 0.95), rgba(232, 92, 113, 0.9));
  box-shadow: 0 0 8px rgba(255, 96, 118, 0.35);
}

.analog-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(14px, 1.7vw, 24px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.82);
  background: radial-gradient(circle at 36% 36%, rgba(255, 255, 255, 0.95), rgba(190, 190, 190, 0.86));
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  z-index: 4;
}

.digital-wrap {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  justify-content: start;
  gap: clamp(8px, 1.5vw, 22px);
}

.digital-clock {
  font-family: "Orbitron", "DIN Alternate", "SFMono-Regular", "Consolas", "Courier New", monospace;
  font-size: clamp(54px, 15vw, 250px);
  letter-spacing: 0.03em;
  line-height: 1;
  font-weight: 500;
  color: rgba(244, 247, 250, 0.98);
  text-shadow:
    0 0 1px rgba(255, 255, 255, 0.75),
    0 0 18px rgba(255, 255, 255, 0.07);
  font-variant-numeric: tabular-nums;
}

.digital-seconds {
  font-family: "Orbitron", "DIN Alternate", "SFMono-Regular", "Consolas", "Courier New", monospace;
  font-size: clamp(26px, 5.5vw, 96px);
  letter-spacing: 0.03em;
  line-height: 1;
  font-weight: 500;
  color: rgba(244, 247, 250, 0.95);
  font-variant-numeric: tabular-nums;
  transform: translateY(-0.03em);
}

.date-line {
  font-family: "Avenir Next", "SF Pro Display", "Helvetica Neue", sans-serif;
  font-size: clamp(28px, 4.8vw, 92px);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: rgba(245, 247, 250, 0.98);
  text-align: center;
  line-height: 1.1;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.06);
  font-variant-numeric: tabular-nums;
}

.listen-line {
  font-family: "Avenir Next", "SF Pro Display", "Helvetica Neue", sans-serif;
  font-size: clamp(11px, 1.35vw, 20px);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(220, 228, 238, 0.72);
  text-align: center;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.04);
}

@media (max-width: 900px) {
  .clock-layout {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: clamp(22px, 4.5vw, 34px);
  }

  .digital-wrap {
    justify-content: center;
  }
}

#live-audio {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.brand-flash {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.985);
  z-index: 12;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  transition:
    opacity 460ms ease,
    transform 460ms ease;
  font-family: "Avenir Next", "SF Pro Display", "Helvetica Neue", sans-serif;
  font-size: clamp(28px, 5vw, 88px);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #ffffff;
  text-shadow:
    0 0 14px rgba(255, 255, 255, 0.2),
    0 0 26px rgba(255, 255, 255, 0.12);
}

.brand-flash.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
