/* Additive mobile layout. The source desktop rules remain in base.css. */
:root {
    --mobile-gutter: 16px;
    --mobile-gap: 12px;
    --mobile-body: 14px;
    --mobile-radius: 8px;
}

.mobile-project-actions,
.mobile-description { display: none; }
.skip-link {
    position: fixed;
    z-index: 1000;
    top: 8px;
    left: 8px;
    min-height: 44px;
    padding: 12px;
    background: #111;
    color: #fff;
    transform: translateY(-160%);
}
.skip-link:focus { transform: none; }
:where(a, button, summary, video):focus-visible {
    outline: 3px solid #067080;
    outline-offset: 4px;
}
.shots-sidebar :where(a, button):focus-visible,
.video-stage :where(button, video):focus-visible { outline-color: var(--accent); outline-offset: -4px; }
:where(section, aside)[id] { scroll-margin-top: 100px; }
.unconfigured-notice {
    width: 100%;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}
[aria-disabled="true"] { cursor: default; }
#back .action-link[aria-disabled="true"] { background: #454545; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .hero-title .line span { animation-delay: 0s !important; transform: none !important; }
    .reveal { opacity: 1; transform: none; transition: none; }
}

@media (max-width: 768px) {
    html, body { min-width: 0; }
    body { font-size: var(--mobile-body); }
    nav, nav.scrolled {
        gap: 12px;
        padding: 6px var(--mobile-gutter);
        min-height: 56px;
        background: rgba(245,245,243,.88);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border);
    }
    .nav-logo { min-height: 44px; font-size: 15px; gap: 8px; }
    .nav-cta { display: inline-flex; min-height: 44px; padding: 0 12px; font-size: 14px; }
    .nav-links { display: none; }
    .detail-layout,
    body.shots-open .detail-layout,
    body:not(.shots-open) .detail-layout {
        width: calc(100% - var(--mobile-gutter) * 2);
        padding-top: 68px;
        display: block;
    }
    .detail-main section,
    .detail-main #info,
    .detail-main #process,
    .detail-main #back { padding: 24px 0; }
    .detail-main #watch { padding: 0 0 18px; }
    :where(section, aside)[id] { scroll-margin-top: 68px; }
    .container, .section-grid, .compact-project-grid,
    .compact-project-copy, .meta-value, .process-card > div { min-width: 0; }
    .compact-project-head {
        margin-bottom: 12px;
        padding: 12px;
        border-radius: var(--mobile-radius);
    }
    .compact-project-meta { gap: 6px; margin-bottom: 10px; align-items: flex-start; }
    .chip, .tag {
        display: inline-flex;
        flex: 0 1 auto;
        width: auto;
        min-width: 0;
        max-width: 100%;
        min-height: 0;
        padding: 4px 8px;
        font-size: 14px;
        line-height: 1.4;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .compact-project-grid { display: block; }
    .compact-project-title {
        display: flex;
        flex-wrap: wrap;
        column-gap: .12em;
        max-width: 100%;
        font-size: clamp(28px, 7.4vw, 42px);
        line-height: 1.16;
        letter-spacing: -.03em;
    }
    .compact-project-title .line { display: inline-block; }
    .compact-project-title .line span { animation-duration: .65s; }
    .compact-project-title .line:nth-child(1) span { animation-delay: .08s; }
    .compact-project-title .line:nth-child(2) span { animation-delay: .16s; }
    .compact-project-title .line:nth-child(3) span { animation-delay: .24s; }
    .watch-head { display: block; margin-bottom: 8px; }
    .watch-head .section-label { margin: 0; }
    .section-label { font-size: 14px; line-height: 1.5; letter-spacing: .02em; }
    .section-label::before { width: 18px; }
    .video-stage {
        min-height: 0;
        width: 100%;
        aspect-ratio: 16 / 9;
        border-radius: var(--mobile-radius);
        box-shadow: 0 12px 28px rgba(0,0,0,.18);
        --scan-distance: calc((100vw - 32px) * .5625 * .66);
    }
    .video-el { width: 100%; height: 100%; object-fit: contain; }
    .video-hud { inset: 12px; }
    .video-hud-top, .video-hud-bottom { gap: 8px; }
    .video-code { font-size: 12px; line-height: 1.4; color: #e4e4e4; }
    .video-title { font-size: clamp(17px, 4.5vw, 26px); line-height: 1.22; }
    .timecode { display: none; }
    .play-button { width: 52px; height: 52px; }
    #videoStage.has-video .video-hud { inset-block-end: 48px; }
    .compact-meta-strip {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px 12px;
        margin-top: 10px;
        padding-top: 10px;
    }
    .micro { min-width: 0; font-size: 14px; line-height: 1.45; color: #4f4f4f; overflow-wrap: anywhere; }
    .mobile-project-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        margin-top: 12px;
    }
    .mobile-project-actions a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        min-width: 0;
        padding: 8px 4px;
        border: 1px solid rgba(17,17,17,.2);
        border-radius: 4px;
        background: rgba(255,255,255,.72);
        font-size: 14px;
        font-weight: 700;
        text-align: center;
    }
    .mobile-project-actions a:first-child { background: #111; color: #fff; }
    .mobile-description {
        display: block;
        margin-top: 8px;
        border-bottom: 1px solid var(--border);
    }
    .mobile-description summary {
        min-height: 44px;
        padding: 12px 0;
        font-size: 14px;
        line-height: 20px;
        font-weight: 600;
        cursor: pointer;
    }
    #mobileDescriptionBody { padding: 2px 0 12px; }
    .compact-project-copy { padding: 0; }
    .compact-project-copy .hero-desc,
    .compact-project-copy .hero-cn,
    .watch-summary {
        max-width: none;
        margin: 0 0 10px;
        font-size: 14px;
        line-height: 1.6;
        color: #4f4f4f;
        overflow-wrap: anywhere;
    }
    .compact-marquee { margin: 0; padding: 10px 0; }
    .marquee-track, .marquee-item { gap: 24px; }
    .marquee-item { font-size: 14px; }
    .section-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
    .info-intro p { margin-top: 8px; font-size: 14px; line-height: 1.6; }
    .info-table { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
    .info-row {
        grid-template-columns: 1fr;
        align-content: start;
        gap: 4px;
        padding: 12px;
        min-width: 0;
    }
    .info-row:has(.tag-list) { grid-column: 1 / -1; }
    .meta-label { color: #555; font-size: 14px; line-height: 1.4; }
    .meta-value { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
    .tag-list { gap: 6px; align-items: flex-start; }
    .process-copy { font-size: 16px; line-height: 1.55; }
    .process-list { grid-template-columns: 1fr; gap: 8px; margin-top: 14px; }
    .process-card {
        display: grid;
        grid-template-columns: 24px minmax(0, 1fr);
        gap: 10px;
        min-height: 0;
        padding: 14px;
        align-items: start;
    }
    .process-num { font-size: 14px; line-height: 1.5; }
    .process-card h3 { margin-top: 0; font-size: 17px; line-height: 1.35; }
    .process-card p { margin-top: 6px; font-size: 14px; line-height: 1.55; }
    #shots.shots-sidebar { margin: 0 0 24px; border-radius: 8px; }
    .shots-toggle, body.shots-open .shots-toggle { min-height: 48px; height: 48px; padding: 0 12px; }
    .shots-toggle-label { font-size: 14px; letter-spacing: .04em; }
    .shots-panel-body { padding-inline: 12px; }
    body.shots-open .shots-panel-body { padding: 0 12px 12px; }
    .shots-sidebar .shots-head { margin: 12px 0; gap: 8px; }
    .shots-sidebar .shots-title { margin-top: 8px; font-size: 26px; line-height: 1.15; color: #fff; }
    .shots-sidebar .shots-note { font-size: 14px; line-height: 1.5; color: #c9c9c9; }
    .shots-sidebar .shot-grid { gap: 8px; }
    .shots-sidebar .shot-card,
    .shots-sidebar .shot-card.large {
        display: grid;
        grid-template-columns: 28% minmax(0, 1fr);
        min-height: 0;
        aspect-ratio: auto;
        grid-column: auto;
    }
    .shots-sidebar .shot-visual { position: relative; min-height: 112px; }
    .shots-sidebar .shot-overlay { position: relative; padding: 10px; background: rgba(0,0,0,.2); }
    .shots-sidebar .shot-kind { font-size: 12px; line-height: 1.45; }
    .shots-sidebar .shot-name { margin-top: 4px; font-size: 16px; line-height: 1.3; }
    .shots-sidebar .shot-desc { margin-top: 6px; font-size: 14px; line-height: 1.5; color: #ccc; }
    #back .next-panel { min-height: 0; padding: 18px; row-gap: 18px; }
    #back .next-copy h2 { margin-top: 12px; font-size: clamp(28px,7vw,38px); line-height: 1.15; }
    #back .next-actions { gap: 8px; }
    #back .action-link { min-height: 44px; padding: 10px 12px; font-size: 14px; line-height: 1.4; letter-spacing: 0; }
    .unconfigured-notice { order: 2; }
    footer { align-items: flex-start; gap: 6px; padding: 18px var(--mobile-gutter); font-size: 14px; }
    #info, #process, #back, #shots { contain-intrinsic-size: auto 360px; }
    #shots { content-visibility: visible; }
    .reveal { transform: translateY(14px); }
    .reveal.visible { transform: none; }
    .stagger-1 { transition-delay: .04s; }
    .stagger-2 { transition-delay: .08s; }
    .stagger-3 { transition-delay: .12s; }
    .stagger-4 { transition-delay: .16s; }
    #videoStage.motion-in-view:not(.has-video) .scanline {
        top: 16%;
        animation: mobileScanMove 6s ease-in-out infinite;
        will-change: transform;
    }
    @keyframes mobileScanMove {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(var(--scan-distance)); }
    }
}

@media (min-width: 600px) and (max-width: 768px) {
    .process-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .shots-sidebar .shot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .shots-sidebar .shot-card, .shots-sidebar .shot-card.large { grid-template-columns: 1fr; }
    .shots-sidebar .shot-visual { min-height: 0; aspect-ratio: 16 / 9; }
}

@media (prefers-reduced-motion: reduce) {
    #videoStage .scanline, #videoStage .orbit-system, #videoStage .orbit-system::before,
    .compact-marquee .marquee-track { animation: none !important; will-change: auto !important; }
}
