@layer motion {
  @media (prefers-reduced-motion: no-preference) {
    html {
      scroll-behavior: smooth;
    }

    @supports (animation-timeline: scroll()) {
      .scroll-progress {
        animation: scroll-progress linear both;
        animation-timeline: scroll(root block);
      }
    }

    @supports (animation-timeline: view()) {
      .reveal {
        animation: reveal-rise linear both;
        animation-timeline: view();
        animation-range: entry 0% cover 23%;
      }
    }

    .hero__aura {
      animation: aura-breathe 17s ease-in-out infinite alternate;
    }

    .chip[data-state="ongoing"]::before {
      animation: pulse-dot 1.9s ease-in-out infinite;
    }
  }

  /* 同文档视图过渡：年份切换、假期切换的轻微交叉淡入 */
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.34s;
    animation-timing-function: var(--ease-soft);
  }

  /* 主题切换：关闭默认交叉淡入，由 JS 做圆形揭示 */
  html.is-theme-transition::view-transition-old(root),
  html.is-theme-transition::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
  }

  html.is-theme-transition::view-transition-old(root) {
    z-index: 0;
  }

  html.is-theme-transition::view-transition-new(root) {
    z-index: 1;
  }

  @keyframes scroll-progress {
    from {
      transform: scaleX(0);
    }
    to {
      transform: scaleX(1);
    }
  }

  @keyframes reveal-rise {
    from {
      opacity: 0;
      translate: 0 18px;
    }
    to {
      opacity: 1;
      translate: 0 0;
    }
  }

  @keyframes aura-breathe {
    from {
      transform: translate3d(0, -1%, 0) scale(1);
    }
    to {
      transform: translate3d(-2%, 2%, 0) scale(1.07);
    }
  }

  @keyframes pulse-dot {
    0%,
    100% {
      opacity: 1;
    }
    50% {
      opacity: 0.35;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }

    .reveal {
      animation: none !important;
      opacity: 1 !important;
      translate: none !important;
    }

    .scroll-progress {
      display: none;
    }

    .hero__aura {
      animation: none !important;
    }

    .chip[data-state="ongoing"]::before {
      animation: none !important;
    }
  }
}

@layer print {
  @media print {
    html {
      color-scheme: light;
    }

    .masthead,
    .grain,
    .scroll-progress,
    .toast,
    .hero__aura,
    .hero__actions,
    .theme-switch,
    .icon-btn,
    .dial__ticks,
    .skip-link {
      display: none !important;
    }

    body {
      font-size: 11pt;
      color: #000;
      background: #fff;
    }

    .section {
      padding-block: 22px;
      break-inside: avoid;
      border-top: 1px solid #999;
    }

    .section--ink {
      color: #000;
      background: #fff;
    }

    .section--ink h2,
    .section--ink h3,
    .method p,
    .method__aside {
      color: #000 !important;
    }

    .hero__number {
      font-size: 110pt;
    }

    .holiday__btn {
      padding-block: 8px;
    }

    .holiday__btn:hover {
      padding-left: 10px;
    }

    .colophon,
    .calendar-strip .month:last-child {
      display: none;
    }

    a {
      text-decoration: none;
    }
  }
}
