html[data-sand="pending"] .site-header,
html[data-sand="pending"] main,
html[data-sand="pending"] .site-footer {
  opacity: 0;
  animation: sand-failsafe 0.6s ease 12s forwards;
}

html[data-sand="late"] :is(.site-header, main, .site-footer, .scene-art) {
  animation: sand-arrive 0.6s ease both;
}

html[data-sand="pending"] .scene-art,
html[data-sand="running"] .scene-art {
  opacity: 0;
}

html[data-sand="pending"] .scene-veil,
html[data-sand="pending"] .hero-inner::before,
html[data-sand="pending"] .section-inner::before,
html[data-sand="running"]:not([data-sand-veil]) .scene-veil,
html[data-sand="running"]:not([data-sand-veil]) .hero-inner::before,
html[data-sand="running"]:not([data-sand-veil]) .section-inner::before {
  opacity: 0;
}

html[data-sand="pending"] .site-header::before,
html[data-sand="running"]:not([data-sand-veil]) .site-header::before {
  opacity: 0;
}

html[data-sand-veil] .site-header::before {
  transition: opacity 1.2s ease;
}

html[data-sand-veil] .scene-veil,
html[data-sand-veil] .hero-inner::before,
html[data-sand-veil] .section-inner::before {
  transition: opacity 1.4s ease;
}

html[data-sand="running"] .sand-canvas {
  opacity: 1;
  transition: opacity 0.4s ease;
}

html[data-sand="running"] [data-sand-part]:not([data-sand-shown]) {
  opacity: 0;
  pointer-events: none;
  animation: sand-failsafe 0.6s ease 12s forwards;
}

html[data-sand="done"][data-sand-gl="live"] [data-sand-part]:not([data-sand-shown]) {
  opacity: 0;
}

html[data-sand="running"] .hero-title {
  animation: title-fill 0.6s ease 1.75s backwards;
}

html[data-sand="running"] .wordmark {
  animation: ink-reveal 0.9s var(--ease-draw) 0.3s backwards;
}

html[data-sand="running"] .site-nav {
  animation: ink-reveal 1s var(--ease-draw) 0.45s backwards;
}

html[data-sand="running"] .hero-tagline {
  animation: ink-reveal 1s var(--ease-draw) 1s backwards;
}

html[data-sand="running"] .hero-statement {
  animation: ink-reveal 1.1s var(--ease-draw) 1.25s backwards;
}

html[data-sand="running"] .hero-action {
  animation: ink-rise 0.9s var(--ease-draw) 1.5s backwards;
}

html[data-sand="running"] .hero-action .button::before {
  animation: halo-draw 1.2s var(--ease-draw) 1.6s backwards;
}

html[data-sand-gl="live"] [data-sand-part][data-sand-shown] {
  animation: ink-reveal 1s var(--ease-draw) backwards;
}

html[data-sand-gl="live"] .section-title[data-sand-shown] {
  animation: ink-reveal 1.1s var(--ease-draw) 0.15s backwards, line-draw 1.3s var(--ease-draw) backwards;
}

html[data-sand-gl="live"] .section-title[data-sand-shown]::before {
  animation: node-pop 0.7s var(--ease-draw) backwards;
}

html[data-sand-gl="live"] .service[data-sand-shown] {
  animation: line-draw 1.2s var(--ease-draw) var(--stagger, 0s) backwards;
}

html[data-sand-gl="live"] .service[data-sand-shown]::before {
  animation: node-pop 0.7s var(--ease-draw) var(--stagger, 0s) backwards;
}

html[data-sand-gl="live"] .service[data-sand-shown] > * {
  animation: ink-reveal 1s var(--ease-draw) backwards;
}

html[data-sand-gl="live"] .service[data-sand-shown] > :nth-child(1) {
  animation-delay: calc(0.25s + var(--stagger, 0s));
}

html[data-sand-gl="live"] .service[data-sand-shown] > :nth-child(2) {
  animation-delay: calc(0.45s + var(--stagger, 0s));
}

html[data-sand-gl="live"] .service[data-sand-shown] > :nth-child(3) {
  animation-delay: calc(0.65s + var(--stagger, 0s));
}

html[data-sand-gl="live"] .service-list > :nth-child(2),
html[data-sand-gl="live"] .team-list > :nth-child(2) {
  --stagger: 0.14s;
}

html[data-sand-gl="live"] .service-list > :nth-child(3) {
  --stagger: 0.28s;
}

html[data-sand-gl="live"] .service-list > :nth-child(4) {
  --stagger: 0.42s;
}

html[data-sand-gl="live"] .person[data-sand-shown] {
  animation: ink-reveal 1s var(--ease-draw) calc(0.35s + var(--stagger, 0s)) backwards;
}

html[data-sand-gl="live"] .person[data-sand-shown]::before {
  animation: bar-draw 1.2s var(--ease-draw) calc(0.15s + var(--stagger, 0s)) backwards;
}

html[data-sand-gl="live"] .person[data-sand-shown]::after {
  animation: node-pop 0.7s var(--ease-draw) var(--stagger, 0s) backwards;
}

html[data-sand-gl="live"] .contact-form[data-sand-shown] {
  animation: none;
}

html[data-sand-gl="live"] .contact-form[data-sand-shown] > * {
  animation: ink-reveal 0.9s var(--ease-draw) backwards;
}

html[data-sand-gl="live"] .contact-form[data-sand-shown] > :nth-child(2) {
  animation-delay: 0.1s;
}

