/* AT&A Motion 1.0.0: movement only. Nothing here changes a colour, a font or a layout. */
:root { --atm-ease: var(--ease, cubic-bezier(0.19, 1, 0.22, 1)); --atm-dark: var(--onyx-sunken, #060606); --atm-gold: var(--gold, #c9a961); }

/* ---------- the pass between pages ----------
   Leaving: the theme's dark panel rises from the bottom. The monogram now sits on it.
   Arriving: the next page opens under the same panel, which carries on upward and off the top. */
.wipe { background: var(--atm-dark) var(--atm-mark) center / clamp(64px, 7vw, 104px) auto no-repeat; }
.wipe::after { content: ""; position: absolute; left: 50%; top: calc(50% + clamp(40px, 4.6vw, 64px)); width: clamp(90px, 11vw, 160px); height: 2px; background: var(--atm-gold); transform: translateX(-50%) scaleX(0); transition: transform 0.5s var(--atm-ease) 0.12s; }
body.is-leaving .wipe::after { transform: translateX(-50%) scaleX(1); }

html.atm-pass body::before {
  content: ""; position: fixed; inset: 0; z-index: 240; pointer-events: none;
  background: var(--atm-dark) var(--atm-mark) center / clamp(64px, 7vw, 104px) auto no-repeat;
  border-bottom: 2px solid var(--atm-gold);
  animation: atmLift 0.95s var(--atm-ease) 0.1s forwards;
}
html.atm-pass .curtain { display: none; }
@keyframes atmLift { 0% { transform: none; } 100% { transform: translateY(-101%); } }

/* the page itself settles as the panel lifts */
html.atm-pass main { animation: atmSettle 1.2s var(--atm-ease) 0.15s both; }
@keyframes atmSettle { from { opacity: 0.35; transform: translateY(28px); } to { opacity: 1; transform: none; } }

/* openings wait for the panel, so the headline rises into view rather than behind it */
@media (prefers-reduced-motion: no-preference) {
  html.atm-pass .subhero .display .line > span { animation-delay: 0.32s; }
  html.atm-pass .subhero .display .line:nth-child(2) > span { animation-delay: 0.42s; }
  html.atm-pass .subhero .display .line:nth-child(3) > span { animation-delay: 0.52s; }
  html.atm-pass .subhero__copy > .label, html.atm-pass .subhero__copy > .lead, html.atm-pass .subhero__copy > .hero__actions { animation-delay: 0.8s; }
  html.atm-pass.seen .hero .display .line > span { animation-delay: 0.5s; }
  html.atm-pass.seen .hero__copy > .label, html.atm-pass.seen .hero__copy > .lead, html.atm-pass.seen .hero__actions, html.atm-pass.seen .hero__cue { animation-delay: 0.95s; }

  /* ---------- the opening photograph on inner pages: a slow reveal, then a long settle ---------- */
  .subhero__photo { overflow: hidden; }
  .subhero__photo img { animation: atmOpen 2.4s var(--atm-ease) 0.25s both; }
  html:not(.seen) .subhero__photo img { animation-delay: 1.45s; }
  html.atm-pass .subhero__photo img { animation-delay: 0.25s; }
  @keyframes atmOpen { from { clip-path: inset(0 0 0 100%); scale: 1.14; } 55% { clip-path: inset(0); } to { clip-path: inset(0); scale: 1; } }

  /* ---------- section rules draw themselves in ---------- */
  html.atm .label::before { transform: scaleX(0); transform-origin: left center; transition: transform 1s var(--atm-ease) 0.15s; }
  html.atm .label.atm-in::before { transform: none; }

  /* ---------- buttons: a light passes across, a press is felt, and the button leans to the pointer ---------- */
  .btn { transition: color 0.45s var(--atm-ease), border-color 0.45s var(--atm-ease), translate 0.5s var(--atm-ease), scale 0.25s var(--atm-ease); }
  .btn--gold::after, .btn--ink::after { content: ""; position: absolute; inset: -1px; z-index: 1; pointer-events: none; background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.42) 50%, transparent 62%); transform: translateX(-130%); }
  .btn--gold:hover::after, .btn--gold:focus-visible::after, .btn--ink:hover::after, .btn--ink:focus-visible::after { transform: translateX(130%); transition: transform 1s var(--atm-ease); }
  .btn:active { scale: 0.97; }
  .nav a:not(.btn) { transition: color 0.3s, translate 0.4s var(--atm-ease); }
  .nav a:not(.btn):active { translate: 0 1px; }

  /* the case-study rows and keynote cards answer the pointer */
  .way__n, .kn__photo { transition: translate 0.6s var(--atm-ease); }
  @media (hover: hover) { .kn:hover .kn__photo { translate: 0 -6px; } }
}

/* ---------- photographs drift against the scroll, as if shot on a slow dolly ---------- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .section .photo:not(.watch__poster .photo) > img, .kn__photo > img, .about__photo > img, .idea__photo > img {
      scale: 1.1; animation: atmDrift linear both; animation-timeline: view(); animation-range: cover 0% cover 100%;
    }
    @keyframes atmDrift { from { translate: 0 -4%; } to { translate: 0 4%; } }
    /* the opening photograph sinks gently as the page moves on */
    .subhero__photo img { animation: atmOpen 2.4s var(--atm-ease) 0.25s both, atmSink linear both; animation-timeline: auto, scroll(root); animation-range: normal, 0 90vh; }
    html:not(.seen) .subhero__photo img { animation-delay: 1.45s, 0s; }
    html.atm-pass .subhero__photo img { animation-delay: 0.25s, 0s; }
    @keyframes atmSink { from { translate: 0 0; } to { translate: 0 7%; } }
  }
}

@media (prefers-reduced-motion: reduce) {
  html.atm-pass body::before { display: none; }
  .wipe::after { display: none; }
}
