/* 詳細ページ(サービス3ページ / 開発事例3ページ)共通スタイル。
   前提マークアップ:
     body.detail-body > main.detail-page
       section.detail-hero            … パンくず / eyebrow / h1(マスク) / リード / detail-meta / タグ / detail-hero__frame
       section.detail-overview        … [data-detail-section]
       section.detail-block           … [data-detail-section] を持つ本文ブロック(複数)
       section.detail-faq             … [data-detail-section](サービスページのみ)
       section.detail-related         … [data-detail-section]
       section.detail-contact         … [data-detail-section]
   見出しは「マスクせり上がり + ヘアライン」で統一する(/services/ の実装に倣う)。
   ヒーロー画像は .detail-hero__frame > picture > img の入れ子で置く
   (picture = 開帳スケール、img = パララックス。単一 PNG でも picture でラップする)。
   モーションは .detail-motion-ready 配下にのみ記述し、ベースCSSは常に最終状態を表示する。 */

.detail-body {
    --detail-navy: #071a34;
    --detail-navy-soft: #0d294d;
    --detail-cyan: #30b9c4;
    --detail-text: #f7fbff;
    --detail-muted: rgba(247, 251, 255, 0.76);
    --detail-faint: rgba(247, 251, 255, 0.48);
    --detail-line: rgba(247, 251, 255, 0.2);
    color: var(--detail-text);
    background: var(--detail-navy);
    overflow-x: clip;
}

.detail-page {
    position: relative;
    z-index: 0;
    background: var(--detail-navy);
    overflow-x: clip;
}

.detail-page::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 8% 12%, rgba(45, 90, 160, 0.1), transparent 40%),
        radial-gradient(circle at 92% 88%, rgba(48, 185, 196, 0.05), transparent 40%);
}

.detail-page section {
    padding: 0;
}

.detail-page a {
    scroll-margin-top: 96px;
}

.detail-page a:focus-visible {
    outline: 2px solid rgba(247, 251, 255, 0.72);
    outline-offset: 5px;
}

.detail-shell {
    width: min(100%, 1180px);
    margin: 0 auto;
    padding-inline: clamp(24px, 6vw, 80px);
}

.detail-eyebrow {
    margin-bottom: 22px;
    color: var(--detail-faint);
    font-family: 'Inter', sans-serif;
    font-size: 0.76rem;
    font-weight: 500;
    letter-spacing: 0.24em;
}

/* 見出し:マスクせり上がり + ヘアライン */
.detail-section-title {
    display: inline-block;
    max-width: 100%;
}

.detail-section-title__mask {
    display: block;
    overflow: hidden;
}

.detail-section-title h2 {
    color: rgba(247, 251, 255, 0.92);
    font-size: clamp(1.7rem, 2.6vw, 2.5rem);
    font-weight: 700;
    line-height: 1.34;
    letter-spacing: -0.03em;
}

.detail-section-title__line {
    display: block;
    height: 1px;
    margin-top: 18px;
    background: rgba(48, 185, 196, 0.55);
    transform-origin: left;
}

/* Hero */
.detail-hero {
    --hero-progress: 0;
    --frame-shift: 0;
    position: relative;
    padding-block: clamp(132px, 17vh, 200px) clamp(60px, 8vh, 96px);
}

.detail-hero__inner {
    position: relative;
}

.detail-body .detail-hero .breadcrumb-list {
    margin-bottom: clamp(30px, 4vh, 46px);
    color: var(--detail-faint);
    font-size: 0.8rem;
}

.detail-body .detail-hero .breadcrumb-list li:not(:last-child)::after {
    color: rgba(247, 251, 255, 0.32);
}

.detail-body .detail-hero .breadcrumb-list a {
    color: rgba(247, 251, 255, 0.68);
    text-decoration: none;
    transition: color 0.6s var(--ease-expo);
}

.detail-body .detail-hero .breadcrumb-list a:hover {
    color: rgba(247, 251, 255, 0.92);
}

.detail-hero__eyebrow {
    margin-bottom: 20px;
    color: var(--detail-faint);
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.24em;
}

