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

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

.services-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%);
}

.services-page section {
    padding: 0;
}

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

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

/* Hero */
.services-hero {
    --hero-progress: 0;
    --hero-image-scale: 1;
    --hero-visual-opacity: 1;
    --hero-scroll-opacity: 1;
    position: relative;
    min-height: 100svh;
    display: flex;
    align-items: center;
    isolation: isolate;
    overflow: visible;
    background: transparent;
}

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

.services-hero__media {
    z-index: -3;
    transform: translate3d(0, calc(var(--hero-progress) * 26svh), 0) scale(var(--hero-image-scale));
    transform-origin: center center;
    opacity: var(--hero-visual-opacity);
    -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%);
}

.services-hero__media picture {
    display: block;
}

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

.services-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%);
}

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

.services-hero__content {
    width: min(100%, 1440px);
    margin: 0 auto;
    padding: clamp(130px, 16vh, 190px) clamp(32px, 6vw, 104px) clamp(90px, 11vh, 132px);
}

.services-hero__eyebrow,
.services-hero__scroll,
.service-chapter__number {
    font-family: 'Inter', sans-serif;
}

.services-hero__eyebrow {
    margin-bottom: 22px;
    color: rgba(247, 251, 255, 0.48);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.24em;
}

.services-hero h1 {
    max-width: 900px;
    color: rgba(247, 251, 255, 0.92);
    font-size: clamp(2.5rem, 4.5vw, 5rem);
    line-height: 1.18;
    letter-spacing: -0.04em;
    text-wrap: balance;
}

.services-hero__lead {
    max-width: 730px;
    margin-top: clamp(28px, 4vh, 46px);
    color: rgba(247, 251, 255, 0.84);
    font-size: clamp(0.96rem, 1.25vw, 1.12rem);
    line-height: 2;
}

.services-hero__lead span {
    display: block;
}

.services-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-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    writing-mode: vertical-rl;
    opacity: var(--hero-scroll-opacity);
}

.services-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;
}

/* Service chapters */
.services-chapters {
    position: relative;
    padding: clamp(140px, 18svh, 220px) 0 clamp(220px, 28svh, 340px);
    display: grid;
    gap: clamp(260px, 35svh, 460px);
}

.service-chapter {
    --chapter-progress: 1;
    --media-shift: 0;
    --copy-progress: 1;
    --exit-progress: 0;
    position: relative;
    scroll-margin-top: 96px;
}

.service-chapter__sticky {
    position: relative;
    min-height: 88svh;
    display: flex;
    align-items: center;
    overflow: visible;
}

.service-chapter__layout {
    width: min(100%, 1440px);
    min-width: 0;
    margin: 0 auto;
    padding: clamp(86px, 10vh, 116px) clamp(42px, 6vw, 104px) clamp(44px, 6vh, 72px);
    display: grid;
    grid-template-columns: minmax(320px, 45fr) minmax(0, 55fr);
    align-items: center;
    gap: clamp(40px, 6vw, 100px);
}

.service-chapter__visual {
    width: min(100%, 680px);
    height: min(72vh, 820px);
    min-height: 440px;
    transform: scale(calc(1 - var(--exit-progress) * 0.015));
    opacity: calc(1 - var(--exit-progress) * 0.28);
}

.service-chapter__frame {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--services-navy-soft);
}

.service-chapter__frame picture {
    display: block;
    width: 100%;
    height: 100%;
}

/* フレームは「大きな画像の上を移動する窓」。画像は 130% + top -15% のはみ出しを持ち、
   スクロール進捗による縦シフト --media-shift ±11(画像高さ基準 → フレーム換算 ±14.3%)が
   この範囲内に収まる */
.service-chapter__frame img {
    position: relative;
    top: -15%;
    display: block;
    width: 100%;
    height: 130%;
    object-fit: cover;
    filter: saturate(0.6) brightness(0.76) contrast(0.92);
}

.service-chapter__copy {
    width: 100%;
    max-width: 620px;
    min-width: 0;
}

.service-chapter__meta {
    display: flex;
    align-items: baseline;
    gap: 18px;
    margin-bottom: 30px;
}

.service-chapter__number {
    color: rgba(247, 251, 255, 0.5);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.16em;
}

.service-chapter__copy h2 {
    color: rgba(247, 251, 255, 0.92);
    font-size: clamp(2.2rem, 3.5vw, 3.5rem);
    line-height: 1.12;
    letter-spacing: -0.04em;
}

