/* Version: v1.2 */

@font-face {
  font-family: "GILROY";
  src: url("./GILROY.OTF") format("opentype");
  font-weight: 400;
  font-style: normal;
}

:root {
  color-scheme: dark;
  --color-bg: #020617;
  --color-surface: rgba(15, 15, 15, 0.957);
  --color-text: #e2e8f0;
  --color-muted: #94a3b8;
  --card-size: clamp(350px, 15vmin, 500px);
  --clock-size: clamp(400px, 55vmin, 520px);
  /* 颜色映射 */
  --A1: #f8fafc;
  --A2: #a5b4fc8a;
  --A3: #a5b4fc8a;
  --B1: #fe9b55;
  --B2: #fe9b5587;
  --B3: #fe9b5587;
  --C1: #76ce7b;
  --C3: #76ce7b82;
  --C2: #76ce7b82;
  /* 指针色 */
  --hour-hand: var(--A1);
  --minute-hand: var(--C1);
  --second-hand: var(--B1);
  --border-radius: 66px;
  --inset: -80px;
  --sprite: 360px;
  font-family: "Segoe UI", "Helvetica Neue", system-ui, -apple-system, BlinkMacSystemFont,
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, #1e3a8a 0%, #0f172a 45%, var(--color-bg) 100%);
  color: var(--color-text);
}

.app {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0;
  padding: 0;
  background: var(--color-surface);
  border: 1px solid rgba(148, 163, 184, 0.16);
  position: relative;
  --r: clamp(66px, 5vw, var(--border-radius));
  border-radius: var(--r);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.38);
  width: min(var(--card-size), 70vmin);
  aspect-ratio: 1;
  overflow: hidden;
  transition: width 150ms ease, height 150ms ease;
}

.glow {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--sprite, 140px);
  height: var(--sprite, 140px);
  pointer-events: none;
  z-index: 0;
  offset-path: path(var(--orbit-path, "M 0 0"));
  offset-distance: 0%;
  offset-position: 0px 0px;
  offset-rotate: 0deg;
  offset-anchor: 50% 50%;
  will-change: offset-distance;
}

.clock {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

.clock__wrapper {
  width: 100%;
  height: 100%;
  position: relative;
}

.clock__face {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.dial {
  transform-origin: center;
}

.dial__orbit,
.dial__content {
  transform-origin: center;
}

.dial__circle {
  fill: none;
  stroke-width: 1;
  opacity: 0.4;
}

.dial--hour .dial__circle {
  stroke: rgba(148, 163, 255, 0.35);
}

.dial__label {
  fill: var(--color-text);
  font-family: "GILROY", "Segoe UI", "Helvetica Neue", system-ui, -apple-system, BlinkMacSystemFont,
    "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 600;
  pointer-events: none;
  opacity: 0.92;
}

.dial__label--hour {
  fill: var(--A1);
}

.dial__label--minute {
  fill: var(--C1);
}

.dial__label--second {
  fill: var(--B1);
}

.dial--minute .dial__circle {
  stroke: rgba(56, 189, 248, 0.25);
}

.dial--second .dial__circle {
  stroke: rgba(249, 115, 22, 0.25);
}

.dial__tick {
  stroke-linecap: round;
}

.dial--hour .dial__tick--major {
  stroke: var(--A1);
  stroke-width: 2.6;
}

.dial--hour .dial__tick--middle {
  stroke: var(--A2);
  stroke-width: 1.8;
}

.dial--hour .dial__tick--minor {
  stroke: var(--A3);
  stroke-width: 1.3;
}

.dial--minute .dial__tick--major {
  stroke: var(--C1);
  stroke-width: 2.2;
  opacity: 0.9;
}

.dial--minute .dial__tick--middle {
  stroke: var(--C2);
  stroke-width: 1.6;
  opacity: 0.85;
}

.dial--minute .dial__tick--minor {
  stroke: var(--C3);
  stroke-width: 1.2;
  opacity: 0.75;
}

.dial--second .dial__tick--major {
  stroke: var(--B1);
  stroke-width: 2;
}

.dial--second .dial__tick--middle {
  stroke: var(--B2);
  stroke-width: 1.4;
  opacity: 0.85;
}

.dial--second .dial__tick--minor {
  stroke: var(--B3);
  stroke-width: 1.1;
  opacity: 0.75;
}

.hands {
  filter: drop-shadow(0 0 3px rgba(15, 23, 42, 0.45));
}

.hand line {
  stroke-linecap: round;
}

.hand--hour line {
  stroke: var(--hour-hand);
  stroke-width: 4;
}

.hand--minute line {
  stroke: var(--minute-hand);
  stroke-width: 3;
}

.hand--second line {
  stroke: var(--second-hand);
  stroke-width: 2;
}

.hand__pivot {
  fill: #f8fafc;
  stroke: rgba(15, 23, 42, 0.6);
  stroke-width: 1.2;
}