.detail-hero__title {
    display: inline-block;
    max-width: 100%;
}

.detail-hero__title-mask {
    display: block;
    overflow: hidden;
}

/* 見出しの改行位置を文節単位に固定する(語の途中で折り返さない) */
.detail-hero__title-phrase {
    display: inline-block;
}

.detail-hero h1 {
    max-width: 940px;
    color: rgba(247, 251, 255, 0.92);
    font-size: clamp(2.1rem, 4vw, 3.5rem);
    font-weight: 700;
    line-height: 1.24;
    letter-spacing: -0.04em;
    text-wrap: balance;
}

.detail-hero__title-line {
    display: block;
    height: 1px;
    margin-top: 22px;
    background: rgba(48, 185, 196, 0.55);
    transform-origin: left;
}

.detail-hero__lead {
    max-width: 740px;
    margin-top: clamp(26px, 4vh, 40px);
    color: rgba(247, 251, 255, 0.84);
    font-size: clamp(0.96rem, 1.25vw, 1.1rem);
    line-height: 2;
}

/* 記事メタ(公開日・更新日・著者) */
.detail-meta {
    margin-top: clamp(20px, 3vh, 30px);
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    color: rgba(247, 251, 255, 0.44);
    font-size: 0.76rem;
    letter-spacing: 0.02em;
}

.detail-meta a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid rgba(247, 251, 255, 0.24);
    transition: color 0.6s var(--ease-expo);
}

.detail-meta a:hover {
    color: rgba(247, 251, 255, 0.82);
}

/* タグ列(ダーク用ピル) */
.detail-hero__tags {
    margin-top: clamp(26px, 4vh, 38px);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.detail-tag {
    padding: 7px 16px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--detail-line);
    border-radius: 999px;
    color: rgba(247, 251, 255, 0.7);
    font-size: 0.76rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.detail-tag--service {
    border-color: rgba(48, 185, 196, 0.5);
    color: rgba(247, 251, 255, 0.9);
    background: rgba(48, 185, 196, 0.12);
}

.detail-tag--industry {
    border-color: rgba(247, 251, 255, 0.34);
    color: rgba(247, 251, 255, 0.88);
}

/* 窓フレームパララックス。img は height 114% / top -7% のはみ出しを持ち、
   シフト ±6%(--frame-shift = (0.5 - progress) * 12)がその範囲に収まる */
.detail-hero__frame {
    position: relative;
    width: 100%;
    margin: clamp(40px, 6vh, 72px) 0 0;
    /* 画像の縦はみ出し(114%)を効かせるため、フレーム側で高さを確定させる */
    aspect-ratio: var(--frame-ratio, 4 / 3);
    overflow: hidden;
    background-color: var(--detail-navy-soft);
}

/* 500×500 の正方形画像用 */
.detail-hero__frame--square {
    --frame-ratio: 1 / 1;
    width: min(560px, 100%);
}

/* 1448×1086 の横長画像用 */
.detail-hero__frame--wide {
    --frame-ratio: 1448 / 1086;
}

/* 1672×941 の横長画像用 */
.detail-hero__frame--cinematic {
    --frame-ratio: 1672 / 941;
}

.detail-hero__frame picture {
    display: block;
    width: 100%;
    height: 100%;
}

.detail-hero__frame img {
    position: relative;
    top: -7%;
    display: block;
    width: 100%;
    height: 114%;
    object-fit: cover;
    object-position: center center;
    filter: saturate(0.72) brightness(0.86) contrast(0.94);
}

/* Hero — cinematic variant(全面背景画像 + 大型タイポグラフィ。services/index.html の .services-hero を踏襲) */
.detail-hero--cinematic {
    min-height: 100svh;
    display: flex;
    align-items: center;
    isolation: isolate;
    padding-block: 0;
}

.detail-hero--cinematic .detail-hero__inner {
    padding-block: clamp(130px, 16vh, 190px) clamp(90px, 11vh, 132px);
}

.detail-hero--cinematic .detail-hero__media,
.detail-hero--cinematic .detail-hero__media picture,
.detail-hero--cinematic .detail-hero__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.detail-hero--cinematic .detail-hero__media {
    z-index: -3;
    transform: translate3d(0, calc(var(--hero-progress) * 26svh), 0) scale(var(--hero-image-scale, 1));
    transform-origin: center center;
    opacity: var(--hero-visual-opacity, 1);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 72%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 72%, transparent 100%);
}

