/* Every scene starts with a fully rendered still photograph. */
[data-scene] { position: relative; isolation: isolate; }
.scene-film {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; pointer-events: none;
  transition: opacity .55s ease;
}
[data-playing] .scene-film { opacity: 1; }
.slide-window { position: relative; overflow: hidden; }
.slide-window img { display: block; }
.builder-film .photo-credit { z-index: 1; }
.motion-switch {
  position: absolute; z-index: 3; right: 14px; top: 14px;
  width: 38px; height: 38px; padding: 0;
  display: grid; place-items: center; border: 1px solid #ffffffad; border-radius: 50%;
  color: white; background: #19231cc9; cursor: pointer;
}
.motion-switch[hidden] { display: none; }
.motion-switch:focus-visible { outline: 3px solid white; outline-offset: 2px; }
.motion-switch span { height: 12px; width: 10px; border: solid currentColor; border-width: 0 3px; }
.motion-switch[data-paused] span {
  width: 0; height: 0; margin-left: 2px; border: solid transparent;
  border-width: 7px 0 7px 10px; border-left-color: currentColor;
}
.clubhouse-layer { position: relative; isolation: isolate; overflow: hidden; }
.clubhouse-planes { display: none; }
html.motion-on .clubhouse-planes {
  display: block; position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  background: url('clubhouse-sky.webp') center / cover;
}
.clubhouse-planes::after {
  content: ''; position: absolute; inset: 0;
  background: url('clubhouse-silhouette.webp') center / cover;
  transform: translateY(var(--layer-travel, 0px)) scale(1.07);
}
.slide-window > a { display: block; cursor: zoom-in; }
.slide-window > a:focus-visible { outline-offset: -4px; }

.motion-on .drawing[data-cutout] img {
  translate: 0 var(--layer-travel, 0px);
  filter: drop-shadow(0 2px 1px rgb(35 53 46 / .12));
}

/* Shared full-width treatment for the community and construction films. */
.film-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  width: 100%;
  min-height: 0;
  aspect-ratio: 2 / 1;
  max-height: 82svh;
  overflow: hidden;
  background: var(--ncc-charcoal);
  color: white;
}
.film-hero .film-poster, .film-hero .scene-film {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center; z-index: -2;
}
.film-hero .scene-film { z-index: -1; }
.film-hero::after {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(0deg, rgb(26 25 29 / .77), transparent 72%),
              linear-gradient(90deg, rgb(32 30 35 / .52), transparent 74%);
}
.film-copy, .film-hero .hero-inner {
  position: relative; z-index: 1; justify-self: start;
  padding: clamp(2rem,5vw,5rem) clamp(1.25rem,5vw,5rem);
}
.film-hero h1, .film-hero h2 {
  margin: 0; color: white; font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(3.15rem,7.6vw,8rem); font-weight: 650;
  letter-spacing: -.068em; line-height: .95;
}
.film-location {
  display: flex; gap: .8rem; align-items: center; margin: 0 0 1.1rem;
  font: 600 .68rem/1.45 ui-monospace, Menlo, monospace;
  text-transform: uppercase; letter-spacing: .14em;
}
.film-location::before { content: ''; width: 2rem; height: 2px; background: var(--ncc-gold); }
.film-links { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1.35rem; margin-top: 1.7rem; }
.film-hero .film-action, .film-hero .action {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: .8rem 1.15rem; color: var(--ncc-ink); background: var(--ncc-gold);
  font: 650 .92rem/1.25 "Helvetica Neue", Arial, sans-serif; text-decoration: none;
}
.film-hero .film-action:hover, .film-hero .action:hover { background: var(--ncc-stone); }
.film-link { color: white; font: 600 .9rem/1.4 "Helvetica Neue", Arial, sans-serif; text-decoration: underline; text-underline-offset: .32em; padding: .68rem 0; }
.film-description { margin: 1.2rem 0 0; max-width: 43ch; line-height: 1.5; }
.film-hero .motion-switch { top: clamp(.8rem,2vw,2rem); right: clamp(.8rem,2vw,2rem); background: rgb(47 46 51 / .78); }
.atlas-model { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.4fr); gap: 5%; align-items: center; padding-block: clamp(2.5rem,5vw,5rem); border-bottom: 1px solid var(--rule); }
.atlas-model .hero-copy { margin: 1rem 0 0; color: var(--copy); }
.community-intro { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.35fr); gap: 6%; align-items: center; }
.community-intro + .stories { margin-top: clamp(2rem,4vw,4rem); }
.photo-story { margin: 0; }
.photo-story .photo-mat { background: var(--paper); }
.photo-story .photo-mat img { height: auto; width: 100%; aspect-ratio: 1.65; object-fit: contain; }
@media (max-width: 690px) {
  .film-hero { aspect-ratio: 1.28; max-height: none; }
  .film-hero h1, .film-hero h2 { font-size: clamp(2.7rem,10.8vw,4.75rem); }
  .film-copy, .film-hero .hero-inner { padding: 2.25rem 5% 1.45rem; }
  .film-hero .hero-inner { padding-bottom: 3.2rem; }
  .film-hero .photo-credit { bottom: .95rem; }
  .film-links, .film-hero .action { margin-top: 1rem; }
  .film-location, .film-hero .eyebrow { margin-bottom: .7rem; font-size: .61rem; }
  .film-description { font-size: .85rem; margin-top: .7rem; }
  .atlas-model, .community-intro { grid-template-columns: minmax(0,1fr); gap: 1.6rem; }
  .photo-story .photo-mat img { aspect-ratio: 1.5; }
}
@media (max-width: 380px) {
  .film-hero { aspect-ratio: 1.14; }
  .film-copy, .film-hero .hero-inner { padding-top: 1.25rem; }
  .film-hero h1, .film-hero h2 { font-size: 2.55rem; }
}

