:root {
  --bg-1: #07111f;
  --bg-2: #13233d;
  --glow-1: #6ee7f9;
  --glow-2: #ffb86b;
  --face-1: rgba(7, 18, 34, 0.9);
  --face-2: rgba(18, 34, 64, 0.7);
  --stroke: rgba(255, 255, 255, 0.12);
  --text: #edf6ff;
  --muted: rgba(237, 246, 255, 0.68);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  overflow-x: hidden;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(110, 231, 249, 0.2), transparent 30%),
    radial-gradient(circle at bottom right, rgba(255, 184, 107, 0.18), transparent 32%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2) 55%, #050913);
}

.scene {
  position: relative;
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px;
  isolation: isolate;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.75;
  z-index: -1;
}

.orb-a {
  width: 320px;
  height: 320px;
  top: 10%;
  left: 12%;
  background: radial-gradient(circle, rgba(110, 231, 249, 0.32), transparent 68%);
  animation: drift 12s ease-in-out infinite;
}

.orb-b {
  width: 420px;
  height: 420px;
  right: 8%;
  bottom: 8%;
  background: radial-gradient(circle, rgba(255, 184, 107, 0.26), transparent 68%);
  animation: drift 16s ease-in-out infinite reverse;
}

.clock-stage {
  width: min(1180px, 100%);
  display: grid;
  gap: 28px;
}

.stage-copy {
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
}

.stage-copy h1 {
  margin: 0;
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  line-height: 0.92;
  letter-spacing: -0.07em;
}

.clock-card {
  width: 100%;
  padding: 28px;
  border: 1px solid var(--stroke);
  border-radius: 36px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  display: grid;
  gap: 24px;
  align-items: center;
}

