:root {
  color-scheme: light;
  font-family:
    "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #ffffff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  overflow: hidden;
  background: #ffffff;
}

button {
  font: inherit;
}

.preview-shell {
  width: 720px;
  height: 810px;
  margin: 0;
}

.calendar-motion {
  --hour: 96px;
  --pre-hour: 48px;
  --event-origin: var(--pre-hour);
  position: relative;
  isolation: isolate;
  width: 720px;
  height: 810px;
  margin: 0;
  overflow: hidden;
  color: #2a2b2d;
  background: #ffffff;
}

.calendar-motion::before {
  content: "";
  position: absolute;
  z-index: 40;
  inset: 0;
  background:
    linear-gradient(to right, #ffffff 0, rgba(255, 255, 255, 0) 7%, rgba(255, 255, 255, 0) 92%, #ffffff 100%),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.55) 0, rgba(255, 255, 255, 0) 5.5%, rgba(255, 255, 255, 0) 88%, #ffffff 100%),
    radial-gradient(ellipse at center, transparent 55%, rgba(255, 255, 255, 0.14) 72%, rgba(255, 255, 255, 0.78) 100%);
  pointer-events: none;
}

.calendar-motion::after {
  content: "";
  position: absolute;
  z-index: 39;
  inset: -18px;
  border: 34px solid rgba(255, 255, 255, 0.84);
  filter: blur(18px);
  pointer-events: none;
}

.calendar-body {
  position: absolute;
  z-index: 0;
  inset: 0;
  background-color: #ffffff;
  background-image:
    linear-gradient(
      to right,
      transparent 0,
      transparent 53px,
      #dfe3e8 53px,
      #dfe3e8 54px,
      transparent 54px,
      transparent 275px,
      #dfe3e8 275px,
      #dfe3e8 276px,
      transparent 276px,
      transparent 497px,
      #dfe3e8 497px,
      #dfe3e8 498px,
      transparent 498px,
      transparent 719px,
      #dfe3e8 719px,
      #dfe3e8 720px
    ),
    linear-gradient(#dfe3e8, #dfe3e8),
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc(var(--hour) - 1px),
      #dfe3e8 calc(var(--hour) - 1px),
      #dfe3e8 var(--hour)
    );
  background-repeat: no-repeat, no-repeat, repeat;
  background-size:
    100% 100%,
    100% 1px,
    100% var(--hour);
  background-position:
    0 0,
    0 0,
    0 var(--event-origin);
}

.time-labels {
  position: absolute;
  inset: 0 auto 0 0;
  width: 54px;
}

.time-labels span {
  position: absolute;
  top: calc(var(--event-origin) + var(--row) * var(--hour) - 8px);
  right: 8px;
  color: #6e7680;
  font-size: 10px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0.12px;
}

.events {
  position: absolute;
  z-index: 3;
  inset: 0;
}

.event {
  --event-blue: #0e72ed;
  --event-ink: #062e5f;
  position: absolute;
  left: var(--day-x);
  top: calc(var(--event-origin) + var(--start) * var(--hour));
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 216px;
  height: calc(var(--duration) * var(--hour) - 5px);
  min-height: 36px;
  padding: 8px 22px 6px 11px;
  overflow: hidden;
  border: 1px solid #ffffff;
  border-radius: 5px;
  color: var(--event-ink);
  background:
    linear-gradient(rgba(14, 114, 237, 0.2), rgba(14, 114, 237, 0.2)),
    #ffffff;
}

.event[style*="--day: 0"] {
  --day-x: 54px;
}

.event[style*="--day: 1"] {
  --day-x: 276px;
}

.event[style*="--day: 2"] {
  --day-x: 498px;
}

.event::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 5px;
  border-radius: 5px 0 0 5px;
  background: var(--event-blue);
}

.event-title {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 100%;
  overflow: hidden;
  font-size: 14px;
  font-weight: 510;
  line-height: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-time {
  position: relative;
  z-index: 1;
  display: block;
  color: inherit;
  font-size: 12px;
  font-weight: 400;
  line-height: 14px;
  white-space: nowrap;
}

.event[style*="--duration: 0.5"] .event-time {
  display: none;
}

.event--compact {
  justify-content: center;
  padding-top: 5px;
  padding-bottom: 5px;
}

.event--flexible {
  z-index: 4;
}

.event--maybe::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0 0 0 5px;
  opacity: 0.38;
  background: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0) 0,
    rgba(255, 255, 255, 0) 5px,
    rgba(255, 255, 255, 0.8) 5px,
    rgba(255, 255, 255, 0.8) 9px
  );
  pointer-events: none;
}

