/* The edge of each sheet carries the reader into the next part of the project. */
.home { --chapter-height: 44px; --sheet-depth: clamp(22px, 3.5vw, 52px); }
.home .site-header { background: #100e18; backdrop-filter: none; }
.home :is(#work, #services, #process, #about, #contact) { scroll-margin-top: var(--chapter-height); }
.chapter-index {
  position: sticky; z-index: 6; top: calc(var(--header-height) + 1px);
  background: #191620; color: #c6bfce; border-block: 1px solid #ffffff17;
}
.chapter-index .shell { display: flex; align-items: stretch; gap: clamp(16px, 3.8vw, 64px); }
.chapter-index a {
  position: relative; display: grid; align-items: center; min-height: var(--chapter-height);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.chapter-index a:last-child { margin-left: auto; }
.chapter-index a::after {
  content: ""; position: absolute; inset: auto 0 0; height: 2px; background: var(--mint);
  transform: scaleX(0); transform-origin: left; transition: transform .36s ease;
}
.chapter-index a:is([aria-current], :hover, :focus-visible) { color: #f4fff9; }
.chapter-index a[aria-current]::after { transform: scaleX(1); }

.home .stats { background: #191620; border-top: 0; }
.home .stats-grid { padding-block: clamp(14px, 3vw, 40px); }
.home .stats-grid > div { min-height: auto; }
.home .stats-grid strong { font-weight: 500; }
.home .section { position: relative; }
.home .section-heading .eyebrow, .home .contact .eyebrow { display: flex; align-items: center; gap: .8em; }
.home .section-heading .eyebrow::before, .home .contact .eyebrow::before {
  content: ""; display: block; width: 28px; height: 1px; background: currentColor;
}
.home :is(.services, .process, .about, .contact)::before {
  content: ""; position: absolute; z-index: 0; inset: calc(-1 * var(--sheet-depth) + 1px) 0 auto;
  width: 100%; height: var(--sheet-depth); background: var(--sheet);
  clip-path: polygon(0 0, 100% 100%, 0 100%); pointer-events: none;
  border: 0; border-radius: 0; transform: none;
}
.home .services { --sheet: #16131f; background: var(--sheet); }
.home .process {
  --sheet: #eae5f1; --text: #241d31; --muted: #595065; --violet: #625078;
  background: var(--sheet); color: var(--text);
}
.home .about { --sheet: #15121c; background: var(--sheet); padding-bottom: clamp(85px, 10vw, 145px); }
.home :is(.process,.contact)::before { clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.home .contact {
  --sheet: #d6c9ef; overflow: visible; background: var(--sheet);
  padding-block: clamp(64px, 9vw, 130px);
}
.home .contact::after { display: none; }
.home .contact-inner { position: relative; isolation: isolate; }
.contact-sculpture { position: absolute; inset: 0; overflow: clip; pointer-events: none; }
.contact-sculpture::before {
  content: ""; position: absolute; inset: -24% 13% -24% 35%;
  background: url('/assets/relay.webp') center / contain no-repeat; opacity: .46;
}
.home .contact-action { align-self: center; }
.home .service-stage { top: calc(var(--header-height) + var(--chapter-height) + 18px); }

/* One artifact progresses from wireframe to a finished screen. */
.delivery {
  --drawing-ink: #65547a; --rule: #6a567d45; --active: #49355e;
  display: grid; grid-template-columns: minmax(235px, .75fr) minmax(0, 1.25fr);
  align-items: start; gap: clamp(35px, 7vw, 110px); color: inherit;
}
.inner-page .delivery { --drawing-ink: #d5c3ec; --rule: #d5c3ec38; --active: var(--mint); }
.delivery-guide {
  position: sticky; top: calc(var(--header-height) + var(--chapter-height, 0px) + 20px);
  display: grid; align-content: start; gap: 14px; min-width: 0;
}
.delivery-model {
  position: relative; isolation: isolate; display: grid; place-items: center; overflow: hidden;
  height: clamp(166px, 28svh, 285px); border-block: 1px solid var(--rule);
  background: radial-gradient(ellipse at 48% 56%, #ad8dca33, transparent 69%),
    repeating-linear-gradient(0deg, transparent 0 27px, #826c9612 27px 28px),
    repeating-linear-gradient(90deg, transparent 0 27px, #826c9612 27px 28px);
  perspective: 760px;
}
.model-stack {
  position: relative; width: clamp(100px, 13vw, 175px); aspect-ratio: 1.46;
  transform-style: preserve-3d;
  transform: rotateX(var(--pitch, 53deg)) rotateZ(var(--roll, -23deg));
  transition: transform .8s cubic-bezier(.2,.72,.23,1);
}
.model-stack > i {
  position: absolute; inset: 0; display: block; border: 1.5px solid #745c86; border-radius: 8%;
  transition: transform .8s cubic-bezier(.2,.72,.23,1), opacity .4s, background-color .5s;
}
.model-base { transform: translateZ(-24px); background: #8e7f9d; box-shadow: 2px 4px 0 #514557; }
.model-wire {
  transform: translate3d(var(--offset, 20px), 0, var(--gap, 16px));
  background: repeating-linear-gradient(90deg, transparent 0 15%, #8d76935c 15% 16%), #ededf1cf;
}
.model-face {
  transform: translate3d(calc(-1 * var(--offset, 20px)), 0, calc(2 * var(--gap, 16px) + 11px));
  background: var(--face, #eee6f0c7); box-shadow: 1px 2px 0 #6d567c85;
}
.model-face b { position: absolute; background: var(--model-accent, #b7a3ca); border-radius: 4px; transition: background-color .45s; }
.model-face b:first-child { inset: 12% 10% auto; height: 8%; }
.model-face b:nth-child(2) { inset: 30% auto 13% 10%; width: 27%; }
.model-face b:last-child { inset: 30% 10% 13% 43%; background: repeating-linear-gradient(0deg, transparent 0 17%, #806c9677 17% 23%); }
.delivery[data-phase="2"] { --roll: -15deg; --offset: 12px; --gap: 22px; --pitch: 44deg; }
.delivery[data-phase="3"] { --roll: -8deg; --offset: 6px; --gap: 20px; --face: #d6c2ed; --model-accent: #8874aa; --pitch: 37deg; }
.delivery[data-phase="4"] { --roll: -18deg; --offset: 0px; --gap: 12px; --face: #c0b3d8; --pitch: 54deg; }
.delivery[data-phase="5"] { --roll: -7deg; --offset: 0px; --gap: 3px; --face: #d3e4dc; --model-accent: #789a89; --pitch: 30deg; }
.delivery[data-phase="6"] { --roll: 0deg; --offset: 0px; --gap: -5px; --face: #d2ebdf; --model-accent: #678978; --pitch: 12deg; }
.delivery-index { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 13px; }
.delivery-index a {
  display: flex; align-items: center; gap: .65em; min-height: 38px; font-size: 13px;
  color: var(--drawing-ink); border-bottom: 1px solid var(--rule);
}
.delivery-index a span { font: 10px var(--mono); }
.delivery-index a[aria-current] { color: var(--active); font-weight: 750; border-bottom-color: currentColor; }
.delivery-stages { list-style: none; padding: 0; margin: 0; }
.delivery-stages li {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(18px, 3vw, 48px); align-content: center;
  min-height: clamp(158px, 22svh, 210px); padding-block: 25px;
  border-top: 1px solid var(--rule); scroll-margin-top: max(calc(var(--chapter-height, 0px) + 20px), calc(46svh - var(--header-height) - 2px));
}
.delivery-stages li:last-child { border-bottom: 1px solid var(--rule); }
.stage-number { color: var(--drawing-ink); font: italic clamp(28px, 4.3vw, 63px)/1 Georgia, serif; letter-spacing: -.065em; }
.stage-label { margin-bottom: 7px; color: var(--drawing-ink); font-size: 12px; font-weight: 700; letter-spacing: .09em; }
.delivery-stages h3 { margin: 0 0 8px; font-size: clamp(19px, 2.05vw, 31px); line-height: 1.26; letter-spacing: -.035em; }
.delivery-stages h3 + p { max-width: 44ch; color: var(--muted); font-size: 14px; line-height: 1.74; }
.home .engagement { margin-top: clamp(30px, 6vw, 83px); }
.home .engagement > div { border-color: #6853754d; }
.home .engagement dt { color: #392e45; }

.home .office-grid { grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr); gap: 3px; }
.home .office {
  min-height: clamp(350px, 39vw, 550px); border: 0; border-radius: 0; padding: clamp(19px, 3vw, 44px);
}
.home .office img { filter: none; }
.home .office:first-child img { object-position: center 18%; }
.home .office::after { background: linear-gradient(to top, #13101ceb 0, #13101c76 28%, transparent 62%); }
.home .office p { color: white; font: italic clamp(34px, 4.7vw, 76px)/1 Georgia, serif; letter-spacing: -.055em; }
.home .office h3 { margin-top: 10px; font-size: clamp(17px, 1.8vw, 26px); }
.home .office address { font-size: 13px; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .home :is(.section, .contact)::before {
      animation: sheet-open linear both; animation-timeline: view();
      animation-range: entry 0% cover 38%; transform-origin: bottom;
    }
    .home .showcase-frame, .home .service-stage {
      animation: plate-arrive linear backwards; animation-timeline: view(); animation-range: entry 0% entry 85%;
    }
    .home .office { view-timeline-name: --office; }
    .home .office img {
      animation: city-lens linear both; animation-timeline: --office; animation-range: cover 0% cover 100%;
    }
    .home .office:nth-child(2) img { animation-direction: reverse; }
    .contact-sculpture::before {
      animation: relay-land linear both; animation-timeline: view(); animation-range: entry 0% cover 75%;
    }
  }
}
@keyframes sheet-open { from { transform: scaleY(.15); } to { transform: scaleY(1); } }
@keyframes plate-arrive { from { transform: translateY(22px) scale(.975); } to { transform: none; } }
@keyframes city-lens { from { transform: translateY(2.3%) scale(1.06); } to { transform: translateY(-2.3%) scale(1.06); } }
@keyframes relay-land { from { transform: translateX(-7%) rotate(-12deg) scale(.9); } to { transform: none; } }

@media (max-width: 820px) {
  .chapter-index .shell { justify-content: space-between; gap: 8px; }
  .chapter-index a:last-child { margin-left: 0; }
  .delivery { gap: 24px; grid-template-columns: minmax(205px,.7fr) minmax(0,1.3fr); }
}
@media (max-width: 640px), (max-height: 540px) {
  .delivery { display: block; }
  .delivery-guide { position: static; grid-template-columns: minmax(90px,.8fr) minmax(0,1.2fr); align-items: center; margin-bottom: 22px; }
  .delivery-model { height: 128px; }
  .model-stack { width: 68px; }
  .delivery-index { gap: 0 7px; }
  .delivery-index a { font-size: 12px; gap: .3em; }
  .delivery-stages li { min-height: 135px; padding-block: 20px; }
  .home .office-grid { grid-template-columns: 1fr; }
  .home .office { min-height: 310px; }
  .contact-sculpture::before { inset: -14% -27% -16% 39%; opacity: .19; }
}

.service-paging { display: none; }
@media (max-width: 899px), (hover: none) {
  .home .service-catalog .services-grid {
    position: relative; display: grid; grid-template-columns: none; grid-auto-flow: column;
    grid-auto-columns: clamp(234px, 77%, 350px); gap: 12px;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
    scroll-padding-inline: 3px;
    scrollbar-width: thin; scrollbar-color: #71617e transparent; padding: 4px 3px 14px;
  }
  .home .service-catalog .service-card {
    display: flex; flex-direction: column; padding: 15px 17px 20px; scroll-snap-align: start;
    border-radius: 0; border-width: 1px 0 0; background: #221d2b;
  }
  .home .service-catalog .service-visual { width: 100%; margin: 0 0 14px; aspect-ratio: 1.87; }
  .home .service-catalog .service-action { top: 8px; right: 8px; font-size: 10px; }
  .home .service-catalog .service-card h3 { margin-bottom: 7px; }
  .home .service-catalog .service-card p { max-width: 26ch; }
  .service-paging { display: flex; gap: 8px; justify-content: end; margin-top: 6px; }
  .service-paging button {
    display: grid; place-items: center; width: 44px; height: 44px;
    border: 1px solid #766785; border-radius: 50%; background: transparent; color: var(--text);
  }
  .service-paging button::before { content: ""; width: 9px; height: 9px; border: solid currentColor; border-width: 1px 1px 0 0; transform: rotate(45deg); }
  .service-paging [data-service-prev]::before { transform: rotate(-135deg); }
  .service-paging button:disabled { opacity: .3; }
}

@media (max-width: 640px) and (min-height: 650px) {
  .delivery-guide {
    position: sticky; z-index: 2; top: calc(var(--header-height) + var(--chapter-height, 0px) + 1px);
    gap: 12px; padding-block: 5px; grid-template-columns: minmax(75px,.32fr) minmax(0,1fr);
    background: var(--sheet, #181223); border-bottom: 1px solid var(--rule);
  }
  .delivery-index { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 5px; }
  .delivery-index a { min-height: 44px; justify-content: center; white-space: nowrap; }
  .delivery-index a span { display: none; }
  .delivery-model { height: 88px; }
  .model-stack { width: 48px; }
}
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .chapter-index::after {
      content: ""; position: absolute; inset: auto 0 -1px; height: 1px; pointer-events: none;
      background: linear-gradient(90deg, #ae91ce, #b8ffe4); transform-origin: left;
      animation: reading-progress linear both; animation-timeline: scroll(root);
    }
  }
}
@keyframes reading-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
