/* Mobile and tablet composition; desktop exhibition geometry remains in style.css. */
@media (max-width: 1024px) {
  .site-header {
    min-height: 72px;
    height: auto;
    gap: 16px;
    padding: 12px 5vw;
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .header-label { display: none; }
  .site-header .brand,
  .site-header .header-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .header-link { white-space: nowrap; }
  .about, .work, .more-work, .contact {
    padding: clamp(64px, 10svh, 112px) 5vw;
    min-width: 0;
  }
  .work { padding-top: clamp(52px, 7svh, 80px); }
  .about { min-height: 0; }
  .more-work-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
  .section-head {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    margin-bottom: clamp(40px, 7svh, 72px);
  }
  .section-head .section-caption { text-align: right; }
  .about-head { align-items: flex-start; }
  .about-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(24px, 5vw, 52px);
  }
  .about-title {
    font-size: clamp(48px, 8.5vw, 88px);
    line-height: 1;
    min-width: 0;
    margin: 0;
  }
  .about-copy { padding-top: 0; min-width: 0; }
  .about-copy p { font-size: 15px; }
  .about-copy p:first-child { font-size: 17px; }
  .about-tags { margin-top: 32px; }
  .contact { min-height: 0; gap: 40px; }
  .contact-title {
    font-size: clamp(40px, 10.5vw, 108px);
    line-height: 1;
    margin-top: 0;
    overflow-wrap: break-word;
  }
  .contact-bottom { gap: 24px; align-items: center; }
  .contact-bottom p { font-size: 14px; }
  .socials { gap: 20px; flex-wrap: wrap; }
  .contact-form { width: 100%; margin-top: 48px; }
  .socials a, footer a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  footer {
    padding: 16px 5vw;
    gap: 8px 24px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 10px;
    line-height: 1.5;
  }
  footer a { margin-left: auto; }
  .chapter-break { margin: clamp(40px, 8svh, 80px) 0; }
  .chapter-header { gap: 12px; }
  .chapter-header .eyebrow { line-height: 1.5; }
  .chapter-description { max-width: 45%; text-align: right; }
  .exhibition-info {
    grid-template-columns: minmax(72px, .42fr) minmax(0, 1fr);
    gap: 7px 12px;
    min-height: 0;
    padding-top: 12px;
  }
  .exhibition-label { font-size: 11px; line-height: 1.45; }
  .exhibition-value { font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
  .exhibition-details .project-cta {
    position: static;
    transform: none;
    grid-column: 1 / -1;
    grid-row: auto;
    justify-self: start;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin: 0;
    padding: 8px 14px;
    border: 1px solid var(--accent);
    font-size: 12px;
  }
  .exhibition-frame { border-radius: 12px; }
  .exhibition-frame:focus-visible,
  .header-link:focus-visible,
  .socials a:focus-visible,
  footer a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
  }
  .chapter-rail {
    scrollbar-width: thin;
    scrollbar-color: var(--muted) transparent;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
  }
  .chapter-rail::-webkit-scrollbar { display: block; height: 3px; }
  .chapter-rail::-webkit-scrollbar-thumb { background: var(--muted); }
  .chapter-rail-items {
    flex-direction: row;
    align-items: flex-start;
    width: max-content;
    gap: 8px;
    padding: 4px 4px 8px;
  }
  .chapter-rail-marker {
    flex: 0 0 64px;
    width: 64px;
    min-height: 64px;
    gap: 3px;
  }
  .chapter-rail-preview { width: 60px; border-radius: 6px; }
  .chapter-rail-number { font-size: 10px; }
  .animated-exhibition .exhibition-viewport {
    height: 100svh;
    min-height: 0;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    padding: 0;
    overflow: hidden;
  }
  .animated-exhibition .chapter-header {
    position: absolute;
    top: 20px;
    left: 5vw;
    right: 5vw;
    display: flex;
    align-items: baseline;
    margin: 0;
  }
  .animated-exhibition .chapter-description { margin: 0; font-size: 11px; }
  .animated-exhibition .exhibition-stage {
    position: absolute;
    inset: clamp(50px, 8svh, 72px) 0 clamp(90px, 14svh, 120px);
    display: block;
    overflow: visible;
    perspective: 1200px;
  }
  .animated-exhibition .exhibition-track { position: relative; width: 100%; height: 100%; }
  .exhibition-motion {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(90%, 620px);
    transform-style: preserve-3d;
    transform-origin: center center;
    will-change: transform, opacity;
  }
  .animated-exhibition .exhibition-project {
    position: static;
    width: 100%;
    margin: 0;
    transform: none !important;
    opacity: 1 !important;
    will-change: auto;
  }
  .animated-exhibition .exhibition-project-number { margin-bottom: 10px; }
  .animated-exhibition .exhibition-details {
    display: block;
  }
  .animated-exhibition .exhibition-info {
    grid-template-columns: minmax(72px, .42fr) minmax(0, 1fr);
    min-height: 0;
  }
  .animated-exhibition .exhibition-details .project-cta {
    display: inline-flex;
    margin-top: 14px;
    min-height: 44px;
    max-width: 100%;
  }
  .animated-exhibition .chapter-rail {
    position: absolute;
    inset: auto 5vw 44px;
    width: auto;
    max-height: none;
    margin: 0;
    transform: none;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .animated-exhibition .chapter-rail-label,
  .animated-exhibition .chapter-rail-line { display: none; }
  .animated-exhibition .chapter-rail-marker { transition: color .3s ease; }
  .animated-exhibition .exhibition-status {
    display: flex;
    position: absolute;
    right: 5vw;
    bottom: 23px;
    gap: 24px;
    font-size: 10px;
  }
  .animated-exhibition .exhibition-progress {
    display: block;
    position: absolute;
    left: 5vw;
    right: 5vw;
    bottom: 12px;
  }
  .reduced-exhibition .exhibition-viewport {
    display: flex;
    flex-direction: column;
    padding-top: 28px;
  }
  .reduced-exhibition .chapter-header { order: 0; display: flex; margin: 0 0 20px; }
  .reduced-exhibition .chapter-rail {
    order: 1;
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--bg);
    margin: 0;
    padding-top: 8px;
  }
  .reduced-exhibition .chapter-rail-label,
  .reduced-exhibition .chapter-rail-line { display: none; }
  .reduced-exhibition .exhibition-stage { order: 2; overflow: visible; }
  .reduced-exhibition .exhibition-project { margin: 48px 0 64px; scroll-margin-top: 100px; }
  .reduced-exhibition .chapter-rail-items { gap: 8px; }
  .reduced-exhibition .chapter-rail-marker { width: 64px; }
  .lightbox { padding: 64px 5vw 28px; }
  .lightbox-content { width: 100%; max-height: 100%; }
  .lightbox-frame { max-height: calc(100svh - 160px); }
  .lightbox-close { top: 12px; right: 5vw; min-height: 44px; min-width: 80px; }
  .lightbox-hint { line-height: 1.6; }
}