.flexible-indicator {
  position: absolute;
  z-index: 2;
  right: 5px;
  bottom: 4px;
  display: block;
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.event--focus {
  --event-blue: #009d9a;
  --event-ink: #003f3e;
  background:
    linear-gradient(rgba(0, 157, 154, 0.2), rgba(0, 157, 154, 0.2)),
    #ffffff;
}

.event--lunch {
  --event-blue: #ff5f0f;
  --event-ink: #662606;
  background:
    linear-gradient(rgba(255, 95, 15, 0.18), rgba(255, 95, 15, 0.18)),
    #ffffff;
}

.event--red {
  --event-blue: #e8173d;
  --event-ink: #5d0918;
  background:
    linear-gradient(rgba(232, 23, 61, 0.16), rgba(232, 23, 61, 0.16)),
    #ffffff;
}

.event--violet {
  --event-blue: #7b47cc;
  --event-ink: #3b1d66;
  background:
    linear-gradient(rgba(123, 71, 204, 0.18), rgba(123, 71, 204, 0.18)),
    #ffffff;
}

.event--move-1on1,
.event--move-jordan {
  justify-content: center;
  padding-top: 5px;
  padding-bottom: 5px;
}

.event--moving {
  z-index: 8;
  transition:
    transform 560ms cubic-bezier(0.16, 1, 0.3, 1),
    width 520ms cubic-bezier(0.16, 1, 0.3, 1),
    height 560ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 260ms ease,
    filter 260ms ease;
  will-change: transform, width, height;
}

.calendar-motion[data-phase="rebalanced"] .event--moving,
.calendar-motion[data-phase="reset"] .event--moving {
  transition:
    transform 1280ms cubic-bezier(0.4, 0, 0.15, 1),
    width 980ms cubic-bezier(0.4, 0, 0.15, 1),
    height 1280ms cubic-bezier(0.4, 0, 0.15, 1),
    box-shadow 360ms ease,
    filter 360ms ease;
}

.event--pending {
  z-index: 3;
  padding-top: 6px;
  padding-bottom: 4px;
  border: 0;
  color: #062e5f;
  background: #ffffff;
  box-shadow: inset 0 0 0 1.5px #0e72ed;
}

.event--incoming {
  z-index: 12;
  opacity: 0;
  transform: translateY(-28px) scale(0.985);
  transform-origin: center top;
  transition:
    opacity 520ms ease,
    transform 700ms cubic-bezier(0.16, 1, 0.3, 1),
    width 560ms cubic-bezier(0.16, 1, 0.3, 1);
}

.event--pending::before {
  width: 6px;
}

.event--pending .event-title {
  font-size: 13px;
  line-height: 14px;
}

.event--pending .event-time {
  font-size: 10.5px;
  line-height: 12px;
}

.calendar-motion:is([data-phase="conflict"], [data-phase="processing"])
  .event--incoming,
.calendar-motion[data-phase="rebalanced"] .event--incoming {
  opacity: 1;
}

.calendar-motion:is([data-phase="conflict"], [data-phase="processing"])
  .event--incoming {
  width: 105px;
  transform: translate(111px, 0) scale(1);
}

.calendar-motion:is([data-phase="conflict"], [data-phase="processing"])
  .event--conflict {
  width: 105px;
  padding-right: 20px;
}

.calendar-motion:is([data-phase="conflict"], [data-phase="processing"])
  .event--incoming {
  padding-right: 8px;
}

.calendar-motion:is([data-phase="conflict"], [data-phase="processing"])
  :is(.event--conflict, .event--incoming)
  .event-title {
  overflow: visible;
  font-size: 12.5px;
  line-height: 14px;
  text-overflow: clip;
  white-space: normal;
}

.calendar-motion:is([data-phase="conflict"], [data-phase="processing"])
  .event--move-1on1,
.calendar-motion:is([data-phase="conflict"], [data-phase="processing"])
  .event--move-jordan {
  padding: 4px 20px 4px 11px;
}

.calendar-motion[data-phase="rebalanced"] .event--incoming {
  width: 216px;
  transform: translate(0, 0) scale(1);
  transition:
    opacity 520ms ease,
    transform 980ms cubic-bezier(0.4, 0, 0.15, 1),
    width 980ms cubic-bezier(0.4, 0, 0.15, 1);
}

.calendar-motion[data-phase="rebalanced"] .event--move-1on1 {
  transform: translateY(48px);
  transition-delay: 280ms;
}

.calendar-motion[data-phase="rebalanced"] .event--move-jordan {
  transform: translateY(-144px);
  transition-delay: 400ms;
}

.calendar-motion[data-phase="rebalanced"] .event--move-focus {
  transform: translateY(96px);
  transition-delay: 520ms;
}

.calendar-motion[data-phase="rebalanced"] .event--move-lunch {
  justify-content: center;
  height: calc(0.5 * var(--hour) - 5px);
  padding-top: 5px;
  padding-bottom: 5px;
  transform: translateY(48px);
  transition-delay: 640ms;
}

.calendar-motion[data-phase="rebalanced"] .event--move-lunch .event-time {
  display: none;
}

.scene-veil {
  position: absolute;
  z-index: 42;
  inset: 0;
  background: rgba(255, 255, 255, 0.72);
  opacity: 0;
  pointer-events: none;
}

.ai-pill-layer {
  position: absolute;
  z-index: 45;
  top: calc(var(--event-origin) + 2.5 * var(--hour) - 24px);
  left: 276px;
  width: 216px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.ai-pill {
  display: flex;
  gap: 12px;
  align-items: center;
  height: 49px;
  padding: 12px 20px 12px 16px;
  border: 0.5px solid #dfe3e8;
  border-radius: 100px;
  background: #ffffff;
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.08),
    0 24px 48px rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: translateY(10px) scale(0.96);
}

.ai-pill-icon-wrap {
  display: grid;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  place-items: center;
  overflow: clip;
}

.ai-pill-icon {
  display: block;
  width: 24px;
  height: 24px;
}

.ai-pill-copy {
  color: #555b62;
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: -0.31px;
  white-space: nowrap;
}

.ai-pill-dots {
  display: inline-block;
  width: 1.15em;
  text-align: left;
}

.ai-pill-dots::after {
  content: "";
}

.calendar-motion[data-phase="processing"] .scene-veil {
  animation: veil-cycle 2600ms ease forwards;
}

.calendar-motion[data-phase="processing"] .ai-pill {
  animation: pill-cycle 2600ms cubic-bezier(0.33, 0, 0.2, 1) forwards;
}

.calendar-motion[data-phase="processing"] .ai-pill-icon {
  animation: sparkle-pulse 1400ms ease-in-out infinite;
}

.calendar-motion[data-phase="processing"] .ai-pill-dots::after {
  animation: ellipsis 1200ms steps(4, end) infinite;
}

@keyframes veil-cycle {
  0% {
    opacity: 0;
  }

  12% {
    opacity: 1;
  }

  68% {
    opacity: 1;
  }

  88% {
    opacity: 0;
  }

  100% {
    opacity: 0;
  }
}

@keyframes pill-cycle {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }

  12% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  68% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  88% {
    opacity: 0;
    transform: translateY(-6px) scale(0.985);
  }

  100% {
    opacity: 0;
    transform: translateY(-6px) scale(0.985);
  }
}

