/* =============================================
   POPUP STYLES — D.A Studio
   Covers: shared components + Templates 1, 2, 3
   Brand: #FFF18D / #312D27 / Crimson Pro / Josefin Sans
   ============================================= */

/* ── SHARED: HERO CAROUSEL ──────────────────── */
.pp-hero {
    position: relative;
    height: 65vh;
    min-height: 400px;
    max-height: 700px;
    background: var(--color-charcoal);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.pp-hero-track {
    display: flex;
    height: 100%;
    width: 100%;
    position: absolute;
    inset: 0;
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform;
    transform: translateZ(0); /* Forces GPU usage */
}

.pp-hero-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    position: relative;
}

.pp-hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    backface-visibility: hidden; /* Prevents flickering during slide */
}

.pp-hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.02) 0%,
            rgba(0, 0, 0, 0.06) 35%,
            rgba(49, 45, 39, 0.70) 68%,
            rgba(49, 45, 39, 0.96) 100%);
    z-index: 1;
    pointer-events: none;
}

.pp-hero-content {
    position: relative;
    z-index: 2;
    padding: 0 clamp(24px, 5vw, 80px) clamp(48px, 7vh, 72px);
    max-width: 980px;
}

.pp-hero-tag {
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--color-gold);
    opacity: 0.9;
    margin-bottom: 16px;
    display: block;
}

.pp-hero-title {
    font-family: var(--font-display);
    font-size: clamp(40px, 7vw, 88px);
    font-weight: 300;
    line-height: 1.04;
    color: #ffffff;
    letter-spacing: -0.5px;
    margin: 0;
}

/* Hero carousel controls */
.pp-hero-controls {
    position: absolute;
    bottom: clamp(20px, 3.5vh, 36px);
    right: clamp(24px, 5vw, 60px);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 14px;
}

.pp-hero-btn {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(49, 45, 39, 0.45);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s, border-color 0.25s, color 0.25s;
    border-radius: 2px;
}

.pp-hero-btn:hover {
    background: var(--color-charcoal);
    border-color: var(--color-gold);
    color: var(--color-gold);
}

.pp-hero-counter {
    font-family: var(--font-body);
    font-size: 10px;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.6);
}

.pp-hero-dots {
    position: absolute;
    bottom: clamp(20px, 3.5vh, 36px);
    left: clamp(24px, 5vw, 80px);
    z-index: 3;
    display: flex;
    gap: 8px;
    align-items: center;
}

.pp-hero-dots span {
    display: block;
    width: 20px;
    height: 1px;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: background 0.3s, width 0.3s;
}

.pp-hero-dots span.active {
    background: var(--color-gold);
    width: 36px;
}

/* scroll cue */
.pp-scroll-cue {
    position: absolute;
    bottom: clamp(20px, 3vh, 36px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.45;
}

.pp-scroll-cue span {
    font-family: var(--font-body);
    font-size: 9px;
    letter-spacing: 3px;
    color: #ffffff;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.pp-scroll-line {
    width: 1px;
    height: 48px;
    background: #ffffff;
    animation: ppScrollPulse 2s ease-in-out infinite;
}

@keyframes ppScrollPulse {

    0%,
    100% {
        transform: scaleY(1);
        opacity: 0.35;
    }

    50% {
        transform: scaleY(0.5);
        opacity: 1;
    }
}

/* ── SHARED: SECTION LABELS ──────────────── */
.pp-section-num {
    font-family: var(--font-body);
    font-size: 10px;
    color: var(--color-text-soft);
    letter-spacing: 2px;
    display: block;
    margin-bottom: 10px;
}

.pp-section-heading {
    font-family: var(--font-display);
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 400;
    line-height: 1.2;
    color: var(--color-text);
    margin: 0 0 10px;
}

.pp-accent-line {
    width: 32px;
    height: 2px;
    background: var(--color-gold);
    margin-bottom: 0;
}

.pp-body-text {
    font-family: var(--font-body);
    font-size: clamp(14px, 1.6vw, 17px);
    font-weight: 300;
    line-height: 1.75;
    color: var(--color-text-secondary);
    margin: 0;
    max-width: 640px;
}

/* ── SHARED: JOURNEY CAROUSEL ────────────── */
.pp-journey {
    padding: clamp(60px, 8vw, 110px) clamp(20px, 5vw, 80px);
    background: var(--color-secondary);
    transition: background-color var(--transition-normal);
}

.pp-journey-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: clamp(28px, 4vw, 52px);
}

