:root {
  color-scheme: light;
  --ink: #1f2328;
  --muted: #4f5661;
  --paper: #f5f6fa;
  --line: #e7e9f0;
  --today: #1769e9;
  --shadow: 0 28px 70px rgba(24, 31, 48, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.86), transparent 28rem),
    linear-gradient(135deg, #eef1f7 0%, #f8f9fc 52%, #eef3fb 100%);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button {
  font: inherit;
}

.site-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.calendar-card {
  width: min(430px, 100%);
  padding: 30px 32px 32px;
  border: 1px solid rgba(31, 35, 40, 0.06);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.18rem, 4vw, 1.38rem);
  font-weight: 720;
  line-height: 1.16;
  letter-spacing: 0;
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  font-size: 1.88rem;
  font-weight: 520;
  line-height: 1;
}

.chevron {
  display: grid;
  width: 20px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  line-height: 1;
}

.chevron:focus-visible {
  outline: 2px solid var(--today);
  outline-offset: 3px;
}

.calendar-grid {
  display: grid;
  gap: 12px;
}

.weekday-row,
.week-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: center;
  justify-items: center;
}

.weekday-row {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 680;
}

.weeks-grid {
  display: grid;
  gap: 10px;
}

.week-row {
  gap: 5px;
}

.day-cell {
  width: 100%;
  min-height: 42px;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 3px;
  border-radius: 8px;
}

.day-cell.is-weekend {
  color: color-mix(in srgb, var(--muted) 82%, white);
}

.calendar-token {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 620;
  line-height: 1;
  letter-spacing: 0;
}

.date-token.is-today {
  min-width: 30px;
  height: 30px;
  margin-top: -4px;
  background: var(--today);
  color: #fff;
  box-shadow: 0 10px 22px rgba(23, 105, 233, 0.28);
}

.calendar-token.is-letter {
  transform-origin: 50% 50%;
}

.calendar-token.is-leaving {
  animation: page-out 420ms cubic-bezier(0.42, 0, 0.16, 1) forwards;
}

.calendar-token.is-entering {
  animation: page-in 420ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes page-out {
  0% {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
  }

  100% {
    opacity: 0;
    transform: translateY(-12px) rotateX(35deg);
  }
}

@keyframes page-in {
  0% {
    opacity: 0;
    transform: translateY(14px) rotateX(-32deg);
  }

  100% {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
  }
}

@media (max-width: 520px) {
  .site-shell {
    padding: 24px 12px;
  }

.calendar-card {
    width: min(360px, 100%);
    padding: 30px 24px 32px;
  }

  .week-row {
    gap: 4px;
  }

  .day-cell {
    min-height: 38px;
    padding-inline: 1px;
  }

  .calendar-token {
    min-width: 20px;
    height: 20px;
    font-size: 0.88rem;
  }

  .date-token.is-today {
    min-width: 28px;
    height: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
