/* Gallery styles are scoped to the existing site's Gallery page. */
.gallery-page { --g-bg: #071421; --g-panel: #0b1b2a; --g-line: rgba(193, 219, 239, .18); --g-soft: #afc1cf; background: var(--g-bg); }
.gallery-page main { padding-top: var(--header-height); }
.gallery-page [hidden] { display: none !important; }
.g-chapter-nav { position: sticky; top: 66px; z-index: 25; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 66px; padding: 10px clamp(22px, 5vw, 82px); border-bottom: 1px solid var(--g-line); background: rgba(7, 20, 33, .94); backdrop-filter: blur(18px); }
.g-nav-label, .g-kicker, .g-row-label, .g-hero-meta, .g-chapter-number, .g-index-label, .g-card-meta { font-size: .67rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.g-nav-label { color: var(--g-soft); white-space: nowrap; }
.g-chapter-links { display: flex; align-items: center; gap: clamp(16px, 3vw, 48px); }
.g-chapter-links a { display: flex; align-items: center; gap: 9px; min-height: 44px; font-size: .8rem; color: var(--g-soft); }
.g-chapter-links a span { font-size: .62rem; color: #829eaf; }
.g-chapter-links a[aria-current="location"], .g-chapter-links a:hover { color: white; }
.g-chapter-links a[aria-current="location"] span { color: var(--cyan); }
.g-motion-toggle { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--g-line); border-radius: 30px; background: transparent; font-size: .72rem; white-space: nowrap; }
.g-motion-toggle:hover { border-color: var(--cyan); }
.g-chapter { position: relative; scroll-margin-top: 132px; --g-accent: #6adcf0; }
.g-chapter[data-chapter="infrastructure"] { --g-accent: #9eafff; }
.g-chapter[data-chapter="engineering"] { --g-accent: #77e8c7; }
.g-hero { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; min-height: 610px; padding: 48px clamp(22px, 5vw, 82px) 30px; overflow: hidden; background: #0c2130; }
.g-chapter:first-child .g-hero { min-height: min(710px, calc(100svh - 146px)); min-height: clamp(600px, calc(100svh - 146px), 800px); }
.g-hero-poster, .g-background-video, .g-hero-shade { position: absolute; z-index: -3; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.g-hero-poster { opacity: .75; }
.g-hero-poster[hidden] { display: none; }
.g-background-video { opacity: 0; transition: opacity 900ms ease; }
.g-background-video.is-playing { opacity: .8; }
.g-hero-shade { z-index: -2; background: linear-gradient(90deg, rgba(4, 15, 27, .92), rgba(4, 15, 27, .52) 58%, rgba(4, 15, 27, .16)), linear-gradient(0deg, #071421, transparent 40%, rgba(7,20,33,.2)); }
.g-index-label { display: flex; align-items: center; gap: 10px; color: #d2e3ec; }
.g-hero:has(> .background-motion:not([hidden])) .g-index-label { padding-right: 140px; }
.g-index-label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--g-accent); box-shadow: 0 0 18px var(--g-accent); }
.g-index-label span { margin-left: auto; color: #c1d3df; font-size: .59rem; }
.g-hero-copy { position: relative; max-width: 900px; padding: 40px 0; }
.g-kicker { margin: 0 0 20px; color: var(--g-accent, #6adcf0); }
.g-hero h1, .g-hero h2 { margin: 0; font-family: var(--display); font-size: clamp(3.5rem, 7vw, 7.3rem); font-weight: 500; line-height: 1.04; letter-spacing: -.065em; }
.g-hero h1 em, .g-hero h2 em { color: var(--g-accent); font-style: normal; }
.g-hero-copy > p:last-child { max-width: 470px; margin: 28px 0 0; color: #cfdee9; font-size: clamp(.94rem, 1.1vw, 1.06rem); line-height: 1.8; }
.g-hero-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 24px; padding-top: 22px; border-top: 1px solid rgba(220,239,250,.24); color: #ccdae5; font-size: .6rem; }
.g-hero-meta > a { margin-left: auto; display: inline-flex; align-items: center; gap: 20px; min-height: 44px; color: white; }
.g-hero-meta > a span { color: var(--g-accent); font-size: 1.2rem; }
.g-chapter-number { position: absolute; right: 4vw; bottom: 60px; z-index: -1; color: transparent; -webkit-text-stroke: 1px rgba(226,243,255,.18); font-family: var(--display); font-size: clamp(130px, 19vw, 290px); line-height: 1; letter-spacing: -.08em; pointer-events: none; }
.g-collection { max-width: 1800px; margin-inline: auto; padding: 64px clamp(22px, 5vw, 82px) 76px; }
.g-row + .g-row { margin-top: 60px; }
.g-row-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 22px; }
.g-row-label { display: flex; gap: 10px; margin: 0 0 8px; color: var(--g-accent); font-size: .59rem; }
.g-row-label span { color: #849daa; }
.g-row h2, .g-row h3 { margin: 0; font: 500 clamp(1.5rem, 2.5vw, 2.25rem)/1.25 var(--display); letter-spacing: -.045em; }
.g-row-controls { display: flex; gap: 10px; align-items: center; }
.g-row-count { margin-right: 14px; color: var(--g-soft); font-size: .65rem; letter-spacing: .1em; font-variant-numeric: tabular-nums; }
.g-arrow { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 44px; height: 44px; border: 1px solid var(--g-line); border-radius: 50%; background: transparent; color: white; font-size: 1.1rem; transition: background 200ms, color 200ms, border-color 200ms; }
.g-arrow:hover:not(:disabled) { border-color: var(--g-accent, #6adcf0); background: var(--g-accent, #6adcf0); color: #071421; }
.g-arrow:disabled { opacity: .3; cursor: default; }
.g-track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 48px) / 3); gap: 24px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: #385466 transparent; padding: 8px 1px 24px; scroll-padding-inline: 1px; }
.g-track:focus-visible { outline-offset: 6px; }
.g-track::-webkit-scrollbar { height: 3px; }
.g-track::-webkit-scrollbar-thumb { background: #385466; border-radius: 3px; }
.g-card { position: relative; display: block; min-width: 0; scroll-snap-align: start; border: 1px solid var(--g-line); border-radius: 5px; background: var(--g-panel); transition: transform 350ms var(--ease-out), border-color 350ms, box-shadow 350ms; }
.g-card-visual { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 4px 4px 0 0; background: #112b3d; }
.g-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 650ms var(--ease-out), filter 500ms; }
.g-card-visual::after { position: absolute; inset: 0; content: ""; background: linear-gradient(0deg, rgba(3,14,25,.65), transparent 65%); pointer-events: none; }
.g-card-caption { display: block; padding: 19px 20px 18px; }
.g-card-caption strong { display: block; font: 500 1rem/1.4 var(--display); letter-spacing: -.025em; }
.g-card-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; color: #a5bdcc; font-size: .53rem; letter-spacing: .11em; }
.g-card-meta span:last-child { color: var(--g-accent); font-size: .9rem; }
.g-card-index, .g-duration { position: absolute; z-index: 1; color: white; font-size: .61rem; letter-spacing: .05em; font-variant-numeric: tabular-nums; }
.g-card-index { top: 14px; left: 15px; padding: 3px 7px; border: 1px solid rgba(255,255,255,.3); border-radius: 3px; background: rgba(3,14,25,.7); }
.g-duration { right: 14px; bottom: 13px; padding: 3px 7px; border-radius: 3px; background: rgba(3,14,25,.8); }
.g-play, .g-expand { position: absolute; z-index: 1; left: 50%; top: 50%; display: grid; place-items: center; width: 56px; height: 56px; border: 1px solid rgba(255,255,255,.7); border-radius: 50%; background: rgba(9,25,40,.45); backdrop-filter: blur(8px); transform: translate(-50%, -50%); transition: background 250ms, border-color 250ms, color 250ms; }
.g-play { padding-left: 3px; font-size: .85rem; }
.g-expand { opacity: 0; font-size: 1.4rem; }
.g-card:focus-visible { border-color: var(--g-accent); }
.g-card:focus-visible img { transform: scale(1.055); }
.g-card:focus-visible .g-expand { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .g-card:hover { border-color: var(--g-accent); transform: translateY(-5px); box-shadow: 0 12px 30px rgba(0,0,0,.2); }
  .g-card:hover img { transform: scale(1.055); filter: saturate(1.1); }
  .g-card:hover .g-play, .g-card:hover .g-expand { opacity: 1; background: var(--g-accent); border-color: var(--g-accent); color: #071421; }
}
.g-image-row .g-track { grid-auto-columns: calc((100% - 72px) / 4); }
.g-image-row .g-card-visual { aspect-ratio: 4 / 3; }
.g-image-row .g-card-caption { padding: 15px 16px; }
.g-image-row .g-card-caption strong { font-size: .87rem; }
.g-image-row .g-card-meta { font-size: .5rem; }
.g-row-footer { display: flex; justify-content: space-between; gap: 16px; margin: 2px 0 0; color: #9bb2c1; font-size: .69rem; }
.g-row-footer span:last-child { color: #c5d9e6; }
.g-chapter + .g-chapter { border-top: 1px solid var(--g-line); }
.g-closing { position: relative; display: grid; grid-template-columns: .45fr 1fr; align-items: center; gap: 50px; padding: 110px clamp(22px, 8vw, 130px) 34px; border-top: 1px solid var(--g-line); background: radial-gradient(ellipse at 10% 40%, #103844, transparent 58%), #0b1c29; }
.g-orb { color: #6adcf0; font-size: clamp(100px, 18vw, 260px); text-align: center; line-height: 1; animation: g-orbit 45s linear infinite; }
.g-closing h2 { margin: 0; font: 500 clamp(2.2rem, 4.5vw, 4.8rem)/1.1 var(--display); letter-spacing: -.06em; }
.g-closing h2 em { font-style: normal; color: #7cdbe9; }
.g-closing .g-reveal > p:not(.g-kicker) { max-width: 500px; margin: 26px 0; color: #c1d2df; }
.g-cta { display: inline-flex; gap: 34px; align-items: center; min-height: 50px; padding: 0 24px; border-radius: 3px; background: #9be5ef; color: #071421; font-size: .85rem; transition: background 180ms, transform 180ms; }
.g-cta:hover { background: #c4f5fa; transform: translateY(-2px); }
.g-disclosure { grid-column: 1 / -1; max-width: 900px; margin: 70px 0 0; color: #9db4c3; font-size: .7rem; line-height: 1.9; }
.g-disclosure a { color: #c2e8f2; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.g-reveal { opacity: 1; }
.g-animate .g-reveal { opacity: 0; transform: translateY(24px); transition: opacity 750ms var(--ease-out), transform 750ms var(--ease-out); }
.g-animate .g-reveal.is-visible, .g-animate .g-reveal:focus-within { opacity: 1; transform: none; }
@keyframes g-orbit { to { transform: rotate(360deg); } }
@media (min-width: 1800px) { .g-hero { padding-inline: max(82px, calc((100vw - 1640px) / 2)); } }
@media (max-width: 1050px) {
  .g-chapter-nav { top: 66px; padding-inline: 22px; }
  .g-nav-label { display: none; }
  .g-chapter-links { gap: 22px; }
  .gallery-page .primary-nav:not(.is-open) { visibility: hidden; }
  .g-collection { padding-top: 48px; padding-bottom: 56px; }
  .g-track { grid-auto-columns: calc((100% - 24px) / 2.25); }
  .g-image-row .g-track { grid-auto-columns: calc((100% - 48px) / 3); }
  .g-hero { min-height: 580px; }
  .g-closing { gap: 30px; padding-top: 80px; }
}
@media (max-width: 680px) {
  .g-chapter-nav { gap: 8px; min-height: 62px; padding: 8px 16px; }
  .g-chapter-links { flex: 1; justify-content: space-between; gap: 8px; }
  .g-chapter-links a { gap: 4px; font-size: .65rem; }
  .g-chapter-links a span { font-size: .53rem; }
  .g-motion-toggle { width: 40px; min-height: 40px; margin-left: 6px; padding: 0; }
  .g-motion-label { display: none; }
  .g-hero, .g-chapter:first-child .g-hero { min-height: 580px; padding: 30px 22px 20px; }
  .g-hero h1, .g-hero h2 { font-size: clamp(2.7rem, 11vw, 4.8rem); }
  .g-hero-copy { padding-block: 44px; }
  .g-kicker { font-size: .58rem; letter-spacing: .13em; }
  .g-hero-copy > p:last-child { max-width: 340px; font-size: .89rem; }
  .g-index-label { font-size: .56rem; }
  .g-index-label span { display: none; }
  .g-hero-meta { gap: 6px 12px; font-size: .52rem; letter-spacing: .09em; }
  .g-hero-meta > a { width: 100%; margin-left: 0; justify-content: space-between; }
  .g-chapter-number { bottom: 100px; }
  /* Keep mobile backgrounds in a deliberate frame, rather than zooming a
     landscape film to the full height of the chapter copy. */
  .g-hero-poster, .g-background-video { height: auto; aspect-ratio: 4 / 3; object-position: center; }
  .g-collection { padding: 36px 22px 44px; }
  .g-row-heading { align-items: center; gap: 10px; }
  .g-row h2, .g-row h3 { font-size: 1.45rem; }
  .g-row-count { display: none; }
  .g-row-controls { gap: 6px; }
  .g-arrow { width: 40px; height: 44px; }
  .g-track, .g-image-row .g-track { grid-auto-columns: 86%; gap: 16px; margin-right: -22px; padding-right: 22px; }
  .g-image-row .g-track { grid-auto-columns: 74%; }
  .g-row + .g-row { margin-top: 36px; }
  .g-row-footer { font-size: .6rem; }
  .g-row-footer span:last-child { display: none; }
  .g-card-caption { padding: 16px; }
  .g-expand { opacity: 1; width: 44px; height: 44px; }
  .g-closing { grid-template-columns: 1fr; gap: 28px; padding: 54px 22px 28px; }
  .g-orb { font-size: 94px; text-align: left; width: 94px; }
  .g-disclosure { margin-top: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-page *, .gallery-page *::before, .gallery-page *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .g-animate .g-reveal { opacity: 1; transform: none; }
}
