/* Local concept branch: the page itself demonstrates the move from drift to tempo. */
html,
body {
  overflow-x: clip;
}

@media (min-width:721px) {
  body {
    --next-section-peek: clamp(8.5rem, 14vw, 15rem);
  }

  .hero {
    min-height: 0;
    align-items: start;
    height: calc(100svh - 92px - var(--next-section-peek));
    /* Shared with .services-hero (services.css) and .work-gate
       (work-gate.css) so the headline starts at the same Y on every
       top-of-page hero, matching the journal-hero top padding too. */
    padding-top: clamp(2.5rem, 4vw, 4rem);
    padding-bottom: clamp(1.5rem, 3vh, 2.75rem);
  }

  .hero-art {
    height: min(41vw, calc(100% - 1rem));
    min-height: 0;
  }

  .hero h1 {
    font-size: clamp(3.8rem, 6vw, 6.5rem);
  }
}

.where-intro {
  padding: clamp(3rem, 5vw, 5.5rem) 0 clamp(3.25rem, 6vw, 5.5rem);
  text-align: center;
}

.where-intro h2,
.drift-tempo-title {
  margin: 0;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -.025em;
}

.where-intro h2 {
  font-size: clamp(3.2rem, 6vw, 6.5rem);
  line-height: .92;
}

.where-intro h2 span {
  color: var(--orange);
}

.story-sequence {
  height: 115vh;
}

.story-sequence-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.story-visual {
  width: 110vw;
  margin-left: -5vw;
}

.story-visual .crosswalk-image {
  --focus-width: 11.5%;
  width: 100%;
  height: 46vh;
  height: 46svh;
  aspect-ratio: auto;
  overflow: hidden;
}

.story-visual .crosswalk-image span {
  width: 11.5%;
}

.story-visual .crosswalk-image img {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  /* 85% pushed the visible crop low enough that on a wide-but-short
     browser window (a wide monitor without a maximized-height window)
     her hair and nose got cropped right at the top edge. 65% keeps a
     safety margin above her head across window shapes -- there's plenty
     of empty street/sidewalk below to give up instead. */
  object-position: center 65%;
}

.story-visual .crosswalk-image::before {
  background-image: url('public/assets/tempo-crosswalk-panorama-v2.jpg');
  background-position: center 65%;
  background-size: cover;
}

.drift-tempo {
  height: auto;
  padding: 0;
}

.drift-tempo-stage {
  --dt-gutter: clamp(3rem, 6.5vw, 5.25rem);
  min-height: 54vh;
  min-height: 54svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: clamp(3rem, 6vh, 5rem);
  padding-bottom: clamp(1.75rem, 3.5vh, 2.75rem);
}

.drift-tempo-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--dt-gutter) minmax(0, 1fr);
  align-items: baseline;
  width: min(78vw, 1000px);
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(3.2rem, 6vw, 6.5rem);
  line-height: .85;
}

.drift-tempo-title .drift-word { text-align: right; }
.drift-tempo-title .tempo-word { text-align: left; }

.drift-tempo-title b {
  font-weight: 400;
  text-align: center;
  letter-spacing: normal;
}

.drift-tempo-arrow {
  color: var(--orange);
}

@media (min-width: 721px) {
  .drift-tempo-arrow {
    font-size: .78em;
  }
}

.drift-tempo-title em {
  color: var(--orange);
}

/* Same column template (and same container width) as .drift-tempo-title
   above, so the gap between these two paragraphs lines up exactly with
   the gap between Drift and Tempo. Two full, matched-length definitions
   read left to right like a before/after -- what it is, what didn't
   change, what it produces -- rather than a quote or a tagline. */
.drift-tempo-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--dt-gutter) minmax(0, 1fr);
  align-items: start;
  width: min(90vw, 1160px);
  margin: clamp(1.5rem, 3vw, 2.5rem) auto 0;
}

.drift-tempo-copy p {
  margin: 0;
  font-size: clamp(.95rem, 1.15vw, 1.05rem);
  line-height: 1.6;
  letter-spacing: -.005em;
}

/* The mobile copy controls require each definition to live in a wrapper.
   Keep those wrappers in the original desktop columns instead of letting
   CSS Grid auto-place Tempo into the narrow arrow gutter. */
.dt-copy-block { min-width: 0; }
.dt-copy-block:first-of-type { grid-column: 1; }
.dt-copy-block:last-of-type { grid-column: 3; }

