/* Closing chapters share the opening's warm light and native scroll rhythm. */
.mobile-closing-only, .mobile-chapter-note, .mobile-panel-label,
.mobile-career-title, .mobile-outdoors-photo, .mobile-contact-orbit,
.mobile-finale-title { display: none; }

@media (max-width: 900px) {
    .mobile-opening-tools { justify-content: center; }
    .mobile-opening-tools .mobile-signal-trigger { padding-inline: 20px; }
    .mobile-closing-only, .mobile-chapter-note, .mobile-career-title, .mobile-finale-title { display: block; }
    .cinema [data-mobile-chapter] { position: relative; isolation: isolate; }
    .cinema > .scene[data-mobile-chapter] { padding: 80px 24px; }
    .cinema > .scene[data-mobile-chapter] > .scene-stage { max-width: 640px; perspective: none; text-align: left; }
    .cinema [data-mobile-chapter] .scene-kicker { font-size: 10px; line-height: 1.7; letter-spacing: .2em; margin-bottom: 18px; }
    .cinema [data-mobile-chapter] .scene-kicker::before { display: none; }
    .cinema [data-mobile-chapter] .scene-title { font-size: clamp(34px, 9vw, 54px); line-height: 1.1; letter-spacing: -.045em; text-wrap: pretty; margin: 0 0 24px; }
    .mobile-chapter-note { color: #bdb2ac; font-size: 15px; line-height: 1.7; margin: 0 0 32px; max-width: 29ch; }
    .mobile-story { max-width: 688px; padding: 88px 24px 20px; overflow: clip; }
    .mobile-story-photo { position: relative; margin: 0 -24px 40px; height: clamp(280px, 80vw, 460px); overflow: hidden; background: #141118; }
    .mobile-story-photo img { width: 100%; height: calc(100% + 40px); object-fit: cover; object-position: 65% 44%; margin-top: -20px; filter: saturate(.65) brightness(.8); }
    .mobile-story-photo::after, .mobile-outdoors-photo::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, #08080e00 48%, #08080eaa); }
    .mobile-story-photo figcaption { position: absolute; z-index: 1; inset: auto 24px 24px; display: flex; justify-content: space-between; gap: 20px; color: #ffeadb; font: 400 9px/1.6 var(--font-mono); letter-spacing: .08em; }
    .mobile-story-photo figcaption span:first-child { text-transform: uppercase; color: #ffba8b; }
    .mobile-story h2 { font-size: clamp(34px, 9.3vw, 54px); margin: 20px 0 28px; }
    .mobile-story > p:not(.mobile-story-kicker) { border-left: 1px solid #ffb48a55; padding-left: 20px; font-size: 16px; line-height: 1.85; }
    .mobile-story-links { margin-top: 28px; gap: 8px; }
    .mobile-story-links a { font-size: 13px; }
    .scene-github[data-mobile-chapter] { background: radial-gradient(ellipse at 100% 30%, #ff9c6810, transparent 65%), #09090f; }
    .scene-github[data-mobile-chapter] .github-heatmap-wrap { margin: 0 0 20px; padding: 20px 16px 22px; background: #15121a; border: 1px solid #ffb48a45; border-radius: 16px; box-shadow: 0 22px 44px #0005; }
    .mobile-panel-label { display: flex; align-items: center; gap: 8px; color: #dbc9bc; text-transform: uppercase; font: 400 9px/1.5 var(--font-mono); letter-spacing: .05em; margin-bottom: 24px; }
    .mobile-panel-label > span:last-child { margin-left: auto; color: #a58a79; }
    .mobile-panel-dot { width: 5px; height: 5px; background: #ffb48a; border-radius: 50%; box-shadow: 0 0 12px #ffb48a88; }
    .scene-github[data-mobile-chapter] .github-heatmap { min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #805842 transparent; }
    .scene-github[data-mobile-chapter] .github-heatmap svg { min-width: 560px; }
    .scene-github[data-mobile-chapter] .github-caption { text-align: left; font-size: 11px; color: #c5b7ac; letter-spacing: .04em; }
    .scene-github[data-mobile-chapter] .github-stack-label { text-align: left; color: #b7a598; margin: 32px 0 14px; }
    .scene-github[data-mobile-chapter] .github-stack { justify-content: flex-start; gap: 8px; margin: 0 0 26px; }
    .scene-github[data-mobile-chapter] .github-stack li { font-size: 11px; padding: 11px 12px; border-radius: 8px; border-color: #ffb48a24; background: #131119; }
    .scene-github[data-mobile-chapter] .github-stack li i { font-size: 12px; }
    .scene-github[data-mobile-chapter] .github-cta { font-size: 12px; }
    .scene-career[data-mobile-chapter]::after { display: none; }
    .scene-career[data-mobile-chapter] .career-track { padding: 0; margin-top: 38px; }
    .scene-career[data-mobile-chapter] :is(.career-track-rail, .career-track-beam, .career-blip) { display: none; }
    .scene-career[data-mobile-chapter] .career-list { gap: 24px; }
    .scene-career[data-mobile-chapter] .career-item {
        display: block; padding: 30px 24px; border-radius: 16px; border-color: #ffb48a35;
        background: radial-gradient(ellipse at 100% 0%, #ff9c6819, transparent 70%), #111119;
        backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: 0 20px 40px #0004;
    }
    .scene-career[data-mobile-chapter] .career-index { display: block; color: #ffba8b; font: 400 12px/1 var(--font-mono); letter-spacing: .15em; margin-bottom: 30px; animation: none; }
    .mobile-career-title { font: 500 clamp(26px, 7vw, 36px)/1.1 var(--font-display); letter-spacing: -.035em; margin: 0 0 20px; color: #f4ece5; }
    .scene-career[data-mobile-chapter] .career-item p { color: #c2b7b0; font-size: 15px; line-height: 1.75; }
    .scene-career[data-mobile-chapter] .career-item::after { content: ""; position: absolute; top: 34px; right: 24px; width: 44px; height: 1px; background: linear-gradient(90deg, #ffb48a99, transparent); }
    .cinema > .scene-contact[data-mobile-chapter] { padding-top: 20px; padding-bottom: 44px; }
    .mobile-outdoors-photo { display: block; position: relative; width: min(calc(100% + 48px), 460px); aspect-ratio: 9 / 16; margin: 0 0 44px; left: 50%; translate: -50% 0; overflow: hidden; background: #241a18; }
    .mobile-outdoors-photo picture { display: block; width: 100%; height: 100%; }
    .mobile-outdoors-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
    .mobile-outdoors-photo figcaption { position: absolute; z-index: 1; bottom: 26px; left: 24px; right: 24px; font: 400 10px/1.6 var(--font-mono); color: #ffe7d8; letter-spacing: .05em; }
    .scene-contact[data-mobile-chapter] .scene-title { max-width: 15ch; font-size: clamp(32px, 8.5vw, 50px); margin-bottom: 32px; }
    .scene-contact[data-mobile-chapter] .contact-video { width: 100%; }
    .scene-contact[data-mobile-chapter] .contact-video::before { animation: none; opacity: .3; }
    .scene-contact[data-mobile-chapter] .contact-video-frame { border-radius: 14px; }
    .scene-contact[data-mobile-chapter] .contact-video-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; }
    .scene-contact[data-mobile-chapter] .contact-video-status { flex-basis: 100%; text-align: left; font-size: 10px; }
    .scene-contact[data-mobile-chapter] .contact-video-watch { display: inline-flex; align-items: center; font-size: 12px; }
    .scene-contact[data-mobile-chapter] .contact-video-sound { font-size: 11px; }
    .scene-contact[data-mobile-chapter] .mobile-contact-finale {
        position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; justify-content: center;
        text-align: center; min-height: 560px; margin: 84px -24px 0; max-width: none; padding: 100px 24px 76px; overflow: hidden;
        background: radial-gradient(ellipse at 50% 45%, #ff9c6814, transparent 65%);
    }
    .mobile-contact-finale .contact-eyebrow { font-size: 9px; line-height: 1.8; letter-spacing: .19em; color: #ceb7a5; }
    .mobile-finale-title { position: relative; font: 500 clamp(40px, 11vw, 66px)/1.07 var(--font-display); letter-spacing: -.05em; color: #fbf0e7; margin: 20px 0 36px; }
    .mobile-finale-title em { color: #ffb48a; font-style: normal; }
    .mobile-contact-finale .contact-link { padding: 17px 22px; font-size: 14px; background: #211a20; border-color: #ffb48a77; box-shadow: 0 16px 40px #0008; }
    .mobile-contact-finale .contact-link:active { background: #39232a; scale: .98; }
    .mobile-contact-orbit { display: block; position: absolute; z-index: -1; pointer-events: none; width: 420px; height: 420px; left: calc(50% - 210px); top: calc(50% - 210px); }
    .mobile-contact-orbit span { position: absolute; inset: 0; border: 1px solid #ffb48a1c; border-radius: 50%; }
    .mobile-contact-orbit span:nth-child(2) { inset: 38px; border-color: #ffb48a30; }
    .mobile-contact-orbit span:nth-child(3) { inset: 78px; border-style: dashed; border-color: #ffb48a18; }
    .mobile-contact-orbit i { position: absolute; top: 58px; left: 58px; width: 7px; height: 7px; border-radius: 50%; background: #ffc292; box-shadow: 0 0 18px #ffb48a; }
    .scene-contact[data-mobile-chapter] .contact-credit { text-align: center; color: #89776d; font-size: 9px; }
}

@media (max-width: 900px) and (prefers-reduced-motion: no-preference) {
    [data-mobile-chapter] [data-mobile-reveal] { translate: 0 calc((1 - var(--reveal, 1)) * 24px); }
    [data-mobile-chapter] [data-mobile-parallax] { translate: 0 var(--photo-shift, 0px); }
    [data-mobile-chapter] .mobile-outdoors-photo[data-mobile-reveal] { translate: -50% calc((1 - var(--reveal, 1)) * 24px); }
    .mobile-outdoors-photo img[data-mobile-parallax] { scale: 1.025; translate: 0 calc(var(--photo-shift, 0px) * .3); }
    [data-mobile-chapter] [data-mobile-orbit] { rotate: var(--orbit-turn, 0deg); }
    .scene-career[data-mobile-chapter] .career-item { scale: calc(.98 + var(--reveal, 1) * .02); }
    .scene-career[data-mobile-chapter] .career-item:nth-child(odd) { rotate: calc((1 - var(--reveal, 1)) * -1.5deg); }
    .scene-career[data-mobile-chapter] .career-item:nth-child(even) { rotate: calc((1 - var(--reveal, 1)) * 1.5deg); }
    .scene-github[data-mobile-chapter] .github-heatmap-wrap::after { content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--chapter-progress, .5) * 100%); width: 36px; pointer-events: none; background: linear-gradient(90deg, transparent, #ffb48a12, transparent); }
}

@media (max-width: 359px) {
    .cinema > .scene[data-mobile-chapter], .mobile-story { padding-inline: 20px; }
    .mobile-story-photo { margin-inline: -20px; }
    .mobile-outdoors-photo { width: min(calc(100% + 40px), 460px); }
    .scene-career[data-mobile-chapter] .career-item { padding: 26px 20px; }
    .scene-contact[data-mobile-chapter] .mobile-contact-finale { margin-inline: -20px; padding-inline: 20px; }
    .mobile-finale-title { font-size: 39px; }
}
