:root {
  --motion-out: cubic-bezier(.22, .8, .24, 1);
  --motion-quick: 180ms;
  --motion-rise: 30px;
}

.site-intro { display: none; }
.site-intro-pending .site-intro {
  position: fixed;
  z-index: 20;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  background: var(--orange, #ff641f);
  color: var(--ink, #171614);
  touch-action: none;
  overscroll-behavior: contain;
}
.site-intro-content { width: min(76vw, 30rem); }
.site-intro-content .display { font: 900 clamp(3.9rem, 15vw, 9rem)/.82 Arial, sans-serif; letter-spacing: -.09em; }
.site-intro-status {
  margin-top: 26px;
  padding-top: 13px;
  border-top: 2px solid currentColor;
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: .08em;
}
.site-intro.is-leaving { animation: loader-exit 560ms cubic-bezier(.62, .07, .35, 1) both; }

.motion-progress {
  position: fixed;
  z-index: 5;
  inset: 0 0 auto;
  height: 3px;
  background: var(--orange);
  pointer-events: none;
  transform: scaleX(var(--reading-progress, 0));
  transform-origin: left;
}
.page-index .motion-progress { background: var(--ink); }

.hero-title > span { overflow: hidden; }
.hero.is-opening .hero-title > span > span {
  animation: type-rise 1080ms cubic-bezier(.31, .12, .37, 1) calc(var(--hero-start, 0ms) + var(--word-delay, 0ms)) both;
}
.hero-title > span:nth-child(2) { --word-delay: 160ms; }
.hero-title > span:nth-child(3) { --word-delay: 320ms; }
.hero.is-opening .hero-message { animation: title-arrive 1050ms var(--motion-out) calc(var(--hero-start, 0ms) + 410ms) both; }

.hero-image-cut {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  clip-path: polygon(
    0 calc(var(--lead) + var(--scroll-edge, 0px) - var(--hero-travel, 0) * var(--lead) * .76),
    100% calc(var(--hero-exit, 0) * 22%),
    100% calc(100% - var(--tail) + var(--hero-travel, 0) * var(--tail) * .72),
    calc(62% + var(--hero-travel, 0) * 24%) 100%,
    0 calc(100% - var(--tail) * (1.18 + var(--hero-exit, 0)))
  );
}
.hero-photo {
  position: absolute;
  inset: 0;
  transform: translateY(calc(2% - var(--hero-travel, 0) * 6%)) scale(calc(1.08 + var(--hero-travel, 0) * .23));
  transform-origin: 52% 59%;
}
.hero-photo.is-front { z-index: 1; }
.hero-photo.is-entering { animation: photo-fade 880ms cubic-bezier(.31, .12, .37, 1) both; }
@media (prefers-reduced-motion: no-preference) {
  @supports (clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%)) {
    .hero-photo.is-entering { animation-name: photo-open; }
  }
}
.hero-image-cut::before {
  position: absolute;
  z-index: 2;
  inset: 0;
  content: "";
  pointer-events: none;
  background: var(--orange);
  opacity: var(--scroll-shade, 0);
}
.hero-image-cut::after {
  position: absolute;
  z-index: 3;
  inset: 0 0 -30%;
  content: "";
  pointer-events: none;
  background: var(--orange);
  clip-path: polygon(0 0, 100% 0, 100% 83%, 0 100%);
  transform: translateY(-102%);
}
.hero.is-opening .hero-image-cut::after {
  animation: hero-open 1600ms cubic-bezier(.42, .11, .28, 1) calc(var(--hero-start, 0ms) + 80ms) both;
}
.hero-story > p {
  opacity: calc(.66 + var(--story-travel, 1) * .34);
  transform: translateY(calc((var(--story-travel, 1) - 1) * 26px));
}

.home-service { position: relative; isolation: isolate; }
.home-service > .section { padding-top: clamp(82px, 12vw, 170px); }
.home-service::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: clamp(64px, 9vw, 135px);
  background: var(--orange);
  clip-path: polygon(0 0, 100% 0, 100% calc(98% - var(--scene-travel, 1) * 88%), 0 calc(8% + var(--scene-travel, 1) * 37%));
}
.home-service .section-heading .display,
.page-index .works-section .section-heading .display {
  display: inline-block;
  transform-origin: left bottom;
  transform: translateY(calc((1 - var(--scene-travel, 1)) * 16px)) scale(calc(.84 + var(--scene-travel, 1) * .16));
}
.page-index .works-section::before {
  height: 76%;
  clip-path: polygon(0 0, calc(28% + var(--scene-travel, 1) * 72%) calc(19% - var(--scene-travel, 1) * 6%),
    calc(65% + var(--scene-travel, 1) * 35%) calc(36% + var(--scene-travel, 1) * 25%), 0 100%);
}
.card-image, .portrait, .service-image { overflow: hidden; }
.card-image img, .portrait img, .service-image img {
  transform: scale(calc(1.02 + (1 - var(--photo-travel, 1)) * .22));
}
.detail-gallery img { opacity: calc(.67 + var(--photo-travel, 1) * .33); }
.contact-band { position: relative; isolation: isolate; }
.contact-band::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: calc(.48 * (1 - var(--scene-travel, 1)));
  background: var(--paper);
  clip-path: polygon(0 0, 100% 0, 100% calc(82% - var(--scene-travel, 1) * 65%), 0 calc(100% - var(--scene-travel, 1) * 78%));
}

