:root {
  --font-bold: "A1ゴシック B",A1 Gothic B,sans-serif;
  --dur: 5000ms;              /* 1タイルのアニメ時間 */
  --ease: cubic-bezier(.2,.7,0,1);
  --digital-blue: #007AFF;
  --analog-orange: #FF9500;
}

footer {
  border-top: 2px solid #E3E3E3;
  font-family: "ヒラギノUD丸ゴ Std W6",HiraginoUDSansRStd-W6,"ヒラギノUD丸ゴ W6 JIS2004",Hiragino UD Sans Rd W6 JIS2004,"ヒラギノ角ゴ Pro W6",Hiragino Kaku Gothic Pro W6,"メイリオ",Meiryo,"ＭＳ Ｐゴシック",sans-serif;
  h1 {
    letter-spacing: .15ex!important;
  }
  p {
    font-size: 19px;
    letter-spacing: .1ex;
    line-height: normal;
  }
  a {
    font-feature-settings: 'halt'!important;
  }
}


/* ===== Mosaic component ===== */
.mosaic {
  position: relative;
  overflow: hidden;
  width: 1382px;
  height: 100%;
}

.mosaic__grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  grid-template-rows: repeat(var(--rows), 1fr);
}

.mosaic__tile {
  background-repeat: no-repeat;

  /* アンチエイリアシングを改善 */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;

  /* より滑らかなレンダリング */
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;

  /* サブピクセルレンダリングを無効化 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* 初期状態（ふわっと出る） */
  opacity: 0;
  transform-origin: center;
  transform:
    translate3d(var(--tx,0), var(--ty,0), 0)
    rotate(var(--rot, 0))
    scale(var(--scale));
  filter: blur(var(--blur));

  /* アニメーションは is-animating クラスが追加された時のみ開始 */
  will-change: transform, opacity, filter;
}

.mosaic.is-animating .mosaic__tile {
  /* in-view でアニメ開始（--delay は inline-style で付与） */
  animation: tileIn var(--dur) var(--ease) var(--delay,0ms) both;
}

@keyframes tileIn {
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

/* ===== 点滅アニメーション（追加部分） ===== */
.mosaic__tile.is-blinking {
  animation: tileBlink 2750ms ease-in-out !important;
  animation-fill-mode: both !important;
}

@keyframes tileBlink {
  0% {
    opacity: 1 ;
  }
  50% {
    opacity: 0 ;
  }
  100% {
    opacity: 1 !important;
  }
}

/* レスポンシブ対応：SP用レイアウト（900px以下） */
@media (width <= 900px) {
  .mosaic-container {
    height: 486px; /* 18px + 36px × 13 = 486px */
  }

  .mosaic {
    width: 800.5px; /* 22px + 36px × 21 + 22px = 800px */
  }
}

/* 高解像度ディスプレイ対応 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .mosaic__tile {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* アニメーション無効化の設定 */
@media (prefers-reduced-motion: reduce) {
  .mosaic__tile {
    animation: none;
    opacity: 1;
    transform: none;
    filter: none;
  }
}

.mv {
  position: relative;
  width: 100%;
  height: 550px;
  display: flex;
  justify-content: center;
  overflow: hidden;
  @media (width <= 900px) {
    height: 486px;
  }
  h1 {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    max-width: 1002px;
    padding: 0 31px;
    opacity: 0;
    transition: opacity 0.6s ease-in;
    &.is-visible {
      opacity: 1;
    }
    @media (width <= 900px) {
      top: 17px;
      left: 0;
      width: 78.5%;
      max-width: 300px;
      min-width: 262px;
      padding: 0 17px;
      transform: translateY(0);
    }
  }
  h1 img {
    @media (width <= 900px) {
      width: 100%;
      height: auto;
    }
  }
}

.intro {
  position: relative;
  padding: 47px 24px 35px;
  background: #F0FAF7;
  overflow: hidden;
  @media (width <= 800px) {
    padding: 35px 18px;
  }
}

/* 四隅の装飾用画像 */
.intro::before,
.intro::after,
.direction-wrap::before,
.direction-wrap::after {
  content: '';
  position: absolute;
  width: 180px;
  height: 150px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 1;
  background-image: url('../../img/digital-analog2025/index/green-pixel.png');
}
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .intro::before,
  .intro::after,
  .direction-wrap::before,
  .direction-wrap::after {
    background-image: url('../../img/digital-analog2025/index/green-pixel@2x.png');
  }
}

.intro::before {
  top: 0;
  left: 0;
}
/* 右上 */
.intro::after {
  top: 0;
  right: 0;
  transform: scale(-1, 1);
}
/* 左下 */
.direction-wrap::before {
  bottom: -35px;
  left: -24px;
  transform: scale(1, -1);
  @media (width <= 800px) {
    right: -18px;
  }
}
/* 右下 */
.direction-wrap::after {
  bottom: -35px;
  right: -24px;
  transform: scale(-1, -1);
  @media (width <= 800px) {
    right: -18px;
  }
}

.intro-wrap {
  margin-bottom: 51px;
  @media (width <= 800px) {
    margin-bottom: 34px;
    padding: 0 6px;
  }
  h4 {
    margin-bottom: 34px;
    color: #ACBFB9;
    text-align: center;
    font-size: 15px;
    @media (width <= 800px) {
      margin-bottom: 25px;
    }
  }
  p {
    max-width: 559px;
    margin: 0 auto;
  }
  p + p {
    margin-top: 2.11em;
    @media (width <= 800px) {
      margin-top: 1.85em;
    }
  }
  .highlight {
    padding: 2px 1px 2px 0;
    &.blue {
      background: #83DAFF;
    }
    &.orange {
      background: #FFD653;
    }
  }
}

