/* ポインター・画面幅・動きの設定に応じた調整をまとめる。
   すべての上書きを保つため、スタイル群の最後に読み込む。 */
@media (pointer: fine) {
  .motion .bubble-cursor { display: block; }
  .intro-ready .bubble-cursor { display: none !important; }
}

@media (max-width: 900px) {
  .profile-layout,
  .story-layout { grid-template-columns: 1fr; }
  .profile-layout,
  .story-layout { gap: 3.5rem; }
  .profile-portrait { aspect-ratio: 4 / 3; }
  .content-grid,
  .gallery-track { grid-template-columns: 1fr; }
  .content-card { gap: 2.2rem; }
  .gallery-track { gap: 3rem; }
  .story-copy { order: 1; }
  .story-image { order: 2; }
}

@media (max-width: 600px) {
  :root {
    --gutter: 1.35rem;
    --section-space: 6rem;
  }
  body { line-height: 1.85; }
  .section-title { font-size: 2rem; }
  .hero {
    min-height: 100svh;
    padding-bottom: 3rem;
  }
  .hero-media img { object-position: 57% center; }
  .hero::before {
    background:
      linear-gradient(0deg, rgb(5 11 24 / 0.96) 0%, rgb(5 11 24 / 0.63) 44%, rgb(5 11 24 / 0.06) 76%),
      linear-gradient(90deg, rgb(5 11 24 / 0.2), transparent);
  }
  .hero-station span:first-child { max-width: 15rem; }
  .hero-name { font-size: clamp(2.5rem, 13vw, 3.25rem); }
  .hero-catch { max-width: 18rem; font-size: 1.35rem; }
  .hero-catch span { display: block; }
  .hero-role { max-width: 18rem; font-size: 0.72rem; line-height: 1.7; }
  .scroll-cue { display: none; }
  .glow-ring { animation: glow-ring-orbit 28s linear infinite; }
  .dive-phase {
    max-width: 19rem;
    padding: 1.35rem;
    background: rgb(5 11 24 / .86);
  }
  .motion .is-animated .dive-phases {
    place-items: center start;
    padding-right: 4.6rem;
  }
  .motion .is-animated .depth-counter {
    top: 1.8rem;
    right: 1rem;
    transform: none;
  }
  .depth-rail { display: none; }
  .depth-scale { left: 0.55rem; opacity: 0.28; }
  .motion .is-animated .dive-face img { object-position: 58% center; }
  .motion .is-animated .station-lockup {
    right: 1.2rem;
    bottom: 2.2rem;
    left: 1.2rem;
  }
  .profile-portrait { aspect-ratio: 4 / 5; }
  .profile-row {
    grid-template-columns: 4.25rem 1fr;
    gap: 0.85rem;
  }
  .profile-row dd { font-size: 0.9rem; }
  .puka-card { grid-template-columns: 3.8rem 1fr; gap: 0.9rem; }
  .puka-icon { width: 3.8rem; }
  .story-image { aspect-ratio: 4 / 3; }
  .gallery-item figcaption { font-size: 0.78rem; }
  .motion .gallery-carousel.is-carousel .gallery-viewport {
    height: clamp(16rem, 72vw, 21rem);
    perspective: 62rem;
  }
  .motion .gallery-carousel.is-carousel .gallery-item {
    top: 0.65rem;
    width: min(78vw, 22rem);
  }
  .motion .gallery-carousel.is-carousel .gallery-current-caption {
    display: grid;
    gap: 0.2rem;
    min-height: 3.4rem;
  }
  .tank-canvas { height: 62svh; }
  .static-tank { min-height: 62svh; }
  .tank-meta {
    top: 0.85rem;
    align-items: flex-start;
  }
  .tank-badge { display: none; }
  .tank-counter { margin-left: auto; }
  .schedule-row {
    grid-template-columns: 2.4rem 1fr auto;
    gap: 0.65rem;
    padding-block: 1rem;
  }
  .schedule-program { font-size: 0.86rem; }
  .schedule-time { font-size: 0.68rem; }
  .social-grid { grid-template-columns: 1fr; }
  .stream-ambience i:nth-child(n + 5) { display: none; }
  .connect-jelly[data-mobile-hide],
  .fish-school i:nth-child(n + 5) { display: none; }
  .connect-scene {
    animation: none;
    transform: scale(1.04);
  }
  .deep-whale {
    top: 28%;
    width: 52rem;
  }
  .footer-brand,
  .footer-bottom {
    display: block;
  }
  .footer-brand span {
    display: block;
    margin-top: 0.5rem;
  }
  .copyright {
    margin-top: 1.2rem;
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
  .marquee-loop { animation: none !important; }
  .bubble-cursor { display: none !important; }
  .connect-scene {
    animation: none !important;
    transform: scale(1.04) !important;
  }
  .window-light {
    opacity: 0.82 !important;
    animation: none !important;
  }
  .connect-jelly {
    bottom: var(--static-bottom, 22%);
    opacity: var(--creature-alpha, 0.14) !important;
    animation: none !important;
    transform: rotate(-1deg);
  }
  .fish-school {
    opacity: 0.1 !important;
    animation: none !important;
    transform: translate3d(34vw, 0, 0);
  }
  .deep-whale,
  .surprise-jelly { display: none !important; }
  .connect .section-title,
  .puka-sprite,
  .signoff-puka .puka-lamp,
  .signoff-puka .puka-body::before,
  .signoff-puka .puka-body::after {
    animation: none !important;
  }
  .puka-touch-hint { animation: none !important; }
  .signoff-puka.is-speaking .puka-speech {
    opacity: 1;
    animation: none !important;
    transform: translate(-50%, 0);
  }
}