.hero-figure figcaption {
  position: static;
  width: min(100% - 2 * var(--frame), 1320px);
  min-height: 47px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 13px;
  justify-content: flex-end;
  align-items: center;
  text-align: left;
}

.gallery-controls { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.gallery-controls button {
  min-height: 44px;
  border: 0;
  color: var(--ink);
  background: transparent;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.gallery-choice { position: relative; min-width: 49px; }
.gallery-choice[aria-pressed="true"] { background: rgb(23 22 20 / .1); }
.gallery-choice::after, .gallery-timer {
  content: "";
  position: absolute;
  inset: auto 5px 5px;
  height: 2px;
  pointer-events: none;
}
.gallery-choice::after { background: rgb(23 22 20 / .24); }
.gallery-timer { z-index: 1; background: var(--ink); transform: scaleX(0); transform-origin: left; }
.gallery-timer.is-counting { animation: read-progress var(--gallery-duration, 6800ms) linear forwards; }
.gallery-controls button:focus-visible { background: rgb(23 22 20 / .1); }

.page-heading::before {
  transform-origin: left center;
  animation: heading-open 990ms cubic-bezier(.3, .2, .35, 1) both;
}
.page-heading h1 { animation: title-arrive 780ms var(--motion-out) 170ms both; }
.page-heading p { animation: title-arrive 780ms var(--motion-out) 290ms both; }
.works-section.motion-in-view::before { transform-origin: left; animation: heading-open 1050ms cubic-bezier(.3, .2, .35, 1) both; }
.page-index .works-section.motion-in-view::before { animation: none; }
.section-heading.motion-in-view h2,
.contact-band-inner.motion-in-view > div:first-child { animation: heading-rise 880ms var(--motion-out) both; }
.section-heading.motion-in-view > :not(h2) { animation: title-arrive 700ms var(--motion-out) 120ms both; }
.motion-in-view:is(.about-feature-copy, .service-link, .service-row > div, .case-meta, .hero-story,
  .contact-option, .contact-location, .faq-item, .company-section, .case-card) {
  animation: title-arrive 760ms var(--motion-out) var(--reveal-delay, 0ms) both;
}
.motion-in-view:is(.portrait, .service-image, .detail-gallery figure),
.case-card.motion-in-view .card-image { animation: section-fade 860ms var(--motion-out) var(--reveal-delay, 0ms) both; }
@supports (clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%)) {
  .motion-in-view:is(.portrait, .service-image, .detail-gallery figure),
  .case-card.motion-in-view .card-image { animation-name: section-photo-open; }
}
@media (min-width: 761px) {
  .case-grid > :nth-child(3n + 2), .service-links > :nth-child(2n),
  .contact-options > :nth-child(2), .detail-gallery > :nth-child(2n) { --reveal-delay: 115ms; }
  .case-grid > :nth-child(3n) { --reveal-delay: 230ms; }
}

.button, .service-link, .case-card a, .filter button {
  transition: background-color var(--motion-quick) ease, color var(--motion-quick) ease;
}
.arrow { transition: transform var(--motion-quick) var(--motion-out); }
:is(.button, .text-link, .service-link, .case-card a):focus-visible .arrow { transform: translate(4px, -3px); }
.case-card img { transition: scale 360ms var(--motion-out); }
.case-card a:focus-visible img { scale: 1.035; }
.mobile-menu[open] nav, .faq-item[open] p { animation: title-arrive 200ms var(--motion-out) both; }

@media (hover: hover) {
  :is(.button, .text-link, .service-link, .case-card a):hover .arrow { transform: translate(4px, -3px); }
  .case-card a:hover img { scale: 1.035; }
}

@media (max-width: 760px) {
  :root { --motion-rise: 22px; }
  .hero-figure figcaption { justify-content: space-between; gap: 0 4px; }
  .gallery-controls { gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --motion-rise: 0px; --motion-quick: 120ms; }
  .site-intro.is-leaving { animation-name: loader-fade; }
  .hero.is-opening .hero-title > span > span { animation-name: section-fade; animation-duration: 800ms; }
  .hero.is-opening .hero-message { animation-name: section-fade; }
  .hero.is-opening .hero-image-cut::after {
    animation: soft-open 1120ms ease-out calc(var(--hero-start, 0ms) + 80ms) both;
  }
  .hero-photo, .hero-story > p,
  .home-service .section-heading .display, .page-index .works-section .section-heading .display,
  .card-image img, .portrait img, .service-image img { transform: none; }
  .home-service::before { clip-path: polygon(0 0, 100% 0, 100% 10%, 0 45%); opacity: calc(.35 + var(--scene-travel, 1) * .65); }
  .page-index .works-section::before {
    clip-path: polygon(0 0, 100% 13%, 100% 61%, 0 100%);
    opacity: calc(.22 + var(--scene-travel, 1) * .78);
  }
  .card-image img, .portrait img, .service-image img { opacity: calc(.60 + var(--photo-travel, 1) * .40); }
  .contact-band::before { clip-path: none; }
  .page-heading::before, .works-section.motion-in-view::before,
  .section-heading.motion-in-view h2, .contact-band-inner.motion-in-view > div:first-child,
  .motion-in-view:is(.portrait, .service-image, .detail-gallery figure),
  .case-card.motion-in-view .card-image { animation-name: section-fade; }
  .mobile-menu[open] nav, .faq-item[open] p { animation: motion-fade 200ms ease-out both; }
  .arrow, .case-card img { transition: none; }
  :is(.button, .text-link, .service-link, .case-card a):is(:hover, :focus-visible) .arrow { transform: none; }
  .case-card a:is(:hover, :focus-visible) img { scale: 1; }
}

@keyframes read-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes loader-exit { to { transform: translateY(-102%); visibility: hidden; } }
@keyframes loader-fade { to { opacity: 0; visibility: hidden; } }
@keyframes type-rise { from { transform: translateY(94%); } to { transform: translateY(0); } }
@keyframes hero-open {
  from { transform: translateY(0); }
  to { transform: translateY(-102%); }
}
@keyframes soft-open { from { opacity: .82; transform: none; } to { opacity: 0; transform: none; } }
@keyframes photo-open {
  from { clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); }
  to { clip-path: polygon(0 0, 116% 0, 100% 100%, 0 100%); }
}
@keyframes photo-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes heading-open { from { transform: scaleX(.12); } to { transform: scaleX(1); } }
@keyframes heading-rise {
  from { opacity: .36; transform: translateY(var(--motion-rise)); clip-path: inset(0 0 74% 0); }
  to { opacity: 1; transform: none; clip-path: inset(0); }
}
@keyframes section-photo-open {
  from { opacity: .55; clip-path: polygon(0 0, 38% 0, 6% 100%, 0 100%); }
  to { opacity: 1; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
}
@keyframes section-fade { from { opacity: .38; } to { opacity: 1; } }
@keyframes title-arrive {
  from { opacity: .5; transform: translateY(var(--motion-rise)); }
  to { opacity: 1; transform: none; }
}
@keyframes motion-fade { from { opacity: .72; } to { opacity: 1; } }