.clock-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.clock-copy {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.clock-copy h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.eyebrow,
.subcopy,
.readout-label,
.picker-label,
.readout-zone {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.72rem;
}

.subcopy {
  max-width: 28rem;
  font-size: 1rem;
  line-height: 1.6;
}

.clock-copy-selectable {
  align-items: start;
}

.timezone-picker {
  display: grid;
  gap: 8px;
  min-width: min(100%, 220px);
}

.picker-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.timezone-picker select {
  appearance: none;
  width: 100%;
  padding: 12px 42px 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  font: inherit;
  outline: none;
  color-scheme: dark;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.timezone-picker select:focus {
  border-color: rgba(110, 231, 249, 0.45);
  box-shadow:
    0 0 0 3px rgba(110, 231, 249, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.timezone-picker option {
  color: #07111f;
  background: #edf6ff;
}

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

.clock {
  --size: min(72vw, 360px);
  position: relative;
  width: var(--size);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.16), transparent 32%),
    radial-gradient(circle at center, var(--face-2), var(--face-1) 62%, rgba(2, 8, 18, 1) 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -20px 30px rgba(0, 0, 0, 0.35),
    0 24px 40px rgba(0, 0, 0, 0.32),
    0 0 0 12px rgba(255, 255, 255, 0.03);
}

.ring,
.ticks,
.numerals,
.hand,
.pin {
  position: absolute;
  inset: 0;
}

.ring {
  border-radius: 50%;
}

.ring-outer {
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ring-inner {
  inset: 36px;
  border: 1px solid rgba(110, 231, 249, 0.18);
  box-shadow: 0 0 24px rgba(110, 231, 249, 0.08);
}

.tick {
  position: absolute;
  top: 18px;
  left: 50%;
  width: 3px;
  height: 18px;
  margin-left: -1.5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  transform-origin: 50% calc(var(--size) / 2 - 18px);
}

.tick.major {
  top: 14px;
  width: 5px;
  height: 26px;
  margin-left: -2.5px;
  background: linear-gradient(180deg, var(--glow-2), rgba(255, 255, 255, 0.85));
  box-shadow: 0 0 14px rgba(255, 184, 107, 0.35);
}

.numerals span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40px;
  margin: -20px;
  text-align: center;
  font-weight: 700;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(237, 246, 255, 0.9);
  transform:
    rotate(calc(30deg * var(--n)))
    translateY(calc(var(--size) / -2 + 72px))
    rotate(calc(-30deg * var(--n)));
  text-shadow: 0 0 14px rgba(110, 231, 249, 0.2);
}

.hand {
  display: grid;
  place-items: center;
}

.hand::before {
  content: "";
  position: absolute;
  bottom: 50%;
  border-radius: 999px;
  transform-origin: bottom center;
}

.hand-hour::before {
  width: 10px;
  height: 96px;
  background: linear-gradient(180deg, #f8fbff, #a7bdcf);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.16);
}

.hand-minute::before {
  width: 6px;
  height: 136px;
  background: linear-gradient(180deg, #c8f8ff, #6ee7f9);
  box-shadow: 0 0 20px rgba(110, 231, 249, 0.32);
}

.hand-second::before {
  width: 3px;
  height: 150px;
  background: linear-gradient(180deg, #fff4dd, #ffb86b);
  box-shadow: 0 0 20px rgba(255, 184, 107, 0.4);
}

.hand-second::after {
  content: "";
  position: absolute;
  top: 88px;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: var(--glow-2);
  box-shadow: 0 0 18px rgba(255, 184, 107, 0.55);
}

.pin {
  inset: auto;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin: -11px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #fff, #b7cddd 45%, #4b6070 100%);
  box-shadow:
    0 0 0 6px rgba(255, 255, 255, 0.05),
    0 0 24px rgba(110, 231, 249, 0.24);
}

.readout {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.readout-zone {
  margin-top: 6px;
  font-size: 0.9rem;
}

.readout-value {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
}

.timeline-panel {
  padding: 28px;
  border: 1px solid var(--stroke);
  border-radius: 36px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  display: grid;
  gap: 22px;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
}

.timeline-header h2 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.timeline-actions {
  display: grid;
  gap: 12px;
  justify-items: end;
}

.timeline-add {
  display: grid;
  gap: 8px;
  width: min(100%, 360px);
}

.timeline-add-label,
.timeline-add-feedback {
  margin: 0;
  color: var(--muted);
}

.timeline-add-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.timeline-add-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.timeline-add-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  color: var(--text);
  font: inherit;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.timeline-add-input:focus {
  border-color: rgba(110, 231, 249, 0.45);
  box-shadow:
    0 0 0 3px rgba(110, 231, 249, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.timeline-add-input::placeholder {
  color: rgba(237, 246, 255, 0.45);
}

.timeline-add-button {
  border: 1px solid rgba(255, 184, 107, 0.28);
  border-radius: 14px;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(255, 184, 107, 0.18), rgba(255, 184, 107, 0.06));
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.timeline-add-feedback {
  min-height: 1.25rem;
  font-size: 0.84rem;
}

.timeline-suggestions {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(6, 18, 34, 0.94);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.timeline-suggestions.is-open {
  display: grid;
}

.timeline-suggestion {
  width: 100%;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  display: grid;
  gap: 4px;
}

.timeline-suggestion + .timeline-suggestion {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.timeline-suggestion:hover,
.timeline-suggestion.is-active {
  background: linear-gradient(90deg, rgba(110, 231, 249, 0.14), rgba(255, 184, 107, 0.1));
}

.timeline-suggestion-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.timeline-suggestion-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.timeline-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.timeline-reset {
  border: 1px solid rgba(110, 231, 249, 0.28);
  border-radius: 999px;
  padding: 12px 18px;
  background: linear-gradient(180deg, rgba(110, 231, 249, 0.18), rgba(110, 231, 249, 0.06));
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.timeline-reset:hover,
.timeline-reset:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(110, 231, 249, 0.52);
  box-shadow: 0 0 0 4px rgba(110, 231, 249, 0.1);
  outline: none;
}

.timeline-scale {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  align-items: center;
}

.timeline-scale::before {
  content: "Window";
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
}

.timeline-scale-hours {
  position: relative;
  height: 24px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: center;
}

.timeline-scale-hours span {
  position: relative;
  justify-self: start;
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.timeline-scale-hours span:last-child {
  justify-self: end;
}

.timeline-grid {
  position: relative;
  display: grid;
  gap: 14px;
  touch-action: none;
}

.timeline-grid:focus-visible {
  outline: 2px solid rgba(110, 231, 249, 0.4);
  outline-offset: 10px;
}

.timeline-rows {
  display: grid;
  gap: 14px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  align-items: center;
}

.timeline-zone {
  display: grid;
  gap: 4px;
}

.timeline-zone strong {
  font-size: 1rem;
  font-weight: 700;
}

.timeline-zone span {
  color: var(--muted);
  font-size: 0.82rem;
}

.timeline-track {
  position: relative;
  height: 54px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(90deg, rgba(3, 11, 22, 0.9), rgba(16, 38, 64, 0.88) 36%, rgba(110, 231, 249, 0.16) 52%, rgba(255, 184, 107, 0.2) 76%, rgba(38, 14, 3, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -18px 24px rgba(0, 0, 0, 0.18);
}

.timeline-track::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.12) 0,
    rgba(255, 255, 255, 0.12) 1px,
    transparent 1px,
    transparent calc(100% / 24)
  );
  background-size: calc(100% / 24) 100%;
  pointer-events: none;
}

.timeline-track::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    90deg,
    transparent 0,
    transparent calc((100% / 24) * 10 - 1px),
    rgba(255, 255, 255, 0.22) calc((100% / 24) * 10),
    transparent calc((100% / 24) * 10 + 1px)
  );
  opacity: 0.9;
  pointer-events: none;
}

.timeline-intersection {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 96px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(6, 18, 34, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(8px);
}

.timeline-time-label {
  display: block;
}

.timeline-day-label {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timeline-day-label.is-yesterday {
  color: rgba(255, 120, 120, var(--day-alpha, 0.75));
}

.timeline-day-label.is-today {
  color: rgba(114, 255, 163, var(--day-alpha, 0.75));
}

.timeline-day-label.is-tomorrow {
  color: rgba(255, 220, 107, var(--day-alpha, 0.75));
}

.timeline-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  pointer-events: none;
  z-index: 3;
}

.timeline-cursor-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(255, 184, 107, 0.95), rgba(110, 231, 249, 0.95));
  box-shadow: 0 0 16px rgba(110, 231, 249, 0.45);
}

.timeline-cursor-head {
  position: absolute;
  top: -8px;
  left: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle at 35% 35%, #fff, #ffb86b 58%, #b65c00 100%);
  box-shadow:
    0 0 0 5px rgba(255, 184, 107, 0.12),
    0 0 20px rgba(255, 184, 107, 0.45);
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(24px, -16px, 0) scale(1.08);
  }
}

@media (max-width: 860px) {
  .clock-grid {
    grid-template-columns: 1fr;
  }

  .timeline-header,
  .timeline-row,
  .timeline-scale {
    grid-template-columns: 1fr;
  }

  .timeline-header {
    display: grid;
    align-items: start;
  }

  .timeline-actions {
    justify-items: start;
    width: 100%;
  }

  .timeline-scale {
    gap: 10px;
  }

  .timeline-row {
    gap: 10px;
  }

  .timeline-add {
    width: 100%;
  }

  .clock-copy {
    display: grid;
    justify-items: center;
    text-align: center;
  }

  .clock-copy-selectable {
    justify-items: stretch;
  }

  .readout {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .scene {
    padding: 16px;
  }

  .clock-card {
    padding: 20px;
    border-radius: 28px;
  }

  .timeline-panel {
    padding: 20px;
    border-radius: 28px;
  }

  .clock {
    --size: min(82vw, 320px);
  }

  .numerals span {
    transform:
      rotate(calc(30deg * var(--n)))
      translateY(calc(var(--size) / -2 + 60px))
      rotate(calc(-30deg * var(--n)));
  }

  .hand-hour::before {
    height: 82px;
  }

  .hand-minute::before {
    height: 120px;
  }

  .hand-second::before {
    height: 132px;
  }

  .timezone-picker {
    min-width: 100%;
  }

  .timeline-track {
    height: 50px;
  }

  .timeline-intersection {
    min-width: 82px;
    font-size: 0.82rem;
  }

  .timeline-add-controls {
    grid-template-columns: 1fr;
  }
}