.pp-journey-header-label {
    font-family: var(--font-body);
    font-size: 10px;
    letter-spacing: 4px;
    color: var(--color-text-soft);
    text-transform: uppercase;
    white-space: nowrap;
}

.pp-journey-header .pp-section-num {
    display: inline;
    margin-bottom: 0;
    flex-shrink: 0;
}

.pp-journey-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.pp-carousel {
    position: relative;
    overflow: hidden;
    background: var(--color-charcoal);
    aspect-ratio: 16 / 9;
    max-height: 640px;
    border-radius: 2px;
}

.pp-carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.72s cubic-bezier(0.77, 0, 0.18, 1);
}

.pp-carousel-track img {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pp-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(49, 45, 39, 0.52);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s, border-color 0.25s, color 0.25s;
    z-index: 5;
    border-radius: 2px;
}

.pp-carousel-btn:hover {
    background: var(--color-charcoal);
    border-color: var(--color-gold);
    color: var(--color-gold);
}

.pp-carousel-btn.pp-prev {
    left: 18px;
}

.pp-carousel-btn.pp-next {
    right: 18px;
}

.pp-carousel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
}

.pp-dot-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pp-dot-row span {
    display: inline-block;
    width: 22px;
    height: 1px;
    background: var(--color-light-gray);
    cursor: pointer;
    transition: background 0.3s, width 0.3s;
}

.pp-dot-row span.pp-dot-active {
    background: var(--color-charcoal);
    width: 38px;
}

/* Manual dark mode */
[data-color-scheme="dark"] .pp-dot-row span.pp-dot-active {
    background: var(--color-gold);
}

/* System dark mode */
@media (prefers-color-scheme: dark) {
    .pp-dot-row span.pp-dot-active {
        background: var(--color-gold);
    }
}

.pp-carousel-counter {
    font-family: var(--font-body);
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--color-text-soft);
}

/* ── SHARED: RESULT SECTION ──────────────── */
.pp-result-section {
    padding: clamp(40px, 6vw, 110px) clamp(20px, 5vw, 80px);
    max-width: 1280px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.85s ease, transform 0.85s ease;
}

.pp-result-section.pp-visible {
    opacity: 1;
    transform: translateY(0);
}

.pp-result-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(12px, 2vw, 24px);
    align-items: start;
    margin-bottom: clamp(40px, 5vw, 64px);
}

.pp-result-label-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 0;
    position: static;
}

.pp-result-body-col .pp-body-text {
    max-width: 100%;
}

.pp-result-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.pp-result-images img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 2px;
    display: block;
}

/* ── SHARED: TESTIMONIAL ──────────────────── */
.pp-testimonial {
    padding: clamp(60px, 8vw, 100px) clamp(20px, 5vw, 80px);
    background: var(--color-charcoal);
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.pp-testimonial.pp-visible {
    opacity: 1;
    transform: translateY(0);
}

.pp-testimonial-quote {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(20px, 3vw, 30px);
    font-weight: 300;
    line-height: 1.6;
    color: #ffffff;
    max-width: 780px;
    margin: 0 auto 36px;
}

.pp-testimonial-quote::before {
    content: '\201C';
    color: var(--color-gold);
    font-size: 1.3em;
    line-height: 0;
    vertical-align: -0.4em;
    margin-right: 4px;
}

.pp-testimonial-quote::after {
    content: '\201D';
    color: var(--color-gold);
    font-size: 1.3em;
    line-height: 0;
    vertical-align: -0.4em;
    margin-left: 4px;
}

.pp-testimonial-author {
    font-family: var(--font-body);
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--color-gold);
    margin-bottom: 6px;
    display: block;
}

.pp-testimonial-role {
    font-family: var(--font-body);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    display: block;
    letter-spacing: 1px;
}

/* ── SHARED: PROJECT NAV ──────────────────── */
.pp-project-nav {
    display: flex;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
    min-height: 100px;
}

/* When only one button is visible, remove the dividing border */
.pp-project-nav:has(> .pp-nav-btn:only-child) .pp-nav-btn {
    border-left: none;
}

