:root {
  --bg-1: #f8ede3;
  --bg-2: #f2d7c8;
  --bg-3: #cce6f4;
  --ink: #1d2b36;
  --ink-soft: #4a6170;
  --accent: #d04a2b;
  --accent-soft: #f7b58f;
  --face: #fef7ef;
  --face-edge: #f1e3d6;
  --ring: #16222c;
  --tick-major: rgba(22, 34, 44, 0.55);
  --tick-minor: rgba(22, 34, 44, 0.22);
  --shadow: 0 30px 70px rgba(12, 22, 30, 0.25);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Space Grotesk", "Noto Sans", "Liberation Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px circle at 12% 15%, rgba(247, 205, 170, 0.6), transparent 60%),
    radial-gradient(800px circle at 88% 12%, rgba(172, 221, 247, 0.55), transparent 55%),
    linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-3) 100%);
  padding: clamp(24px, 4vw, 60px);
}

body[data-theme="morning"] {
  --bg-1: #fff2e3;
  --bg-2: #f8d7bf;
  --bg-3: #d3ecf7;
}

body[data-theme="afternoon"] {
  --bg-1: #f9efe6;
  --bg-2: #f4cfa2;
  --bg-3: #bfe3f6;
}

body[data-theme="evening"] {
  --bg-1: #f3e4d7;
  --bg-2: #e0b9a8;
  --bg-3: #b2c7e2;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background:
    radial-gradient(180px circle at 18% 70%, rgba(255, 255, 255, 0.35), transparent 70%),
    radial-gradient(220px circle at 82% 75%, rgba(255, 255, 255, 0.28), transparent 70%);
  opacity: 0.8;
}

body::after {
  background:
    radial-gradient(480px circle at 70% 30%, rgba(255, 244, 233, 0.65), transparent 70%);
  opacity: 0.5;
}

.app {
  width: min(960px, 100%);
  display: grid;
  gap: clamp(20px, 4vw, 36px);
  text-align: center;
}

.app-header {
  display: grid;
  gap: 12px;
  justify-items: center;
  animation: riseIn 0.6s ease-out;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

h1 {
  margin: 0;
  font-family: "Fraunces", "Georgia", serif;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 1.05;
}

.subhead {
  margin: 0;
  max-width: 36ch;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

.clock-wrap {
  display: grid;
  gap: 18px;
  justify-items: center;
}

.clock {
  width: clamp(240px, 52vw, 420px);
  height: clamp(240px, 52vw, 420px);
  border-radius: 50%;
  padding: clamp(14px, 3vw, 26px);
  background: linear-gradient(145deg, #fef2e7 0%, #e7d3c4 100%);
  border: 3px solid var(--ring);
  box-shadow: var(--shadow);
  position: relative;
  animation: floatIn 0.8s ease-out 0.1s both;
}

.clock::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));
  opacity: 0.6;
  pointer-events: none;
}

.clock-face {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #ffffff 0%, var(--face) 48%, var(--face-edge) 100%);
  box-shadow: inset 0 0 24px rgba(12, 20, 26, 0.15);
  overflow: hidden;
}

.clock-face::before {
  content: "";
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background:
    repeating-conic-gradient(var(--tick-major) 0deg 2deg, transparent 2deg 30deg),
    repeating-conic-gradient(var(--tick-minor) 0deg 1deg, transparent 1deg 6deg);
  -webkit-mask: radial-gradient(circle, transparent 0 70%, #000 71% 100%);
  mask: radial-gradient(circle, transparent 0 70%, #000 71% 100%);
}

.clock-face::after {
  content: "";
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  border: 1px solid rgba(22, 34, 44, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.hand {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: 0% 50%;
  transform: translateY(-50%) rotate(90deg);
  border-radius: 999px;
}

.hour-hand {
  width: 28%;
  height: 8px;
  background: var(--ink);
  box-shadow: 0 3px 6px rgba(13, 20, 26, 0.25);
}

.min-hand {
  width: 42%;
  height: 5px;
  background: var(--ink);
  box-shadow: 0 2px 4px rgba(13, 20, 26, 0.2);
}

.second-hand {
  width: 56%;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(208, 74, 43, 0.25);
}

.center-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 245, 236, 0.9), 0 6px 12px rgba(14, 22, 30, 0.25);
}

.readout {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 12px 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 12px 30px rgba(13, 20, 26, 0.15);
  backdrop-filter: blur(6px);
  animation: riseIn 0.6s ease-out 0.2s both;
}

.digital {
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.18em;
}

.timezone {
  font-size: 0.8rem;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 600px) {
  body {
    padding: 20px;
  }

  .app {
    gap: 20px;
  }

  .readout {
    border-radius: 20px;
  }

  .digital {
    letter-spacing: 0.12em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-header,
  .clock,
  .readout {
    animation: none;
  }
}