.drift-copy {
  text-align: right;
  color: rgba(13, 13, 12, .66);
  font-weight: 400;
}

.tempo-copy {
  text-align: left;
  color: var(--ink);
  font-weight: 500;
}

.dt-kicker,
.dt-copy-divider,
.dt-copy-toggle {
  display: none;
}

.dt-mobile-summary { display: none; }

.drift-tempo .process-flow {
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: clamp(1.25rem, 3.5vw, 4rem);
  margin-top: clamp(5rem, 8vh, 7rem);
  width: 100%;
  opacity: 0;
  transform: translateY(1.65rem);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(1.55rem, 2.25vw, 2.65rem);
  line-height: .9;
  text-transform: uppercase;
  /* Delayed on top of its own scroll threshold (processStart in script.js)
     so it doesn't start fading in right on Tempo's heels -- Tempo has its
     own .4s transition-delay plus up to 1.15s to animate in, so this gives
     that room to actually finish being read before the process row joins.
     The delay lives on the .process-ready rule below (not here) so it only
     slows the reveal -- scrolling back up, the process row fades out with
     no delay, ahead of Tempo and Drift. */
  transition: opacity .75s ease, transform .9s cubic-bezier(.22, 1, .36, 1);
}

.drift-tempo.process-ready .process-flow {
  opacity: 1;
  transform: translateY(0);
  transition-delay: .65s;
}

.drift-tempo .process-flow .step,
.drift-tempo .process-flow .num {
  transition: color .28s ease, opacity .28s ease;
}

.drift-tempo .process-flow .step {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: .7rem;
  white-space: normal;
  color: rgba(13, 13, 12, .28);
  text-align: center;
}

.drift-tempo .process-flow .step.is-revealed:not(.is-active) {
  color: rgba(13, 13, 12, .52);
}

.drift-tempo .process-flow .step.is-active,
.drift-tempo .process-flow .step.is-active .num {
  color: var(--orange);
}

.drift-tempo .process-flow .step-label {
  display: inline-flex;
  align-items: baseline;
  gap: .45rem;
  white-space: nowrap;
}

.drift-tempo .process-flow small {
  min-height: 1.3em;
  max-width: 19rem;
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(.76rem, .82vw, .88rem);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: -.035em;
  text-transform: none;
  text-align: center;
  opacity: 0;
  transform: translateY(.5rem);
  transition:
    opacity .4s ease,
    transform .45s cubic-bezier(.22, 1, .36, 1);
}

.drift-tempo .process-flow .step.is-revealed small {
  opacity: .42;
  transform: none;
}

.drift-tempo .process-flow .step.is-active small {
  opacity: 1;
  font-weight: 700;
}

@media (min-width:721px) {
  .services-cta {
    margin-top: clamp(1.5rem, 2.5vw, 2.5rem);
  }
}

.team .services-cta {
  display: flex;
  justify-content: flex-end;
  padding-top: .5rem;
  padding-bottom: clamp(1rem, 2vw, 1.5rem);
  color: var(--cream);
  text-decoration: none;
}

.team .services-cta-link {
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  font-weight: 700;
  white-space: nowrap;
  transition: opacity .2s ease;
}

.team .services-cta-link span {
  margin-left: .5rem;
}

.team .services-cta:hover .services-cta-link {
  opacity: .7;
}

.drift-tempo .process-flow .step.is-bouncing {
  animation: none;
}

.drift-word,
.drift-tempo-title b,
.drift-copy,
.tempo-word,
.tempo-copy {
  opacity: 0;
  transition:
    opacity .9s ease,
    transform 1.15s cubic-bezier(.22, 1, .36, 1),
    filter 1.05s cubic-bezier(.22, 1, .36, 1);
  will-change: opacity, transform, filter;
}

.drift-word {
  transform: translateX(-16vw);
  filter: blur(14px);
}

.drift-tempo-title b {
  transform: scale(.8);
}

.tempo-word {
  transform: translateX(4rem);
  filter: blur(10px);
}

/* The scroll distance between Drift revealing and Tempo revealing is short
   enough now (see .story-sequence's height) that a fast scroll can trigger
   both within the same frame, which reads as them arriving together. A
   fixed delay on Tempo's own transition guarantees it visibly starts after
   Drift regardless of how fast someone scrolls through that gap. This delay
   lives on the [data-stage="2"] rule below (the reveal target), not here,
   so it only slows Tempo's reveal -- not its fade-out on the way back up. */

