/* Stable contrast over moving footage. Media sizing and playback stay independent. */
body { line-height: 1.65; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; text-wrap: balance; }
p { text-wrap: pretty; }
.site-header, .site-header.is-compact { background: var(--panel-control-fill); backdrop-filter: none; -webkit-backdrop-filter: none; }
.primary-nav a { color: #d8e6f4; font-size: .9375rem; }
.glass-panel { backdrop-filter: none; -webkit-backdrop-filter: none; }
.hero-details { padding: 14px 18px; border: 1px solid var(--glass-stroke); border-radius: 8px; background: var(--panel-fill); }
.hero-details .eyebrow, .hero-caption, .hero-caption span:last-child { color: #d8e6f4; font-size: .75rem; letter-spacing: .04em; }
.hero-caption { border: 0; background: transparent; padding: 0; }
.eyebrow { color: #c4d4e8; font-size: .75rem; letter-spacing: .09em; line-height: 1.6; }
.eyebrow-index { color: #c4d4e8; font-size: .6875rem; }
.story-copy, .feature-copy, .close-content, .wireframe-content {
  padding: clamp(22px, 3vw, 36px); border: 1px solid var(--glass-stroke); border-radius: 8px; background: var(--panel-fill);
}
.story-copy :is(h1, h2), .feature-copy h2, .close-content h2, .wireframe-content h1 {
  font-weight: 600; letter-spacing: -.045em; line-height: 1.12; overflow-wrap: anywhere;
}
h1 em, h2 em { font-weight: 500; }
.story-copy :is(h1, h2) { font-size: clamp(2rem, 3.6vw, 3.5rem); }
.story-copy > p:not(.eyebrow), .feature-copy > p:not(.eyebrow), .close-content > p:not(.eyebrow), .wireframe-detail p,
.delivery-process li span, .delivery-process > p:last-child, .home-service-list a > span { color: #d3e0ef; font-size: 1rem; line-height: 1.7; }
.wireframe-lead { max-width: 65ch; font-size: 1.125rem; line-height: 1.7; }
.wireframe-content h1 { font-size: clamp(2.4rem, 5vw, 4.75rem); }
.wireframe-details { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.wireframe-detail { padding: 20px; background: var(--panel-card-fill); }
.wireframe-detail h2, .home-service-list strong { font-size: 1.0625rem; line-height: 1.4; letter-spacing: -.02em; }
/* Fill a centered desktop container on informational pages. */
@media (min-width: 1051px) {
  body:is([data-page="projects"], [data-page="services"], [data-page="technologies"], [data-page="about"], [data-page="contact"]) .wireframe-main { padding-inline: clamp(32px, 5vw, 80px); }
  body:is([data-page="projects"], [data-page="services"], [data-page="technologies"], [data-page="about"], [data-page="contact"]) .wireframe-content { width: 100%; max-width: var(--content-width); min-width: 0; margin-inline: auto; }
  body[data-page="about"] .wireframe-details { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body[data-page="contact"] .wireframe-detail p { max-width: 65ch; }
  body[data-page="contact"] [data-contact-builder] .tx-checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body[data-page="contact"] [data-contact-builder] .tx-checks > label { min-width: 0; }
}
@media (min-width: 1360px) {
  body:is([data-page="projects"], [data-page="services"], [data-page="technologies"]) .wireframe-details { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.detail-number { font-size: .75rem; }
.delivery-process strong { font-size: 1rem; }
.enquiry-status { font-size: 1rem; background: var(--panel-card-fill); }
.home-service-list { gap: 18px; }
.home-service-list a { padding: 20px; background: var(--panel-card-fill); }
.home-service-list a:hover, .home-service-list a:focus-visible { background: var(--panel-control-fill); }
.text-link { font-size: 1rem; text-decoration: underline; text-underline-offset: 5px; }
.cta-link { background: var(--panel-card-fill); font-size: 1rem; }
.scene-feature { height: auto; min-height: 800px; padding: 100px clamp(30px, 10.4vw, 168px) 48px; }
.feature-layout { position: relative; inset: auto; }
.feature-copy { flex: 1 1 auto; min-width: 0; }
.feature-copy h2 { font-size: clamp(2.4rem, 4.5vw, 4.6rem); }
.feature-gallery-block { position: relative; inset: auto; margin: 48px 0 0; }
.scene-close { height: auto; min-height: 620px; padding: 80px clamp(30px, 10.4vw, 168px); }
.close-content, .close-content.reveal, .close-content.reveal.is-visible { position: relative; inset: auto; width: min(100%, 650px); transform: none; }
.close-content h2 { font-size: clamp(2.6rem, 5vw, 5rem); }
.closing-stamp { display: none; } /* Decorative seal yields space to readable enquiry copy. */
.gallery-heading { position: relative; align-items: center; min-height: 80px; padding: 14px 112px 14px 16px; border-radius: 6px; background: var(--panel-fill); }
.gallery-heading h2, .interior-gallery .gallery-heading h2, .compact-heading h2 { margin-top: 5px; font-size: clamp(1.2rem, 2vw, 1.7rem); line-height: 1.35; letter-spacing: -.03em; }
.gallery-heading .eyebrow { font-size: .6875rem; }
.gallery-note { color: #c4d4e8; font-size: .8125rem; margin: 0; }
.gallery-controls, .interior-gallery .gallery-controls { top: 20px; right: 12px; }
.gallery-controls button { width: 40px; height: 44px; background: var(--panel-card-fill); }
.video-card, .interior-gallery .video-card { height: 190px; }
.image-card, .interior-gallery .image-card { height: 180px; }
.media-card .media-visual { bottom: 76px; }
.card-caption, .image-card .card-caption { inset: auto 0 0; min-height: 76px; padding: 10px 14px; background: var(--panel-fill); text-shadow: none; }
.card-caption strong, .image-card .card-caption strong { font-size: .875rem; font-weight: 600; line-height: 1.4; }
.card-caption span { display: block; margin-top: 3px; color: #c4d4e8; font-size: .75rem; line-height: 1.45; }
.card-number, .card-play, .image-card .image-expand { color: white; background: var(--panel-fill); }
.card-number { padding: 2px 5px; border-radius: 3px; }
.scene-index { background: var(--panel-fill); padding: 3px 7px; border-radius: 3px; color: #c4d4e8; }
.background-motion { font-size: .8125rem; background: var(--panel-fill); }
.site-footer { font-size: .9375rem; color: #c4d4e8; }
.footer-bottom { font-size: .8125rem; }
.g-chapter-nav { background: var(--panel-control-fill); backdrop-filter: none; }
.g-hero-copy { width: min(100%, 800px); padding: clamp(22px, 3vw, 36px); margin-block: 30px; border: 1px solid var(--g-line); border-radius: 8px; background: var(--panel-fill); }
.g-hero h1, .g-hero h2 { font-weight: 600; letter-spacing: -.045em; font-size: clamp(2.75rem, 5.8vw, 6rem); line-height: 1.12; }
.g-hero-copy > p:last-child { max-width: 62ch; font-size: 1.0625rem; line-height: 1.7; margin-top: 24px; }
.g-kicker, .g-row-label { font-size: .75rem; letter-spacing: .09em; }
.g-index-label, .g-hero-meta { width: fit-content; max-width: 100%; padding: 10px 14px; background: var(--panel-control-fill); border-radius: 4px; font-size: .75rem; letter-spacing: .06em; }
.g-index-label span, .g-hero-meta span { font-size: .6875rem; }
.g-hero-meta { width: 100%; }
.g-card-caption strong { font-weight: 600; }
.g-card-meta, .g-image-row .g-card-meta { font-size: .6875rem; letter-spacing: .06em; }
.g-row-footer, .g-disclosure { font-size: .875rem; color: #bdcedc; line-height: 1.7; }
.g-play, .g-expand { background: var(--panel-control-fill); backdrop-filter: none; }
.g-viewer-bottom h2 { font-weight: 600; letter-spacing: -.025em; }
.g-viewer-description { max-width: 65ch; font-size: 1rem; line-height: 1.65; }
.g-viewer-credit { font-size: .8125rem; }
.g-viewer-count, .g-viewer-help, .g-viewer-kind { font-size: .75rem; }
@media (max-width: 1050px) {
  .primary-nav { background: var(--panel-control-fill); }
  .hero-details { padding: 10px 14px; }
  .hero-details .eyebrow { flex-wrap: wrap; }
  .hero-details .eyebrow-index { display: none; }
  .hero-caption .caption-rule { display: none; }
  .hero-caption span:last-child { flex-basis: 100%; }
  .gallery-controls, .interior-gallery .gallery-controls { top: 20px; right: 12px; }
  .feature-mark { display: none; }
  .feature-copy { max-width: 680px; }
  .g-chapter-links a { font-size: .8125rem; }
}
@media (max-width: 760px) {
  .story-copy, .feature-copy, .close-content, .wireframe-content { padding: 20px; }
  .story-copy :is(h1, h2) { font-size: clamp(1.85rem, 7.5vw, 3rem); }
  .wireframe-main { padding: calc(var(--header-height) + 55px) 20px 60px; }
  .wireframe-details { grid-template-columns: 1fr; gap: 16px; }
  .wireframe-detail { padding: 16px; }
  .home-service-list { grid-template-columns: 1fr; }
  .scene-feature { padding: 70px 24px 48px; min-height: 0; }
  .feature-layout { margin-top: 0; }
  .scene-close { min-height: 0; padding: 70px 24px; }
  .scene-story .image-gallery-wrap { margin-top: 38px; }
  .gallery-heading, .gallery-block .gallery-heading, .image-gallery-wrap .gallery-heading, .interior-gallery .gallery-heading { padding: 14px 108px 14px 14px; }
  .hero-gallery-block .gallery-controls, .feature-gallery-block .gallery-controls { right: 12px; }
  .gallery-heading .eyebrow { letter-spacing: .04em; }
  .gallery-heading h2 { overflow-wrap: anywhere; }
  .g-hero-copy { margin-block: 24px; padding: 22px; }
  .g-hero-copy > p:last-child { font-size: 1rem; }
  .g-hero, .g-chapter:first-child .g-hero { min-height: 0; }
  .g-hero-meta { font-size: .75rem; }
  .g-hero-meta > a { font-size: .875rem; }
  .g-viewer-description { font-size: .9375rem; }
  .g-viewer-credit { font-size: .75rem; }
  .g-viewer-help { font-size: .6875rem; }
}
@media (max-width: 360px) {
  .hero-details { gap: 8px; padding: 10px; grid-template-columns: minmax(0, 1fr) 40px; }
  .hero-details .round-link { width: 40px; height: 40px; }
  .hero-details .hero-caption { gap: 4px; }
  .hero-details .hero-caption span:last-child { font-size: .6875rem; }
  .g-chapter-nav { padding-inline: 10px; }
  .g-chapter-links a { font-size: .75rem; }
  .g-chapter-links a span { display: none; }
}

/* Small supporting labels receive the same stable contrast as the main copy. */
.art-caption { color: #d3e0ef; background: var(--panel-fill); padding: 8px 10px; width: fit-content; max-width: 100%; border-radius: 4px; font-size: .8125rem; line-height: 1.6; }
.hero-aside { color: #c4d4e8; background: var(--panel-fill); padding: 10px; border-radius: 4px; font-size: .6875rem; }
@media (max-width: 1050px) { .hero-aside { display: none; } }

/* Shared panels: the same tint and contrast treatment on every page. */
:is(.hero-details, .story-copy, .feature-copy, .close-content, .wireframe-content,
    .gallery-heading, .card-caption, .g-card-caption, .g-hero-copy, .g-index-label, .g-hero-meta, .art-caption) {
  background: var(--panel-fill);
  color: var(--panel-text);
}
:is(.wireframe-detail, .enquiry-status) {
  background: var(--panel-card-fill);
  color: var(--panel-text);
}
/* Standalone service cards need the text-panel tint; nested cards use 38%. */
.home-service-list a { background: var(--panel-fill); color: var(--panel-text); }
.home-service-list strong span { color: var(--panel-accent); }
.hero-aside { color: var(--panel-text); }
:is(.hero-details, .story-copy, .feature-copy, .close-content, .wireframe-content,
    .gallery-heading, .card-caption, .g-card-caption, .g-hero-copy, .g-index-label, .g-hero-meta,
    .home-service-list, .site-header, .g-chapter-nav) :is(p, .eyebrow, .eyebrow-index,
    .wireframe-lead, .gallery-note, .detail-number, .g-kicker, .g-card-meta, .g-nav-label,
    .g-chapter-links a, .g-chapter-links a span, .g-index-label span, .g-hero-meta span,
    .delivery-process li span, .home-service-list a > span, .card-caption span) {
  color: var(--panel-text);
}
:is(.hero-caption, .hero-caption span:last-child, .primary-nav a, .brand-name b) { color: var(--panel-text); }
:is(.story-copy, .feature-copy, .close-content, .wireframe-content, .gallery-heading,
    .g-hero-copy) :is(h1 em, h2 em, h1 span, .text-link span, .cta-link span, .home-service-list strong span) {
  color: var(--panel-accent);
}
.media-card, .g-card { background: transparent; }
:is(.gallery-controls button, .card-number, .card-play, .image-card .image-expand,
    .scene-index, .background-motion, .g-play, .g-expand) { background: var(--panel-control-fill); }
:is(.cta-link, .home-service-list a:hover, .home-service-list a:focus-visible) { background: var(--panel-control-fill); }
.gallery-heading > div { flex: 1; min-width: 0; }
.gallery-heading .gallery-note { flex: 0 1 22ch; max-width: 22ch; }
.gallery-heading, .interior-gallery .gallery-heading { padding-right: 116px; gap: 16px; }

/* The first film collection belongs in document flow below the protected intro. */
.intro-films { position: relative; padding: 24px clamp(30px, 10.4vw, 168px) 28px; }
body[data-page="home"] .intro-films .hero-gallery-block {
  position: relative; inset: auto; margin: 0; width: 100%; max-width: var(--content-width);
}
@media (max-width: 1050px) {
  body[data-page="home"] .scene-hero { padding-bottom: 0; }
  .intro-films { padding: 24px 0 28px 24px; }
  .intro-films .gallery-heading { margin-right: 24px; }
  body[data-page="home"] .intro-films .gallery-controls { right: 36px; }
}

/* Continue the centered desktop layout on the remaining pages. */
@media (min-width: 1051px) {
  body:is([data-page="home"], [data-page="about"], [data-page="contact"], [data-page="gallery"]) .tx-deck,
  body[data-page="gallery"] .g-collection {
    max-width: calc(var(--content-width) + 160px);
    padding-inline: clamp(32px, 5vw, 80px);
  }
  body[data-page="home"] :is(.intro-films, .scene-story, .scene-feature, .scene-close),
  body[data-page="gallery"] :is(.g-hero, .g-closing) {
    padding-inline: max(clamp(32px, 5vw, 80px), calc((100% - var(--content-width)) / 2));
  }
  body[data-page="home"] :is(.story-layout, .feature-layout) {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
    gap: clamp(32px, 4vw, 64px);
  }
  body[data-page="home"] :is(.story-copy, .feature-copy) { width: 100%; max-width: none; }
  body[data-page="home"] .story-art { width: min(100%, 440px); }
  body[data-page="home"] .art-frame { height: auto; aspect-ratio: 16 / 10; }
  body[data-page="home"] .feature-mark { width: min(100%, 400px); justify-self: center; }
  body[data-page="home"] .scene-close .close-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px clamp(32px, 4vw, 64px);
    width: 100%;
  }
  body[data-page="home"] .close-content > .eyebrow { grid-column: 1 / -1; }
  body[data-page="home"] .close-content h2 { grid-row: 2 / span 2; margin: 0; }
  body[data-page="home"] .close-content > p:not(.eyebrow) { max-width: 60ch; }
  body[data-page="home"] .close-content .cta-link { justify-self: start; align-self: start; margin-top: 0; }

  body[data-page="about"] #capability-map {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    grid-template-areas: "heading heading" "controls controls" "map detail" "count detail" "connections connections";
    gap: 18px 32px;
    align-items: start;
  }
  body[data-page="about"] #capability-map > .tx-head { grid-area: heading; margin-bottom: 0; }
  body[data-page="about"] #capability-map > .tx-controls { grid-area: controls; margin-block: 0; }
  body[data-page="about"] #capability-map > .tx-universe { grid-area: map; min-width: 0; }
  body[data-page="about"] #capability-map > [data-topic-count] { grid-area: count; margin: 0; }
  body[data-page="about"] #capability-map > .tx-topic-detail { grid-area: detail; min-width: 0; margin-top: 0; }
  body[data-page="about"] #capability-map > details { grid-area: connections; }

  body[data-page="gallery"] #gallery-tools {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    gap: 16px 40px;
    align-items: center;
  }
  body[data-page="gallery"] #gallery-tools > .tx-head { grid-row: 1 / span 2; margin: 0; }
  body[data-page="gallery"] #gallery-tools > :is(.tx-controls, .tx-note) { grid-column: 2; margin: 0; }
  body[data-page="gallery"] .g-hero-copy {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: center;
    gap: 20px clamp(32px, 4vw, 64px);
    width: 100%;
    max-width: none;
  }
  body[data-page="gallery"] .g-hero-copy > .g-kicker { grid-column: 1 / -1; margin-bottom: 0; }
  body[data-page="gallery"] .g-hero-copy > p:last-child { margin-top: 0; }
}

/* Let tablet copy use its own row instead of squeezing beside the artwork. */
@media (min-width: 761px) and (max-width: 1050px) {
  body[data-page="home"] .story-layout { grid-template-columns: 1fr; gap: 28px; }
  body[data-page="home"] .story-copy { width: 100%; max-width: none; }
  body[data-page="home"] .story-art { width: min(100%, 440px); }
}
body[data-page="home"] :is(.story-copy, .feature-copy, .close-content) > .eyebrow { flex-wrap: wrap; }
body[data-page="contact"] [data-contact-builder] > fieldset:nth-of-type(2) { display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* Homepage rhythm follows content; background films remain absolute layers.
   Keep the established hero/player and gallery dimensions independent. */
body[data-page="home"] :is(.scene-story, .scene-feature, .scene-close) {
  height: auto;
  min-height: 0;
  padding-block: clamp(40px, 4.5vw, 64px) 32px;
}
body[data-page="home"] :is(.story-layout, .feature-layout) { margin-top: 0; }
body[data-page="home"] .tx-home { padding-block: clamp(40px, 4.5vw, 64px); }
@media (max-width: 760px) {
  body[data-page="home"] :is(.scene-story, .scene-feature, .scene-close),
  body[data-page="home"] .tx-home { padding-block: 36px; }
}
