:root {
  --bg: #0b1220;
  --fg: #f8f7f4;
  --accent: #2f5d9e;
  --dial: max(250px, min(88vw, 62vh, 600px));
  --sans: "Jost", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Marcellus", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

main { position: fixed; inset: 0; }

.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;
}

/* The dial: positioned by JS with translate3d, starts centered. */
.dial {
  position: absolute;
  left: 0; top: 0;
  width: var(--dial);
  height: var(--dial);
  border-radius: 50%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  will-change: transform;
  outline: none;
  visibility: hidden; /* shown once JS has placed it */
}
.dial.ready { visibility: visible; }
.dial.grabbing { cursor: grabbing; }
.dial.spinning { cursor: alias; }
.dial:focus-visible { box-shadow: 0 0 0 2px var(--fg); }

.bezel, .hands {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  overflow: visible;
  pointer-events: none;
}
.bezel { will-change: transform; }

.ring-text {
  fill: var(--fg);
  font-family: var(--sans);
  font-size: 30px;
  font-weight: 400;
  text-transform: lowercase;
}

.tick { stroke: var(--fg); stroke-linecap: round; }
.tick-minor { stroke-width: 2; opacity: .45; }
.tick-major { stroke-width: 4; }
.tick-twelve { stroke: var(--accent); stroke-width: 7; }

.hand { stroke: var(--fg); stroke-linecap: round; }
.hand-hour   { stroke-width: 14; }
.hand-minute { stroke-width: 8; }
.hand-second { stroke: var(--accent); stroke-width: 3; }
.pinion { fill: var(--accent); stroke: var(--fg); stroke-width: 3; }

.dial-print {
  fill: var(--fg);
  opacity: .55;
  font-family: var(--sans);
  font-size: 22px;
  letter-spacing: 6px;
}

.hint, .links {
  position: absolute;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: lowercase;
  color: var(--fg);
}

.hint {
  left: 0; right: 0;
  bottom: calc(22px + env(safe-area-inset-bottom));
  margin: 0;
  text-align: center;
  opacity: .5;
  pointer-events: none;
  transition: opacity .6s ease;
}
.hint.gone { opacity: 0; }

.links {
  top: calc(20px + env(safe-area-inset-top));
  right: calc(22px + env(safe-area-inset-right));
  display: flex;
  gap: 18px;
}
.links a {
  color: inherit;
  text-decoration: none;
  opacity: .55;
  transition: opacity .2s ease;
}
.links a:hover, .links a:focus-visible { opacity: 1; outline: none; text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 520px) {
  .links { left: 0; right: 0; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .hint, .links a { transition: none; }
}