.detail-hero--cinematic .detail-hero__media picture {
    display: block;
}

.detail-hero--cinematic .detail-hero__media img {
    display: block;
    object-fit: cover;
    object-position: center center;
    filter: saturate(0.76) brightness(0.96) contrast(0.94);
}

.detail-hero--cinematic .detail-hero__shade {
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(90deg, rgba(2, 10, 23, 0.86) 0%, rgba(3, 13, 29, 0.6) 34%, rgba(3, 13, 29, 0.08) 69%, rgba(3, 13, 29, 0.24) 100%),
        linear-gradient(180deg, rgba(2, 8, 18, 0.14), rgba(2, 8, 18, 0.42));
    transform: translate3d(0, calc(var(--hero-progress) * 26svh), 0);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 72%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 72%, transparent 100%);
}

/* 終端色をページ背景の navy に合わせ、完全被覆(opacity 1)まで上げることで
   媒体フェードと打ち消し合わず単調に「沈む」(明るさが途中で戻らない) */
.detail-hero--cinematic .detail-hero__shade::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #020812, var(--detail-navy));
    opacity: clamp(0, calc(var(--hero-progress) * 1.25), 1);
}

/* cinematic ヒーロー直後の本文は、開発事例ページ(.cases-approach)と同じ間合いで始める */
.detail-hero--cinematic + .detail-shell {
    padding-block-start: clamp(150px, 20vw, 250px);
}

.detail-hero--cinematic h1 {
    max-width: 900px;
    font-size: clamp(2.5rem, 4.5vw, 5rem);
    line-height: 1.18;
}

.detail-hero--cinematic .detail-hero__lead {
    max-width: 730px;
    margin-top: clamp(28px, 4vh, 46px);
    font-size: clamp(0.96rem, 1.25vw, 1.12rem);
}

.detail-hero--cinematic .detail-hero__scroll {
    position: absolute;
    left: clamp(18px, 2.4vw, 38px);
    bottom: clamp(30px, 5vh, 56px);
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(247, 251, 255, 0.48);
    font-family: 'Inter', sans-serif;
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    writing-mode: vertical-rl;
    opacity: var(--hero-scroll-opacity, 1);
}

.detail-hero--cinematic .detail-hero__scroll::after {
    content: '';
    width: 1px;
    height: 62px;
    background: linear-gradient(180deg, rgba(247, 251, 255, 0.38), transparent);
    transform-origin: top;
    animation: page-scroll-line 2.8s var(--ease-expo) infinite;
}

/* Overview */
.detail-overview {
    padding-block: clamp(80px, 12vh, 132px);
}

.detail-overview__inner {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    align-items: start;
    gap: clamp(40px, 6vw, 88px);
}

.detail-overview__copy p {
    max-width: 640px;
    margin-top: clamp(26px, 4vh, 38px);
    color: var(--detail-muted);
    font-size: clamp(0.92rem, 1.1vw, 1.02rem);
    line-height: 2.1;
}

.detail-facts {
    margin: 0;
    display: grid;
}

.detail-facts > div {
    display: grid;
    grid-template-columns: minmax(88px, 30%) minmax(0, 1fr);
    gap: 12px 20px;
    padding: 16px 0;
    border-bottom: 1px solid var(--detail-line);
}

.detail-facts > div:first-child {
    border-top: 1px solid var(--detail-line);
}

.detail-facts dt {
    color: var(--detail-faint);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    line-height: 1.9;
}

.detail-facts dd {
    margin: 0;
    color: rgba(247, 251, 255, 0.88);
    font-size: 0.9rem;
    line-height: 1.9;
}

/* 本文ブロック */
.detail-blocks {
    display: grid;
    gap: clamp(72px, 11vh, 128px);
    padding-bottom: clamp(80px, 12vh, 132px);
}

