:root {
  --page: #edf4f7;
  --ink: #17212b;
  --muted: #596a76;
  --line: #cfdce4;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-solid: #ffffff;
  --clock-inner: #f7fbfd;
  --ticks: rgba(23, 33, 43, 0.28);
  --marker: rgba(23, 33, 43, 0.14);
  --button-bg: rgba(255, 255, 255, 0.88);
  --blue: #0969da;
  --green: #0f8f6f;
  --red: #df3b36;
  --gold: #f5b642;
  --shadow: 0 24px 60px rgba(36, 55, 70, 0.16);
}

[data-theme="dark"] {
  --page: #0d1420;
  --ink: #eef6ff;
  --muted: #aab8c6;
  --line: #344456;
  --panel: rgba(18, 27, 40, 0.88);
  --panel-solid: #121b28;
  --clock-inner: #182535;
  --ticks: rgba(238, 246, 255, 0.26);
  --marker: rgba(238, 246, 255, 0.18);
  --button-bg: rgba(18, 27, 40, 0.9);
  --blue: #58a6ff;
  --green: #42d6a4;
  --red: #ff6b65;
  --gold: #ffd166;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans SC", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(9, 105, 218, 0.12), transparent 34%),
    linear-gradient(250deg, rgba(15, 143, 111, 0.13), transparent 38%),
    repeating-linear-gradient(0deg, rgba(23, 33, 43, 0.045) 0 1px, transparent 1px 36px),
    repeating-linear-gradient(90deg, rgba(23, 33, 43, 0.045) 0 1px, transparent 1px 36px),
    var(--page);
  overflow-x: hidden;
  transition: background 0.25s ease, color 0.25s ease;
}

.bg-grid,
.bg-glow {
  display: none;
}

.page {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0 54px;
}

.hero {
  position: relative;
  display: grid;
  justify-items: center;
  text-align: center;
  margin-bottom: 26px;
  animation: rise-in 0.55s ease-out;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin: 0 0 18px;
  padding: 8px 14px;
  border: 1px solid rgba(23, 33, 43, 0.14);
  border-radius: 999px;
  color: var(--ink);
  background: var(--button-bg);
  box-shadow: 0 12px 28px rgba(23, 33, 43, 0.12);
  font: 600 0.95rem/1 "Noto Sans SC", sans-serif;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.25s ease,
    background 0.25s ease,
    color 0.25s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--blue);
}

.theme-toggle:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 36%, transparent);
  outline-offset: 3px;
}

.toggle-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--blue);
  font-size: 0.9rem;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.24em;
  font-size: 0.82rem;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-size: 2.8rem;
  line-height: 1.12;
  letter-spacing: 0;
}

.subtitle {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

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

.clock-card {
  position: relative;
  display: grid;
  gap: 22px;
  padding: 24px;
  border: 1px solid rgba(23, 33, 43, 0.12);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  overflow: hidden;
  animation: rise-in 0.65s ease-out both;
}

.clock-card::before {
  content: "";
  position: absolute;
  inset: 0;
  height: 7px;
  background: linear-gradient(90deg, var(--blue), var(--green), var(--gold));
}

.city-meta {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 8px;
}

.city-tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--panel-solid);
  background: var(--ink);
  font-family: "Orbitron", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.city-meta h2 {
  margin: 2px 0 0;
  font-size: 1.75rem;
  line-height: 1.15;
}

.city-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.analog-clock {
  display: grid;
  place-items: center;
  padding: 4px 0 0;
}

.clock-face {
  position: relative;
  width: min(100%, 315px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 12px solid #ffffff;
  background:
    repeating-conic-gradient(
      from -1deg,
      var(--ticks) 0deg 1deg,
      transparent 1deg 6deg
    ),
    radial-gradient(circle at center, var(--panel-solid) 0 55%, var(--clock-inner) 56% 100%);
  box-shadow:
    inset 0 0 0 1px var(--line),
    inset 0 0 34px rgba(9, 105, 218, 0.07),
    0 18px 38px rgba(23, 33, 43, 0.18);
}

.clock-face::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 1px solid rgba(23, 33, 43, 0.08);
}

.clock-face::after {
  content: "";
  position: absolute;
  inset: 48px;
  border-radius: 50%;
  background: var(--panel-solid);
  box-shadow: inset 0 0 0 1px rgba(23, 33, 43, 0.05);
}

.clock-number {
  position: absolute;
  z-index: 3;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-family: "Orbitron", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0;
}

.number-12,
.number-3,
.number-6,
.number-9 {
  color: var(--blue);
  font-size: 1.35rem;
  font-weight: 700;
}

.number-12 {
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
}

.number-1 {
  top: 42px;
  right: 78px;
}

.number-2 {
  top: 86px;
  right: 36px;
}

.number-3 {
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
}

.number-4 {
  right: 36px;
  bottom: 86px;
}

.number-5 {
  right: 78px;
  bottom: 42px;
}

.number-6 {
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
}

.number-7 {
  bottom: 42px;
  left: 78px;
}

.number-8 {
  bottom: 86px;
  left: 36px;
}

.number-9 {
  top: 50%;
  left: 18px;
  transform: translateY(-50%);
}

.number-10 {
  top: 86px;
  left: 36px;
}

.number-11 {
  top: 42px;
  left: 78px;
}

.marker {
  position: absolute;
  z-index: 1;
  background: var(--marker);
  border-radius: 999px;
}

.marker-12,
.marker-6 {
  width: 3px;
  height: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.marker-3,
.marker-9 {
  width: 16px;
  height: 3px;
  top: 50%;
  transform: translateY(-50%);
}

.marker-12 {
  top: 10px;
}

.marker-3 {
  right: 10px;
}

.marker-6 {
  bottom: 10px;
}

.marker-9 {
  left: 10px;
}

.hand {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 50%;
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(0deg);
  border-radius: 999px;
}

.hour {
  width: 8px;
  height: 28%;
  background: var(--ink);
}

.minute {
  width: 5px;
  height: 38%;
  background: var(--blue);
}

.second {
  width: 3px;
  height: 41%;
  background: var(--red);
}

.center-dot {
  position: absolute;
  z-index: 4;
  inset: 50% auto auto 50%;
  width: 17px;
  height: 17px;
  transform: translate(-50%, -50%);
  border: 4px solid var(--panel-solid);
  border-radius: 50%;
  background: var(--red);
  box-shadow:
    0 0 0 2px rgba(23, 33, 43, 0.14),
    0 6px 12px rgba(223, 59, 54, 0.24);
}

.digital-panel {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 10px;
  width: 100%;
  padding: 20px 18px;
  border: 1px solid rgba(23, 33, 43, 0.12);
  border-radius: 8px;
  background: var(--panel-solid);
  box-shadow: inset 0 -4px 0 rgba(9, 105, 218, 0.08);
}

.digital-time {
  width: 100%;
  font-family: "Orbitron", sans-serif;
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
}

.digital-date {
  width: 100%;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.4;
  text-align: center;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .page {
    width: min(100% - 24px, 620px);
    padding-top: 28px;
  }

  .hero h1 {
    font-size: 2.1rem;
  }

  .clock-stage {
    grid-template-columns: 1fr;
  }

  .clock-card {
    padding: 20px;
  }
}

@media (max-width: 420px) {
  .hero h1 {
    font-size: 1.72rem;
  }

  .clock-face {
    width: min(100%, 285px);
  }

  .digital-time {
    font-size: 2.05rem;
  }

  .clock-number {
    font-size: 0.92rem;
  }

  .number-12,
  .number-3,
  .number-6,
  .number-9 {
    font-size: 1.15rem;
  }
}