.pp-nav-btn {
    flex: 1;
    padding: clamp(28px, 4vw, 52px) clamp(20px, 5vw, 60px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    background: none;
    border: none;
    text-align: left;
    transition: background var(--transition-normal);
}

.pp-nav-btn:hover {
    background: var(--color-secondary);
}

.pp-nav-btn.pp-nav-next {
    text-align: right;
    border-left: 1px solid var(--color-border);
}

.pp-nav-dir {
    font-family: var(--font-body);
    font-size: 10px;
    letter-spacing: 3px;
    color: var(--color-text-soft);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pp-nav-btn:not(.pp-nav-next) .pp-nav-dir::before {
    content: '←';
    color: var(--color-text);
    font-size: 14px;
}

.pp-nav-btn.pp-nav-next .pp-nav-dir {
    justify-content: flex-end;
}

.pp-nav-btn.pp-nav-next .pp-nav-dir::after {
    content: '→';
    color: var(--color-text);
    font-size: 14px;
}

.pp-nav-name {
    font-family: var(--font-display);
    font-size: clamp(18px, 2.5vw, 24px);
    font-weight: 400;
    color: var(--color-text);
}

.pp-nav-btn[data-disabled] {
    opacity: 0.28;
    pointer-events: none;
}

/* ── TEMPLATE 1: minimal, text-focused ──────
   Layout: Banner carousel → Space (full-width text) →
           Journey carousel → Result (left/right) + bottom carousel →
           Testimonial
   ─────────────────────────────────────────── */

/* Space section — full-width editorial */
.t1-space {
    padding: 60px 40px;
    max-width: 1100px;
    margin: 0 auto;

    display: flex;
    flex-direction: row;
    /* 👈 FORCE horizontal */
    gap: 60px;
    align-items: flex-start;
}

/* control spacing BETWEEN sections */
.t1-space+.t1-space {
    margin-top: 20px;
    /* 👈 adjust this (try 16–32px) */
}

/* LEFT */
.t1-space>.t1-label {
    flex: 0 0 260px;
}

/* RIGHT */
.t1-space>.pp-body-text {
    flex: 1;
    margin: 0;
}

/* SAFETY (prevents stacking issues) */
.t1-space>* {
    min-width: 0;
}

.t1-space.reverse {
    flex-direction: row-reverse;
    /* flips sides */
}

/* ── TEMPLATE 2: editorial with side images ─
   Layout: Banner carousel → Ask (text + photo side) →
           Space (photo reveal + text stagger) →
           Journey carousel → Result (left/right) + bottom carousel →
           Testimonial
   ─────────────────────────────────────────── */

/* Shared side-by-side section */
.t2-side-section {
    padding: clamp(60px, 8vw, 110px) clamp(20px, 5vw, 80px);
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 55fr 45fr;
    gap: clamp(40px, 6vw, 90px);
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.85s ease, transform 0.85s ease, border-color var(--transition-normal);
}

.t2-side-section.pp-visible {
    opacity: 1;
    transform: translateY(0);
}

.t2-side-section.t2-flip {
    direction: rtl;
}

.t2-side-section.t2-flip>* {
    direction: ltr;
}

.t2-text-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Image reveal container — curtain wipe */
.t2-img-col {
    position: relative;
    overflow: hidden;
    background: var(--color-secondary);
    aspect-ratio: 1 / 1;
    max-height: 420px;
}

.t2-img-curtain {
    position: absolute;
    inset: 0;
    background: var(--color-charcoal);
    transform-origin: left center;
    transform: scaleX(1);
    transition: transform 1.3s cubic-bezier(0.77, 0, 0.175, 1);
    z-index: 2;
}

.t2-side-section.pp-visible .t2-img-curtain {
    transform: scaleX(0);
}

/* The image fills the column completely */
.t2-img-col > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.5s ease 0.9s;
}

.t2-side-section.pp-visible .t2-img-col > img {
    opacity: 1;
}

/* The Space — horizontal scroll reveal text stagger */
.t2-space-section {
    padding: clamp(60px, 8vw, 110px) clamp(20px, 5vw, 80px);
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 6vw, 90px);
    align-items: start;
    border-bottom: 1px solid var(--color-border);
}

.t2-space-text {
    /* sticky removed — it fights with translateY reveal transform causing scroll jank */
    align-self: start;
}