.detail-block__body {
    max-width: 760px;
    margin-top: clamp(26px, 4vh, 38px);
    display: grid;
    gap: clamp(18px, 2.4vh, 26px);
}

.detail-block__body p {
    color: var(--detail-muted);
    font-size: clamp(0.92rem, 1.1vw, 1.02rem);
    line-height: 2.1;
}

/* エッセイブロック(章番号 + 見出し + 段落) */
.detail-eyebrow--number {
    color: rgba(48, 185, 196, 0.7);
    font-size: clamp(1.1rem, 1.6vw, 1.4rem);
    letter-spacing: 0.2em;
}

.detail-block--essay {
    padding-block: clamp(24px, 4vh, 48px);
}

.detail-block--essay .detail-block__body p {
    max-width: 34em;
    line-height: 2.1;
}

.detail-block--essay .detail-block__body p + p {
    margin-top: 1.8em;
}

/* 開発事例ブロック */
.detail-work__frame {
    margin-top: 2.5rem;
    overflow: hidden;
    border: 1px solid rgba(247, 251, 255, 0.12);
    background-color: var(--detail-navy-soft);
}

.detail-work__frame img {
    display: block;
    width: 100%;
    height: auto;
}

.detail-block--work .detail-card__link {
    margin-top: 2rem;
}

/* チェックリスト */
.detail-check-list {
    display: grid;
    gap: 14px;
    list-style: none;
}

.detail-check-list li {
    position: relative;
    padding-left: 30px;
    color: rgba(247, 251, 255, 0.82);
    font-size: clamp(0.9rem, 1.05vw, 0.98rem);
    line-height: 1.9;
}

/* シアンのチェックマーク(borderを45度回転させて描画) */
.detail-check-list li::before {
    content: '';
    position: absolute;
    top: 0.55em;
    left: 3px;
    width: 11px;
    height: 6px;
    border-left: 1.5px solid var(--detail-cyan);
    border-bottom: 1.5px solid var(--detail-cyan);
    transform: rotate(-45deg);
}

/* FAQ(details / summary をダーク用に再スタイル)
   .detail-blocks の中に置くほか、独立セクションとしても使える */
.detail-page > .detail-faq {
    padding-bottom: clamp(80px, 12vh, 132px);
}

.detail-faq__list {
    max-width: 860px;
    margin-top: clamp(26px, 4vh, 38px);
    border-top: 1px solid var(--detail-line);
}

.detail-faq__item {
    border-bottom: 1px solid var(--detail-line);
}

.detail-faq__question {
    position: relative;
    padding: 22px 44px 22px 0;
    display: block;
    color: rgba(247, 251, 255, 0.9);
    font-size: clamp(0.94rem, 1.1vw, 1.02rem);
    font-weight: 600;
    line-height: 1.8;
    cursor: pointer;
    list-style: none;
    transition: color 0.6s var(--ease-expo);
}

.detail-faq__question::-webkit-details-marker {
    display: none;
}

.detail-faq__question:hover {
    color: var(--detail-text);
}

.detail-faq__question:focus-visible {
    outline: 2px solid rgba(247, 251, 255, 0.72);
    outline-offset: 4px;
}

/* 開閉アイコン(+ / −)。横棒は常時、縦棒は開いたときに畳む */
.detail-faq__question::before,
.detail-faq__question::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 6px;
    width: 13px;
    height: 1px;
    background: rgba(48, 185, 196, 0.85);
    transition: transform 0.7s var(--ease-expo);
}

.detail-faq__question::after {
    transform: rotate(90deg);
}

.detail-faq__item[open] .detail-faq__question::after {
    transform: rotate(0deg);
}

.detail-faq__answer {
    padding: 0 44px 26px 0;
}

.detail-faq__answer p {
    color: var(--detail-muted);
    font-size: clamp(0.9rem, 1.05vw, 0.98rem);
    line-height: 2.05;
}

/* 関連する開発事例 */
.detail-related {
    padding-block: clamp(80px, 12vh, 132px);
    border-top: 1px solid rgba(247, 251, 255, 0.12);
}

.detail-related__grid {
    margin-top: clamp(34px, 5vh, 52px);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: clamp(28px, 3.5vw, 48px);
}