/* Scrolling back to the top needs to visibly unwind in the reverse of the
   reveal order: process row first, then Tempo, then Drift last -- even on
   a fast scroll. Tempo and the process row fade out with no delay; Drift
   gets a short delay on its own fade-out so it's still the last thing on
   screen. The [data-stage] rule below zeroes this out again so Drift still
   reveals instantly on the way in. */
.drift-word,
.drift-copy {
  transition-delay: .35s;
}

.drift-copy,
.tempo-copy { transform: translateY(.8rem); }

.drift-tempo[data-stage="1"] .drift-word,
.drift-tempo[data-stage="2"] .drift-word,
.drift-tempo[data-stage="1"] .drift-copy,
.drift-tempo[data-stage="2"] .drift-copy {
  opacity: 1;
  transform: none;
  filter: blur(0);
  transition-delay: 0s;
}

.drift-tempo[data-stage="2"] .drift-tempo-title b,
.drift-tempo[data-stage="2"] .tempo-word,
.drift-tempo[data-stage="2"] .tempo-copy {
  opacity: 1;
  transform: none;
  filter: blur(0);
  transition-delay: .4s;
}

@media (min-width:721px) and (max-height:850px) {
  .story-visual .crosswalk-image {
    height: 38vh;
    height: 38svh;
  }

  .drift-tempo-stage {
    min-height: 62vh;
    min-height: 62svh;
    padding-top: 2rem;
  }

  .drift-tempo .process-flow {
    margin-top: 3rem;
  }
}

@media (max-width:720px) {
  .where-intro {
    padding: 2.5rem 0 2.5rem;
  }

  .where-intro h2 {
    font-size: clamp(2.6rem, 13vw, 4rem);
  }

  .story-visual {
    width: 110vw;
    margin-left: -5vw;
  }

  .story-visual .crosswalk-image {
    --focus-width: 13%;
    height: 38vh;
    height: 38svh;
    aspect-ratio: auto;
  }

  .story-visual .crosswalk-image span { width: 13%; }

  .story-sequence {
    height: 120vh;
  }

  .drift-tempo-stage {
    --dt-gutter: 1.2rem;
    min-height: 62svh;
    padding: 1.35rem 0 1.5rem;
  }

  .drift-tempo-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2rem minmax(0, 1fr);
    width: 100%;
    font-size: clamp(3rem, 14.5vw, 4.35rem);
    line-height: .84;
  }

  .drift-tempo-arrow { font-size: .55em; }

  .drift-tempo-copy {
    grid-template-columns: 1fr;
    width: 100%;
    margin-top: 1.1rem;
    border-top: 1px solid var(--line);
  }

  .dt-copy-block,
  .dt-copy-block:first-of-type,
  .dt-copy-block:last-of-type {
    grid-column: 1;
    padding: .9rem 0;
    border-bottom: 1px solid var(--line);
  }

  .drift-copy,
  .tempo-copy,
  .dt-kicker,
  .dt-copy-divider,
  .dt-copy-toggle {
    display: none;
  }

  .dt-mobile-summary {
    display: block;
    grid-column: 1;
    margin: 0;
    max-width: 34rem;
    font-size: .88rem;
    line-height: 1.38;
    letter-spacing: -.025em;
    opacity: 0;
    transform: translateY(.55rem);
    transition: opacity .7s ease, transform .85s cubic-bezier(.22, 1, .36, 1);
  }

  .drift-summary { color: rgba(13, 13, 12, .62); }
  .tempo-summary { color: var(--ink); font-weight: 600; }

  .drift-tempo[data-stage="1"] .drift-summary,
  .drift-tempo[data-stage="2"] .drift-summary,
  .drift-tempo[data-stage="2"] .tempo-summary {
    opacity: 1;
    transform: none;
  }

  .drift-tempo[data-stage="2"] .tempo-summary {
    transition-delay: .4s;
  }

  .drift-tempo .process-flow {
    width: 100%;
    margin-top: 1.1rem;
    gap: 0;
    border-top: 1px solid var(--line);
    font-size: clamp(1.3rem, 5.8vw, 1.75rem);
    line-height: 1;
  }

  .drift-tempo .process-flow .step {
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
    align-items: center;
    width: 100%;
    gap: .75rem;
    padding: .72rem 0;
    border-bottom: 1px solid var(--line);
    text-align: left;
  }

  .drift-tempo .process-flow .step-label {
    gap: .35rem;
    white-space: nowrap;
  }

  .drift-tempo .process-flow .num {
    width: 1.4rem;
    font-family: 'DM Sans', sans-serif;
    font-size: .42em;
    letter-spacing: .02em;
  }

  .drift-tempo .process-flow small {
    min-height: 0;
    max-width: none;
    font-size: .68rem;
    line-height: 1.25;
    text-align: left;
  }

  .drift-tempo .process-flow .step.is-revealed:not(.is-active) {
    color: rgba(13, 13, 12, .62);
  }

  .drift-tempo .process-flow .step.is-revealed small {
    opacity: .72;
  }

  .team .services-cta {
    margin-top: 1.5rem;
    padding-top: .5rem;
    padding-bottom: 1.5rem;
  }

}

