/*
 * Progressive cinematic enhancement for the Home page.
 * The complete document layout remains the fallback below 1024px, on
 * touch-first devices and whenever reduced motion is requested.
 */

.page-home .home-bigger-idea-plane,
.page-home .home-bigger-idea-world {
  position: relative;
}

.page-home .home-bigger-idea-motif {
  display: none;
}

@media (min-width: 64rem) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  /* The Home header begins as part of the hero and becomes the standard header
     through the same timeline that moves the hero into the services scene. */
  .home-cinematic-enabled .page-home main {
    padding-top: 0;
  }

  .home-cinematic-enabled .page-home .site-header,
  .home-cinematic-enabled .page-home .site-header.is-hidden {
    --header-shift-y: 0;
    color: var(--light);
    background: rgba(7, 35, 42, 0.1);
    border-color: rgba(236, 238, 238, 0.22);
    box-shadow: 0 0.4rem 1.8rem rgba(7, 35, 42, 0.08);
    opacity: 1;
    pointer-events: auto;
    backdrop-filter: blur(8px);
  }

  .home-cinematic-enabled .page-home .site-header .brand,
  .home-cinematic-enabled .page-home .site-header .site-nav a:not(.nav-contact) {
    color: var(--light);
  }

  .home-cinematic-enabled .page-home .site-header .site-nav a[aria-current="page"]::after {
    background: var(--mint);
  }

  .home-cinematic-enabled .page-home .site-header .nav-contact {
    color: var(--ink);
    background: var(--mint);
  }

  .home-cinematic-enabled .page-home .section-1,
  .home-cinematic-enabled .page-home .section-2,
  .home-cinematic-enabled .page-home .section-4,
  .home-cinematic-enabled .page-home .section-5,
  .home-cinematic-enabled .page-home .section-6,
  .home-cinematic-enabled .page-home .section-8 {
    perspective: 93.75rem;
    perspective-origin: 50% 46%;
  }

  /* The hero reaches the viewport edge so the navigation sits in the scene. */
  .home-cinematic-enabled .page-home .section-1 {
    z-index: 3;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    column-gap: clamp(0rem, 1vw, 1rem);
    height: 100svh;
    min-height: 100svh;
    max-height: 100svh;
    margin-top: 0;
    margin-right: 0;
    margin-left: 0;
    padding-top: max(clamp(4.5rem, 8vw, 7rem), 7.75rem);
    overflow: hidden;
    border-radius: 0 0 var(--site-radius-panel) var(--site-radius-panel);
  }

  .home-cinematic-enabled .page-home .section-1::before {
    inset: 0;
    border-radius: inherit;
    background-attachment: scroll;
    transform: translate3d(0, 0, -0.01px);
    transform-origin: center;
  }

  .home-cinematic-enabled .page-home .section-1 > .content-inner {
    padding-inline-start: clamp(1rem, 4.5vw, 4rem);
  }

  .home-cinematic-enabled .page-home .section-1 > .home-hero-logo-frame {
    padding-right: clamp(3.5rem, 5vw, 4.75rem);
    padding-left: clamp(2rem, 3vw, 3rem);
  }

  .home-cinematic-enabled .page-home .section-1 > .home-hero-logo-frame,
  .home-cinematic-enabled .page-home .section-1 > .content-inner,
  .home-cinematic-enabled .page-home .home-hero-logo-mark,
  .home-cinematic-enabled .page-home .home-hero-heading,
  .home-cinematic-enabled .page-home .section-1 .content-item > p {
    transform-style: preserve-3d;
    transform-origin: center;
  }

  .home-cinematic-enabled .page-home .home-hero-logo-mark {
    isolation: isolate;
    justify-self: center;
    width: min(122%, 40rem);
    margin-right: 0;
    margin-left: clamp(-7rem, -7vw, -4.75rem);
    top: clamp(-2.35rem, calc(0.3rem - 3vw), -1.8rem);
    will-change: transform;
  }

  .home-cinematic-enabled .page-home .home-hero-heading {
    max-width: 12ch;
  }

  .home-cinematic-enabled .page-home .home-hero-logo-mark::before,
  .home-cinematic-enabled .page-home .home-hero-logo-mark::after {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: -1;
    aspect-ratio: 1;
    border: 1px solid rgba(179, 232, 195, 0.42);
    border-radius: 22%;
    content: "";
    pointer-events: none;
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .home-cinematic-enabled .page-home .home-hero-logo-mark::before {
    width: 79%;
  }

  .home-cinematic-enabled .page-home .home-hero-logo-mark::after {
    width: 58%;
    border-color: rgba(132, 189, 182, 0.58);
  }

  /* Service cards live in independent compositions. Each composition owns its
     diamond route, so geometry and card always enter and retreat together. */
  .home-cinematic-enabled .page-home .section-2 {
    z-index: 2;
    min-height: clamp(40.5rem, calc(100svh - 6rem), 49rem);
    margin-top: clamp(-6.5rem, -7.5vw, -4.75rem);
    padding-block: clamp(1.5rem, 3vw, 2.75rem);
    overflow: visible;
  }

  .home-cinematic-enabled .page-home .home-service-world {
    position: relative;
    display: block;
    min-height: clamp(34rem, calc(100svh - 9rem), 42rem);
    perspective: 100rem;
    perspective-origin: 50% 46%;
    transform-style: preserve-3d;
    transform-origin: center;
    will-change: transform;
  }

  .home-cinematic-enabled .page-home .home-service-world > .home-scroll-route {
    display: none;
  }

  .home-cinematic-enabled .page-home .home-service-world > .content-inner,
  .home-cinematic-enabled .page-home .home-service-world > .content-inner > div {
    height: 100%;
  }

  .home-cinematic-enabled .page-home .home-service-world > .content-inner > div > div {
    position: relative;
    display: block;
    height: clamp(34rem, 68svh, 42rem);
    perspective: 100rem;
    perspective-origin: 50% 46%;
    transform-style: preserve-3d;
  }

  .home-cinematic-enabled .page-home .home-service-composition {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(91%, 72rem);
    height: min(100%, 38.5rem);
    max-height: calc(100svh - 8rem);
    backface-visibility: hidden;
    isolation: isolate;
    transform-style: preserve-3d;
    transform-origin: center;
    will-change: transform;
  }

  .home-cinematic-enabled .page-home .section-2 .home-service-composition > .content-card {
    position: relative;
    z-index: 2;
    top: auto;
    left: auto;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(17rem, 0.92fr);
    grid-template-rows: minmax(0, 1fr);
    gap: clamp(1.25rem, 2.5vw, 2.25rem);
    align-items: stretch;
    align-content: stretch;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #84bdb6;
    opacity: 1;
    backdrop-filter: none;
    backface-visibility: hidden;
    box-shadow: 0 2rem 5rem rgba(28, 57, 37, 0.2);
    transform-style: preserve-3d;
    transform-origin: center;
    will-change: transform;
  }

  .home-cinematic-enabled .page-home .section-2 .home-service-composition > .content-card[inert] > .home-service-image,
  .home-cinematic-enabled .page-home .section-2 .home-service-composition > .content-card[inert] > .content-inner {
    visibility: hidden;
  }

  .home-cinematic-enabled .page-home .home-service-motif {
    position: absolute;
    inset: clamp(-2.75rem, -3.5vw, -2rem);
    z-index: 1;
    opacity: 0.8;
    pointer-events: none;
    transform-style: preserve-3d;
    transform-origin: center;
  }

  .home-cinematic-enabled .page-home .home-service-motif-segment {
    position: absolute;
    display: block;
    background: var(--home-route-line);
    border-radius: var(--radius-pill);
  }

  .home-cinematic-enabled .page-home .home-service-motif-segment--top {
    top: 0;
    left: 3%;
    width: 68%;
    height: 1px;
  }

  .home-cinematic-enabled .page-home .home-service-motif-segment--right {
    top: 0;
    right: 0;
    width: 1px;
    height: 64%;
  }

  .home-cinematic-enabled .page-home .home-service-motif-segment--bottom {
    right: 0;
    bottom: 0;
    width: 54%;
    height: 1px;
  }

  .home-cinematic-enabled .page-home .home-service-motif-segment--left {
    bottom: 0;
    left: 3%;
    width: 1px;
    height: 38%;
  }

  .home-cinematic-enabled .page-home .home-service-anchor {
    position: absolute;
    display: block;
    width: 0.82rem;
    aspect-ratio: 1;
    background: var(--green);
    border-radius: 0.2rem;
    transform: rotate(45deg);
  }

  .home-cinematic-enabled .page-home .home-service-anchor--one {
    top: -0.4rem;
    left: 3%;
  }

  .home-cinematic-enabled .page-home .home-service-anchor--two {
    top: -0.4rem;
    left: 70%;
    background: var(--teal);
  }

  .home-cinematic-enabled .page-home .home-service-anchor--three {
    right: -0.4rem;
    top: 63%;
    background: var(--mint);
  }

  .home-cinematic-enabled .page-home .home-service-anchor--four {
    right: 53%;
    bottom: -0.4rem;
  }

  .home-cinematic-enabled .page-home .home-service-composition--website-design .home-service-motif {
    transform: rotate(180deg);
  }

  .home-cinematic-enabled .page-home .home-service-composition--website-design .home-service-motif-segment {
    background: rgba(132, 189, 182, 0.66);
  }

  .home-cinematic-enabled .page-home .home-service-composition--one-page .home-service-motif-segment--left {
    display: none;
  }

  .home-cinematic-enabled .page-home .section-2 .content-card > .home-service-image {
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
  }

  .home-cinematic-enabled .page-home .section-2 .content-card > .content-inner {
    display: grid;
    align-content: center;
    height: 100%;
    min-height: 0;
  }

  .home-cinematic-enabled .page-home .section-2 .content-card > div:not(.content-inner) {
    display: none;
  }

  .home-cinematic-enabled .page-home .section-2 .content-card > .content-inner > .content-grid {
    display: flex;
    gap: clamp(0.85rem, 1.5vw, 1.2rem);
    align-content: center;
    align-items: flex-start;
    flex-direction: column;
    height: auto;
  }

  .home-cinematic-enabled .page-home .section-2 .content-card > .content-inner > .content-grid > .content-item {
    display: flex;
    gap: clamp(0.65rem, 1vw, 0.9rem);
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
  }

  .home-cinematic-enabled .page-home .section-2 .content-card > .content-inner > .content-grid > .content-item :is(h2, p) {
    margin-block: 0;
  }

  .home-cinematic-enabled .page-home .home-service-composition--one-page .content-grid > .content-item:first-child,
  .home-cinematic-enabled .page-home .home-service-composition--website-design .content-grid > .content-item:last-child {
    order: 1 !important;
  }

  .home-cinematic-enabled .page-home .home-service-composition--one-page .content-grid > .content-item:last-child,
  .home-cinematic-enabled .page-home .home-service-composition--website-design .content-grid > .content-item:first-child {
    order: 2 !important;
  }

  .home-cinematic-enabled .page-home .section-2 .home-service-image img {
    transform: scale(1.025);
  }

  /* Story content is unchanged. Only its arrival joins the services exit. */
  .home-cinematic-enabled .page-home .section-4 {
    z-index: 3;
    margin-top: clamp(-6rem, -7vw, -4rem);
    padding-top: calc(var(--site-section) + clamp(3.5rem, 6vw, 5rem));
  }

  .home-cinematic-enabled .page-home .section-4 .home-story-copy,
  .home-cinematic-enabled .page-home .section-4 .home-story-portrait,
  .home-cinematic-enabled .page-home .section-4 .home-story-copy > *,
  .home-cinematic-enabled .page-home .section-4 .home-portrait-frame,
  .home-cinematic-enabled .page-home .section-4 .home-portrait-frame img {
    transform-style: preserve-3d;
    transform-origin: center;
  }

  .home-cinematic-enabled .page-home .section-4 .home-portrait-frame {
    will-change: transform;
  }

  .home-cinematic-enabled .page-home .section-4 .home-portrait-frame img {
    transform: scale(1.025);
  }

  /* A finite sticky stage gives each testimonial a readable foreground beat. */
  .home-cinematic-enabled .page-home .section-5 {
    --home-testimonial-stage-height: clamp(30rem, 66svh, 40rem);
    z-index: 2;
    height: clamp(174rem, 350svh, 214rem);
    min-height: 0;
    padding-block: 0;
    overflow: visible;
    transform-style: preserve-3d;
  }

  .home-cinematic-enabled .page-home .section-5 .quote-region {
    position: sticky;
    top: 0;
    display: grid;
    grid-template-rows: auto var(--home-testimonial-stage-height);
    align-content: center;
    min-height: 100svh;
    padding-top: clamp(6.4rem, 10svh, 7.6rem);
    padding-bottom: clamp(1rem, 3svh, 2rem);
    box-sizing: border-box;
    isolation: isolate;
    overflow: visible;
  }

  .home-cinematic-enabled .page-home .section-5::before {
    display: none;
  }

  .home-cinematic-enabled .page-home .home-testimonial-motif-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: visible;
    pointer-events: none;
  }

  .home-cinematic-enabled .page-home .home-testimonial-orbit,
  .home-cinematic-enabled .page-home .home-testimonial-waypoint,
  .home-cinematic-enabled .page-home .home-testimonial-route {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    pointer-events: none;
    transform-origin: center;
    will-change: transform, opacity;
  }

  .home-cinematic-enabled .page-home .home-testimonial-orbit {
    width: clamp(8.5rem, 13vw, 12.5rem);
    aspect-ratio: 1;
    border: 2px solid rgba(132, 189, 182, 0.72);
    border-radius: 50%;
  }

  .home-cinematic-enabled .page-home .home-testimonial-waypoint {
    width: clamp(1rem, 1.5vw, 1.35rem);
    aspect-ratio: 1;
    background: var(--green);
    border-radius: 0.3rem;
  }

  .home-cinematic-enabled .page-home .home-testimonial-route {
    width: clamp(13rem, 28vw, 27rem);
    height: 1px;
    background: var(--home-route-line-soft);
    transform-origin: left center;
  }

  .home-cinematic-enabled .page-home .home-testimonials-heading {
    position: relative;
    z-index: 2;
    margin-bottom: clamp(0.8rem, 2svh, 1.5rem);
  }

  .home-cinematic-enabled .page-home .section-5 .testimonial-grid {
    position: relative;
    display: block;
    width: min(100%, 68rem);
    height: var(--home-testimonial-stage-height);
    margin-inline: auto;
    z-index: 2;
    perspective: 100rem;
    perspective-origin: 50% 48%;
    transform-style: preserve-3d;
  }

  .home-cinematic-enabled .page-home .section-5 .testimonial-column {
    display: contents;
  }

  .home-cinematic-enabled .page-home .section-5 .testimonial-final-row {
    position: absolute;
    inset: 0;
    display: block;
    pointer-events: none;
    transform-style: preserve-3d;
    transform-origin: center;
  }

  .home-cinematic-enabled .page-home .section-5 .testimonial-grid .content-card {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: min(100%, 64rem);
    height: auto;
    max-height: calc(var(--home-testimonial-stage-height) - 0.5rem);
    margin: 0;
    padding: clamp(1.5rem, 2.4vw, 2.25rem);
    overflow: auto;
    justify-self: auto;
    backface-visibility: hidden;
    box-shadow: 0 2rem 5rem rgba(28, 57, 37, 0.16);
    transform-style: preserve-3d;
    transform-origin: center;
    will-change: transform, opacity;
  }

  .home-cinematic-enabled .page-home .section-5 .testimonial-grid .content-card blockquote {
    height: auto;
  }

  /* Hannah holds the stage until the CTA world is already approaching. */
  .home-cinematic-enabled .page-home .testimonial-card--hannah {
    transform-origin: center bottom;
  }

  .home-cinematic-enabled .page-home .section-6 {
    --home-bigger-header-space: 6.75rem;
    --home-bigger-idea-height: clamp(36rem, calc(100svh - var(--home-bigger-header-space)), 48rem);
    z-index: 3;
    display: grid;
    min-height: var(--home-bigger-idea-height);
    margin-top: clamp(-3rem, -3vw, -2rem);
    padding-block: 0;
    overflow: visible;
    place-items: center;
  }

  .home-cinematic-enabled .page-home .section-6::before,
  .home-cinematic-enabled .page-home .section-6::after {
    display: none;
  }

  .home-cinematic-enabled .page-home .section-6 > .content-inner,
  .home-cinematic-enabled .page-home .section-6 > .content-inner > .content-grid,
  .home-cinematic-enabled .page-home .section-6 .content-item {
    width: 100%;
    min-height: var(--home-bigger-idea-height);
  }

  .home-cinematic-enabled .page-home .section-6 > .content-inner > .content-grid,
  .home-cinematic-enabled .page-home .section-6 .content-item {
    display: grid;
    place-items: center;
  }

  .home-cinematic-enabled .page-home .section-6 > .content-inner > .content-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-cinematic-enabled .page-home .section-6 .content-item {
    grid-area: 1 / 1;
    margin-inline: 0;
  }

  .home-cinematic-enabled .page-home .section-6 .home-bigger-idea-world {
    display: grid;
    width: 100%;
    min-height: var(--home-bigger-idea-height);
    padding: 0;
    box-sizing: border-box;
    place-items: center;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    transform-origin: center;
    will-change: transform;
  }

  .home-cinematic-enabled .page-home .section-6 .home-bigger-idea-plane {
    z-index: 2;
    grid-area: 1 / 1;
    width: min(100%, 54rem);
    backface-visibility: hidden;
    transform-style: preserve-3d;
    transform-origin: center;
  }

  .home-cinematic-enabled .page-home .home-bigger-idea-motif {
    position: absolute;
    top: 50%;
    margin-top: clamp(-5.5rem, -6.5vw, -4rem);
    z-index: 1;
    display: block;
    width: clamp(8rem, 13vw, 11rem);
    aspect-ratio: 1;
    border: 2px solid var(--home-route-line-soft);
    border-radius: 25%;
    transform-origin: center;
  }

  .home-cinematic-enabled .page-home .home-bigger-idea-motif--left {
    left: clamp(1.5rem, 6vw, 5.5rem);
  }

  .home-cinematic-enabled .page-home .home-bigger-idea-motif--right {
    right: clamp(1.5rem, 6vw, 5.5rem);
  }

  .home-cinematic-enabled .page-home .section-8 {
    z-index: 4;
    margin-top: clamp(-6rem, -7vw, -4.5rem);
    padding-top: calc(var(--site-section) + clamp(2rem, 4vw, 3.5rem));
    transform-style: preserve-3d;
  }

  .home-cinematic-enabled .page-home .section-8 > .content-inner {
    transform-style: preserve-3d;
    transform-origin: center top;
  }
}

@media (min-width: 64rem) and (max-width: 81.99rem) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .home-cinematic-enabled .page-home .home-hero-heading {
    max-width: none;
    font-size: clamp(3.25rem, 5vw, 4rem);
    line-height: 0.96;
    white-space: nowrap;
  }
}

@media (min-width: 64rem) and (max-width: 74.99rem) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .home-cinematic-enabled .page-home .section-1 > .home-hero-logo-frame {
    padding-right: clamp(3.75rem, 7vw, 5rem);
    padding-left: clamp(1.75rem, 3vw, 2.5rem);
  }

  .home-cinematic-enabled .page-home .home-hero-logo-mark {
    width: min(114%, 34rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-home .home-bigger-idea-plane {
    opacity: 1;
    transform: none;
  }
}
