/* ポインター種別と画面幅、動き軽減設定を集約する最終CSS。 */
/* pointer:fine→広い幅→狭い幅→reduced-motionの順序を変更しない。 */
@media (pointer: fine) {
  .table-of-contents__list a:hover::before,
  .table-of-contents__list a:hover::after {
    opacity: 1;
    transform: translate(0, -50%) scaleY(1);
  }

  .table-of-contents__list a:hover::before {
    transform: none;
  }

  .table-of-contents__list a:hover > span:nth-child(2) {
    color: var(--ink);
  }

  .bookmark-button:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--paper);
    transform: translateY(-2px);
  }

  .profile-object:hover {
    background: rgba(231, 223, 209, 0.72);
    border-color: var(--sepia);
    color: var(--accent);
    transform: translateY(-2px);
  }

  .envelope-button:hover,
  .envelope-button:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-4px);
  }

  .envelope-button:hover .envelope-button__seal::after,
  .envelope-button:focus-visible .envelope-button__seal::after {
    opacity: 0.92;
    transform: translateX(3px);
  }

  .contact-secondary:hover,
  .contact-secondary:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
  }
}

@media (min-width: 721px) {
  .book-spread__link {
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .book-spread--reverse .book-spread__visual {
    grid-column: 2;
    grid-row: 1;
  }

  .book-spread--reverse .book-spread__copy {
    grid-column: 1;
    grid-row: 1;
  }

  .book-spread--night .book-spread__link {
    grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
    padding: clamp(48px, 7vw, 96px) clamp(20px, 6vw, 88px);
  }

  .book-spread--night .book-spread__copy {
    padding-inline-end: 0;
  }

  .profile-layout {
    align-items: end;
    display: grid;
    gap: clamp(48px, 8vw, 112px);
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .profile-layout .seal {
    margin-block-start: 0;
  }

  .bookmark-layout {
    display: grid;
    gap: clamp(48px, 8vw, 112px);
    grid-template-columns: auto minmax(0, 1fr);
  }

  .bookmark-ribbon {
    margin-block-end: 0;
  }

  .request-layout {
    align-items: start;
    display: grid;
    gap: clamp(56px, 8vw, 112px);
    grid-template-columns: 1fr 1fr;
  }

  .request-list {
    margin-block-start: 0;
  }

  .footer-inner {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 2rem;
    justify-content: space-between;
  }

  .footer-inner p + p {
    margin-block-start: 0;
  }
}

@media (min-width: 901px) {
  .profile-layout {
    grid-template-columns: minmax(0, 0.24fr) minmax(0, 1fr) auto;
  }

  .profile-copy {
    grid-column: 2;
  }

  .profile-layout .seal {
    grid-column: 3;
  }

  .bookmark-layout {
    grid-template-columns: minmax(0, 0.18fr) auto minmax(0, 1fr) minmax(0, 0.18fr);
  }

  .bookmark-ribbon {
    grid-column: 2;
  }

  .bookmark-layout > div {
    grid-column: 3;
  }

  .contact__content {
    display: grid;
    grid-template-columns: minmax(0, 0.22fr) minmax(0, 1fr) minmax(0, 0.22fr);
  }

  .contact__content > * {
    grid-column: 2;
  }

  .contact__content > .section-heading {
    grid-column: 1 / -1;
  }
}

@media (min-width: 721px) and (max-width: 900px) {
  .book-spread h3 {
    font-size: 1.5rem;
    letter-spacing: 0.035em;
  }

  .book-opening-page__content {
    padding: clamp(34px, 5vw, 48px);
  }

  .book-spread--night .book-opening-page__content {
    padding-inline: clamp(18px, 2.6vw, 24px);
  }
}

@media (max-width: 720px) {
  .book-page::before,
  .book-page::after {
    font-size: 0.625rem;
  }

  .hero__content {
    gap: 18px;
    padding-block: 68px 46px;
  }

  .hero__catch {
    line-height: 1.75;
  }

  .section-heading {
    gap: 12px;
  }

  .chapter-title__inner {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .chapter-title__number {
    grid-row: 1 / 3;
    justify-self: start;
  }

  .chapter-title__copy {
    text-align: start;
  }

  .seal--chapter {
    grid-column: 2;
    justify-self: end;
  }

  .book-spread__copy {
    padding-block: 48px 68px;
  }

  .book-spread--night .book-spread__link {
    padding-block-end: 24px;
  }

  .book-fragment {
    grid-template-columns: minmax(0, 0.06fr) minmax(0, 1fr) minmax(0, 0.06fr);
  }

  .section-heading--plain {
    margin-block-end: 2.5rem;
  }
}

@media (max-width: 480px) {
  .book-spread__visual {
    perspective: 980px;
  }

  .line-break--mobile {
    display: block;
  }

  .hero__title {
    font-size: 2.75rem;
    letter-spacing: 0.09em;
  }

  .hero__catch {
    font-size: 0.875rem;
    letter-spacing: 0.03em;
  }

  .hero__intro-line {
    transform: scaleY(0.78);
    transform-origin: top;
  }

  .resume-link {
    font-size: 0.875rem;
  }

  .news-item {
    display: block;
  }

  .news-item time {
    display: block;
    margin-block-end: 0.35rem;
  }

  .chapter-rule {
    flex-basis: 22px;
  }

  .section-heading h2 {
    font-size: 1.65rem;
  }

  .book-fragment,
  .book-opening-page__sentence {
    font-size: 0.94rem;
    letter-spacing: 0.065em;
  }

  .book-spread h3 {
    font-size: 1.7rem;
  }

  .letter-card__actions {
    display: block;
  }

  .envelope-button {
    display: flex;
  }

  .contact-secondary {
    display: inline-block;
    margin-block-start: 1rem;
  }
}

@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;
  }

  [data-reveal],
  [data-image-reveal-layer],
  [data-image-reveal] picture,
  [data-fragment-line],
  [data-news-reveal] > *,
  [data-seal-pop],
  .hero__catch {
    opacity: 1 !important;
    transform: none !important;
  }

  .hero__window-light {
    animation: none !important;
    opacity: 0.42;
  }

  .night-light {
    animation: none !important;
    opacity: 0.52;
  }

  .aquarium-bubble,
  .moving-dust,
  .night-star,
  .night-firefly,
  .profile-light-band,
  .profile-dust,
  .book-spread__depth {
    animation: none !important;
  }


  .book-opening-page__seal.is-stamped {
    opacity: 0.86;
    transform: scale(1) rotate(-2deg);
  }

  .book-spread__depth {
    transform: none !important;
  }

  .ink-trail__drop {
    display: none !important;
  }
}