.direction-wrap {
  position: relative;
  background: #F0FAF7;
  padding-bottom: 30px;
  h3 {
    margin-bottom: 30px;
    font-size: 20px;
    text-align: center;
    @media (width <= 800px) {
      font-size: 18px;
      margin-bottom: 23px;
    }
  }
  a {
    position: relative;
    z-index: 2;
    max-width: 952px;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.10));
  }
  .direction-img {
    display: flex;
    img {
      width: 100%;
      border-radius: 10px 10px 0 0;
    }
  }
  .direction-text {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    row-gap: 12px;
    column-gap: 27px;
    padding: 34px 40px;
    background: #0D6B96;
    border-radius: 0 0 10px 10px;
    @media (width <= 800px) {
      row-gap: 13px;
      padding: 12px 20px 20px;
      border-radius: 0 0 12px 12px;
    }
    p {
      color: #fff;
      font-size: clamp(19px, 1.8vw, 22px);
      line-height: 1.5;
    }
    img {
      @media (width <= 800px) {
        position: absolute;
        top: 50%;
        right: 13px;
        transform: translateY(-50%);
      }
    }
  }
  .read-more  {
    min-width: 166px;
    height: 42px;
    padding: 7px 15px 7px 28px;
    border: solid 2px #fff;
    border-radius: 21px;
    color: #fff;
    @media (width <= 800px) {
      width: 100%;
      max-width: 299px;
      height: 40px;
      justify-content: center;
      background: #0D6B96;
      color: #fff;
    }
    &::before {
      background: #fff;
    }
    span {
      margin-right: 16px;
      font-size: 18px;
      letter-spacing: 0;
      @media (width <= 800px) {
        font-size: 16px;
      }
    }
    svg {
      @media (width <= 800px) {
        position: absolute;
        right: 14px;
      }
    }
  }
  .direction-link:hover {
    opacity: 1!important;
    .read-more {
      color: #0D6B96;
      &::before {
        transform: scaleX(1);
        transform-origin: left;
      }
    }
  }
}

.fixed-bg{
  &.part1-bg {
    background-image: url('../../img/digital-analog2025/common/part1-bg.jpg');
    @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
      background-image: url('../../img/digital-analog2025/common/part1-bg@2x.jpg');
    }
    @media (width <= 800px) {
      background-image: url('../../img/digital-analog2025/common/part1-bg-sp.jpg');
      @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
        background-image: url('../../img/digital-analog2025/common/part1-bg-sp@2x.jpg');
      }
    }
  }
  &.part2-bg {
    background-image: url('../../img/digital-analog2025/common/part2-bg.jpg');
    @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
      background-image: url('../../img/digital-analog2025/common/part2-bg@2x.jpg');
    }
    @media (width <= 800px) {
      background-image: url('../../img/digital-analog2025/common/part2-bg-sp.jpg');
      @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
        background-image: url('../../img/digital-analog2025/common/part2-bg-sp@2x.jpg');
      }
    }
  }
  &.part3-bg {
    background-image: url('../../img/digital-analog2025/common/part3-bg.jpg');
    @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
      background-image: url('../../img/digital-analog2025/common/part3-bg@2x.jpg');
    }
    @media (width <= 800px) {
      background-image: url('../../img/digital-analog2025/common/part3-bg-sp.jpg');
      @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
        background-image: url('../../img/digital-analog2025/common/part3-bg-sp@2x.jpg');
      }
    }
  }
}

.part1 {
  .left {
    max-width: 422px;
  }
}

/* スクロールスナップ用の追加スタイル */

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

/* セクション共通スタイル */
section {
  position: relative;
}

/* ブロック1: .mv + .intro をラップ（スクロール可能） */
.block1 {
  overflow-y: auto;
}

/* ブロック5: コラム＋レポート一覧（スクロール可能） */
.post-section {
  overflow-y: auto;
  background: #fff;
}

/* ブロック2-4はビューポート高さに固定 */
.part1,
.part2,
.part3 {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* fixed-bgとfixed-linkの調整 */
.fixed-bg {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  background-size: cover;
  background-position: center;
  z-index: 0;
  overflow: hidden; /* 左右の見切れ部分を隠す */
  display: flex;
  justify-content: center;
  align-items: center;
}

.mosaic-canvas-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.fixed-bg .mosaic {
  position: absolute;
  /* 高さ100%、幅はauto（JSで計算） */
  height: 100%;
  width: auto;
  transform-origin: center center;
}

.fixed-bg .mosaic {
  position: absolute;
  /* 高さ100%、幅はauto（JSで計算） */
  height: 100%;
  width: auto;
  transform-origin: center center;
}

.fixed-link {
  position: absolute;
  top: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 1s ease-out, transform 1s ease-out;
}

.fixed-link.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* スクロール中のアニメーション改善 */
.scrolling {
  pointer-events: none;
}

/* モバイル対応 */
@media (width <= 800px) {
  .part1,
  .part2,
  .part3 {
    min-height: unset; /* モバイルブラウザのアドレスバーを考慮 */
  }

  .fixed-bg,
  .fixed-link {
    height: calc(100% - 103px);
    min-height: 620px;
  }
}

