:root {
  color-scheme: light;
  background: #f4e2c5;
  font-family: "Trebuchet MS", "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: #f4e2c5 url("assets/background.jpg") center center / cover no-repeat;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, rgb(255 249 238 / 12%), rgb(107 69 112 / 8%));
  content: "";
  pointer-events: none;
}

.clock-shell {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(2.5rem, 9vh, 7rem) 1rem 2rem;
  text-align: center;
}

.clock {
  display: inline-flex;
  align-items: center;
  color: #624466;
  filter: drop-shadow(0 3px 1px rgb(255 248 229 / 78%));
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.2rem, 12vw, 9rem);
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0.025em;
  line-height: 0.95;
  text-shadow: 0 1px 0 rgb(255 247 225 / 90%), 0 0 18px rgb(91 56 102 / 28%);
  white-space: nowrap;
}

.time-group {
  display: inline-flex;
}

.digit {
  display: inline-block;
  width: 0.62em;
  height: 1em;
  overflow: hidden;
  vertical-align: top;
}

.digit-track {
  display: flex;
  flex-direction: column;
  transform: translateY(0);
  transition: transform 520ms cubic-bezier(0.22, 0.8, 0.25, 1);
}

.digit-track span {
  display: block;
  height: 1em;
}

.separator {
  display: inline-block;
  margin: 0 0.04em;
  animation: soft-blink 2s ease-in-out infinite;
}

.clock-caption {
  position: static;
  margin: clamp(1rem, 2.5vh, 1.75rem) 0 0;
  color: #67466b;
  font-size: clamp(0.72rem, 1.5vw, 1rem);
  font-style: italic;
  letter-spacing: 0.18em;
  text-shadow: 0 1px 0 rgb(255 247 225 / 88%), 0 2px 8px rgb(89 54 99 / 45%);
  text-transform: lowercase;
}

@keyframes soft-blink {
  0%,
  45%,
  100% {
    opacity: 1;
  }

  50%,
  95% {
    opacity: 0.42;
  }
}

@media (max-width: 600px) {
  body {
    background-position: center center;
  }

  .clock-shell {
    padding-top: clamp(2rem, 8vh, 4.5rem);
  }

  .clock-caption {
    margin-top: 0.9rem;
    letter-spacing: 0.1em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .digit-track,
  .separator {
    transition: none;
    animation: none;
  }
}
