.hero {
    --film: #140819;
    --reel-height: clamp(360px, 68vh, 490px);
    --fh: calc(var(--reel-height) * 0.38);                                  /* コマの高さ */
    --pf: calc(var(--reel-height) * 0.044);                                 /* パーフォレーション帯 */
    --gap: calc(var(--reel-height) * 0.015);
    --fw: max(calc(var(--fh) * 16 / 9), 16vw);
    --cell: calc(var(--fw) + var(--gap));
    position: relative;
    width: 100%;
    height: var(--reel-height);
    overflow: hidden;
    isolation: isolate;
    /* フィルムの隙間と穴から覗く夕焼け */
    background: linear-gradient(100deg, #ffb86e 0%, #ff7a70 26%, #ef4f93 50%, #8a3fb8 76%, #34155f 100%);
    color: #fff4e6;
    font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Noto Sans JP", "Noto Sans CJK JP", system-ui, sans-serif;
  }

  @supports (height: 1svh) {
    .hero { --reel-height: clamp(360px, 68svh, 490px); }
  }

  /* ── フィルムストリップ ───────────────────────── */
  .reel {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; justify-content: center;
    gap: calc(var(--reel-height) * 0.03);
    transform: rotate(-4deg) scale(1.1);
  }
  .strip { position: relative; flex: none; height: calc(var(--fh) + var(--pf) * 2); }
  .strip::before {               /* 帯の落ち影 */
    content: ""; position: absolute; top: 0; bottom: 0; left: -30vw; right: -30vw;
    box-shadow: 0 calc(var(--reel-height) * 0.016) calc(var(--reel-height) * 0.04) rgba(40, 8, 50, .45);
    pointer-events: none;
  }
  .strip--c { display: none; }

  .track {
    position: absolute; top: 0; left: calc(var(--cell) * -1.5);
    width: calc(var(--cell) * 12); height: 100%;
    display: flex; gap: var(--gap);
    padding: var(--pf) 0;
    background: linear-gradient(var(--film), var(--film)) 0 50% / 100% calc(100% - var(--pf) * 2 + 2px) no-repeat;
    will-change: transform;
  }
  .strip--a .track { animation: run 32s linear infinite; }
  .strip--b .track { animation: run 42s linear infinite reverse; }
  .strip--c .track { animation: run 37s linear -12s infinite; }
  @keyframes run {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(calc(var(--cell) * -3), 0, 0); }
  }

  .frame { position: relative; flex: 0 0 var(--fw); min-width: 0; height: var(--fh); margin: 0; }
  .frame img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
  /* コマごとの穴あき帯（穴は透過して夕焼けが見える） */
  .frame::before, .frame::after {
    content: ""; position: absolute;
    left: calc(var(--gap) * -.5); width: calc(var(--cell) + 1px); height: var(--pf);
    background:
      linear-gradient(var(--film), var(--film)) 0 0 / 100% 27% no-repeat,
      linear-gradient(var(--film), var(--film)) 0 100% / 100% 27% no-repeat,
      linear-gradient(90deg, var(--film) 0 30%, transparent 30% 70%, var(--film) 70% 100%) 0 50% / 10% 52% repeat-x;
  }
  .frame::before { bottom: 100%; }
  .frame::after { top: 100%; }

  /* ── 光漏れ ───────────────────────── */
  .leak {
    position: absolute; top: -10%; bottom: -10%; left: 0; width: 200%;
    pointer-events: none; mix-blend-mode: screen;
    background: linear-gradient(100deg,
      rgba(255, 150, 80, 0) 0%, rgba(255, 150, 80, 0) 30%,
      rgba(255, 150, 80, .34) 42%, rgba(255, 84, 140, .22) 52%,
      rgba(255, 84, 140, 0) 66%, rgba(255, 84, 140, 0) 100%) 0 0 / 50% 100% repeat-x;
    will-change: transform;
    animation: leak 16s linear -5s infinite;
  }
  @keyframes leak {
    from { transform: translate3d(-50%, 0, 0); }
    to   { transform: translate3d(0, 0, 0); }
  }

  .shade {
    position: absolute; inset: 0; pointer-events: none;
    background:
      linear-gradient(0deg, rgba(20, 7, 32, .5), rgba(20, 7, 32, 0) 30%),
      radial-gradient(130% 100% at 40% 50%, rgba(20, 7, 32, 0) 55%, rgba(20, 7, 32, .5));
  }
  .shade::after {
    content: ""; position: absolute; inset: 0; opacity: .15; mix-blend-mode: overlay;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }

  .panel {
    position: absolute;
    inset: auto 0 0;
    z-index: 4;
    padding: clamp(66px, calc(var(--reel-height) * 0.17), 94px) clamp(20px, 5vw, 84px) clamp(22px, calc(var(--reel-height) * 0.06), 38px);
    background: linear-gradient(0deg, #180c20 0%, rgba(24, 12, 32, .91) 30%, rgba(24, 12, 32, .56) 65%, transparent);
    pointer-events: none;
  }
  .title {
    margin: 0;
    color: #fff4e6;
    font: 700 clamp(15px, 5.35vw, 62px)/1.3 "Hiragino Sans", "Yu Gothic", sans-serif;
    letter-spacing: -.025em;
    white-space: nowrap;
    writing-mode: horizontal-tb;
  }

  /* ── スマホ：コマを小さくして3段に ───────────────────────── */
  @media (max-width: 639px) {
    .hero {
      --reel-height: clamp(310px, 96vw, 420px);
      --fh: calc(var(--reel-height) * 0.255);
      --pf: calc(var(--reel-height) * 0.032);
      --gap: calc(var(--reel-height) * 0.012);
    }
    .strip--a .track { animation-duration: 24s; }
    .strip--b .track { animation-duration: 30s; }
    .strip--c .track { animation-duration: 27s; }
    .reel { gap: calc(var(--reel-height) * 0.022); transform: rotate(-4deg) scale(1.06); }
    .strip--c { display: block; }
  }
  @media (prefers-reduced-motion: reduce) {
    .track, .leak { animation-play-state: paused !important; }
  }