/* Content stays rendered before enhancement and whenever the reader pauses motion. */
@keyframes title-arrival {
  from { opacity: .45; translate: 0 .38em; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes photograph-arrival {
  from { clip-path: inset(3.5% 2% 8% 2%); }
  to { clip-path: inset(0); }
}
@keyframes detail-arrival {
  from { opacity: .55; translate: 0 10px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes line-arrival {
  from { scale: .25 1; }
  to { scale: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  .motion-on {
    --entrance-ease: cubic-bezier(.16,.78,.22,1);
  }
  .motion-on [data-scroll-photo] img {
    transform: translate3d(0,var(--layer-travel, 0px),0) scale(1.045);
  }
  .motion-on [data-scroll-photo] { overflow: hidden; }
  .motion-on .film-hero :is(.film-copy, .hero-inner) {
    transform: translateY(calc(var(--layer-travel, 0px) * -.38));
  }
  .motion-on h2.arriving,
  .motion-on :is(.film-copy, .hero-inner, .review-head .wrap).arriving :is(h1, h2) {
    animation: title-arrival .86s var(--entrance-ease) both;
  }
  .motion-on .film-copy.arriving .film-location::before,
  .motion-on .hero-inner.arriving .eyebrow i {
    transform-origin: left;
    animation: line-arrival .86s var(--entrance-ease) both;
  }
  .motion-on :is(.film-copy, .hero-inner, .review-head .wrap).arriving :is(.film-links, .action, .film-description, p:last-child) {
    animation: detail-arrival .78s .12s var(--entrance-ease) both;
  }
  .motion-on :is(.finish-photo, .project, .photo-story, .stories article, .photo-grid article).arriving :is(img, .clubhouse-layer),
  .motion-on :is(.map-inner img, .model-card, .plan-view, [data-scroll-photo]).arriving {
    animation: photograph-arrival .95s var(--entrance-ease) both;
    animation-delay: var(--arrival-delay, 0s);
  }
  .motion-on :is(.finish-photo, .project, .photo-story, .stories article, .photo-grid article, .directions article).arriving :is(h2, h3, figcaption, .project-meta),
  .motion-on .directions article.arriving img,
  .motion-on .decision-list article.arriving {
    animation: detail-arrival .8s var(--entrance-ease) both;
    animation-delay: var(--arrival-delay, .08s);
  }
  .motion-on :is(.gallery-buttons button, .film-hero .film-action, .film-hero .action, .plan-options button, .community-list summary span) {
    transition: transform .25s ease, background-color .25s ease, color .25s ease;
  }
  .motion-on :is(.arriving:focus-visible, .arriving:focus-within img) {
    animation: none;
  }
}
@media (min-width: 720px) {
  :is(.project-grid, .stories, .finishes-lead, .photo-grid, .directions) > :nth-child(2) { --arrival-delay: .075s; }
  :is(.project-grid, .stories, .finishes-lead, .photo-grid, .directions) > :nth-child(3) { --arrival-delay: .15s; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .motion-on :is(.film-hero .film-action, .film-hero .action, .gallery-buttons button):hover { transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  .scene-film, .motion-switch, .clubhouse-planes { display: none !important; }
}
