:root {
  color-scheme: dark;
  --forest: #142c24;
  --green: #23624e;
  --ivory: #f2e9d9;
  --brass: #c6a56e;
  --muted: #b7b8a9;
  --hairline: rgb(242 233 217 / 24%);
  --caption-size: 12px;
  --touch-target: 44px;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ivory);
  background: var(--forest);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 82px; }
body { width: 100%; min-width: 320px; min-height: 100%; margin: 0; overflow-x: hidden; background: var(--forest); }
button, a, input, textarea { font: inherit; }
button, a { color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: wait; }
a { text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--brass); outline-offset: 4px; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4.4vw;
  border-bottom: 1px solid var(--hairline);
  background: rgb(20 44 36 / 96%);
  backdrop-filter: blur(12px);
}
.wordmark { display: inline-flex; align-items: center; gap: 11px; font-size: 11px; font-weight: 650; letter-spacing: .2em; }
.mark { display: block; flex-shrink: 0; width: 29px; height: 29px; border-radius: 0; object-fit: contain; }
.nav { display: flex; align-items: center; gap: clamp(10px, 2vw, 28px); font-size: 13px; }
.nav a:hover { color: var(--brass); }
.nav-cta { padding: 9px 14px; border: 1px solid var(--brass); background: transparent; }
main { margin-top: -64px; }