@media (max-width:720px) and (max-height:720px) {
  .drift-tempo-stage {
    padding: .8rem 0 .9rem;
  }

  .drift-tempo-title {
    font-size: clamp(2.65rem, 13vw, 3.35rem);
  }

  .drift-tempo-copy {
    margin-top: .7rem;
  }

  .dt-copy-block {
    padding: .55rem 0;
  }

  .dt-mobile-summary {
    font-size: .8rem;
    line-height: 1.28;
  }

  .drift-tempo .process-flow {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    margin-top: .7rem;
    font-size: clamp(1.1rem, 5vw, 1.4rem);
  }

  .drift-tempo .process-flow .step {
    grid-template-columns: 1fr;
    align-content: start;
    gap: .25rem;
    padding: .55rem .45rem .55rem 0;
  }

  .drift-tempo .process-flow .step:nth-child(even) {
    padding-left: .65rem;
    border-left: 1px solid var(--line);
  }

  .drift-tempo .process-flow small {
    font-size: .61rem;
  }
}

@media (prefers-reduced-motion:reduce) {
  .drift-word,
  .drift-tempo-title b,
  .drift-copy,
  .tempo-word,
  .tempo-copy {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Mobile: drop the stacked hairlines in Drift / Tempo. Spacing does the separating. */
@media (max-width: 720px) {
  .drift-tempo-copy,
  .drift-tempo .process-flow { border-top: 0; }
  .dt-copy-block,
  .dt-copy-block:first-of-type,
  .dt-copy-block:last-of-type { border-bottom: 0; }
  .drift-tempo .process-flow .step,
  .drift-tempo .process-flow .step:nth-child(even) { border-bottom: 0; border-left: 0; }
}

/* Mobile: each summary names and defines its concept, in parallel form. */
@media (max-width: 720px) {
  .drift-tempo .dt-mobile-summary { font-size: .95rem; line-height: 1.4; }
  .drift-tempo .dt-mobile-summary .dt-label {
    display: block;
    margin-bottom: .3rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ink);
  }
  .drift-tempo .tempo-summary .dt-label { color: var(--orange-text, #b8360f); }
  .drift-tempo .dt-copy-block { padding: .9rem 0; }
}

/* Mobile: the four steps become a swipeable row of cards, title with its
   description underneath. The next card peeks in to show there is more. */
@media (max-width: 720px) {
  .drift-tempo .process-flow {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: .75rem;
    width: auto;
    margin: 1.25rem -4vw 0;
    padding: .25rem 4vw .5rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 4vw;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    font-size: 1rem;
  }
  .drift-tempo .process-flow::-webkit-scrollbar { display: none; }

  .drift-tempo .process-flow .step,
  .drift-tempo .process-flow .step:nth-child(even) {
    flex: 0 0 74%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: .6rem;
    min-height: 0;
    padding: 1.15rem 1.1rem 1.3rem;
    background: rgba(13, 13, 12, .045);
    scroll-snap-align: start;
    white-space: normal;
    text-align: left;
  }

  .drift-tempo .process-flow .step-label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
    padding: 0;
    font-size: clamp(2.2rem, 11vw, 2.8rem);
    line-height: .95;
  }

  .drift-tempo .process-flow .num {
    font-family: 'DM Sans', sans-serif;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .16em;
    color: var(--orange-text, #b8360f);
  }

  .drift-tempo .process-flow small {
    display: block;
    font-size: 1rem;
    line-height: 1.35;
    letter-spacing: -.01em;
    color: var(--ink);
  }
}
