[data-reveal] {
    transition: opacity 450ms ease, transform 450ms cubic-bezier(0.2, 0.65, 0.3, 1), box-shadow 220ms ease, border-color 220ms ease;
    transition-delay: var(--reveal-delay, 0ms);
}

.reveal-pending {
    opacity: 0;
    transform: translateY(12px);
}

.button,
.filter-button,
.nav-contact,
.site-nav a,
.text-link,
.contact-link,
.next-project {
    transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.project-image {
    transition: box-shadow 220ms ease, transform 320ms cubic-bezier(0.2, 0.65, 0.3, 1);
}

.project-image img {
    transition: opacity 180ms ease, transform 220ms ease;
}

.preview-scene { transition: opacity 180ms ease; }

.preview-scene:not(.preview-scene--presentations) .preview-tile {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.has-preview .preview-scene:not(.preview-scene--presentations) .preview-tile {
    opacity: 1;
    transform: none;
    transition-duration: var(--tile-duration, 300ms);
    transition-delay: var(--tile-delay, 0ms);
    transition-timing-function: cubic-bezier(0.2, 0.65, 0.3, 1);
}

.preview-scene--branding { --tile-duration: 360ms; }

.preview-scene--presentations .preview-layout {
    transition: transform 420ms cubic-bezier(0.2, 0.65, 0.3, 1);
}

.project-arrow,
.image-open {
    transition: color 180ms ease, background-color 180ms ease;
}

html.hero-motion:not(.hero-intro-complete) .hero-copy > * {
    animation: soft-enter 650ms cubic-bezier(0.2, 0.65, 0.3, 1) both;
}

html.hero-motion:not(.hero-intro-complete) .hero-copy > :nth-child(2) {
    animation-delay: 60ms;
}

html.hero-motion:not(.hero-intro-complete) .hero-copy > :nth-child(3) {
    animation-delay: 120ms;
}

html.hero-motion:not(.hero-intro-complete) .hero-copy > :nth-child(4) {
    animation-delay: 180ms;
}

html.hero-motion:not(.hero-intro-complete) .hero-copy > :nth-child(5) {
    animation-delay: 240ms;
}

html.hero-motion:not(.hero-intro-complete) .hero-art {
    animation: art-enter 900ms cubic-bezier(0.2, 0.65, 0.3, 1) both;
}

.motion-ready .hero-illustration {
    animation: illustration-float 8s ease-in-out infinite;
    animation-play-state: paused;
}

.motion-ready .assembly-ready:not(.assembly-complete) .hero-layer {
    animation: hero-part-enter 800ms cubic-bezier(0.16, 0.8, 0.3, 1) var(--part-delay, 0ms) both;
    animation-play-state: paused;
}

.hero-layer--base {
    --part-x: 24px;
    --part-y: 32px;
    --part-angle: -5deg;
}

.hero-layer--tools {
    --part-x: -48px;
    --part-y: -18px;
    --part-angle: -8deg;
    --part-delay: 140ms;
}

.hero-layer--swatches {
    --part-x: 20px;
    --part-y: -42px;
    --part-angle: 7deg;
    --part-delay: 280ms;
}

.motion-ready .hero-layer--tools img {
    animation: tools-float 9s ease-in-out -2s infinite;
    animation-play-state: paused;
}

.motion-ready .hero-layer--swatches img {
    animation: swatches-float 11s ease-in-out -4s infinite;
    animation-play-state: paused;
}

.motion-ready .hero-orbit--blue {
    animation: orbit-blue 18s ease-in-out infinite;
    animation-play-state: paused;
}

.motion-ready .hero-orbit--burgundy {
    animation: orbit-burgundy 22s ease-in-out -4s infinite;
    animation-play-state: paused;
}

.motion-ready .hero-pebble--blue {
    animation: pebble-float 7s ease-in-out -2s infinite;
    animation-play-state: paused;
}

.motion-ready .hero-pebble--cream {
    animation: pebble-float 9s ease-in-out -5s infinite reverse;
    animation-play-state: paused;
}

.motion-ready .hero-shadow {
    animation: shadow-breathe 8s ease-in-out infinite;
    animation-play-state: paused;
}

.motion-ready .hero-art.is-animating .hero-illustration,
.motion-ready .hero-art.is-animating .hero-layer,
.motion-ready .hero-art.is-animating .hero-layer img,
.motion-ready .hero-art.is-animating .hero-orbit,
.motion-ready .hero-art.is-animating .hero-pebble,
.motion-ready .hero-art.is-animating .hero-shadow {
    animation-play-state: running;
}

.is-revealed .timeline li,
.is-revealed .tool-list li {
    animation: soft-enter 550ms ease-out var(--item-delay, 0ms) both;
}

.is-revealed .portrait-frame {
    animation: portrait-settle 800ms cubic-bezier(0.2, 0.65, 0.3, 1) both;
}

.section-heading h2::after {
    content: '';
    display: block;
    width: 88px;
    height: 10px;
    margin-top: 18px;
    background: url('assets/wave-line.svg') center / contain no-repeat;
    transform-origin: left;
}

.section-heading.is-revealed h2::after {
    animation: line-enter 650ms ease-out 120ms both;
}

.site-nav a:not(.nav-contact) {
    position: relative;
}

.site-nav a:not(.nav-contact)::after {
    content: '';
    position: absolute;
    inset: auto 0 -5px;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 250ms ease;
}

.service-card,
.gallery-image-link {
    transition: transform 280ms ease, box-shadow 280ms ease, border-color 220ms ease, background-color 220ms ease;
}

.title-star,
.small-star {
    transition: transform 450ms cubic-bezier(0.2, 0.65, 0.3, 1);
}

.wave-arrow {
    transition: transform 300ms cubic-bezier(0.2, 0.65, 0.3, 1);
}

@supports (animation-timeline: scroll()) {
    .site-header::after {
        content: '';
        position: absolute;
        bottom: -1px;
        left: max(40px, calc((100% - 1200px) / 2));
        width: min(1200px, calc(100% - 80px));
        height: 2px;
        border-radius: 999px;
        background: var(--ink);
        transform-origin: left;
        animation: reading-progress linear both;
        animation-timeline: scroll(root block);
    }
}

@media (hover: hover) and (pointer: fine) {
    .button-primary:hover {
        background: var(--glass-accent-hover);
        border-color: #ffffff99;
    }

    .button-outline:hover,
    .nav-contact:hover,
    .filter-button[aria-pressed="false"]:hover {
        background: var(--glass-fill);
        border-color: #ffffff;
        box-shadow: var(--glass-shadow-hover);
    }

    .project-link:hover .project-image {
        box-shadow: 0 10px 24px #34445c0c, inset 0 1px 0 #ffffff;
        transform: translateY(-4px);
    }

    .project-link:hover .project-image > .project-cover {
        transform: scale(1.025);
    }

    .project-link:hover .project-arrow,
    .gallery-image-link:hover .image-open {
        background: var(--glass-accent);
        color: white;
    }

    .text-link:hover,
    .contact-link:hover > span:last-child,
    .next-project:hover strong,
    .site-nav a:not(.nav-contact):hover {
        color: #a44362;
    }

    .button:hover {
        transform: translateY(-2px);
        box-shadow: var(--glass-shadow-hover);
    }

    .project-card:hover,
    .contact-link:hover {
        border-color: #ffffff;
        box-shadow: var(--glass-shadow-hover);
    }

    .service-card:hover {
        border-color: #ffffff;
        box-shadow: var(--glass-shadow-hover);
        transform: translateY(-5px);
    }

    .gallery-image-link:hover {
        transform: translateY(-3px);
        border-color: #ffffff;
        box-shadow: var(--glass-shadow-hover);
    }

    .hero-copy:hover .title-star,
    .hero-copy:hover .small-star {
        transform: rotate(35deg);
    }

    .site-nav a:hover::after,
    .site-nav a:focus-visible::after {
        transform: scaleX(1);
    }

    a:hover .wave-arrow,
    .service-card:hover .wave-arrow {
        transform: translateX(3px);
    }

    a:hover .wave-arrow-line,
    .service-card:hover .wave-arrow-line {
        animation: wave-draw 600ms ease-out;
    }
}

@media (max-width: 767px) {
    .navigation-enhanced .site-nav:not([hidden]) {
        animation: soft-enter 220ms ease-out;
    }
}

@keyframes soft-enter {
    from { opacity: 0.35; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes art-enter {
    from { opacity: 0.35; transform: translateY(14px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes illustration-float {
    0%, 100% { transform: translate3d(0, 5px, 0) rotate(-1deg); }
    50% { transform: translate3d(4px, -12px, 0) rotate(1deg); }
}

@keyframes hero-part-enter {
    from { opacity: 0; transform: translate3d(var(--part-x), var(--part-y), 0) rotate(var(--part-angle)) scale(0.96); }
    to { opacity: 1; transform: translate3d(0, 0, 0) rotate(0) scale(1); }
}

@keyframes tools-float {
    0%, 100% { transform: translate3d(0, 2px, 0) rotate(-0.5deg); }
    50% { transform: translate3d(-3px, -4px, 0) rotate(0.5deg); }
}

@keyframes swatches-float {
    0%, 100% { transform: translate3d(0, -3px, 0) rotate(0.5deg); }
    50% { transform: translate3d(3px, 5px, 0) rotate(-0.5deg); }
}

@keyframes orbit-blue {
    0%, 100% { transform: translate(-50%, -50%) rotate(-25deg); }
    50% { transform: translate(-50%, -50%) rotate(-8deg); }
}

@keyframes orbit-burgundy {
    0%, 100% { transform: translate(-50%, -50%) rotate(28deg); }
    50% { transform: translate(-50%, -50%) rotate(10deg); }
}

@keyframes pebble-float {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(-6px, -16px, 0); }
}

@keyframes shadow-breathe {
    0%, 100% { transform: scaleX(1); opacity: 0.8; }
    50% { transform: scaleX(0.86); opacity: 0.45; }
}

@keyframes portrait-settle {
    from { transform: translateY(8px) rotate(-2deg); }
    to { transform: translateY(0) rotate(3deg); }
}

@keyframes line-enter {
    from { transform: scaleX(0.1); opacity: 0; }
    to { transform: scaleX(1); opacity: 1; }
}

@keyframes wave-draw {
    from { stroke-dasharray: 80; stroke-dashoffset: 80; }
    to { stroke-dasharray: 80; stroke-dashoffset: 0; }
}

@keyframes reading-progress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

/* Only the selected artwork is captured; the page itself stays live. */
@media (prefers-reduced-motion: no-preference) {
    @view-transition {
        navigation: auto;
    }

    :root { view-transition-name: none; }

    .project-transition-source .project-cover,
    .project-arrival .case-cover img {
        view-transition-name: project-art;
    }

    .project-transition-source .project-cover {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .project-transition-source .preview-frame,
    .project-transition-source .preview-scene,
    .project-transition-source .preview-progress {
        opacity: 0 !important;
        transition: none !important;
    }

    ::view-transition { pointer-events: none; }

    ::view-transition-group(project-art) {
        animation-duration: 360ms;
        animation-timing-function: cubic-bezier(0.22, 0.8, 0.25, 1);
        overflow: clip;
        border-radius: 14px;
        box-shadow: 0 16px 42px #30252b1a;
        pointer-events: none;
    }

    ::view-transition-old(project-art),
    ::view-transition-new(project-art) {
        width: 100%;
        height: 100%;
        object-fit: contain;
        mix-blend-mode: normal;
        pointer-events: none;
    }

    ::view-transition-old(project-art) {
        animation: project-cover-out 140ms ease-in both;
    }

    ::view-transition-new(project-art) {
        z-index: 1;
        background: var(--background);
        animation: project-cover-in 170ms 140ms cubic-bezier(0.2, 0.65, 0.3, 1) both;
    }

    .project-arrival .case-intro > * {
        animation: project-caption-in 230ms 70ms cubic-bezier(0.2, 0.65, 0.3, 1) both;
    }
    .project-arrival .case-intro h1 { animation-delay: 100ms; }
    .project-arrival .case-lead,
    .project-arrival .case-tags { animation-delay: 130ms; }
}

@keyframes project-cover-out {
    from { opacity: 1; }
    to { opacity: 0; }
}
@keyframes project-cover-in {
    from { clip-path: inset(0 100% 0 0); }
    to { clip-path: inset(0); }
}
@keyframes project-caption-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) { animation: none !important; }
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    html {
        scroll-behavior: auto;
    }

    [data-reveal],
    .button,
    .filter-button,
    .nav-contact,
    .site-nav a,
    .text-link,
    .contact-link,
    .next-project,
    .project-image,
    .project-image img,
    .project-arrow,
    .image-open {
        transition: none;
    }

    .reveal-pending {
        opacity: 1;
        transform: none;
    }

    .preview-scene,
    .preview-progress { display: none !important; }

    .project-image.has-preview .project-cover { opacity: 1; }

    .project-link:hover .project-image img {
        transform: none;
    }

    .site-header::after,
    .hero-art::after {
        display: none;
    }

    .button:hover,
    .service-card:hover,
    .gallery-image-link:hover,
    .project-link:hover .project-image,
    .hero-copy:hover .title-star,
    .hero-copy:hover .small-star,
    a:hover .wave-arrow,
    .service-card:hover .wave-arrow {
        transform: none;
    }
}