.detail-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.detail-card__frame {
    position: relative;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background-color: var(--detail-navy-soft);
}

.detail-card__frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.72) brightness(0.86) contrast(0.94);
    transition: transform 1.2s var(--ease-expo), filter 1.2s var(--ease-expo);
}

.detail-card:hover .detail-card__frame img {
    transform: scale(1.04);
    filter: saturate(0.82) brightness(0.94) contrast(0.96);
}

.detail-card__topline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
}

.detail-card__industry,
.detail-card__service {
    padding: 5px 12px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--detail-line);
    border-radius: 999px;
    color: rgba(247, 251, 255, 0.68);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.detail-card__service {
    border-color: rgba(48, 185, 196, 0.45);
    color: rgba(247, 251, 255, 0.86);
}

.detail-card h3 {
    color: rgba(247, 251, 255, 0.92);
    font-size: clamp(1.02rem, 1.35vw, 1.2rem);
    font-weight: 600;
    line-height: 1.7;
    letter-spacing: -0.01em;
}

.detail-card__link {
    margin-top: auto;
    padding: 0 2px 9px;
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 12px;
    color: rgba(247, 251, 255, 0.92);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    background-image: linear-gradient(var(--detail-cyan), var(--detail-cyan));
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 38px 2px;
    transition: background-size 0.8s var(--ease-expo);
}

.detail-card__link .material-symbols-rounded {
    color: rgba(247, 251, 255, 0.68);
    font-size: 1.15rem;
    transition: transform 0.8s var(--ease-expo);
}

.detail-card__link:hover {
    background-size: 100% 2px;
}

.detail-card__link:hover .material-symbols-rounded {
    transform: translateX(4px);
}

.detail-note {
    margin-top: clamp(28px, 4vh, 40px);
    color: rgba(247, 251, 255, 0.5);
    font-size: 0.8rem;
    line-height: 2;
}

/* Contact(サービス一覧ページの CONTACT と同じ構成) */
.detail-page .detail-contact {
    position: relative;
    padding-block: clamp(120px, 16vw, 200px);
    overflow: hidden;
}

.detail-contact__inner {
    position: relative;
    z-index: 1;
}

.detail-contact h2 {
    max-width: 900px;
    color: rgba(247, 251, 255, 0.92);
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.03em;
}

.detail-contact__lead {
    max-width: 680px;
    margin-top: clamp(22px, 3vh, 32px);
    color: var(--detail-muted);
    font-size: clamp(0.92rem, 1.1vw, 1.02rem);
    line-height: 2.05;
}

.detail-contact__lead + .detail-contact__lead {
    margin-top: 1.4em;
}

.detail-contact__actions {
    margin-top: clamp(40px, 6vw, 60px);
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.detail-contact__button {
    position: relative;
    min-width: 228px;
    min-height: 58px;
    padding: 16px 22px;
    display: inline-flex;
    justify-content: space-between;
    align-items: center;
    gap: 28px;
    border: 1px solid rgba(247, 251, 255, 0.32);
    color: rgba(247, 251, 255, 0.92);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.7s var(--ease-expo), background-color 0.7s var(--ease-expo), border-color 0.7s var(--ease-expo);
}

.detail-contact__button--primary {
    border-color: rgba(247, 251, 255, 0.9);
    color: var(--detail-navy);
    background: rgba(247, 251, 255, 0.94);
}

.detail-contact__button:hover {
    border-color: var(--detail-cyan);
    color: var(--detail-navy);
    background: var(--detail-cyan);
}

.detail-contact__button .material-symbols-rounded {
    font-size: 1.15rem;
    transition: transform 0.7s var(--ease-expo);
}

.detail-contact__button:hover .material-symbols-rounded {
    transform: translateX(5px);
}

/* Match the renewed top-page footer without loading its page-wide stylesheet. */
.detail-body footer {
    padding: 120px 0 40px;
    color: #ffffff;
    background: #0a1526;
    font-size: 15px;
    line-height: 1.75;
}

.detail-body footer .footer-container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: row;
    gap: 80px;
}

