/*
  TimeDrift-style rotating calendar clock
  Isolated component: no Tailwind, React, Next.js or external dependency.
*/

.tdc-page,
.tdc-page * {
  box-sizing: border-box;
}

.tdc-page {
  --tdc-text-primary: rgba(207, 232, 226, 0.96);
  --tdc-text-secondary: rgba(159, 202, 192, 0.82);
  --tdc-text-muted: rgba(139, 184, 173, 0.62);
  --tdc-border-default: rgba(139, 184, 173, 0.16);
  --tdc-border-emphasis: rgba(139, 184, 173, 0.36);

  /* Zenith-like glass surfaces used by the six original layers. */
  --tdc-surface-1: rgba(18, 38, 33, 0.30);
  --tdc-surface-2: rgba(23, 50, 43, 0.42);
  --tdc-surface-3: rgba(30, 65, 55, 0.52);
  --tdc-surface-4: rgba(42, 83, 71, 0.61);
  --tdc-surface-5: rgba(57, 103, 90, 0.69);

  width: 100%;
  min-height: 620px;
  height: 100dvh;
  position: relative;
  overflow: hidden;
  color: var(--tdc-text-primary);
  background: transparent;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  isolation: isolate;
}

.tdc-clock {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.tdc-dial-anchor {
  width: 720px;
  height: 720px;
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translate(-50%, -50%) scale(var(--tdc-scale, 1));
  transform-origin: 50% 50%;
  overflow: visible;
  z-index: 2;
}

.tdc-dial {
  width: 720px;
  height: 720px;
  position: relative;
  transform: rotate(90deg);
  transform-origin: 50% 50%;
  overflow: visible;
}

.tdc-ring {
  --tdc-label-offset: 22px;
  --tdc-tick-length: 8px;
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 9999px;
  border: 1px solid var(--tdc-border-emphasis);
  transform-origin: 50% 50%;
}

.tdc-ring-plate {
  position: absolute;
  inset: 5px;
  border-radius: 9999px;
  border: 1px dashed var(--tdc-border-emphasis);
  background: var(--tdc-ring-surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  filter: var(--tdc-ring-shadow);
  pointer-events: none;
}

.tdc-ring[data-ring="seconds"] {
  --tdc-label-offset: 22px;
  --tdc-tick-length: 8px;
  --tdc-ring-surface: var(--tdc-surface-1);
  --tdc-ring-shadow: drop-shadow(0 4px 22.7px rgba(139, 184, 173, 0.22));
  transition: none;
  will-change: transform;
  z-index: 3;
}

.tdc-ring[data-ring="minutes"] {
  --tdc-label-offset: 22px;
  --tdc-tick-length: 8px;
  --tdc-ring-surface: var(--tdc-surface-2);
  --tdc-ring-shadow: drop-shadow(0 4px 24.8px rgba(139, 184, 173, 0.34));
  transition: transform 2000ms ease-in-out;
  z-index: 4;
}

.tdc-ring[data-ring="hours"] {
  --tdc-label-offset: 22px;
  --tdc-tick-length: 8px;
  --tdc-ring-surface: var(--tdc-surface-3);
  --tdc-ring-shadow: drop-shadow(0 4px 39.8px rgba(8, 22, 18, 0.92));
  transition: transform 2000ms ease-in-out;
  z-index: 5;
}

.tdc-ring[data-ring="weekdays"] {
  --tdc-label-offset: 20px;
  --tdc-tick-length: 8px;
  --tdc-ring-surface: var(--tdc-surface-4);
  --tdc-ring-shadow: drop-shadow(0 4px 45.6px rgba(8, 22, 18, 0.82));
  transition: transform 3000ms ease-out;
  z-index: 6;
}

.tdc-ring[data-ring="months"] {
  --tdc-label-offset: 20px;
  --tdc-tick-length: 8px;
  --tdc-ring-surface: var(--tdc-surface-5);
  --tdc-ring-shadow: drop-shadow(0 4px 35px rgba(8, 22, 18, 0.52));
  transition: transform 4000ms ease-out;
  z-index: 7;
}

.tdc-ring[data-ring="year"] {
  --tdc-label-offset: 0px;
  --tdc-label-gap-y: 0px;
  --tdc-tick-length: 0px;
  --tdc-ring-surface: rgba(21, 51, 43, 0.82);
  --tdc-ring-shadow: drop-shadow(0 4px 35px rgba(8, 22, 18, 0.38));
  transition: none;
  color: var(--tdc-text-primary);
  z-index: 8;
}

.tdc-year-center {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  transform: translate(-50%, -50%) rotate(-90deg);
  transform-origin: 50% 50%;
  color: var(--tdc-text-primary);
  font-size: 14px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
  text-shadow:
    0 0 8px rgba(159, 202, 192, 0.42),
    0 0 18px rgba(139, 184, 173, 0.18);
}

.tdc-year-center.is-active {
  color: #d7eee8;
  text-shadow:
    0 0 9px rgba(159, 202, 192, 0.58),
    0 0 20px rgba(139, 184, 173, 0.26);
}

.tdc-marks {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  z-index: 3;
}

.tdc-mark {
  width: 0;
  height: 0;
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  pointer-events: none;
}

.tdc-mark-content {
  display: contents;
}

.tdc-mark-label {
  position: absolute;
  left: calc(-1 * var(--tdc-label-offset));
  top: 0;
  display: inline-block;
  width: max-content;
  min-width: 0;
  color: var(--tdc-text-muted);
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
  transform: translate(-50%, -50%) rotate(-90deg);
  transform-origin: 50% 50%;
}

.tdc-mark-tick {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--tdc-tick-length);
  height: 2px;
  border-radius: 9999px;
  background: var(--tdc-text-secondary);
  transform: translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.tdc-mark.is-active .tdc-mark-label {
  color: #d7eee8;
  font-weight: 800;
  opacity: 1;
  text-shadow:
    0 0 7px rgba(159, 202, 192, 0.58),
    0 0 18px rgba(139, 184, 173, 0.28);
}

.tdc-mark.is-active .tdc-mark-tick {
  width: calc(var(--tdc-tick-length) + 2px);
  background: #9fcac0;
  box-shadow:
    0 0 7px rgba(159, 202, 192, 0.58),
    0 0 14px rgba(139, 184, 173, 0.22);
}

/* Fixed selection axis: all current values line up here at the bottom. */
.tdc-selection-axis {
  width: 1px;
  height: min(365px, 39vh);
  position: absolute;
  left: 50%;
  top: 8px;
  z-index: 1;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0.16;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0),
    rgba(255,255,255,0.22) 35%,
    rgba(255,255,255,0.02)
  );
}