/* The camera drives a small, intrinsic-height text window, not page scroll. */
.gallery-story { position: relative; }
.story-rail { position: absolute; z-index: 2; top: max(92px, 15svh); left: 4.4vw; width: min(390px, 31vw); margin: 0; }
.story-chapter { display: flex; min-height: 0; flex-direction: column; align-items: flex-start; padding: 30px 0; }
.story-chapter.intro { position: relative; z-index: 1; top: auto; left: auto; width: 100%; padding: 0; }
.story-enhanced .story-rail { z-index: 2; overflow: visible; }
.story-panels { position: relative; max-height: min(50svh, 360px); overflow: auto; scrollbar-width: thin; }
.story-enhanced .story-panels { display: grid; max-height: none; overflow: hidden; }
.story-enhanced .story-chapter { grid-area: 1 / 1; align-self: stretch; position: relative; top: auto; left: auto; width: 100%; padding: 0; transform: translateY(var(--story-y, 0%)); pointer-events: none; }
.story-chapter h1, .story-chapter h2 { margin: 0; font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif; font-size: clamp(30px, 2.9vw, 44px); font-weight: 400; line-height: 1.1; letter-spacing: -.04em; }
.story-chapter h1 em, .story-chapter h2 em { color: #ddc596; font-weight: 400; }
.story-chapter h2 { font-size: clamp(29px, 2.55vw, 39px); }
.story-chapter > p:not(.eyebrow) { max-width: 38ch; color: #d2d1c3; font-size: 14px; line-height: 1.7; }
.story-actions { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 10px; }
.story-enhanced .story-actions { display: flex; }
.story-chapters { display: flex; flex-wrap: wrap; gap: 7px 12px; }
.story-chapters a { display: inline-flex; min-height: 24px; align-items: center; padding: 6px 0; border-bottom: 1px solid transparent; color: var(--muted); font-size: 10px; }
.story-chapters a[aria-current="true"] { border-color: var(--brass); color: #ddc596; }
.story-actions .story-discovery { margin-top: 0; }
.story-chapter > .studio-detail { margin: 0 0 8px; font-size: 11px; color: var(--muted); }

/* The navigation overlays the first viewport, preserving the approved gallery framing. */
.gallery-shell {
  position: relative;
  top: 0;
  align-self: start;
  isolation: isolate;
  width: 100%;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  background: radial-gradient(ellipse at 56% 52%, #2d5748 0, #1c3d31 42%, var(--forest) 83%);
}
#scene { position: absolute; z-index: -1; inset: 0; width: 100%; height: 100%; outline: none; touch-action: none; opacity: 0; transition: opacity 500ms cubic-bezier(.23, 1, .32, 1); }
.scene-ready #scene { opacity: 1; }
#scene:focus-visible { outline: 2px solid var(--brass); outline-offset: -5px; }
.scene-poster { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; transition: visibility 0s linear 500ms; }
.scene-ready .scene-poster { visibility: hidden; }
.scene-unavailable #scene { visibility: hidden; opacity: 0; transition: none; }
.scene-unavailable .scene-poster { visibility: visible; transition: none !important; }
.scene-wash { position: absolute; z-index: -1; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgb(20 44 36 / 94%), rgb(20 44 36 / 67%) 23%, transparent 46%), linear-gradient(0deg, rgb(11 28 23 / 58%), transparent 27%); }
#wall-labels { position: absolute; z-index: 2; inset: 0; pointer-events: none; opacity: 0; transition: opacity 500ms; }
.scene-ready #wall-labels { opacity: 1; }
.scene-unavailable #wall-labels { opacity: 0; }
.wall-label { position: absolute; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; transform: translate(-50%, -50%); border: 0; border-radius: 0; background: transparent; color: transparent; pointer-events: auto; touch-action: none; }
.wall-label:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.wall-title { position: absolute; left: calc(100% + 7px); top: 50%; transform: translateY(-50%); width: max-content; max-width: 210px; padding: 8px 10px; border: 1px solid var(--brass); background: var(--forest); color: var(--ivory); font-size: 11px; text-align: left; opacity: 0; visibility: hidden; pointer-events: none; }
.wall-label:focus-visible .wall-title, .wall-label[data-highlight="selected"] .wall-title { opacity: 1; visibility: visible; }
@media (hover: hover) and (pointer: fine) {
  .wall-label:hover .wall-title { opacity: 1; visibility: visible; }
}
.masthead { position: absolute; z-index: 1; top: 22px; right: 4.4vw; left: 4.4vw; }
.intro { width: 100%; }
.eyebrow, .floor-label, .illustration-caption { font-size: 9px; font-weight: 650; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow { margin: 0 0 14px; color: var(--brass); }
h1, .dialog-content h2, .index-heading h2 { font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif; font-weight: 400; }
h1 { margin: 0; font-size: clamp(30px, 2.9vw, 44px); line-height: 1.1; letter-spacing: -.04em; }
h1 em { color: #ddc596; font-weight: 400; }
.intro-note { margin: 18px 0; color: #d2d1c3; font-size: 12px; line-height: 1.7; }
.intro-cta { display: inline-flex; align-items: center; gap: 10px; margin-top: 8px; padding: 12px 16px; border: 1px solid var(--brass); background: rgb(20 44 36 / 90%); color: var(--ivory); font-size: 12px; }
.intro-cta:hover { background: var(--green); }
.scene-status { position: absolute; z-index: 2; bottom: 15%; left: calc(4.4vw + min(390px, 31vw) + 28px); max-width: min(390px, 40vw); }
#loading, #error { display: flex; align-items: center; gap: 11px; font-size: 11px; }
#loading small, #error small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.status-spinner { width: 13px; height: 13px; border: 1px solid rgb(198 165 110 / 38%); border-top-color: var(--brass); border-radius: 50%; animation: spin 1.2s linear infinite; }
.error-mark { display: grid; width: 20px; height: 20px; place-items: center; border: 1px solid #d38e78; border-radius: 50%; color: #e4aa90; }
#reload { border: 1px solid var(--hairline); background: rgb(20 44 36 / 90%); color: var(--ivory); }
#reload { margin-left: 8px; padding: 7px 10px; font-size: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

.project-index { position: absolute; z-index: 3; top: 12%; right: 4.4vw; width: clamp(232px, 23vw, 310px); padding: 22px 20px 18px; border: 1px solid rgb(198 165 110 / 40%); background: rgb(20 44 36 / 88%); box-shadow: 0 14px 50px rgb(0 0 0 / 14%); backdrop-filter: blur(12px); scroll-margin-top: 80px; }
.index-heading { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid var(--hairline); }
.index-heading .eyebrow { margin: 0; }
.index-heading h2 { margin: 0; font-size: 18px; }
.floor-group { padding-top: 18px; }
.lower-group { margin-top: 14px; padding-top: 17px; border-top: 1px solid var(--hairline); }
.floor-label { display: flex; align-items: center; gap: 9px; margin: 0 0 8px; color: var(--brass); font-size: 8px; }
.floor-rule { height: 1px; flex: 1; background: rgb(198 165 110 / 40%); }
.project-list { display: grid; gap: 1px; margin: 0; padding: 0; list-style: none; }
.project-index > .project-list { padding-top: 14px; }
.project-link { display: flex; width: 100%; min-height: 30px; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border: 0; border-bottom: 1px solid rgb(242 233 217 / 10%); background: transparent; color: #e9e3d6; text-align: left; font-size: 11px; }
.project-name { min-width: 0; overflow-wrap: anywhere; }
.project-link:hover { color: #e4c88f; }
.project-arrow { flex-shrink: 0; color: var(--brass); }
.index-footnote { margin: 14px 0 0; color: var(--muted); font: italic 10px Georgia, serif; }
.static-projects { padding-left: 20px; font-size: 12px; line-height: 1.8; }
.orbit-hint { position: absolute; right: 4.4vw; bottom: 7.4%; margin: 0; color: var(--muted); font-size: 9px; }
.orbit-hint span { color: var(--brass); }
.gallery-footer { position: absolute; right: 4.4vw; bottom: 2.6%; left: 4.4vw; display: flex; justify-content: space-between; color: rgb(242 233 217 / 57%); font-size: 8px; letter-spacing: .08em; }
#diagnostics { position: absolute; z-index: 4; bottom: 19%; left: 8vw; max-width: 40vw; padding: 10px; background: #0d1c17; color: var(--ivory); font-size: 10px; }

#project-dialog { width: min(920px, calc(100vw - 36px)); max-width: none; max-height: min(86svh, 800px); padding: 0; overflow: auto; border: 1px solid rgb(198 165 110 / 52%); background: #172f27; color: var(--ivory); box-shadow: 0 30px 100px #0008; opacity: 0; transform: translateY(12px) scale(.97); transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out), display 160ms allow-discrete, overlay 160ms allow-discrete; }
#project-dialog[open] { opacity: 1; transform: none; transition-duration: 240ms, 240ms, 240ms, 240ms; }
@starting-style { #project-dialog[open] { opacity: 0; transform: translateY(12px) scale(.97); } }
#project-dialog[data-instant] { transition: none; }
#project-dialog::backdrop { background: rgb(6 15 12 / 76%); backdrop-filter: blur(5px); opacity: 0; transition: opacity 160ms var(--ease-out), display 160ms allow-discrete, overlay 160ms allow-discrete; }
#project-dialog[open]::backdrop { opacity: 1; }
#project-dialog[open]::backdrop { transition-duration: 240ms, 240ms, 240ms; }
#project-dialog[data-instant]::backdrop { transition: none; }
#project-dialog:not([open]), #project-dialog:not([open])::backdrop { pointer-events: none; }
@starting-style { #project-dialog[open]::backdrop { opacity: 0; } }
.project-link[aria-busy="true"] { color: var(--brass); }
.dialog-topline { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 17px 24px; border-bottom: 1px solid var(--hairline); background: #172f27; }
.dialog-topline .eyebrow { margin: 0; }
.dialog-close { width: 32px; height: 32px; border: 1px solid var(--hairline); background: transparent; font-size: 22px; }
.dialog-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .92fr); gap: 36px; padding: 31px 36px 36px; }
.dialog-overview { display: contents; }
.dialog-client { color: var(--brass); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.dialog-content h2 { min-width: 0; overflow-wrap: anywhere; font-size: clamp(34px, 5vw, 52px); line-height: 1.05; }
.dialog-summary { color: #d8d5c9; font: 17px/1.5 Georgia, serif; }
.story-block h3 { color: var(--brass); font-size: 9px; letter-spacing: .15em; text-transform: uppercase; }
.story-block p, .story-block li { color: #d3d4c9; font-size: 12px; line-height: 1.7; }
.illustration-caption { color: var(--muted); font-size: 8px; }
.text-action { border: 0; border-bottom: 1px solid var(--brass); background: transparent; }
.preview-frame { position: sticky; top: 82px; align-self: start; margin: 0; padding: 10px; border: 1px solid rgb(198 165 110 / 38%); background: #10231d; }
.preview-frame img { display: block; width: 100%; height: auto; max-height: 60svh; aspect-ratio: auto; object-fit: contain; }
#project-media-controls { display: grid; gap: 8px; margin-top: 10px; }
.media-controls-label { color: var(--muted); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.media-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.media-select { min-height: 32px; padding: 6px 9px; border: 1px solid var(--hairline); background: transparent; color: var(--ivory); font-size: 12px; }
.media-select[aria-pressed="true"] { border-color: var(--brass); color: #e4c88f; }
.media-status { color: var(--muted); font-size: 10px; }
.media-open { display: inline-block; margin-top: 12px; padding-bottom: 3px; border-bottom: 1px solid var(--brass); color: var(--ivory); font-size: 11px; }
.preview-frame figcaption, .narrative-figure figcaption { color: var(--brass); font-size: var(--caption-size); font-weight: 400; letter-spacing: normal; line-height: 1.55; text-transform: none; }
.preview-frame figcaption { margin: 11px 2px 1px; }

.section-lede { max-width: 70ch; color: #d2d1c3; line-height: 1.7; }
.contact-form { display: grid; max-width: 650px; gap: 10px; margin-top: 28px; }
.contact-form label { margin-top: 10px; color: #ddc596; font-size: 13px; }
.contact-form input, .contact-form textarea { width: 100%; padding: 12px; border: 1px solid var(--hairline); background: #0d1c17; color: var(--ivory); }
.contact-form textarea { resize: vertical; }
.form-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 10px; }
.formStatus { color: var(--ivory); font-size: 13px; }

#discovery-dialog { width: min(650px, calc(100vw - 32px)); max-width: none; max-height: min(88dvh, 780px); padding: 0; overflow: hidden; border: 1px solid rgb(198 165 110 / 52%); background: #172f27; color: var(--ivory); box-shadow: 0 30px 100px #0008; opacity: 0; transform: translateY(8px); transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); }
#discovery-dialog[open] { opacity: 1; transform: none; }
@starting-style { #discovery-dialog[open] { opacity: 0; transform: translateY(8px); } }
#discovery-dialog:not([open]) { transition: none; }
#discovery-dialog[data-instant] { transition: none; }
#discovery-dialog::backdrop { background: rgb(6 15 12 / 76%); backdrop-filter: blur(5px); }
.discovery-topline { position: sticky; z-index: 1; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--hairline); background: #172f27; }
.discovery-topline .eyebrow { margin: 0; }
.discovery-close { width: 32px; height: 32px; border: 1px solid var(--hairline); background: transparent; font-size: 22px; }
.discovery-content { max-height: calc(min(88dvh, 780px) - 62px); overflow: auto; padding: 22px 26px 28px; overscroll-behavior: contain; }
.discovery-content h2 { margin: 0; font: 32px/1.1 "Iowan Old Style", "Palatino Linotype", Georgia, serif; }
.discovery-content .section-lede { margin: 12px 0; }
.discovery-content .contact-form { margin-top: 12px; }
#discovery-dialog:not([open]), #discovery-dialog:not([open])::backdrop { pointer-events: none; }

@media (max-width: 760px) {
  html { scroll-padding-top: 72px; }
  .topbar { min-height: 58px; padding: 6px 14px; }
  main { margin-top: 0; }
  .wordmark { gap: 7px; font-size: 9px; }
  .mark { width: 25px; height: 25px; }
  .nav { gap: clamp(7px, 2.2vw, 14px); font-size: clamp(9px, 2.7vw, 12px); }
  .nav-cta { padding: 7px 8px; }
  .gallery-story { position: relative; display: block; }
  .story-rail { top: 78px; left: 22px; width: min(330px, calc(100% - 44px)); }
  .story-panels { max-height: 330px; }
  .story-actions { position: relative; top: auto; right: auto; bottom: auto; left: auto; margin: 0; gap: 4px; }
  .gallery-shell { display: flow-root; position: relative; height: auto; min-height: 1250px; overflow: visible; }
  #scene, .scene-poster { top: 210px; height: 460px; }
  .scene-wash { background: linear-gradient(180deg, var(--forest) 205px, rgb(20 44 36 / 85%) 210px, rgb(20 44 36 / 65%) 320px, transparent 390px, transparent 600px, var(--forest) 675px); }
  .masthead { top: 18px; right: 20px; left: 20px; }
  .story-chapter { display: flex; min-height: 0; padding: 15px 3px; opacity: 1; transform: none; pointer-events: auto; }
  .story-chapter.intro { position: relative; z-index: 1; top: auto; left: auto; width: 100%; padding: 0; }
  .story-chapter:not(.intro) { padding-top: 14px; padding-bottom: 14px; }
  .story-chapter h1, .story-chapter h2 { font-size: clamp(28px, 7vw, 36px); }
  .story-chapter h2 { font-size: clamp(27px, 6.5vw, 34px); }
  .story-chapter > p:not(.eyebrow) { max-width: none; margin-top: 12px; }
  .story-chapter > p:not(.eyebrow) { font-size: 12px; line-height: 1.5; }
  .intro .eyebrow { margin-bottom: 12px; font-size: 8px; }
  h1 { font-size: clamp(28px, 7vw, 36px); }
  .intro-note { max-width: 360px; margin: 10px 0; font-size: 11px; }
  .intro-cta { padding: 9px 12px; }
  .project-index { position: relative; inset: auto; width: calc(100% - 32px); margin: 752px auto 40px; padding: 15px 16px 12px; }
  .index-heading { padding-bottom: 11px; }
  .project-index > .project-list { padding-top: 10px; }
  .project-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
  .project-link { min-height: 42px; padding: 8px 0; font-size: 11px; }
  .index-footnote { margin-top: 8px; }
  .scene-status { top: 614px; right: 20px; bottom: auto; left: 22px; max-width: none; }
  .orbit-hint { display: none; }
  .gallery-footer { right: 16px; bottom: 15px; left: 16px; font-size: 7px; }
  .dialog-content { grid-template-columns: 1fr; gap: 22px; padding: 23px 22px 28px; }
  .preview-frame { position: static; grid-row: 1; }
  .dialog-topline { padding: 13px 18px; }
  .discovery-content { padding: 18px 18px 22px; }
  .wall-title { max-width: 165px; font-size: 10px; }
}

/* Enhanced phone stage: one real canvas box fills the area below the measured nav. */
@media (max-width: 760px), (max-height: 600px) and (pointer: coarse) {
  .topbar { padding-top: calc(6px + env(safe-area-inset-top)); padding-bottom: 6px; padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .topbar .nav > a, .topbar .nav-cta { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding-inline: 10px; }
  .phone-gallery-ready main { margin-top: 0; }
  .phone-gallery-ready .gallery-shell {
    height: calc(100vh - var(--nav-height, 58px));
    height: calc(100dvh - var(--nav-height, 58px));
    min-height: 0;
    overflow: hidden;
    touch-action: auto;
  }
  .phone-gallery-ready #scene, .phone-gallery-ready .scene-poster { top: 0; height: 100%; touch-action: pinch-zoom !important; }
  .phone-gallery-ready .scene-wash { background: linear-gradient(90deg, rgb(20 44 36 / 82%), rgb(20 44 36 / 57%) 54%, rgb(20 44 36 / 16%)), linear-gradient(0deg, rgb(11 28 23 / 58%), transparent 34%); }
  .phone-gallery-ready .story-rail { position: absolute; top: max(18px, env(safe-area-inset-top)); right: 18px; bottom: 0; left: 18px; width: min(390px, calc(100% - 36px)); margin: 0; }
  .phone-gallery-ready .story-rail { pointer-events: none; }
  .phone-gallery-ready .story-panels { max-height: none; overflow: visible; scrollbar-width: thin; pointer-events: none; }
  .phone-gallery-ready .story-enhanced .story-panels { display: grid; max-height: none; overflow: visible; }
  .phone-gallery-ready .gallery-story:not(.story-enhanced) .story-panels { max-height: calc(100dvh - var(--nav-height, 58px) - 170px); overflow-y: auto; pointer-events: auto; touch-action: pan-y pinch-zoom; overscroll-behavior: contain; }
  .phone-gallery-ready .story-chapter[data-reading-overflow="true"] { max-height: min(53dvh, 400px); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y pinch-zoom; pointer-events: auto; }
  .phone-gallery-ready .story-chapter { display: flex; touch-action: pinch-zoom; }
  .phone-gallery-ready .gallery-story:not(.story-enhanced) .story-chapter { touch-action: pan-y pinch-zoom; }
  .phone-gallery-ready .story-enhanced .story-chapter[aria-hidden="false"] { pointer-events: auto; }
  .phone-gallery-ready .story-actions { pointer-events: auto; }
  .phone-gallery-ready .story-chapter h1, .phone-gallery-ready .story-chapter h2 { font-size: clamp(26px, 7vw, 36px); }
  .phone-gallery-ready .story-chapter > p:not(.eyebrow) { font-size: 12px; line-height: 1.5; }
  .phone-gallery-ready .story-actions { position: absolute; z-index: 4; top: auto; right: 12px; bottom: max(15px, env(safe-area-inset-bottom)); left: 12px; display: flex; align-items: flex-start; gap: 8px; margin: 0; }
  .phone-gallery-ready .story-chapters { gap: 4px; }
  .phone-gallery-ready .story-chapters a { min-height: 44px; padding: 8px 9px; font-size: 11px; }
  .phone-gallery-ready .intro-cta { min-height: 44px; padding: 10px 12px; }
  .media-select { min-height: var(--touch-target); font-size: 12px; }
  .dialog-close, .discovery-close { width: var(--touch-target); height: var(--touch-target); }
  /* 44px close control + 28px header padding + header/dialog borders. */
  .discovery-content { max-height: calc(min(88dvh, 780px) - 75px); }
  #project-dialog.has-narrative .dialog-overview .preview-frame img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: min(24svh, 200px);
    margin-inline: auto;
    object-fit: contain;
  }
  .phone-gallery-ready .project-index { display: none; }
  .phone-gallery-ready .scene-status { top: auto; right: 16px; bottom: calc(15px + env(safe-area-inset-bottom) + 170px); left: auto; max-width: min(270px, 48vw); }
  .phone-gallery-ready .gallery-footer, .phone-gallery-ready .orbit-hint { display: none; }
  #project-index-dialog { width: min(520px, calc(100vw - 24px)); max-width: none; max-height: min(88dvh, 760px); padding: 0; border: 1px solid rgb(198 165 110 / 52%); background: #172f27; color: var(--ivory); }
  #project-index-dialog::backdrop { background: rgb(6 15 12 / 78%); backdrop-filter: blur(5px); }
  .index-dialog-topline { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--hairline); background: #172f27; }
  .index-dialog-topline .eyebrow { margin: 0; }
  .index-dialog-close { width: 44px; height: 44px; border: 1px solid var(--hairline); background: transparent; font-size: 24px; }
  .index-dialog-content { max-height: calc(min(88dvh, 760px) - 74px); overflow: auto; padding: 4px 18px 18px; overscroll-behavior: contain; }
  #project-index-dialog .project-index { display: block; position: relative; inset: auto; width: 100%; margin: 0; border: 0; padding: 10px 0; box-shadow: none; backdrop-filter: none; }
  #project-index-dialog .project-list { grid-template-columns: 1fr; }
  #project-index-dialog .project-link { min-height: 48px; font-size: 13px; }
  #project-index-dialog .index-heading, #project-index-dialog .index-footnote { display: none; }
  .phone-gallery-ready .wall-label { touch-action: pinch-zoom; }
}

@media (max-height: 600px) and (pointer: coarse) {
  .phone-gallery-ready .story-rail { top: 8px; }
  .phone-gallery-ready .story-chapter[data-reading-overflow="true"] { max-height: 45dvh; }
  .phone-gallery-ready .story-actions { flex-direction: row; align-items: center; }
  .phone-gallery-ready .story-chapters a { min-height: 40px; }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .orbit-hint { display: none; }
}

@media (max-width: 390px) {
  .topbar { padding-right: 9px; padding-left: 9px; }
  .nav { gap: 8px; font-size: 10px; }
  .nav-cta { padding: 7px 8px; }
  .wordmark { gap: 5px; font-size: 8px; }
  .wordmark > span:last-child { display: none; }
  .project-index { right: 12px; left: 12px; }
  .project-link { font-size: 9px; }
  .gallery-footer span:first-child { display: none; }
  .gallery-footer { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --scene-reveal-duration: 200ms; }
  .story-enhanced .story-chapter { transform: none !important; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  #scene, #wall-labels { transition-duration: var(--scene-reveal-duration) !important; }
  .scene-poster { transition-duration: 0s !important; transition-delay: var(--scene-reveal-duration) !important; }
  #project-dialog { transform: none; transition: opacity 160ms var(--ease-out), display 160ms allow-discrete, overlay 160ms allow-discrete; }
  #project-dialog, #project-dialog::backdrop { transition-duration: 160ms !important; }
  #project-dialog[data-instant], #project-dialog[data-instant]::backdrop { transition: none !important; }
  @starting-style { #project-dialog[open] { opacity: 0; transform: none; } }
  #discovery-dialog { transform: none; }
  @starting-style { #discovery-dialog[open] { transform: none; } }
}

/* Case-study narrative is deliberately full-width beneath the overview. */
#project-dialog.has-narrative .dialog-content { display: block; padding: 28px 36px 36px; }
#project-dialog.has-narrative .dialog-overview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .92fr); gap: 32px; align-items: start; }
#project-dialog.has-narrative .preview-frame { position: static; grid-row: auto; }
#project-dialog.has-narrative .dialog-summary { max-width: 58ch; }
#project-dialog.has-narrative .dialog-topline { gap: 12px; }
#project-dialog.has-narrative .dialog-topline .eyebrow { min-width: 0; line-height: 1.5; }
#project-dialog.has-narrative .dialog-close { flex-shrink: 0; }
.dialog-narrative { max-width: 76ch; margin: 34px auto 0; }
.dialog-narrative:empty { display: none; }
.narrative-headline { margin: 0 0 12px; color: var(--brass); font: 400 clamp(23px, 3vw, 31px)/1.2 "Iowan Old Style", "Palatino Linotype", Georgia, serif; }
.dialog-narrative > p, .narrative-section > p, .narrative-section li { color: #d3d4c9; font-size: 16px; line-height: 1.75; }
.dialog-narrative > p { max-width: 68ch; }
.narrative-section { margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--hairline); }
.narrative-section h4 { margin: 0 0 10px; color: var(--brass); font: 400 23px/1.25 "Iowan Old Style", "Palatino Linotype", Georgia, serif; }
.narrative-section ul { padding-left: 22px; }
.narrative-section li + li { margin-top: 5px; }
.narrative-figure { margin: 22px 0 0; padding: 12px; border: 1px solid rgb(198 165 110 / 38%); background: #10231d; }
.narrative-figure a { display: block; }
.narrative-image-open { display: inline-block; margin-top: 10px; padding-bottom: 3px; border-bottom: 1px solid var(--brass); font-size: 12px; }
.narrative-figure img { display: block; width: 100%; max-height: 72svh; object-fit: contain; }
.narrative-figure figcaption { margin-top: 10px; }
.narrative-image-unavailable { margin: 0; padding: 24px 12px; color: var(--muted); font-size: 14px; }
@media (max-width: 760px) {
  #project-dialog.has-narrative .dialog-close { width: var(--touch-target); height: var(--touch-target); }
  #project-dialog.has-narrative .dialog-content { padding: 20px 16px 26px; }
  #project-dialog.has-narrative .dialog-overview { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .dialog-narrative { margin-top: 28px; }
  .dialog-narrative > p, .narrative-section > p, .narrative-section li { font-size: 15px; line-height: 1.7; }
  .narrative-section { margin-top: 28px; padding-top: 20px; }
  .narrative-figure { padding: 8px; }
}