.detail-body footer .footer-links,
.detail-body footer .footer-links:first-child {
    flex: 0 0 auto;
    margin-right: 0;
}

.detail-body footer .footer-links h3 {
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
    font-weight: 700;
}

.detail-body footer .footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-body footer .footer-links li {
    margin-bottom: 0;
}

.detail-body footer .footer-links a {
    padding-bottom: 2px;
    color: #ffffff;
    font-size: 0.875rem;
    background-image: linear-gradient(#ffffff, #ffffff);
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0 1px;
    transition: background-size 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.detail-body footer .footer-links a:hover {
    color: #ffffff;
    background-size: 100% 1px;
}

.detail-body footer .copyright {
    max-width: 1120px;
    margin: 80px auto 0;
    padding: 24px 24px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    text-align: left;
}

/* Motion is opt-in so the static page remains complete without JavaScript. */
/* ヒーローは読み込み時に時間ベースで組み上がる。スクロール連動は
   フレームのパララックス(--frame-shift)のみが担当する。 */
.detail-motion-ready .detail-hero .breadcrumb-list,
.detail-motion-ready .detail-hero__eyebrow,
.detail-motion-ready .detail-hero__lead,
.detail-motion-ready .detail-hero .detail-meta,
.detail-motion-ready .detail-hero__tags {
    animation: detail-copy-in 1.45s var(--ease-expo) both;
}

.detail-motion-ready .detail-hero .breadcrumb-list {
    animation-delay: 0.12s;
    --detail-enter-y: 12px;
}

.detail-motion-ready .detail-hero__eyebrow {
    animation-delay: 0.26s;
    --detail-enter-y: 14px;
}

.detail-motion-ready .detail-hero h1 {
    animation: detail-title-up 1.6s var(--ease-slow) 0.4s both;
}

.detail-motion-ready .detail-hero__title-line {
    animation: detail-line-in 1.8s var(--ease-slow) 0.9s both;
}

.detail-motion-ready .detail-hero__lead {
    animation-delay: 0.86s;
    --detail-enter-y: 18px;
}

.detail-motion-ready .detail-hero .detail-meta {
    animation-delay: 1s;
    --detail-enter-y: 14px;
}

.detail-motion-ready .detail-hero__tags {
    animation-delay: 1.12s;
    --detail-enter-y: 14px;
}

/* 窓の開帳(clip-path)と微スケール 1.06 → 1 */
.detail-motion-ready .detail-hero__frame {
    animation: detail-frame-open 1.7s var(--ease-slow) 0.7s both;
}

/* スケールは picture、パララックスは img が担当するため、
   ヒーロー画像は必ず <picture> でラップする(単一 PNG でも同様) */
.detail-motion-ready .detail-hero__frame picture {
    animation: detail-frame-scale 2.1s var(--ease-slow) 0.7s both;
}

/* パララックス: --frame-shift = (0.5 - hero-progress) * 12 → ±6%(はみ出し7%の内側) */
.detail-motion-ready .detail-hero__frame img {
    transform: translate3d(0, calc(var(--frame-shift, 0) * 1%), 0);
}

@keyframes detail-copy-in {
    from {
        opacity: 0;
        transform: translateY(var(--detail-enter-y, 16px));
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes detail-title-up {
    from { transform: translateY(102%); }
    to { transform: translateY(0); }
}

@keyframes detail-line-in {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes detail-frame-open {
    from { clip-path: inset(0 0 100% 0); }
    to { clip-path: inset(0 0 0 0); }
}

@keyframes detail-frame-scale {
    from { transform: scale(1.06); }
    to { transform: scale(1); }
}

/* Motion — cinematic hero(services-hero-image-in / -copy-in / -fade-in を踏襲) */
.detail-motion-ready .detail-hero--cinematic .detail-hero__media picture {
    animation: detail-hero-media-in 1.2s var(--ease-expo) both;
}

.detail-motion-ready .detail-hero--cinematic h1 {
    animation: detail-copy-in 1.45s var(--ease-expo) 0.4s both;
    --detail-enter-y: 24px;
}

.detail-motion-ready .detail-hero--cinematic .detail-hero__scroll {
    animation: detail-hero-fade-in 1.1s var(--ease-expo) 1.05s both;
}

@keyframes detail-hero-media-in {
    from {
        opacity: 0.65;
        transform: scale(1.04);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes detail-hero-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* デスクトップ: セクションごとの --section-progress をスクラブして段階表示する */
@media (min-width: 901px) {
    .detail-motion-ready [data-detail-section] {
        --section-progress: 0;
    }

    .detail-motion-ready [data-detail-section] .detail-section-title h2 {
        --title-progress: clamp(0, calc((var(--section-progress) - 0.1) * 2), 1);
        transform: translate3d(0, calc((1 - var(--title-progress)) * 102%), 0);
    }

    .detail-motion-ready [data-detail-section] .detail-section-title__line {
        --line-progress: clamp(0, calc((var(--section-progress) - 0.3) * 2.5), 1);
        transform: scaleX(var(--line-progress));
    }

    .detail-motion-ready [data-detail-section] .detail-eyebrow,
    .detail-motion-ready [data-detail-section] .detail-overview__copy p,
    .detail-motion-ready [data-detail-section] .detail-facts,
    .detail-motion-ready [data-detail-section] .detail-block__body,
    .detail-motion-ready [data-detail-section] .detail-faq__list,
    .detail-motion-ready [data-detail-section] .detail-related__grid,
    .detail-motion-ready [data-detail-section] .detail-note,
    .detail-motion-ready .detail-contact__inner > * {
        --reveal-progress: clamp(0, calc((var(--section-progress) - var(--reveal-delay, 0)) * 2.35), 1);
        opacity: var(--reveal-progress);
        transform: translate3d(0, calc((1 - var(--reveal-progress)) * var(--reveal-offset, 24px)), 0);
    }

    .detail-motion-ready [data-detail-section] .detail-eyebrow {
        --reveal-delay: 0;
        --reveal-offset: 12px;
    }

    .detail-motion-ready [data-detail-section] .detail-overview__copy p,
    .detail-motion-ready [data-detail-section] .detail-block__body,
    .detail-motion-ready [data-detail-section] .detail-faq__list,
    .detail-motion-ready [data-detail-section] .detail-related__grid {
        --reveal-delay: 0.42;
        --reveal-offset: 20px;
    }

    .detail-motion-ready [data-detail-section] .detail-facts {
        --reveal-delay: 0.5;
        --reveal-offset: 20px;
    }

    .detail-motion-ready [data-detail-section] .detail-note {
        --reveal-delay: 0.56;
        --reveal-offset: 16px;
    }

    .detail-motion-ready .detail-contact__inner > :nth-child(2) { --reveal-delay: 0.08; }
    .detail-motion-ready .detail-contact__inner > :nth-child(3) { --reveal-delay: 0.16; }
    .detail-motion-ready .detail-contact__inner > :nth-child(4) { --reveal-delay: 0.24; }
    .detail-motion-ready .detail-contact__inner > :nth-child(5) { --reveal-delay: 0.32; }
}

@media (max-width: 900px) {
    .detail-shell {
        padding-inline: clamp(20px, 6vw, 48px);
    }

    .detail-hero {
        padding-block: clamp(112px, 15vh, 150px) clamp(48px, 6vh, 72px);
    }

    .detail-hero__frame--square {
        width: 100%;
    }

    .detail-hero--cinematic {
        min-height: 86svh;
    }

    .detail-hero--cinematic .detail-hero__inner {
        padding-block: 126px 88px;
    }

    .detail-hero--cinematic .detail-hero__shade {
        background:
            linear-gradient(90deg, rgba(2, 10, 23, 0.8), rgba(3, 13, 29, 0.32) 78%, rgba(3, 13, 29, 0.32)),
            linear-gradient(180deg, rgba(2, 8, 18, 0.12), rgba(2, 8, 18, 0.5));
    }

    .detail-hero--cinematic .detail-hero__scroll {
        display: none;
    }

    .detail-hero--cinematic + .detail-shell {
        padding-block-start: clamp(120px, 22vw, 190px);
    }

    .detail-overview,
    .detail-related {
        padding-block: clamp(64px, 9vh, 96px);
    }

    .detail-overview__inner {
        grid-template-columns: minmax(0, 1fr);
        gap: clamp(32px, 6vh, 48px);
    }

    .detail-blocks {
        gap: clamp(56px, 9vh, 88px);
        padding-bottom: clamp(64px, 9vh, 96px);
    }

    .detail-related__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: clamp(32px, 6vh, 44px);
    }

    /* モバイルは IntersectionObserver 由来の .is-visible で時間ベース再生する */
    .detail-motion-ready [data-detail-section] .detail-section-title h2 {
        transform: translateY(102%);
        transition: transform 1.6s var(--ease-slow);
    }

    .detail-motion-ready [data-detail-section] .detail-section-title__line {
        transform: scaleX(0);
        transition: transform 1.8s var(--ease-slow) 0.5s;
    }

    .detail-motion-ready [data-detail-section] .detail-eyebrow {
        opacity: 0;
        transform: translateY(12px);
        transition: opacity 1.2s var(--ease-slow),
                    transform 1.2s var(--ease-slow);
    }

    .detail-motion-ready [data-detail-section] .detail-overview__copy p,
    .detail-motion-ready [data-detail-section] .detail-facts,
    .detail-motion-ready [data-detail-section] .detail-block__body,
    .detail-motion-ready [data-detail-section] .detail-faq__list,
    .detail-motion-ready [data-detail-section] .detail-related__grid,
    .detail-motion-ready [data-detail-section] .detail-note,
    .detail-motion-ready [data-detail-section] .detail-contact__inner > * {
        opacity: 0;
        transform: translateY(18px);
        transition: opacity 1.4s var(--ease-slow) 0.9s,
                    transform 1.4s var(--ease-slow) 0.9s;
    }

    .detail-motion-ready [data-detail-section].is-visible .detail-section-title h2 {
        transform: translateY(0);
    }

    .detail-motion-ready [data-detail-section].is-visible .detail-section-title__line {
        transform: scaleX(1);
    }

    .detail-motion-ready [data-detail-section].is-visible .detail-eyebrow,
    .detail-motion-ready [data-detail-section].is-visible .detail-overview__copy p,
    .detail-motion-ready [data-detail-section].is-visible .detail-facts,
    .detail-motion-ready [data-detail-section].is-visible .detail-block__body,
    .detail-motion-ready [data-detail-section].is-visible .detail-faq__list,
    .detail-motion-ready [data-detail-section].is-visible .detail-related__grid,
    .detail-motion-ready [data-detail-section].is-visible .detail-note,
    .detail-motion-ready [data-detail-section].is-visible .detail-contact__inner > * {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .detail-body footer {
        padding: 80px 0 32px;
    }

    .detail-body footer .footer-container {
        flex-direction: column;
        gap: 48px;
    }

    .detail-body .menu-overlay {
        z-index: 999;
    }

    .detail-contact__actions {
        flex-direction: column;
    }

    .detail-contact__button {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .detail-hero h1 {
        font-size: clamp(1.9rem, 8vw, 2.6rem);
        line-height: 1.28;
    }

    .detail-hero__lead {
        font-size: 0.92rem;
        line-height: 1.95;
    }

    .detail-hero--cinematic {
        min-height: 92svh;
    }

    .detail-hero--cinematic .detail-hero__media img {
        object-position: 58% center;
    }

    .detail-hero--cinematic .detail-hero__inner {
        padding-top: 112px;
        padding-bottom: 64px;
    }

    .detail-hero--cinematic .detail-hero__eyebrow {
        margin-bottom: 16px;
    }

    .detail-hero--cinematic h1 {
        font-size: clamp(2.35rem, 11vw, 3.4rem);
        line-height: 1.22;
    }

    .detail-hero--cinematic .detail-hero__lead {
        margin-top: 24px;
        font-size: 0.9rem;
        line-height: 1.86;
    }

    .detail-facts > div {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }

    .detail-faq__question {
        padding-right: 36px;
        font-size: 0.94rem;
    }

    .detail-faq__answer {
        padding-right: 0;
    }
}