@keyframes sparkle-pulse {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
    filter: saturate(1);
  }

  50% {
    transform: scale(1.12) rotate(14deg);
    filter: saturate(1.25);
  }
}

@keyframes ellipsis {
  0% {
    content: "";
  }

  25% {
    content: ".";
  }

  50% {
    content: "..";
  }

  75%,
  100% {
    content: "...";
  }
}

.motion-control {
  position: absolute;
  z-index: 50;
  top: 18px;
  right: 20px;
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(42, 43, 45, 0.08);
  border-radius: 999px;
  color: #526274;
  background: rgba(255, 255, 255, 0.78);
  opacity: 0;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition:
    opacity 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.calendar-motion:hover .motion-control,
.motion-control:focus-visible {
  opacity: 1;
}

.motion-control:hover {
  background: #ffffff;
  transform: scale(1.04);
}

.pause-icon {
  display: flex;
  gap: 3px;
}

.pause-icon::before,
.pause-icon::after {
  content: "";
  display: block;
  width: 2px;
  height: 9px;
  border-radius: 2px;
  background: currentColor;
}

.play-icon {
  display: none;
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
}

.calendar-motion[data-paused="true"] .pause-icon {
  display: none;
}

.calendar-motion[data-paused="true"] .play-icon {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .event,
  .event--moving,
  .event--pending,
  .scene-veil,
  .ai-pill,
  .motion-control {
    animation: none !important;
    transition: none !important;
  }

  .calendar-motion .event--incoming {
    opacity: 1;
    transform: none;
  }

  .calendar-motion .event--move-1on1 {
    transform: translateY(48px);
  }

  .calendar-motion .event--move-jordan {
    transform: translateY(-144px);
  }

  .calendar-motion .event--move-focus {
    transform: translateY(96px);
  }

  .calendar-motion .event--move-lunch {
    height: calc(0.5 * var(--hour) - 5px);
    transform: translateY(48px);
  }

  .calendar-motion .event--move-lunch .event-time {
    display: none;
  }

  .calendar-motion .scene-veil,
  .calendar-motion .ai-pill {
    display: none;
  }

  .motion-control {
    display: none;
  }
}
