/* Entrance and typing animations used on the homepage. */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: var(--d, 0ms);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Text cursor and live status indicator. */
.type-cursor {
  display: inline-block;
  width: 0.55ch;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.1em;
  background: currentColor;
  animation: blink 1s steps(1) infinite;
  transition: opacity 0.6s;
}

.type-cursor.hide {
  opacity: 0;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.status {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-size: 0.85em;
  opacity: 0.8;
}

.led {
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
  background: var(--accent, #4ade80);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0
      color-mix(in srgb, var(--accent, #4ade80) 60%, transparent);
  }

  70%,
  100% {
    box-shadow: 0 0 0 0.6em transparent;
  }
}

section:hover > h2::after {
  content: "_";
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .type-cursor {
    animation: none;
  }
}

/* Current time and weather in Limerick. */
.clock-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
}

.clock {
  font-size: 2.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

.clock .colon {
  animation: blink 1s steps(1) infinite;
}

.clock-date {
  opacity: 0.7;
  font-size: 0.85em;
}

.cookie-clicker {
  margin: 2rem auto 0;
}

.clock-weather {
  margin-top: 0.4rem;
}

.clock-weather small {
  display: block;
  opacity: 0.7;
  font-size: 0.8em;
}

.clock-credit {
  font-size: 0.7em;
  opacity: 0.5;
}

.clock-diff,
.clock-sun {
  font-size: 0.85em;
  opacity: 0.8;
}

.clock-sun {
  font-variant-numeric: tabular-nums;
}