.tdc-readout {
  width: 100%;
  position: absolute;
  left: 50%;
  top: min(63%, 640px);
  z-index: 20;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  direction: ltr;
  text-align: center;
  color: #cfe8e2;
  text-shadow:
    0 8px 24px rgba(5, 19, 15, 0.72),
    0 0 18px rgba(139, 184, 173, 0.14);
}

.tdc-time {
  display: flex;
  align-items: baseline;
  justify-content: center;
  white-space: nowrap;
  direction: ltr;
  font-variant-numeric: tabular-nums;
  font-size: 60px;
  line-height: 1;
  font-weight: 760;
  letter-spacing: -0.055em;
}

.tdc-time-main {
  display: inline-block;
}

.tdc-ampm {
  display: inline-block;
  margin-left: 12px;
  font-size: 0.55em;
  letter-spacing: -0.02em;
}

.tdc-date {
  margin-top: 11px;
  margin-bottom: 24px;
  white-space: nowrap;
  color: #9fcac0;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* Rolling digit animation for the digital readout. */
.tdc-digit {
  width: 0.61em;
  height: 1em;
  position: relative;
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.tdc-digit-track {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  transform: translateY(0);
  transition: transform 360ms cubic-bezier(.2, .8, .2, 1);
}

.tdc-digit-track > span {
  width: 100%;
  height: 1em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tdc-separator {
  width: 0.38em;
  display: inline-flex;
  justify-content: center;
}

@media (max-width: 760px) {
  .tdc-page {
    min-height: 540px;
  }

  .tdc-readout {
    top: 61%;
  }

  .tdc-time {
    font-size: clamp(38px, 12vw, 52px);
  }

  .tdc-date {
    max-width: calc(100vw - 30px);
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 15px;
  }

  .tdc-mark-label {
    font-size: 11px;
  }

  .tdc-ring[data-ring="seconds"],
  .tdc-ring[data-ring="minutes"],
  .tdc-ring[data-ring="hours"] {
    --tdc-label-offset: 20px;
      --tdc-tick-length: 7px;
  }

  .tdc-ring[data-ring="weekdays"],
  .tdc-ring[data-ring="months"] {
    --tdc-label-offset: 18px;
      --tdc-tick-length: 7px;
  }
}

@media (max-height: 700px) {
  .tdc-readout {
    top: 66%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tdc-ring,
  .tdc-digit-track {
    transition: none !important;
  }
}

@media (min-width: 901px) {
  .tdc-dial-anchor,
  .tdc-selection-axis {
    top: 72px;
  }
}

@media (max-width: 760px) {
  .tdc-year-center {
    font-size: 13px;
  }
}