html[data-sand-gl="live"] .contact-form[data-sand-shown] > :nth-child(3) {
  animation-delay: 0.2s;
}

html[data-sand-gl="live"] .contact-form[data-sand-shown] > :nth-child(4) {
  animation-delay: 0.3s;
}

html[data-sand-gl="live"] .contact-form[data-sand-shown] > :nth-child(n + 5) {
  animation-delay: 0.42s;
}

html [data-sand-shown="instant"],
html [data-sand-shown="instant"]::before,
html [data-sand-shown="instant"]::after,
html [data-sand-shown="instant"] > *,
html :is([data-sand-shown], [data-sand-shown] > *):is(:has(.term[data-open]), :has(.term:hover), :has(.term-button:focus-visible), :focus-within) {
  animation: none !important;
}

@keyframes ink-rise {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
    filter: blur(4px);
  }
}

@keyframes ink-reveal {
  0% {
    opacity: 0;
    -webkit-mask-image: linear-gradient(90deg, #000 30%, rgba(0, 0, 0, 0.55) 33.4%, transparent 40%);
    mask-image: linear-gradient(90deg, #000 30%, rgba(0, 0, 0, 0.55) 33.4%, transparent 40%);
    -webkit-mask-size: 300% 100%;
    mask-size: 300% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: 100% 0;
    mask-position: 100% 0;
    filter: blur(6px) brightness(1.7);
  }
  55% {
    opacity: 1;
    filter: blur(0.5px) brightness(1.2);
  }
  100% {
    opacity: 1;
    -webkit-mask-image: linear-gradient(90deg, #000 30%, rgba(0, 0, 0, 0.55) 33.4%, transparent 40%);
    mask-image: linear-gradient(90deg, #000 30%, rgba(0, 0, 0, 0.55) 33.4%, transparent 40%);
    -webkit-mask-size: 300% 100%;
    mask-size: 300% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: 0 0;
    mask-position: 0 0;
    filter: none;
  }
}

@keyframes title-fill {
  0% {
    opacity: 0;
    filter: blur(6px);
  }
  60% {
    opacity: 1;
    filter: blur(0.5px);
  }
  100% {
    opacity: 1;
  }
}

@keyframes line-draw {
  from {
    background-size: 0% 1px;
  }
}

@keyframes node-pop {
  0% {
    opacity: 0;
    transform: scale(0.2);
  }
  60% {
    opacity: 1;
    transform: scale(1.5);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes bar-draw {
  from {
    transform: scaleY(0);
  }
}

@keyframes halo-draw {
  from {
    opacity: 0;
  }
}

@keyframes sand-failsafe {
  to {
    opacity: 1;
    transform: none;
    filter: none;
    mask-image: none;
    pointer-events: auto;
  }
}

@keyframes sand-arrive {
  from {
    opacity: 0;
  }
}

.title-stroke {
  position: absolute;
  z-index: 1;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 0 0.5px rgba(28, 27, 25, 0.4));
  animation: stroke-fade 0.6s ease 2s forwards;
}

.title-stroke text {
  font-family: var(--font-display);
  font-weight: 680;
  font-size: inherit;
  letter-spacing: 0;
  text-shadow: none;
}

.title-stroke .glyph {
  fill: transparent;
  stroke: url(#title-ink);
  stroke-width: 2.8px;
  stroke-linejoin: round;
  stroke-dasharray: calc(var(--len) * 1px) calc(var(--len) * 1px);
  stroke-dashoffset: calc(var(--len) * 1px);
  animation: glyph-draw 0.72s var(--ease-draw) calc(0.15s + var(--i) * 0.11s) forwards;
}

.title-stroke .glyph-fill {
  fill: url(#title-ink);
  opacity: 0;
  animation: glyph-fill 0.45s ease calc(0.62s + var(--i) * 0.11s) forwards;
}

@keyframes glyph-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes glyph-fill {
  to {
    opacity: 1;
  }
}

@keyframes stroke-fade {
  to {
    opacity: 0;
  }
}

html[data-fabric] .section-inner::before,
html[data-fabric] .section-title::before {
  display: none;
}

html[data-fabric] .service {
  background: none;
}

html[data-fabric] .service::before,
html[data-fabric] .contact-form::before {
  display: none;
}

.sand-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s ease;
}

html[data-sand-gl="live"] .sand-canvas {
  opacity: 1;
}

html[data-sand-gl="live"] .scene-art {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s linear 0.8s, visibility 0s linear 1.4s;
}

html[data-sand-gl="paused"] .sand-canvas {
  opacity: 1;
}

html[data-sand-gl="paused"] .scene-art {
  opacity: 0;
  visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html[data-sand] .site-header,
  html[data-sand] main,
  html[data-sand] .site-footer,
  html[data-sand] [data-sand-part] {
    opacity: 1 !important;
    animation: none !important;
    filter: none !important;
    transform: none !important;
    pointer-events: auto !important;
  }
  .sand-canvas,
  .title-stroke {
    display: none;
  }
  html[data-sand] .scene-art,
  html[data-sand] .scene-veil {
    opacity: 1 !important;
    visibility: visible !important;
  }
}

@media print {
  html[data-sand] [data-sand-part],
  html[data-sand] :is(.site-header, main, .site-footer) {
    opacity: 1 !important;
    animation: none !important;
    filter: none !important;
  }
  .sand-canvas,
  .title-stroke {
    display: none !important;
  }
}