.service-chapter__catch {
    margin-top: 20px;
    color: rgba(247, 251, 255, 0.84);
    font-size: clamp(1.15rem, 1.6vw, 1.5rem);
    font-weight: 500;
    line-height: 1.6;
}

.service-chapter__description {
    max-width: 580px;
    margin-top: clamp(34px, 5vh, 52px);
    color: var(--services-muted);
    font-size: clamp(0.92rem, 1.1vw, 1.04rem);
    line-height: 2;
}

.service-chapter__links {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: clamp(34px, 5vh, 50px);
}

.service-chapter__links .service-chapter__link {
    margin-top: 0;
}

.service-chapter__link {
    position: relative;
    width: fit-content;
    max-width: 100%;
    margin-top: clamp(34px, 5vh, 50px);
    padding: 0 2px 9px;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    color: rgba(247, 251, 255, 0.92);
    font-weight: 600;
    text-decoration: none;
    background-image: linear-gradient(var(--services-cyan), var(--services-cyan));
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 42px 2px;
    transition: background-size 0.8s var(--ease-expo);
}

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

.service-chapter__link:hover {
    background-size: 100% 2px;
}

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

.service-chapter--reverse .service-chapter__visual {
    grid-column: 2;
    grid-row: 1;
}

.service-chapter--reverse .service-chapter__copy {
    grid-column: 1;
    grid-row: 1;
}

/* Contact(開発事例ページの CONTACT セクションと同じ構成) */
.services-shell {
    width: min(100%, 1440px);
    margin: 0 auto;
    padding-inline: clamp(32px, 6vw, 104px);
}

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

.services-page .services-contact {
    position: relative;
    padding-block: clamp(130px, 17vw, 220px);
    overflow: hidden;
}

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

.services-contact__actions {
    margin-top: clamp(44px, 6vw, 66px);
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.services-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);
}

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

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

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

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

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

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

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

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

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

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

.services-landing-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);
}

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

.services-landing-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. */
.services-motion-ready .services-hero__media picture {
    animation: services-hero-image-in 1.2s var(--ease-expo) both;
}

.services-motion-ready .services-hero__eyebrow,
.services-motion-ready .services-hero h1,
.services-motion-ready .services-hero__lead,
.services-motion-ready .services-hero__scroll {
    animation: services-hero-copy-in 1.45s var(--ease-expo) both;
}

.services-motion-ready .services-hero__eyebrow {
    animation-delay: 0.2s;
    --hero-enter-y: 16px;
}

.services-motion-ready .services-hero h1 {
    animation-delay: 0.42s;
    --hero-enter-y: 24px;
}

.services-motion-ready .services-hero__lead {
    animation-delay: 0.7s;
    --hero-enter-y: 18px;
}

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

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

@keyframes services-hero-copy-in {
    from {
        opacity: 0;
        transform: translateY(var(--hero-enter-y));
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@media (min-width: 901px) {
    .services-motion-ready .service-chapter {
        --chapter-progress: 0;
        --media-shift: 11;
        --copy-progress: 0;
    }

    .services-motion-ready .service-chapter__frame img {
        transform: translate3d(0, calc(var(--media-shift) * 1%), 0);
    }

    .services-motion-ready .service-chapter__meta,
    .services-motion-ready .service-chapter__catch,
    .services-motion-ready .service-chapter__description,
    .services-motion-ready .service-chapter__link {
        --item-progress: clamp(0, calc((var(--copy-progress) - var(--copy-delay)) * 2.5), 1);
        opacity: var(--item-progress);
        transform: translate3d(0, calc((1 - var(--item-progress)) * var(--copy-offset)), 0);
    }

    .services-motion-ready .service-chapter__meta {
        --copy-delay: 0;
        --copy-offset: 12px;
    }

    .services-motion-ready .service-chapter__copy h2 {
        --title-progress: clamp(0, calc((var(--copy-progress) - 0.1) * 2), 1);
        transform: translate3d(0, calc((1 - var(--title-progress)) * 102%), 0);
    }

    .services-motion-ready .service-chapter__title-line {
        --line-progress: clamp(0, calc((var(--copy-progress) - 0.3) * 2.5), 1);
        transform: scaleX(var(--line-progress));
    }

    .services-motion-ready .service-chapter__catch {
        --copy-delay: 0.2;
        --copy-offset: 20px;
    }

    .services-motion-ready .service-chapter__description {
        --copy-delay: 0.3;
        --copy-offset: 18px;
    }

    .services-motion-ready .service-chapter__link {
        --copy-delay: 0.4;
        --copy-offset: 18px;
    }

    .services-motion-ready .service-chapter.is-active .service-chapter__visual,
    .services-motion-ready .service-chapter.is-active .service-chapter__frame,
    .services-motion-ready .service-chapter.is-active .service-chapter__frame img {
        will-change: transform, opacity;
    }

    .services-motion-ready [data-service-section] {
        --section-progress: 0;
    }

    .services-motion-ready .services-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);
    }

    .services-motion-ready .services-contact__inner > :nth-child(2) { --reveal-delay: 0.08; }
}