@media (max-width: 600px) {
  .about-layout { display: block; }
  .about-title { font-size: clamp(48px, 16vw, 88px); margin-bottom: 32px; }
  .about-head { gap: 12px; }
  .section-head { gap: 16px; }
  .section-caption { font-size: 11px; }
  .contact-bottom { display: block; }
  .socials { margin-top: 20px; }
  .contact-form-fields { grid-template-columns: 1fr; }
  .contact-form { margin-top: 48px; }
  footer > span:nth-child(2) { font-size: 9px; }
  footer a { flex-basis: 100%; margin: 0; }
}

@media (min-width: 560px) and (max-width: 1024px) and (max-height: 600px) {
  .animated-exhibition .chapter-header { top: 12px; }
  .animated-exhibition .exhibition-stage { inset: 52px 0 118px; }
  .animated-exhibition .exhibition-motion { width: 88%; }
  .animated-exhibition .exhibition-artwork {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 20px;
    align-items: center;
  }
  .animated-exhibition .exhibition-info { padding-top: 0; gap: 5px 10px; }
  .animated-exhibition .exhibition-details .project-cta { min-height: 52px; }
  .animated-exhibition .exhibition-project-number { margin-bottom: 6px; }
  .animated-exhibition .chapter-rail { bottom: 38px; }
  .animated-exhibition .exhibition-status { bottom: 19px; }
  .animated-exhibition .exhibition-progress { bottom: 9px; }
}

@media (max-width: 1024px) and (prefers-reduced-motion: reduce) {
  .chapter-rail-marker, .chapter-rail-preview, .chapter-rail-dot, .project-cta, .project-cta span { transition: none; }
}