.t2-space-text .pp-section-num,
.t2-space-text .pp-section-heading,
.t2-space-text .pp-accent-line,
.t2-space-text .pp-body-text {
    opacity: 0;
    transform: translateX(-24px);
    transition: opacity 0.75s ease, transform 0.75s ease;
}

.t2-space-text .pp-section-heading {
    transition-delay: 0.1s;
}

.t2-space-text .pp-accent-line {
    transition-delay: 0.2s;
}

.t2-space-text .pp-body-text {
    transition-delay: 0.3s;
}

.t2-space-section.pp-visible .t2-space-text .pp-section-num,
.t2-space-section.pp-visible .t2-space-text .pp-section-heading,
.t2-space-section.pp-visible .t2-space-text .pp-accent-line,
.t2-space-section.pp-visible .t2-space-text .pp-body-text {
    opacity: 1;
    transform: translateX(0);
}

/* Space image — parallax-ish layered reveal */
.t2-space-img-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    width: 100%;
    background: #f8f6f2;
}

/* When used as da-img-wrap, ensure it still shows correctly */
.t2-space-img-wrap.da-img-wrap {
    display: block;
}

.t2-space-img-wrap img:not(.da-monogram-logo):not(.img-floorplan):not(.img-floorplan-portrait) {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transform: scale(1.04);
    transition: transform 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
    will-change: transform;
}

/* Floor plan / technical drawing — show full image without cropping */
.t2-space-img-wrap .img-floorplan {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    padding: 20px;
    box-sizing: border-box;
    background: #f8f6f2;
    transform: scale(1.0);
    display: block;
}

/* Portrait floor plan — wrapper becomes taller to fit vertical drawings */
.t2-space-img-wrap:has(.img-floorplan-portrait) {
    aspect-ratio: 3 / 4;
}

.t2-space-img-wrap .img-floorplan-portrait {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    padding: 20px;
    box-sizing: border-box;
    background: #f8f6f2;
    transform: scale(1.0);
    display: block;
}

.t2-space-section.pp-visible .t2-space-img-wrap img:not(.da-monogram-logo):not(.img-floorplan):not(.img-floorplan-portrait) {
    transform: scale(1) !important;
    /* After animation completes, remove will-change to free GPU memory */
    transition: transform 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.2s, will-change 0s 1.6s;
    will-change: auto;
}

.t2-space-img-overlay {
    position: absolute;
    inset: 0;
    background: var(--color-gold);
    opacity: 0.12;
    transform: translateY(0%);
    transition: transform 1.2s cubic-bezier(0.77, 0, 0.175, 1);
    pointer-events: none;
}

.t2-space-section.pp-visible .t2-space-img-overlay {
    transform: translateY(-100%);
}

/* ── TEMPLATE 3: same as T2 + journey video ─
   Inherits all T2 styles. Only difference is
   the journey section adds a video embed.
   ─────────────────────────────────────────── */

.t3-journey-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.t3-journey-video {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 2px;
    background: var(--color-charcoal);
}

.t3-journey-video iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.t3-journey-carousel {
    /* inherits .pp-carousel styles, just sits in the grid */
    aspect-ratio: 16/9;
}

/* ── SCROLL REVEAL BASE ──────────────────── */
[data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.85s ease, transform 0.85s ease;
}

/* Once visible, NEVER revert — scroll-back must not re-trigger */
[data-reveal].pp-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: opacity 0.85s ease, transform 0.85s ease;
}