@media (max-width: 1100px) and (min-width: 901px) {
    .service-chapter__layout {
        padding-right: 48px;
        padding-left: 48px;
        gap: 42px;
    }

    .service-chapter__visual {
        min-height: 410px;
    }

}

@media (max-width: 900px) {
    .services-chapters {
        gap: clamp(120px, 18svh, 180px);
    }

    .services-hero {
        min-height: 86svh;
    }

    .services-hero__content {
        padding: 126px clamp(20px, 6vw, 48px) 88px;
    }

    .services-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));
    }

    .services-hero__scroll {
        display: none;
    }

    .service-chapter {
        min-height: 0;
    }

    .service-chapter__sticky {
        min-height: 0;
        height: auto;
    }

    .service-chapter__layout {
        width: min(100%, 760px);
        padding: clamp(112px, 16vw, 144px) clamp(20px, 5vw, 32px);
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: clamp(32px, 7vw, 54px);
    }

    .service-chapter__copy {
        display: contents;
    }

    .service-chapter__copy-head,
    .service-chapter__copy-body {
        width: min(100%, 680px);
        margin: 0 auto;
    }

    .service-chapter__copy-head {
        grid-row: 1;
    }

    .service-chapter__visual,
    .service-chapter--reverse .service-chapter__visual {
        width: min(100%, 680px);
        height: auto;
        min-height: 0;
        aspect-ratio: 4 / 5;
        margin: 0 auto;
        grid-column: 1;
        grid-row: 2;
        opacity: 1;
        transform: none;
    }

    .service-chapter__copy-body,
    .service-chapter--reverse .service-chapter__copy-body {
        grid-column: 1;
        grid-row: 3;
    }

    .service-chapter__meta {
        margin-bottom: 18px;
    }

    .service-chapter__copy h2 {
        font-size: clamp(2.1rem, 7.5vw, 3.2rem);
    }

    .service-chapter__description {
        margin-top: 0;
    }

    .services-motion-ready .service-chapter__frame {
        opacity: 0;
        transform: translateY(36px);
        transition: opacity 0.9s var(--ease-expo), transform 1.1s var(--ease-expo);
    }

    .services-motion-ready .service-chapter.is-visible .service-chapter__frame {
        opacity: 1;
        transform: translateY(0);
    }

    /* 画像は 130% + top -15% ではみ出しを持つため、シフト ±11(フレーム換算 ±14.3%)が枠内に収まる */
    .services-motion-ready .service-chapter__frame img {
        transform: translate3d(0, calc(var(--media-shift) * 1%), 0);
    }

    .services-motion-ready .service-chapter.is-active .service-chapter__frame img {
        will-change: transform;
    }

    .services-motion-ready .service-chapter__catch {
        opacity: 0;
        transform: translateY(10px);
        transition: opacity 1.4s var(--ease-slow) 0.9s,
                    transform 1.4s var(--ease-slow) 0.9s;
    }

    .services-motion-ready .service-chapter.is-visible .service-chapter__catch {
        opacity: 1;
        transform: translateY(0);
    }

    .services-motion-ready [data-service-section] .services-contact__inner > * {
        opacity: 0;
        transform: translateY(26px);
        transition: opacity 1.35s var(--ease-slow), transform 1.55s var(--ease-slow);
    }

    .services-motion-ready [data-service-section].is-visible .services-contact__inner > * {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

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

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

@media (max-width: 600px) {
    .services-hero {
        min-height: 92svh;
    }

    .services-hero__media img {
        object-position: 58% center;
    }

    .services-hero__content {
        padding-top: 112px;
        padding-bottom: 64px;
    }

    .services-hero__eyebrow {
        margin-bottom: 16px;
    }

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

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

    .service-chapter__layout {
        padding-right: 20px;
        padding-left: 20px;
    }

    .service-chapter__meta {
        gap: 12px;
    }

    .service-chapter__catch {
        margin-top: 14px;
        font-size: 1.2rem;
    }

    .service-chapter__description {
        font-size: 0.94rem;
        line-height: 1.9;
    }

    .service-chapter__link {
        font-size: 0.94rem;
    }

}