/* Same lock for the individually-styled sections */
.t2-side-section.pp-visible,
.t2-space-section.pp-visible,
.pp-result-section.pp-visible,
.pp-testimonial.pp-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Lock text stagger children too */
.t2-space-section.pp-visible .t2-space-text .pp-section-num,
.t2-space-section.pp-visible .t2-space-text .pp-section-heading,
.t2-space-section.pp-visible .t2-space-text .pp-accent-line,
.t2-space-section.pp-visible .t2-space-text .pp-body-text {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

/* ── RESPONSIVE ─────────────────────────── */
@media (max-width: 900px) {

    .t2-side-section,
    .t2-space-section {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .t2-side-section.t2-flip {
        direction: ltr;
    }

    /* FIX #2: t2-space image on tablet — use cover not contain, proper aspect ratio */
    .t2-img-col {
        display: flex;
        align-items: stretch;
        aspect-ratio: 16 / 9;
        min-height: 220px;
    }

    .t2-space-img-wrap {
        aspect-ratio: 16 / 9;
        width: 100%;
    }

    .t2-space-img-wrap img {
        width: 100%;
        height: 100%;
        object-fit: cover !important;
        aspect-ratio: unset;
    }

    .t2-space-text {
        position: static;
    }

    .t3-journey-grid {
        grid-template-columns: 1fr;
    }

    .pp-result-label-col {
        position: static;
    }

    /* FIX #5: Prev/Next nav visible on tablet */
    .pp-project-nav {
        display: flex;
        position: relative;
        z-index: 10;
        min-height: unset;
        height: auto;
    }

    .pp-nav-btn {
        padding: 28px 24px;
        flex: 1;
        height: auto;
    }
}

@media (max-width: 1100px) {
    .pp-result-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* FIX #3: Template 1 mobile — stack flex columns properly */
@media (max-width: 768px) {

    .t1-space,
    .t1-space.reverse {
        flex-direction: column;
        gap: 16px;
        padding: 28px 20px;
    }

    /* Reduce gap between consecutive t1-space sections on mobile */
    .t1-space + .t1-space {
        margin-top: 0;
        padding-top: 16px;
    }

    .t1-space > .t1-label {
        flex: unset;
        width: 100%;
    }

    .t1-space > .pp-body-text {
        flex: unset;
        width: 100%;
    }

    .t1-space.reverse {
        flex-direction: column;
    }

    .t1-space {
        text-align: left;
    }

    .t1-space .pp-section-num {
        text-align: left;
    }

    .t1-space .pp-accent-line {
        margin-left: 0;
    }

    .t1-space .pp-body-text {
        text-align: left;
    }

    /* FIX #5: Prev/Next nav on mobile */
    .pp-project-nav {
        display: flex !important;
        flex-direction: column;
        position: relative;
        z-index: 10;
        min-height: unset;
        height: auto;
    }

    .pp-nav-btn {
        padding: 24px 20px;
        width: 100%;
        flex: unset;
        height: auto;
    }

    .pp-nav-btn.pp-nav-next {
        border-left: none;
        border-top: 1px solid var(--color-border);
    }

    .pp-nav-name {
        font-size: 16px;
    }
}

@media (max-width: 640px) {
    .pp-hero-controls {
        right: 16px;
    }

    .pp-carousel-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .pp-result-images {
        grid-template-columns: 1fr;
    }
}


/*--------------------speed fix---------------------------*/

/* Skip layout+paint for off-screen sections — big perf win */
.intro-section,
.portfolio-section,
.process-section,
.testimonials-section {
    content-visibility: auto;
    contain-intrinsic-size: 0 600px;
}

/* Once revealed, lock permanently visible — no re-animation on scroll-back */
.is-revealed {
    opacity: 1 !important;
    transform: translateY(0) !important;
    visibility: visible !important;
    animation: none !important;
}

/* Elements restored from sessionStorage snap in instantly with no transition */
.is-revealed.no-transition {
    transition: none !important;
}

/* CSS fallback: if JS is slow, above-fold hero fades in on its own after 150ms */
.hero-text, .hero-image, .hero-content {
    animation: revealFallback 0.5s ease 0.15s both;
}
@keyframes revealFallback {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Initial hidden state — JS IntersectionObserver adds is-revealed when in view */
.portfolio-card, .process-card, .testimonial-card, .project-item,
.intro-text, .intro-image, .section-header,
.hero-text, .hero-image, .hero-content {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

/* ── POPUP PERFORMANCE ───────────────────── */
/* NOTE: content-visibility removed — it causes scroll jank/stutter
   because the browser recalculates layout as sections enter/leave viewport */

/* ── DA LOADER INTEGRATION IN POPUP ────────
   Works with image_loader.css + image-loader.js
   applied to result images and side images
   ─────────────────────────────────────────── */

/* Result grid images use da-img-wrap */
.pp-result-images .da-img-wrap {
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: 2px;
    overflow: hidden;
}

.pp-result-images .da-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Space image wrap already has da-img-wrap class,
   ensure loader rings sit correctly inside it */
.t2-space-img-wrap.da-img-wrap {
    overflow: hidden;
}
