/* ── NUCLEAR OVERRIDE: Remove external white aura/vignette ── */
#preact-border-shadow-host,
[id*="preact-border-shadow"],
.animate-breathing {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    box-shadow: none !important;
}

:root {
    --bg-dark: #0d0d0d;
    --primary-purple: #c586c0;
    --primary-blue: #569cd6;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;

    --font-main: 'Manrope', sans-serif;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.04);
    --glass-blur: 14px;
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background-color: #000 !important;
    scroll-behavior: smooth;
    background: #000;
}

body {
    background-color: #000 !important;
    background: transparent;
    color: var(--text-main);
    font-family: var(--font-main);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Contrast veil between animated orbs and foreground content.
   Keeps bright text readable even when an orb passes behind it. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background:
        radial-gradient(120% 72% at 50% 10%, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.2) 56%, rgba(0, 0, 0, 0.3) 100%);
}

/* Global Scrollbar */
html {
    background-color: #000 !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

::-webkit-scrollbar {
    width: 14px;
    background: transparent;
}

::-webkit-scrollbar-track {
    background: transparent;
    margin-block: 4px;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 3px solid transparent;
    background-clip: content-box;
    /* box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.1); */
    backdrop-filter: blur(4px);
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.25);
    /* box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.2); */
}

#app {
    width: 100%;
    min-height: 100vh;
    position: relative;
    z-index: 10;
}

/* ── Noise Overlay — animated grain ── */
#noise-overlay {
    position: fixed;
    top: -50px;
    left: -50px;
    width: calc(100% + 100px);
    height: calc(100% + 100px);
    pointer-events: none;
    z-index: 1;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    animation: grain 0.15s steps(1) infinite;
    will-change: transform;
    contain: strict;
}

@keyframes grain {

    0%,
    100% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(-2px, 2px);
    }

    50% {
        transform: translate(2px, -2px);
    }

    75% {
        transform: translate(-2px, -2px);
    }
}

/* ── Orbs Container ── */
#orb-container {
    top: -100px;
    left: -100px;
    width: calc(100% + 200px);
    height: calc(100% + 200px);
    position: fixed;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: transparent;
}

#orb-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ── Glass Utilities ── */
/* ── Glass Utilities ── */
.glass-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.liquid-glass {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
}

.liquid-glass::before {
    display: none;
}

/* ── Header — Animated Nav ── */
#main-header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: clamp(0.85rem, 2.1vw, 1.2rem) clamp(0.5rem, 3vw, 1.5rem);
    z-index: 100;
    display: flex;
    justify-content: center;
    pointer-events: none;
    /* Let clicks pass through empty space */
}

nav {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    pointer-events: none;
    background: none;
    border: none;
    box-shadow: none;
    position: relative;
}

/* ── Logo area — hidden in compact, inline in expanded bar ── */
.nav-logo-area {
    display: flex;
    align-items: center;
    pointer-events: auto;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transform: translateX(-12px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
        max-width 0.95s cubic-bezier(0.22, 1, 0.36, 1),
        margin 0.95s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.95s cubic-bezier(0.22, 1, 0.36, 1);
    white-space: nowrap;
    margin-right: 0;
}

.nav-logo {
    font-weight: 700;
    font-size: clamp(0.72rem, 1.9vw, 1.02rem);
    letter-spacing: -0.02em;
    word-spacing: 0.04em;
    line-height: 1.05;
    color: var(--text-main);
    white-space: nowrap;
    opacity: 0;
    text-shadow: none;
    transition: opacity 0.3s ease;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logo-dot,
.hero-dot {
    color: rgba(200, 170, 230, 0.55);
    -webkit-text-fill-color: rgba(200, 170, 230, 0.55);
    font-weight: 900;
    display: inline-block;
    animation: spin-3d 4s ease-in-out infinite;
    /* Tweaking axis to look centered for a period glyph */
    transform-origin: center 70%;
    line-height: 1;
}

@keyframes spin-3d {

    0%,
    100% {
        transform: perspective(200px) rotateY(0deg);
    }

    50% {
        transform: perspective(200px) rotateY(360deg);
    }
}

/* ── Right bubble — Explore + nav links ── */
.nav-bubble-right {
    background: rgba(13, 13, 13, 0.45);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.1),
        0 4px 20px rgba(0, 0, 0, 0.35);
    pointer-events: auto;
    padding: clamp(0.52rem, 1.8vw, 0.8rem) clamp(0.72rem, 3vw, 1.6rem);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    cursor: pointer;
    transition: border-radius 1.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        gap 1.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        padding 1.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 1.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        flex 1.4s cubic-bezier(0.22, 1, 0.36, 1),
        width 1.4s cubic-bezier(0.22, 1, 0.36, 1),
        max-width 1.4s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
    min-width: var(--compact-bubble-width);
    --compact-bubble-width: 158px;
    will-change: width, box-shadow;
}

.menu-label {
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    opacity: 0.8;
    transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
        max-width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 120px;
    transform: translateX(0);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: clamp(0.35rem, 2vw, 1.8rem);
    list-style: none;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    margin-left: 0;
    transform: translateX(-34px);
    transition: max-width 1.2s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 1s ease,
        margin-left 1.2s cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    min-width: 0;
}

/* Hover expand in compact mode */
nav[data-state="compact"] .nav-bubble-right:hover .nav-links {
    max-width: 500px;
    opacity: 1;
    margin-left: 1.5rem;
    transform: translateX(0);
}

nav[data-state="compact"] .nav-bubble-right:hover .menu-label {
    opacity: 0.78;
}

/* During compact settle phase, suppress hover re-expand to avoid a second stretch blip. */
nav.compact-settling[data-state="compact"] .nav-bubble-right:hover .nav-links {
    max-width: 0;
    opacity: 0;
    margin-left: 0;
}

nav.compact-settling[data-state="compact"] .nav-bubble-right:hover .menu-label {
    opacity: 0.8;
}

/* Force-expand: JS-triggered simulated hover for auto-expand animation */
.nav-bubble-right.force-expand .nav-links {
    max-width: 500px;
    opacity: 1;
    margin-left: 1.5rem;
    transform: translateX(0);
    transition: max-width 1.55s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 1.1s ease,
        margin-left 1.55s cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 1.55s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: left center;
}

.nav-bubble-right.force-expand .nav-links a {
    animation: nav-link-jelly-in 0.68s cubic-bezier(0.22, 1.2, 0.34, 1) both;
    will-change: transform;
}

.nav-bubble-right.force-expand .nav-links li:nth-child(2) a {
    animation-delay: 0.03s;
}

.nav-bubble-right.force-expand .nav-links li:nth-child(3) a {
    animation-delay: 0.06s;
}

.nav-bubble-right.force-expand .nav-links li:nth-child(4) a {
    animation-delay: 0.09s;
}

.nav-bubble-right.force-expand .menu-label {
    opacity: 0.82;
    transition: opacity 1s cubic-bezier(0.34, 1.56, 0.64, 1),
        max-width 1s cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: right center;
}

.nav-bubble-right.is-collapsing {
    animation: nav-bar-collapse-bounce 1.4s cubic-bezier(0.32, 0.06, 0.68, 1) both;
    justify-content: flex-end;
}

.nav-bubble-right.is-collapsing .nav-links {
    transition: max-width 1.24s cubic-bezier(0.32, 0.06, 0.68, 1),
        opacity 0.9s ease 0.3s,
        margin-left 1.24s cubic-bezier(0.32, 0.06, 0.68, 1),
        transform 1.24s cubic-bezier(0.32, 0.06, 0.68, 1);
    margin-left: 1.5rem;
    transform: translateX(8px) scaleX(0.94);
}

.nav-bubble-right.is-collapsing .menu-label {
    transition: opacity 1.1s ease, transform 1.1s cubic-bezier(0.32, 0.06, 0.68, 1);
    transform: translateX(-1px) scale(1);
}

/* During collapse while still in expanded state, keep Explore hidden until compact settles. */
nav[data-state="expanded"] .nav-bubble-right.is-collapsing .nav-links {
    max-width: 500px;
    opacity: 1;
    margin-left: 1.5rem;
    transform: translateX(0) scaleX(1);
    /* Keep submenu readable through most of the collapse; switch happens at final snap. */
    transition: max-width 1.1s cubic-bezier(0.32, 0.06, 0.68, 1),
        opacity 0.24s ease 1.62s,
        margin-left 1.1s cubic-bezier(0.32, 0.06, 0.68, 1),
        transform 1.1s cubic-bezier(0.32, 0.06, 0.68, 1);
}

nav[data-state="expanded"] .nav-bubble-right.is-collapsing .menu-label {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transform: translateX(18px) scale(0.96);
    transition: opacity 0.3s ease,
        transform 0.8s cubic-bezier(0.32, 0.06, 0.68, 1),
        max-width 0.8s cubic-bezier(0.32, 0.06, 0.68, 1);
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-size: clamp(0.62rem, 2.2vw, 0.88rem);
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    opacity: 0.82;
    transform: translate3d(0, 0, 0);
    transition: opacity 0.3s ease, color 0.3s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

.nav-links a:hover {
    opacity: 1;
    color: #c586c0;
}

/* ═══════════════════════════════════════════════════
   EXPANDED STATE — unified full horizontal bar
   Triggered by JS when CTA scrolls out of view
   Bar stretches RIGHT → LEFT (from Explore toward UNDO logo)
   ═══════════════════════════════════════════════════ */

nav[data-state="expanded"] {
    justify-content: flex-end;
}

/* Unified bar: bubble grows to fill width — flex-end keeps it anchored right */
nav[data-state="expanded"] .nav-bubble-right {
    flex: 1;
    border-radius: 18px;
    justify-content: flex-end;
}

.nav-bubble-right.is-expanding {
    animation: nav-bar-expand-bounce 1.28s cubic-bezier(0.22, 1.18, 0.34, 1) both;
    transform-origin: right center;
}

/* Logo appears INSIDE the bar (left side) */
nav[data-state="expanded"] .nav-logo-area {
    max-width: clamp(90px, 26vw, 210px);
    opacity: 1;
    margin-right: auto;
    padding: 0 0 0 clamp(0.12rem, 0.7vw, 0.42rem);
    transform: translateX(0);
}

/* Links right-aligned, anchored — they stay in place */
nav[data-state="expanded"] .nav-links {
    max-width: min(76vw, 500px);
    opacity: 1;
    margin-left: clamp(0.35rem, 2vw, 1.5rem);
    transform: translateX(0);
}

/* Explore label: fly out to the right + fade */
nav[data-state="expanded"] .menu-label {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    padding: 0;
    transform: translateX(36px) scaleX(1.08) scaleY(0.94);
    transition: transform 0.62s cubic-bezier(0.22, 1.2, 0.34, 1),
        opacity 0.24s ease 0.2s,
        max-width 0.24s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
}

nav[data-state="compact"] .menu-label {
    transition-delay: 0s;
    max-width: 120px;
    overflow: visible;
}

nav[data-state="compact"] .nav-bubble-right {
    justify-content: center;
    padding: clamp(0.52rem, 1.8vw, 0.8rem) clamp(0.68rem, 2.5vw, 1.3rem);
}

nav[data-state="compact"] .menu-label.pre-spring {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transform: translateX(12px) scale(0.96);
}

nav[data-state="compact"] .menu-label.spring-in {
    animation: menu-label-spring-in 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
    transition: none;
    will-change: opacity, transform;
}

/* Final swap while still collapsed: keep Explore hidden and move links fully away. */
nav[data-state="expanded"] .nav-bubble-right.is-collapsing.swap-to-explore .nav-links {
    max-width: 500px;
    opacity: 0;
    margin-left: 1.5rem;
    transform: translateX(-34px);
    transition: opacity 0.22s ease, transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

nav[data-state="expanded"] .nav-bubble-right.is-collapsing.swap-to-explore .nav-links a {
    opacity: 0;
    transform: translateX(-34px);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}

nav[data-state="expanded"] .nav-bubble-right.swap-to-explore .menu-label {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transform: translateX(12px) scale(0.96);
    transition: opacity 0.2s ease, transform 0.2s ease, max-width 0.2s ease;
}

/* Prevent second-pass animation replay when JS snaps state at the end. */
nav.state-snap .nav-bubble-right,
nav.state-snap .nav-links,
nav.state-snap .menu-label,
nav.state-snap .nav-logo-area {
    transition: none !important;
    animation: none !important;
}

@keyframes nav-bar-expand-bounce {
    0% {
        transform: scaleX(0.982) scaleY(1.018) translateX(0);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
        border-radius: 22px;
    }
    38% {
        transform: scaleX(1.028) scaleY(0.948) translateX(-0.8px);
        box-shadow: 0 10px 30px rgba(197, 134, 192, 0.14), 0 10px 34px rgba(0, 0, 0, 0.32);
        border-radius: 24px;
    }
    64% {
        transform: scaleX(0.994) scaleY(1.008) translateX(-0.2px);
        border-radius: 20px;
    }
    100% {
        transform: scaleX(1) scaleY(1) translateX(0);
        box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
        border-radius: 18px;
    }
}

@keyframes nav-bar-collapse-bounce {
    0% {
        transform: scaleX(1) translateX(0);
        box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
        border-radius: 18px;
    }
    35% {
        transform: scaleX(0.95) translateX(1px);
        box-shadow: 0 9px 28px rgba(0, 0, 0, 0.33), 0 0 14px rgba(197, 134, 192, 0.1);
        border-radius: 27px;
    }
    68% {
        transform: scaleX(0.94) translateX(1px);
        border-radius: 24px;
    }
    86% {
        transform: scaleX(1.014) translateX(-0.5px);
        border-radius: 20px;
    }
    100% {
        transform: scaleX(1) translateX(0);
        box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
        border-radius: 18px;
    }
}

@keyframes menu-label-spring-in {
    0% {
        opacity: 0;
        transform: translate3d(8px, 0, 0) scale(0.985);
    }
    68% {
        opacity: 1;
        transform: translate3d(-0.5px, 0, 0) scale(1.006);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes nav-link-jelly-in {
    0% {
        opacity: 0.82;
        transform: translate3d(-14px, 0, 0);
    }
    56% {
        opacity: 0.82;
        transform: translate3d(1px, 0, 0);
    }
    100% {
        opacity: 0.82;
        transform: translate3d(0, 0, 0);
    }
}

/* ── Neon flicker animation — cold fluorescent ── */
@keyframes neon-flicker-on {
    0% {
        opacity: 0;
        text-shadow: none;
    }

    4% {
        opacity: 0.6;
        text-shadow: 0 0 8px rgba(197, 134, 192, 0.6);
    }

    6% {
        opacity: 0;
        text-shadow: none;
    }

    10% {
        opacity: 0.4;
        text-shadow: 0 0 6px rgba(197, 134, 192, 0.4);
    }

    12% {
        opacity: 0;
        text-shadow: none;
    }

    18% {
        opacity: 0.7;
        text-shadow: 0 0 10px rgba(197, 134, 192, 0.5);
    }

    22% {
        opacity: 0.1;
        text-shadow: none;
    }

    30% {
        opacity: 0.8;
        text-shadow: 0 0 12px rgba(197, 134, 192, 0.6);
    }

    34% {
        opacity: 0.2;
        text-shadow: none;
    }

    45% {
        opacity: 0.85;
        text-shadow: 0 0 14px rgba(197, 134, 192, 0.5);
    }

    50% {
        opacity: 0.4;
        text-shadow: 0 0 4px rgba(197, 134, 192, 0.3);
    }

    65% {
        opacity: 0.9;
        text-shadow: 0 0 16px rgba(197, 134, 192, 0.6);
    }

    80% {
        opacity: 0.95;
        text-shadow: 0 0 12px rgba(197, 134, 192, 0.4);
    }

    100% {
        opacity: 1;
        text-shadow: 0 0 8px rgba(197, 134, 192, 0.3), 0 0 20px rgba(168, 85, 247, 0.15);
    }
}

@keyframes neon-flicker-off {
    0% {
        opacity: 1;
        text-shadow: 0 0 8px rgba(197, 134, 192, 0.3);
    }

    10% {
        opacity: 0.3;
        text-shadow: 0 0 4px rgba(197, 134, 192, 0.2);
    }

    15% {
        opacity: 0.7;
        text-shadow: 0 0 6px rgba(197, 134, 192, 0.3);
    }

    25% {
        opacity: 0.1;
        text-shadow: none;
    }

    30% {
        opacity: 0.4;
        text-shadow: 0 0 4px rgba(197, 134, 192, 0.2);
    }

    50% {
        opacity: 0;
        text-shadow: none;
    }

    100% {
        opacity: 0;
        text-shadow: none;
    }
}

/* Applied by JS */
.nav-logo.neon-on {
    animation: neon-flicker-on 0.8s ease-out forwards;
}

.nav-logo.neon-off {
    animation: neon-flicker-off 0.5s ease-out forwards;
}

/* Neon flicker for Explore label (faster variant) */
.menu-label.neon-on {
    animation: neon-flicker-on 0.5s ease-out forwards;
    max-width: 120px !important;
    opacity: 1 !important;
}

.menu-label.neon-off {
    animation: neon-flicker-off 0.3s ease-out forwards;
}

/* ── Hero Section ── */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.hero-content {
    max-width: 650px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;

    background: transparent;
    background-image: linear-gradient(135deg, rgba(86, 156, 214, 0.05), rgba(197, 134, 192, 0.05));
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 34px;
    padding: 4rem;
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.15),
        0 20px 50px rgba(0, 0, 0, 0.35);
    position: relative;
    overflow: hidden;
    transform-origin: center bottom;
    will-change: transform, border-radius, box-shadow;
    --hero-ty-base: 0px;
    --hero-sx-base: 0;
    --hero-sy-base: 0;
    --hero-ty-hover: 0px;
    --hero-sx-hover: 0;
    --hero-sy-hover: 0;

    /* Entrance Animation */
    opacity: 0;
    animation: heroPanelEntry 1.06s cubic-bezier(0.22, 1.18, 0.34, 1) forwards;
}

.hero-content.hero-live {
    animation: none;
    opacity: 1;
    transform: translateY(calc(var(--hero-ty-base) + var(--hero-ty-hover))) scaleX(calc(1 + var(--hero-sx-base) + var(--hero-sx-hover))) scaleY(calc(1 + var(--hero-sy-base) + var(--hero-sy-hover)));
}

.hero-content.hero-live:hover {
    --hero-ty-hover: -1px;
    --hero-sx-hover: 0.004;
    --hero-sy-hover: -0.002;
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.16),
        0 24px 58px rgba(0, 0, 0, 0.38);
}

@keyframes heroPanelEntry {
    0% {
        opacity: 0;
        transform: translateY(46px) scaleX(0.93) scaleY(1.08);
        border-radius: 42px;
    }
    46% {
        opacity: 1;
        transform: translateY(-3px) scaleX(1.028) scaleY(0.952);
        border-radius: 38px;
    }
    72% {
        opacity: 1;
        transform: translateY(1px) scaleX(0.992) scaleY(1.01);
        border-radius: 35px;
    }
    100% {
        opacity: 1;
        transform: translateY(0) scaleX(1) scaleY(1);
        border-radius: 34px;
    }
}

.hero-content h1,
.hero-content .tagline,
.hero-content .cta-sonar-wrap {
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-content h1 {
    animation-delay: 0.3s;
}

.hero-content .tagline {
    animation-delay: 0.5s;
}

.hero-content .cta-sonar-wrap {
    animation-delay: 0.7s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.04), transparent 40%);
    pointer-events: none;
}

.hero-content h1 {
    color: #ffffff;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.25));
}



h1 {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #ffffff 0%, #eeeeee 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: #ffffff;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.25));
    position: relative;
    cursor: default;
}

/* Subtle edge contrast for bright headlines over dynamic glow backgrounds */
.section-title,
.service-title,
.project-title {
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.42);
    -webkit-text-stroke: 0.35px rgba(0, 0, 0, 0.22);
}

/* Keep secondary bright text readable when a bright orb passes behind it */
.tagline,
.section-subtitle,
.project-desc,
.contact-lead {
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.42);
}

.bouncy-text .letter {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.3s ease;
    -webkit-text-fill-color: initial;
    /* Reset specific fill for hover effect */
    color: transparent;
    /* Use background-clip */
    background: inherit;
    background-clip: text;
    -webkit-background-clip: text;
}

.bouncy-text .letter:hover {
    transform: scale(1.3) translateY(-10px) rotate(5deg);
    /* Neon glow on hover */
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    -webkit-text-fill-color: #fff;
}

.strikethrough-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 0;
    height: 4px;
    background: linear-gradient(90deg, #569cd6, #c586c0);
    transform: translateY(-50%) rotate(-2deg);
    border-radius: 4px;
    animation: strike 1.5s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    animation-delay: 1s;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(197, 134, 192, 0.5);
}

@keyframes strike {
    0% {
        width: 0;
        opacity: 0;
    }

    100% {
        width: 100%;
        opacity: 0.8;
    }
}

.tagline {
    font-size: 1.3rem;
    color: #ffffff;
    font-weight: 600;
    opacity: 0.95;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.cta-button {
    /* Purple iridescent glass — matching brand */
    background: linear-gradient(135deg, rgba(197, 134, 192, 0.12), rgba(168, 85, 247, 0.10), rgba(124, 58, 237, 0.08));
    color: #d8b4fe;
    border: 1px solid rgba(197, 134, 192, 0.25);
    padding: 1rem 2.8rem;
    /* Chamfered rectangle — unique shape */
    border-radius: 6px 20px 6px 20px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow:
        0 0 16px rgba(197, 134, 192, 0.08);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(197, 134, 192, 0.2), rgba(168, 85, 247, 0.15), transparent);
    transition: 0.6s;
}

.cta-button:hover {
    background: linear-gradient(135deg, rgba(197, 134, 192, 0.22), rgba(168, 85, 247, 0.18), rgba(124, 58, 237, 0.12));
    color: #fff;
    border-color: rgba(197, 134, 192, 0.5);
    box-shadow:
        0 0 24px rgba(197, 134, 192, 0.2),
        0 0 48px rgba(168, 85, 247, 0.1),
        inset 0 1px 2px rgba(255, 255, 255, 0.15);
    text-shadow: 0 0 8px rgba(197, 134, 192, 0.4);
}

.cta-button:hover::before {
    left: 100%;
}

/* ── CTA Sonar Pulse ── */
.cta-sonar-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sonar-ring {
    position: absolute;
    inset: 0;
    border-radius: 6px 20px 6px 20px;
    border: 1.5px solid rgba(168, 85, 247, 0.4);
    opacity: 0;
    pointer-events: none;
    animation: sonar-pulse 3.5s cubic-bezier(0.2, 0.6, 0.4, 1) infinite;
}

/* Staggered: 3 waves, then 2-beat pause baked into keyframe */
.sonar-ring:nth-child(1) {
    animation-delay: 0s;
}

.sonar-ring:nth-child(2) {
    animation-delay: 0.35s;
}

.sonar-ring:nth-child(3) {
    animation-delay: 0.7s;
}

@keyframes sonar-pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
        border-color: rgba(168, 85, 247, 0.45);
    }

    30% {
        transform: scale(2);
        opacity: 0.15;
        border-color: rgba(124, 58, 237, 0.2);
    }

    50% {
        transform: scale(2.8);
        opacity: 0;
        border-color: rgba(124, 58, 237, 0);
    }

    /* Pause beats — stay invisible */
    100% {
        transform: scale(2.8);
        opacity: 0;
    }
}

#services {
    padding: 8rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

@property --svc-float-y {
    syntax: '<length>';
    inherits: false;
    initial-value: 0px;
}

@property --svc-float-sx {
    syntax: '<number>';
    inherits: false;
    initial-value: 0;
}

@property --svc-float-sy {
    syntax: '<number>';
    inherits: false;
    initial-value: 0;
}

@property --svc-ty-hover {
    syntax: '<length>';
    inherits: false;
    initial-value: 0px;
}

@property --svc-sx-hover {
    syntax: '<number>';
    inherits: false;
    initial-value: 0;
}

@property --svc-sy-hover {
    syntax: '<number>';
    inherits: false;
    initial-value: 0;
}

@property --svc-rot-hover {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

.section-header {
    margin-bottom: 4rem;
    text-align: center;
}

.section-title {
    font-size: 2.5rem;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
}

@media (max-width: 850px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
}

.service-card {
    padding: 3.5rem;
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1),
        box-shadow 0.5s cubic-bezier(0.23, 1, 0.32, 1),
        background-color 0.5s cubic-bezier(0.23, 1, 0.32, 1),
        border-color 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    --service-card-radius: 24px;
    border-radius: var(--service-card-radius);

    /* Floating Animation — will be paused off-screen by IntersectionObserver */
    animation: floatCard 6s ease-in-out infinite;
    will-change: transform, box-shadow;
    contain: layout style paint;
    isolation: isolate;
    --svc-ty-base: 0px;
    --svc-sx-base: 0;
    --svc-sy-base: 0;
    --svc-rot-base: 0deg;
    --svc-ty-hover: 0px;
    --svc-sx-hover: 0;
    --svc-sy-hover: 0;
    --svc-rot-hover: 0deg;
    --svc-float-y: 0px;
    --svc-float-sx: 0;
    --svc-float-sy: 0;
    --glow-rgb: 197, 134, 192;
}

.service-card:nth-child(even) {
    animation-duration: 7s;
    animation-delay: -1s;
}

.service-card:nth-child(3n) {
    animation-duration: 8s;
    animation-delay: -2.5s;
}

@keyframes floatCard {

    0%,
    100% {
        transform: translateY(0);
    }

    33% {
        transform: translateY(-8px);
    }

    66% {
        transform: translateY(-4px);
    }
}

@keyframes service-card-burst-in {
    0% {
        opacity: 0;
        transform: translateY(44px) scaleX(0.88) scaleY(1.14) rotate(var(--svc-burst-rot, -0.8deg));
    }
    54% {
        opacity: 1;
        transform: translateY(-3px) scaleX(1.042) scaleY(0.95) rotate(calc(var(--svc-burst-rot, -0.8deg) * -0.5));
    }
    78% {
        opacity: 1;
        transform: translateY(1px) scaleX(0.992) scaleY(1.01) rotate(0deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scaleX(1) scaleY(1) rotate(0deg);
    }
}

@keyframes service-card-micro-float {
    0%,
    100% {
        --svc-float-y: 0px;
        --svc-float-sx: 0;
        --svc-float-sy: 0;
    }
    42% {
        --svc-float-y: -2.3px;
        --svc-float-sx: 0.004;
        --svc-float-sy: -0.003;
    }
    74% {
        --svc-float-y: -1px;
        --svc-float-sx: -0.0015;
        --svc-float-sy: 0.0015;
    }
}

@keyframes service-card-hover-jelly {
    0%,
    100% {
        transform: translateY(calc(var(--svc-ty-base) + var(--svc-ty-hover))) scaleX(calc(1 + var(--svc-sx-base) + var(--svc-sx-hover))) scaleY(calc(1 + var(--svc-sy-base) + var(--svc-sy-hover))) rotate(calc(var(--svc-rot-base) + var(--svc-rot-hover)));
    }
    38% {
        transform: translateY(calc(var(--svc-ty-base) + var(--svc-ty-hover) - 3px)) scaleX(calc(1 + var(--svc-sx-base) + var(--svc-sx-hover) + 0.02)) scaleY(calc(1 + var(--svc-sy-base) + var(--svc-sy-hover) - 0.017)) rotate(calc(var(--svc-rot-base) + 0.26deg));
    }
    66% {
        transform: translateY(calc(var(--svc-ty-base) + var(--svc-ty-hover) + 1px)) scaleX(calc(1 + var(--svc-sx-base) + var(--svc-sx-hover) - 0.007)) scaleY(calc(1 + var(--svc-sy-base) + var(--svc-sy-hover) + 0.006)) rotate(calc(var(--svc-rot-base) - 0.1deg));
    }
}

/* Gradient Border Reveal on Card Hover */
.service-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, var(--glow-color), rgba(255, 255, 255, 0.35), var(--glow-color));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    clip-path: inset(0 round var(--service-card-radius));
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    pointer-events: none;
    z-index: 1;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.service-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 30px var(--glow-color);
    background: rgba(255, 255, 255, 0.04);
    animation-play-state: paused;
}

.service-card:hover::before {
    opacity: 1;
}

#services.services-jelly-enabled .service-card {
    animation: none;
    opacity: 0;
    pointer-events: none;
    transform: translateY(42px) scaleX(0.9) scaleY(1.08) rotate(-0.4deg);
}

#services.services-jelly-enabled .service-card.is-revealed {
    animation: service-card-burst-in 0.86s cubic-bezier(0.22, 1.22, 0.34, 1) both;
    pointer-events: auto;
}

#services.services-jelly-enabled .service-card.jelly-live {
    animation: none;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(calc(var(--svc-ty-base) + var(--svc-ty-hover) + var(--svc-float-y))) scaleX(calc(1 + var(--svc-sx-base) + var(--svc-sx-hover) + var(--svc-float-sx))) scaleY(calc(1 + var(--svc-sy-base) + var(--svc-sy-hover) + var(--svc-float-sy))) rotate(calc(var(--svc-rot-base) + var(--svc-rot-hover)));
    transition: transform 0.56s cubic-bezier(0.2, 0.9, 0.24, 1), box-shadow 0.42s ease, background 0.42s ease, border-color 0.42s ease;
    animation: service-card-micro-float 7.2s cubic-bezier(0.33, 0.06, 0.28, 1) infinite;
}

#services.services-jelly-enabled .service-card.jelly-live:hover {
    --svc-ty-hover: -13px;
    --svc-sx-hover: 0.034;
    --svc-sy-hover: -0.028;
    --svc-rot-hover: 0deg;
    transform: translateY(calc(var(--svc-ty-base) + var(--svc-ty-hover) + var(--svc-float-y))) scaleX(calc(1 + var(--svc-sx-base) + var(--svc-sx-hover) + var(--svc-float-sx))) scaleY(calc(1 + var(--svc-sy-base) + var(--svc-sy-hover) + var(--svc-float-sy))) rotate(calc(var(--svc-rot-base) + var(--svc-rot-hover)));
    box-shadow:
        0 30px 64px rgba(0, 0, 0, 0.54),
        0 0 36px var(--glow-color),
        0 0 12px rgba(var(--glow-rgb), 0.36);
    background: rgba(255, 255, 255, 0.055);
    animation-play-state: running;
}

/* Squircle Icon Container */
/* Squircle Icon Container */
.service-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    /* Base subtle bg */
    --service-icon-radius: 22px;
    border-radius: var(--service-icon-radius);
    position: relative;
    overflow: hidden;
    overflow: clip;
    /* Mask for sliding gradient */
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1),
        box-shadow 0.5s cubic-bezier(0.23, 1, 0.32, 1),
        filter 0.5s cubic-bezier(0.23, 1, 0.32, 1),
        color 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    color: var(--text-main);
    z-index: 2;
    isolation: isolate;
    contain: paint;
    clip-path: inset(0 round var(--service-icon-radius));
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Gradient Fill Layer (Direction Aware) */
.service-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--glow-color), var(--glow-color-dark));
    opacity: 0;
    transform: translate(var(--tx, 0), var(--ty, 100%));
    /* Start hidden (will be overridden by JS) */
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.3s ease;
    z-index: -1;
}

.service-icon::after {
    content: '';
    position: absolute;
    inset: -12%;
    border-radius: inherit;
    background: radial-gradient(circle, rgba(var(--glow-rgb), 0.46) 0%, rgba(var(--glow-rgb), 0) 72%);
    opacity: 0;
    transform: scale(0.84);
    transition: opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1), transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    mix-blend-mode: screen;
    z-index: -2;
}

/* Distinct Gradients for each card */
.service-card:nth-child(1) {
    --glow-color: #c586c0;
    --glow-color-dark: #9a5c96;
    --glow-rgb: 197, 134, 192;
}

.service-card:nth-child(2) {
    --glow-color: #569cd6;
    --glow-color-dark: #418ac6;
    --glow-rgb: 86, 156, 214;
}

.service-card:nth-child(3) {
    --glow-color: #4ec9b0;
    --glow-color-dark: #3da08d;
    --glow-rgb: 78, 201, 176;
}

.service-card:nth-child(4) {
    --glow-color: #ce9178;
    --glow-color-dark: #ad735a;
    --glow-rgb: 206, 145, 120;
}

.service-card:hover .service-icon {
    color: #fff;
    transform: scale(1.09);
    /* Slight scale up */
    box-shadow:
        0 6px 24px rgba(0, 0, 0, 0.24),
        0 0 18px rgba(var(--glow-rgb), 0.42),
        inset 0 0 16px rgba(var(--glow-rgb), 0.22);
    filter: drop-shadow(0 0 10px rgba(var(--glow-rgb), 0.52)) drop-shadow(0 0 24px rgba(var(--glow-rgb), 0.34));
}

.service-card:hover .service-icon::before {
    opacity: 1;
    transform: translate(0, 0) !important;
    /* Force fill */
}

.service-card:hover .service-icon::after {
    opacity: 1;
    transform: scale(1.08);
}

.service-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
}

.service-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* ── Portfolio Section ── */
/* ── Infinite Portfolio Carousel ── */
#portfolio {
    padding: 0;
    overflow: hidden;
    position: relative;
    background: transparent;
    /* Fixed: Removed black bg */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.portfolio-header {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    z-index: 10;
    pointer-events: none;
}

.portfolio-viewport {
    width: 100%;
    height: 60vh;
    position: relative;
    overflow: visible;
    /* cursor: grab; REMOVED */
    perspective: 1000px;
    touch-action: pan-y;
    /* Allow vertical scroll, but maybe block horizontal if we want to be safe? actually auto is fine if no listeners */
}

.project-card-3d img {
    pointer-events: none;
    /* Prevent drag ghost */
    user-select: none;
    -webkit-user-drag: none;
}

.portfolio-viewport:active {
    /* cursor: grabbing; REMOVED */
}

.portfolio-track {
    display: flex;
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    gap: 4vw;
    padding-left: 50vw;
    /* Center start */
    will-change: transform;
}

/* Kinetic Project Card */
.project-card-3d {
    width: 40vw;
    min-width: 400px;
    height: 100%;
    position: relative;
    flex-shrink: 0;
    border-radius: 20px;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 0.1s linear;
    /* Smooth inertia updates */
    user-select: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    /* Glass Effect */
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px;
    /* Frame */
}

.project-card-3d img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.05);
    transition: transform 0.5s ease;
    filter: brightness(0.8);
}

.project-card-3d:hover img {
    transform: scale(1.1);
    filter: brightness(1);
}

/* UI Overlay */
.project-ui-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), transparent 40%, rgba(0, 0, 0, 0.8));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2.5rem;
    color: white;
    transform: translateZ(20px);
    pointer-events: none;
}

.project-meta {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    text-align: left;
}

.project-card-3d:hover .project-meta {
    opacity: 1;
    transform: translateY(0);
}

.project-tags {
    font-size: 0.75rem;
    color: #ff00ff;
    /* Neon Pink/Purple or similar accent */
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    display: inline-block;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.project-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    color: white;
    line-height: 1.1;
}

.project-desc {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 90%;
    font-weight: 400;
    line-height: 1.4;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* Emoji Styling */
.project-emoji-container {
    width: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.project-emoji {
    font-size: 14rem;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s ease;
    line-height: 1;
    /* Fix vertical alignment */
}

.carousel-card:hover .project-emoji {
    transform: scale(1.1) rotate(5deg);
}

/* Fix for 3D Shadow Artifact */
.carousel-card {
    /* Ensure no weird 3D clipping */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    /* Smooth transition for tilt */
    will-change: transform;

    /* NUCLEAR OPTION: Disable all dragging/selection */
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: default !important;
    /* Ensure no hand cursor on the card itself */
    pointer-events: none;
    /* HEADER LOCK: Disable interaction by default */
}

/* Only active card interacts */
.carousel-card.card-active {
    pointer-events: auto;
}

/* Prevent hand cursor on active click */
.carousel-card:active,
.carousel-card:focus {
    cursor: default !important;
}

.carousel-card a.project-trigger {
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 50 !important;
    /* Ensure it's above everything */
    user-select: none;
    /* Keep text unselectable but clickable */
    -webkit-user-drag: none;
}

/* NUCLEAR FIX: Prevent any transform reset on active/focus */
.carousel-card:active,
.carousel-card:focus,
.carousel-card:focus-within,
.carousel-card:hover:active {
    transform-style: preserve-3d !important;
    outline: none !important;
    cursor: default !important;
    /* Important: We rely on JS for transform, so we don't want CSS to override it with 'none' or 'scale'. 
       Inline styles win over normal CSS, so just ensure no !important CSS overrides inline. */
}

/* Ensure children don't capture drag */
.carousel-card *,
.project-card-inner * {
    -webkit-user-drag: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

/* Exception for links */
.carousel-card a.project-trigger {
    cursor: pointer !important;
    pointer-events: auto !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
}


/* Mobile adjust for emoji */
@media (max-width: 768px) {
    .project-emoji-container {
        width: 100%;
        margin-bottom: 1rem;
    }

    .project-emoji {
        font-size: 6rem;
    }
}

/* Hints */
.drag-hint {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    pointer-events: auto;
    /* Allow interaction */
    cursor: pointer;
    opacity: 0;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(13, 13, 13, 0.45);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    transition: opacity 0.3s ease;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.drag-hint.left {
    left: 2rem;
}

.drag-hint.right {
    right: 2rem;
}

#portfolio:hover .drag-hint {
    opacity: 1;
    /* Fully visible on section hover */
}

/* ── Mobile Carousel Adjustments ── */
@media (max-width: 768px) {
    .project-card-3d {
        width: 80vw;
        min-width: 300px;
    }

    .portfolio-track {
        padding-left: 10vw;
        gap: 1rem;
    }

    .project-title {
        font-size: 1.8rem;
    }

    .portfolio-viewport {
        height: 50vh;
    }
}

/* ── Playground / Contact Section ── */
#contact {
    padding: 4rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.playground-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.ui-group {
    margin-bottom: 2rem;
}

.ui-label {
    display: block;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: #fff;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s ease, background 0.3s ease;
    font-size: 1rem;
}

input:focus,
textarea:focus {
    border-color: var(--primary-blue);
    background: rgba(86, 156, 214, 0.05);
    box-shadow: 0 0 16px rgba(86, 156, 214, 0.1);
}

/* ── Contact ── */
.contact-wrapper {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--glass-bg);
    border-radius: 34px;
    position: relative;
    overflow: hidden;
    transform-origin: center bottom;
    will-change: transform, border-radius, box-shadow;
    --contact-ty-base: 0px;
    --contact-sx-base: 0;
    --contact-sy-base: 0;
    --contact-ty-hover: 0px;
    --contact-sx-hover: 0;
    --contact-sy-hover: 0;
    opacity: 0;
    animation: heroPanelEntry 1.06s cubic-bezier(0.22, 1.18, 0.34, 1) forwards;
}

.contact-wrapper.contact-live {
    animation: none;
    opacity: 1;
    transform: translateY(calc(var(--contact-ty-base) + var(--contact-ty-hover))) scaleX(calc(1 + var(--contact-sx-base) + var(--contact-sx-hover))) scaleY(calc(1 + var(--contact-sy-base) + var(--contact-sy-hover)));
}

.contact-wrapper.contact-live:hover {
    --contact-ty-hover: -1px;
    --contact-sx-hover: 0.004;
    --contact-sy-hover: -0.002;
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.16),
        0 24px 58px rgba(0, 0, 0, 0.38);
}

.contact-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.04), transparent 42%);
}

.contact-wrapper .section-title,
.contact-wrapper .contact-lead,
.contact-wrapper .contact-link-inline {
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.contact-wrapper .section-title {
    animation-delay: 0.2s;
}

.contact-wrapper .contact-lead {
    animation-delay: 0.4s;
}

.contact-wrapper .contact-link-inline {
    animation-delay: 0.6s;
}

.mail-link {
    font-size: 2rem;
    color: #fff;
    text-decoration: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 0.5rem;
    transition: all 0.3s ease;
    font-weight: 700;
}

.mail-link:hover {
    color: var(--primary-purple);
    border-color: var(--primary-purple);
    text-shadow: 0 0 16px rgba(197, 134, 192, 0.35);
}

/* ── Portfolio / Card Stack Overrides ── */
/* Ensure the portfolio content fits well in the shared card structure */
#portfolio-carousel .carousel-card {
    /* Optional: Make it slightly more transparent if requested "no gray background" */
    background: rgba(20, 20, 20, 0.4);
    backdrop-filter: blur(20px) saturate(180%);
}

.project-content-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
}

.project-card-inner {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    align-items: center;
    height: 100%;
}

.project-img-main {
    width: 50%;
    max-height: 100%;
    object-fit: contain;
    /* or cover based on pref */
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.project-info-glass {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    text-align: left;
}

.project-tags {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--primary-blue);
    font-weight: 700;
    text-transform: uppercase;
}

.project-title {
    font-size: 2.5rem;
    line-height: 1.1;
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.project-desc {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    max-width: 400px;
}

/* Mobile Adjustments for Card Layout */
@media (max-width: 768px) {
    .project-card-inner {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .project-img-main {
        width: 100%;
        max-height: 200px;
    }

    .project-info-glass {
        align-items: center;
        text-align: center;
    }

    .project-title {
        font-size: 1.8rem;
    }
}


.project-content-wrap {
    height: 100%;
    overflow: hidden;
    /* Disable internal scroll */
    position: relative;
}

/* ── Footer ── */
footer {
    text-align: center;
    padding: 2rem;
    opacity: 0.5;
    font-size: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 4rem;
    color: var(--text-muted);
}

/* ── Performance Tier Overrides ── */

body.perf-low .glass-panel,
body.perf-low .liquid-glass,
body.perf-low .nav-bubble-left,
body.perf-low .nav-bubble-right,
body.perf-low .hero-content {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(20, 20, 20, 0.85);
}

body.perf-low .service-card {
    animation: none;
}

body.perf-low #noise-overlay {
    display: none;
}

body.perf-medium .glass-panel,
body.perf-medium .liquid-glass {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

body.perf-medium .nav-bubble-left,
body.perf-medium .nav-bubble-right {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ── Responsiveness ── */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .playground-container {
        grid-template-columns: 1fr;
    }

    #main-header {
        padding: 0.8rem clamp(0.35rem, 2.8vw, 0.75rem);
    }

    .nav-bubble-right {
        padding: 0.55rem clamp(0.55rem, 2.5vw, 0.95rem);
    }

    nav[data-state="expanded"] .nav-bubble-right {
        justify-content: space-between;
    }

    nav[data-state="expanded"] .nav-logo-area {
        max-width: clamp(88px, 28vw, 150px);
        padding-left: clamp(0.08rem, 0.6vw, 0.26rem);
    }

    .nav-logo {
        font-size: clamp(0.68rem, 3vw, 0.86rem);
    }

    nav[data-state="expanded"] .nav-links {
        max-width: 100%;
        opacity: 1;
        gap: clamp(0.3rem, 2vw, 0.72rem);
        margin-left: clamp(0.24rem, 1.8vw, 0.75rem);
        transform: translateX(0);
    }

    nav[data-state="expanded"] .nav-links a {
        font-size: clamp(0.6rem, 2.9vw, 0.78rem);
        letter-spacing: -0.01em;
    }

    nav[data-state="compact"] .nav-links {
        max-width: 0;
        opacity: 0;
        margin-left: 0;
        transform: translateX(-24px);
    }

    nav[data-state="compact"] .menu-label {
        display: inline-block;
        font-size: clamp(0.62rem, 2.6vw, 0.78rem);
        max-width: 100px;
        opacity: 0.86;
    }

    #hero {
        min-height: 80vh;
    }

    .section-title {
        font-size: 2rem;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .hero-content {
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        padding: 2.5rem;
    }

    .nav-bubble-left,
    .nav-bubble-right {
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }

    .hero-content {
        padding: 2rem;
        border-radius: 24px;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .mail-link {
        font-size: 1.3rem;
    }

    nav[data-state="expanded"] .nav-logo-area {
        max-width: clamp(68px, 26vw, 108px);
    }

    .nav-logo {
        font-size: clamp(0.62rem, 3.4vw, 0.76rem);
    }

    .nav-bubble-right {
        padding: 0.5rem clamp(0.4rem, 2.2vw, 0.7rem);
    }

    .nav-bubble-right .nav-links {
        display: flex;
        gap: clamp(0.22rem, 2vw, 0.45rem);
        margin-left: clamp(0.16rem, 1.4vw, 0.42rem);
    }

    .nav-links a {
        font-size: clamp(0.53rem, 3vw, 0.7rem);
    }
}

/* ── Scroll-to-Top Button ── */
#scroll-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(13, 13, 13, 0.45);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    box-shadow:
        0 0 10px rgba(0, 0, 0, 0.5),
        0 4px 20px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;

    /* Hidden by default */
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

#scroll-top-btn.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

#scroll-top-btn:hover {
    border-color: rgba(197, 134, 192, 0.3);
    box-shadow:
        0 0 10px rgba(0, 0, 0, 0.5),
        0 0 16px rgba(197, 134, 192, 0.15);
}

.scroll-top-icon {
    width: 20px;
    height: 16px;
    color: rgba(255, 255, 255, 0.7);
    display: block;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
        opacity 0.3s ease;
}

/* Flatten chevron to dash on scroll-to-top */
.scroll-top-icon.flattening {
    transform: scaleY(0.15);
}

/* ── Contact Modal ── */
#contact-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#contact-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: rgba(18, 18, 18, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 3rem;
    width: 90%;
    max-width: 600px;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.7);
    position: relative;
    text-align: center;
    /* Ensure it's not stuck */
    margin: auto;
}

/* ── Vertical PS3-Style Module (Scoped) ── */
/* Restore global scroll */
body,
html {
    background-color: #000 !important;
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
    margin: 0;
    padding: 0;
    background: transparent;
}

/* The Module Container */
#vertical-stage {
    position: relative;
    width: 100%;
    height: 100vh;
    /* Takes full viewport height when scrolled to */
    min-height: 800px;
    overflow: hidden;
    margin: 4rem 0;
    /* Add spacing from other sections */
}

/* Tiers positioned ABSOLUTELY within the relative stage */
#portfolio,
#playground {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding-top: 0;
    /* Let flex handle centering */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1.000), opacity 0.8s ease;
}

/* Initial State: Projects Active */
#portfolio {
    z-index: 10;
    transform: translateY(0);
    opacity: 1;
    /* background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%); */
}

#playground {
    z-index: 9;
    transform: translateY(100%);
    /* Start below stage */
    opacity: 0;
    pointer-events: none;
    /* background: radial-gradient(circle at center, #111 0%, #000 100%); */
}

/* State: Playground Active (Applied to STAGE, not body) */
#vertical-stage.view-playground #portfolio {
    transform: translateY(-100%);
    /* Move up */
    opacity: 0;
    pointer-events: none;
}

#vertical-stage.view-playground #playground {
    transform: translateY(0);
    /* Move in */
    opacity: 1;
    pointer-events: auto;
}

/* Nav Buttons */
.tier-nav-btn {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(13, 13, 13, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.8rem 2rem;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
    z-index: 100;
}

.tier-nav-btn.lab-gated {
    display: none !important;
}

.tier-nav-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.tier-nav-btn .icon {
    font-size: 1.2rem;
}

.tier-nav-btn.down {
    bottom: 1.5rem;
    animation: float-nav 3s ease-in-out infinite;
}

.tier-nav-btn.up {
    top: 7rem;
    /* Below header */
    animation: float-nav 3s ease-in-out infinite;
}

@keyframes float-nav {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(-10px);
    }
}

/* Override existing margins/padding from sections if needed */
#portfolio .portfolio-header,
#playground .section-header {
    margin-top: 0;
    padding-top: 0;
}

/* Reusing .modal structure for Project Modal, but ensuring it overrides */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal.open {
    opacity: 1;
    pointer-events: auto;
}

/* Project Modal Specifics */
.project-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

@media (max-width: 768px) {
    .project-modal-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .modal-content {
        padding: 2rem;
        width: 95%;
    }

    #modal-title {
        font-size: 1.8rem !important;
    }
}

/* ── Hover Effects for Project Cards ── */
.project-card-3d {
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease;
    /* cursor: pointer; REMOVED to prevent confusion */
}

.project-card-3d:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.project-card-3d:hover .project-ui-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.5) 100%);
}

/* Placeholder specific */
.placeholder-card {
    background: #111;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.placeholder-content {
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
}

.placeholder-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 0.5rem;
    filter: grayscale(1);
    transition: filter 0.3s;
}

.placeholder-card:hover .placeholder-icon {
    filter: grayscale(0);
}

#contact-modal.open .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #666;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #fff;
}

.project-types {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin: 2rem 0;
    justify-content: center;
}

.type-checkbox {
    display: none;
}

.type-label {
    padding: 0.6rem 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.02);
    color: #aaa;
    user-select: none;
}

.type-checkbox:checked+.type-label {
    background: #fff;
    color: #000;
    border-color: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

.modal-cta {
    display: inline-block;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #c586c0, #7c3aed);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 1rem;
    transition: transform 0.2s;
    text-decoration: none;
}

.modal-cta:hover {
    transform: scale(1.02);
}

/* ── Polish Pass: Consistency + Premium Tone ── */
:root {
    --surface-elevated: rgba(255, 255, 255, 0.04);
    --surface-border: rgba(255, 255, 255, 0.08);
    --radius-card: 28px;
    --shadow-soft: 0 14px 45px rgba(0, 0, 0, 0.38);
}

#noise-overlay {
    opacity: 0.012;
    animation: grain 0.35s steps(2) infinite;
}

.logo-dot,
.hero-dot {
    animation: spin-3d 4s ease-in-out infinite;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.9rem);
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.section-subtitle {
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.04rem;
    line-height: 1.65;
}

.section-subtitle--narrow {
    max-width: 600px;
}

.portfolio-title {
    margin-bottom: 0.5rem;
}

.hero-content {
    background: transparent;
    background-image: linear-gradient(135deg, rgba(86, 156, 214, 0.05), rgba(197, 134, 192, 0.05));
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.15), 0 20px 50px rgba(0, 0, 0, 0.35);
}

.tagline {
    color: rgba(255, 255, 255, 0.84);
}

.service-card {
    animation: none;
    background: var(--surface-elevated);
    border-color: var(--surface-border);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

.service-card:hover {
    transform: translateY(-11px) scale(1.02);
    box-shadow:
        0 22px 46px rgba(0, 0, 0, 0.34),
        0 0 24px rgba(197, 134, 192, 0.22);
}

#portfolio-wrapper.carousel-wrapper {
    position: relative;
    height: clamp(520px, 64vh, 620px);
    margin: 0;
    perspective: 1200px;
    overflow: visible;
    padding: 0 2.2rem 4.6rem;
}

#portfolio-wrapper .carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
    touch-action: pan-x;
}

#portfolio-wrapper .carousel-card {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(86vw, 1180px);
    height: min(500px, 60vh);
    border-radius: 30px;
    padding: 2.5rem;
    background: rgba(14, 14, 17, 0.66);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 22px 64px rgba(0, 0, 0, 0.44),
        inset 0 1px 2px rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    transform-origin: center center;
    transition: transform 620ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 420ms ease,
        filter 520ms ease;
    will-change: transform, opacity, filter;
    opacity: 0;
    pointer-events: none;
}

#portfolio-wrapper .carousel-card.rail-active {
    z-index: 12;
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) translateX(0) scale(1);
    filter: saturate(1.04);
}

#portfolio-wrapper .carousel-card.rail-active:hover {
    transform: translate(-50%, -50%) translateX(0) scale(1.018);
    filter: saturate(1.08) brightness(1.03);
}

#portfolio-wrapper .carousel-card.rail-prev {
    z-index: 9;
    opacity: 0.44;
    transform: translate(-50%, -50%) translateX(-58%) scale(0.9);
    filter: saturate(0.75) brightness(0.78);
}

#portfolio-wrapper .carousel-card.rail-next {
    z-index: 9;
    opacity: 0.44;
    transform: translate(-50%, -50%) translateX(58%) scale(0.9);
    filter: saturate(0.75) brightness(0.78);
}

#portfolio-wrapper .carousel-card.rail-hidden {
    z-index: 1;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.82);
    filter: blur(0.4px);
}

#portfolio-wrapper .carousel-card:hover .project-emoji {
    transform: none;
}

#portfolio-wrapper .project-card-inner {
    display: grid;
    grid-template-columns: 58% 42%;
    align-items: center;
    gap: 2.4rem;
    height: 100%;
}

#portfolio-wrapper .project-emoji-container {
    width: 100%;
    height: 100%;
    border-radius: 24px;
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

#portfolio-wrapper .project-emoji {
    font-size: clamp(6rem, 10vw, 9.2rem);
}

#portfolio-wrapper .project-info-glass {
    align-items: flex-start;
    text-align: left;
    gap: 1rem;
}

#portfolio-wrapper .project-tags {
    color: var(--primary-blue);
    background: transparent;
    border: 0;
    padding: 0;
    text-shadow: none;
}

#portfolio-wrapper .project-title {
    background: linear-gradient(135deg, #fff 0%, #cfd6df 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 3px 16px rgba(0, 0, 0, 0.46);
}

#portfolio-wrapper .project-desc {
    max-width: 34ch;
    color: rgba(255, 255, 255, 0.82);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.44);
}

.portfolio-shimmer-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    border-radius: 20px;
}

.drag-hint {
    display: none;
}

#portfolio-wrapper .nav-dots {
    display: none;
}

#portfolio-wrapper .carousel-nav {
    top: 50%;
    left: 0;
    width: 100%;
    padding: 0 0.5rem;
}

#portfolio-wrapper .nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(8, 8, 10, 0.52);
}

#portfolio-wrapper .nav-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.06);
}

#portfolio-wrapper .portfolio-progress {
    position: absolute;
    left: 50%;
    bottom: 0.8rem;
    transform: translateX(-50%);
    padding: 0.36rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.03));
    backdrop-filter: blur(14px) saturate(145%);
    -webkit-backdrop-filter: blur(14px) saturate(145%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 12px 30px rgba(0, 0, 0, 0.32);
    display: flex;
    align-items: center;
    gap: 0.62rem;
    z-index: 120;
    overflow: hidden;
    isolation: isolate;
}

#portfolio-wrapper .portfolio-progress::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.015) 55%);
    pointer-events: none;
    z-index: -1;
}

#portfolio-wrapper .portfolio-progress-step {
    --step-width: 10px;
    width: var(--step-width);
    height: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    border-radius: 999px;
    overflow: hidden;
    transition: width 380ms cubic-bezier(0.22, 1, 0.36, 1), transform 260ms ease;
}

#portfolio-wrapper .portfolio-progress-core {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.18) 55%, rgba(255, 255, 255, 0.1) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -2px 5px rgba(0, 0, 0, 0.16);
    transition: background 320ms ease, box-shadow 340ms ease, border-color 320ms ease;
}

#portfolio-wrapper .portfolio-progress-step.is-active {
    --step-width: 42px;
    transform: translateY(-0.5px);
}

#portfolio-wrapper .portfolio-progress-step.is-active .portfolio-progress-core {
    border-color: rgba(201, 235, 255, 0.74);
    background:
        linear-gradient(90deg, rgba(121, 211, 255, 0.92) 0%, rgba(197, 134, 192, 0.9) 100%),
        linear-gradient(160deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.08));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        0 0 12px rgba(121, 211, 255, 0.4),
        0 0 22px rgba(197, 134, 192, 0.34);
}

#playground .carousel-wrapper {
    margin-top: 2.5rem;
}

#playground-carousel {
    touch-action: pan-x;
}

.playground-controls {
    margin-bottom: 2rem;
    z-index: 20;
    position: relative;
    display: flex;
    gap: 0.8rem;
}

.flex-col-start {
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
    width: 100%;
}

.flex-col-compact {
    gap: 1.5rem;
}

.lab-item-spaced {
    margin-top: 2rem;
}

.lab-item-full {
    width: 100%;
}

.materials-more-card {
    background: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.magic-note {
    text-align: center;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.85rem;
    margin-top: 1rem;
}

.contact-lead {
    margin: 0 auto 3rem;
    color: var(--text-muted);
    max-width: 500px;
}

.contact-link-inline {
    display: inline-block;
}

.project-modal-content {
    max-width: 800px;
    text-align: left;
    position: relative;
}

.project-modal-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.project-modal-image {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.project-modal-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.project-modal-desc {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.project-modal-link {
    width: auto;
    padding: 1rem 2rem;
    display: inline-flex;
}

.contact-modal-title {
    margin-bottom: 1rem;
    color: #fff;
}

.contact-modal-subtitle {
    color: #888;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    #portfolio-wrapper .carousel-card {
        width: min(94vw, 720px);
        height: min(500px, 66vh);
        padding: 1.6rem;
    }

    #portfolio-wrapper .carousel-card.rail-prev {
        transform: translate(-50%, -50%) translateX(-52%) scale(0.9);
        opacity: 0.3;
    }

    #portfolio-wrapper .carousel-card.rail-next {
        transform: translate(-50%, -50%) translateX(52%) scale(0.9);
        opacity: 0.3;
    }

    #portfolio-wrapper .project-card-inner {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    #portfolio-wrapper .project-emoji-container {
        min-height: 180px;
    }

    #portfolio-wrapper .project-info-glass {
        align-items: center;
        text-align: center;
    }

    #portfolio-wrapper .project-desc {
        max-width: 100%;
    }

    #portfolio-wrapper .portfolio-progress-step.is-active {
        --step-width: 34px;
    }

    .project-modal-grid-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ── Accessibility helper ───────────────────────────────── */
.u-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* ── Flow Strip (after hero) ────────────────────────────── */
#service-flow-strip {
    width: 100%;
    padding: 0 0 3rem;
    overflow: hidden;
}

.flow-strip-shell {
    position: relative;
    width: 100%;
    min-height: 112px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(95% 180% at 50% 50%, rgba(172, 57, 64, 0.22) 0%, rgba(22, 8, 10, 0.32) 50%, rgba(4, 4, 6, 0.92) 100%),
        linear-gradient(90deg, rgba(86, 156, 214, 0.1) 0%, rgba(197, 134, 192, 0.09) 50%, rgba(86, 156, 214, 0.1) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(255, 255, 255, 0.08),
        0 18px 36px rgba(0, 0, 0, 0.24);
}

.flow-strip-shell::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01) 56%);
    z-index: -1;
}

.flow-strip-track {
    display: flex;
    width: max-content;
    min-width: 100%;
    animation: flow-strip-loop 26s linear infinite;
    will-change: transform;
}

.flow-strip-group {
    display: flex;
    align-items: center;
    gap: clamp(1.1rem, 1.8vw, 2rem);
    flex: 0 0 auto;
    padding-inline: clamp(1.8rem, 4vw, 4.2rem);
}

.flow-item {
    font-size: clamp(1.5rem, 4.1vw, 4.2rem);
    font-weight: 700;
    color: rgba(251, 248, 248, 0.92);
    letter-spacing: -0.03em;
    white-space: nowrap;
    text-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.flow-item-outline {
    color: transparent;
    -webkit-text-fill-color: transparent;
    -webkit-text-stroke: 1.1px rgba(255, 255, 255, 0.72);
    text-shadow: none;
}

.flow-sep {
    font-size: clamp(1.15rem, 2vw, 1.85rem);
    color: rgba(255, 255, 255, 0.82);
    flex: 0 0 auto;
}

@keyframes flow-strip-loop {
    from {
        transform: translate3d(0, 0, 0);
    }

    to {
        transform: translate3d(-50%, 0, 0);
    }
}

/* ── Playground Gate section ─────────────────────────────── */
#ui-playground-gate {
    --pg-top-closed: 35%;
    --pg-bottom-closed: 64%;
    --pg-top-open: 9%;
    --pg-bottom-open: 84%;
    position: relative;
    width: 100%;
    min-height: clamp(640px, 86vh, 920px);
    margin-top: 3.5rem;
    padding: 5.2rem 0 4.6rem;
    overflow: hidden;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#ui-playground-gate.is-open {
    min-height: clamp(920px, 118vh, 1240px);
}

.pg-track {
    position: absolute;
    left: -16vw;
    width: 132vw;
    display: flex;
    gap: 1rem;
    pointer-events: none;
    transform-origin: center center;
    z-index: 2;
    transition:
        top 900ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 900ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 500ms ease;
}

.pg-track-top {
    top: var(--pg-top-closed);
    transform: rotate(-12deg);
}

.pg-track-bottom {
    top: var(--pg-bottom-closed);
    transform: rotate(10deg);
}

#ui-playground-gate.is-open .pg-track-top {
    top: var(--pg-top-open);
    transform: rotate(0deg);
}

#ui-playground-gate.is-open .pg-track-bottom {
    top: var(--pg-bottom-open);
    transform: rotate(0deg);
}

.pg-track-run {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: max-content;
    flex: 0 0 auto;
}

.pg-track-top .pg-track-run {
    animation: pg-track-left 31s linear infinite;
}

.pg-track-bottom .pg-track-run {
    animation: pg-track-right 33s linear infinite;
}

.pg-pill {
    padding: 0.82rem 2.1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.022));
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    color: rgba(255, 255, 255, 0.95);
    font-size: clamp(1.9rem, 4.5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    white-space: nowrap;
    text-shadow: 0 8px 22px rgba(0, 0, 0, 0.42);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 10px 24px rgba(0, 0, 0, 0.24);
    animation: pg-pill-jelly 6.2s ease-in-out infinite;
}

.pg-pill-outline {
    color: transparent;
    -webkit-text-fill-color: transparent;
    -webkit-text-stroke: 1.2px rgba(255, 255, 255, 0.8);
    text-shadow: none;
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.005));
}

.pg-symbol {
    font-size: clamp(1.2rem, 2vw, 1.9rem);
    color: rgba(255, 255, 255, 0.74);
    line-height: 1;
}

.pg-launch-shell {
    width: min(700px, 92vw);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
        radial-gradient(110% 120% at 20% 0%, rgba(86, 156, 214, 0.15), rgba(197, 134, 192, 0.14) 45%, rgba(8, 8, 10, 0.2) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 24px 56px rgba(0, 0, 0, 0.32);
    text-align: center;
    padding: clamp(1.5rem, 3vw, 2.4rem);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    transition:
        opacity 480ms ease,
        transform 760ms cubic-bezier(0.22, 1, 0.36, 1),
        filter 520ms ease;
    will-change: transform;
}

.pg-launch-kicker {
    font-size: 0.74rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.64);
    margin-bottom: 0.5rem;
}

.pg-launch-title {
    font-size: clamp(1.8rem, 3.8vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.pg-launch-sub {
    color: rgba(255, 255, 255, 0.8);
    max-width: 54ch;
    margin: 0 auto;
}

.pg-launch-btn {
    margin-top: 1.6rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(140deg, rgba(197, 134, 192, 0.25), rgba(86, 156, 214, 0.24));
    color: #fff;
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.86rem 1.6rem;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 260ms ease, box-shadow 320ms ease, border-color 260ms ease;
}

.pg-launch-btn:hover {
    transform: translateY(-1px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.42);
    box-shadow:
        0 0 20px rgba(197, 134, 192, 0.22),
        0 0 34px rgba(86, 156, 214, 0.15);
}

.pg-launch-btn:disabled {
    opacity: 0.7;
    cursor: default;
}

#ui-playground-gate.is-open .pg-launch-shell {
    opacity: 0;
    transform: translate(-50%, -58%) scale(0.9);
    filter: blur(4px);
    pointer-events: none;
}

.pg-panel {
    width: min(1240px, 95vw);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 32px;
    background:
        linear-gradient(145deg, rgba(10, 10, 14, 0.82), rgba(14, 14, 20, 0.74)),
        radial-gradient(120% 130% at 10% 10%, rgba(86, 156, 214, 0.17), rgba(197, 134, 192, 0.12) 42%, rgba(7, 7, 10, 0.3) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.23),
        0 26px 66px rgba(0, 0, 0, 0.36);
    backdrop-filter: blur(22px) saturate(145%);
    -webkit-backdrop-filter: blur(22px) saturate(145%);
    overflow: hidden;
    z-index: 6;
    max-height: 0;
    opacity: 0;
    transform: translateY(26px) scaleX(0.96) scaleY(1.03);
    filter: blur(3px);
    transition:
        max-height 980ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 620ms ease,
        transform 920ms cubic-bezier(0.22, 1, 0.36, 1),
        filter 520ms ease;
    pointer-events: none;
}

#ui-playground-gate.is-open .pg-panel {
    max-height: 980px;
    opacity: 1;
    transform: translateY(0) scaleX(1) scaleY(1);
    filter: blur(0);
    pointer-events: auto;
    animation: pg-panel-jelly-in 940ms cubic-bezier(0.22, 1.1, 0.3, 1) both;
}

.pg-panel-head {
    padding: 1.4rem 1.5rem 0.6rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.pg-panel-head h3 {
    font-size: clamp(1.2rem, 2.4vw, 2rem);
    letter-spacing: -0.02em;
}

.pg-panel-head p {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.95rem;
}

.pg-showcase-wrapper {
    position: relative;
    height: clamp(520px, 62vh, 640px);
    margin: 0.3rem 0.5rem 1.4rem;
    perspective: 1200px;
    overflow: visible;
    padding: 0 2rem 3.8rem;
}

.pg-showcase-track {
    position: relative;
    width: 100%;
    height: 100%;
    touch-action: pan-x;
}

.pg-card {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(82vw, 960px);
    height: min(460px, 56vh);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background:
        linear-gradient(165deg, rgba(14, 14, 20, 0.9), rgba(12, 12, 17, 0.74)),
        radial-gradient(130% 150% at 12% 6%, rgba(86, 156, 214, 0.24), rgba(197, 134, 192, 0.17) 43%, rgba(8, 8, 10, 0.22) 100%);
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 18px 46px rgba(0, 0, 0, 0.34);
    transition:
        transform 620ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 360ms ease,
        filter 460ms ease;
    will-change: transform, opacity, filter;
    opacity: 0;
    pointer-events: none;
}

.pg-card.pg-rail-active {
    z-index: 12;
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) translateX(0) scale(1);
    filter: saturate(1.05);
}

.pg-card.pg-rail-prev {
    z-index: 9;
    opacity: 0.24;
    transform: translate(-50%, -50%) translateX(-56%) scale(0.88);
    filter: saturate(0.62) brightness(0.62) blur(0.8px);
}

.pg-card.pg-rail-next {
    z-index: 9;
    opacity: 0.24;
    transform: translate(-50%, -50%) translateX(56%) scale(0.88);
    filter: saturate(0.62) brightness(0.62) blur(0.8px);
}

.pg-card.pg-rail-hidden {
    z-index: 1;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.82);
    filter: blur(0.4px);
}

.pg-card h4 {
    font-size: clamp(1.15rem, 2vw, 1.8rem);
    letter-spacing: -0.01em;
}

.pg-card-sub {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.92rem;
    margin-top: -0.25rem;
}

.pg-demo-row {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.pg-demo-btn {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    border-radius: 14px;
    padding: 0.62rem 0.9rem;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 200ms ease, box-shadow 250ms ease, border-color 240ms ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pg-demo-btn:hover {
    transform: translateY(-2px);
}

.pg-btn-liquid {
    background: linear-gradient(130deg, rgba(66, 191, 255, 0.38), rgba(197, 134, 192, 0.46));
    box-shadow: 0 0 18px rgba(86, 156, 214, 0.35);
}

.pg-btn-outline-sweep {
    background: transparent;
    position: relative;
    overflow: hidden;
}

.pg-btn-outline-sweep::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.28) 50%, transparent 100%);
    transform: translateX(-120%);
    transition: transform 420ms ease;
}

.pg-btn-outline-sweep:hover::before {
    transform: translateX(120%);
}

.pg-btn-glass-pop {
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
}

.pg-btn-magnetic {
    background: linear-gradient(140deg, rgba(152, 255, 129, 0.28), rgba(86, 156, 214, 0.22));
}

.pg-btn-toggle.is-on {
    background: linear-gradient(140deg, rgba(197, 134, 192, 0.5), rgba(86, 156, 214, 0.44));
    border-color: rgba(255, 255, 255, 0.36);
    box-shadow: 0 0 16px rgba(197, 134, 192, 0.28);
}

.pg-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.34rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.78);
    transition: border-color 220ms ease, color 220ms ease, box-shadow 280ms ease;
}

.pg-badge.is-on {
    color: #fff;
    border-color: rgba(126, 255, 212, 0.55);
    box-shadow: 0 0 14px rgba(126, 255, 212, 0.28);
}

.pg-slider-group {
    display: grid;
    gap: 0.4rem;
}

.pg-slider-group label {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.74);
}

.pg-slider-value {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
}

.pg-range {
    --range-pct: 50%;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 11px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(90deg, rgba(197, 134, 192, 0.75) 0%, rgba(86, 156, 214, 0.7) var(--range-pct), rgba(255, 255, 255, 0.12) var(--range-pct), rgba(255, 255, 255, 0.12) 100%);
    outline: none;
}

.pg-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: #fff;
    cursor: pointer;
}

.pg-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: #fff;
    cursor: pointer;
}

.pg-range.is-gradient {
    background: linear-gradient(90deg, rgba(147, 197, 253, 0.9) 0%, rgba(197, 134, 192, 0.9) var(--range-pct), rgba(255, 255, 255, 0.12) var(--range-pct), rgba(255, 255, 255, 0.12) 100%);
}

.pg-range.is-neon {
    background: linear-gradient(90deg, rgba(126, 255, 212, 0.95) 0%, rgba(85, 247, 255, 0.9) var(--range-pct), rgba(255, 255, 255, 0.12) var(--range-pct), rgba(255, 255, 255, 0.12) 100%);
    box-shadow: 0 0 12px rgba(126, 255, 212, 0.28);
}

.pg-range.is-elastic::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    box-shadow: 0 0 0 0 rgba(197, 134, 192, 0.35);
    transition: transform 150ms ease, box-shadow 180ms ease;
}

.pg-range.is-elastic:active::-webkit-slider-thumb {
    transform: scale(1.2);
    box-shadow: 0 0 0 9px rgba(197, 134, 192, 0.2);
}

.pg-switch-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pg-switch {
    position: relative;
    width: 52px;
    height: 30px;
    display: inline-flex;
}

.pg-switch input {
    display: none;
}

.pg-switch span {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    transition: background 240ms ease;
}

.pg-switch span::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.pg-switch input:checked+span {
    background: linear-gradient(120deg, rgba(197, 134, 192, 0.68), rgba(86, 156, 214, 0.65));
}

.pg-switch input:checked+span::after {
    transform: translateX(22px);
}

.pg-pulse-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #7effd4;
    box-shadow: 0 0 12px rgba(126, 255, 212, 0.7);
    animation: pg-pulse 1.8s ease-in-out infinite;
}

.pg-loader {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: rgba(197, 134, 192, 0.9);
    border-right-color: rgba(86, 156, 214, 0.9);
    animation: pg-spin 1s linear infinite;
}

.pg-loader-wrap {
    margin-top: auto;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.pg-loader-wrap.is-fast .pg-loader {
    animation-duration: 0.45s;
    filter: drop-shadow(0 0 10px rgba(126, 255, 212, 0.4));
}

.pg-loader-wrap.is-muted .pg-loader {
    animation-duration: 1.6s;
    opacity: 0.8;
}

.pg-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.pg-chip {
    border-radius: 999px;
    padding: 0.4rem 0.72rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

.pg-tone-chip.is-active {
    border-color: rgba(255, 255, 255, 0.44);
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.16);
}

.pg-ambient-box {
    margin-top: auto;
    position: relative;
    min-height: 128px;
    border-radius: 16px;
    background: radial-gradient(circle at 16% 22%, rgba(86, 156, 214, 0.34), rgba(8, 8, 10, 0.56));
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
    transition: background 420ms ease;
}

.pg-ambient-box[data-palette="sunset"] {
    background: radial-gradient(circle at 20% 20%, rgba(255, 181, 88, 0.4), rgba(215, 70, 90, 0.28) 42%, rgba(12, 8, 10, 0.6) 100%);
}

.pg-ambient-box[data-palette="acid"] {
    background: radial-gradient(circle at 18% 20%, rgba(152, 255, 129, 0.44), rgba(78, 255, 204, 0.32) 42%, rgba(10, 14, 12, 0.6) 100%);
}

.pg-ambient-box[data-palette="acid"] .pg-orb-a {
    background: rgba(152, 255, 129, 0.74);
}

.pg-ambient-box[data-palette="acid"] .pg-orb-b {
    background: rgba(78, 255, 204, 0.7);
}

.pg-ambient-box[data-palette="sunset"] .pg-orb-a {
    background: rgba(255, 181, 88, 0.75);
}

.pg-ambient-box[data-palette="sunset"] .pg-orb-b {
    background: rgba(255, 96, 122, 0.75);
}

.pg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(8px);
}

.pg-orb-a {
    width: 86px;
    height: 86px;
    left: 12%;
    top: 18%;
    background: rgba(86, 156, 214, 0.7);
    animation: pg-orb-float-a 4.5s ease-in-out infinite;
}

.pg-orb-b {
    width: 70px;
    height: 70px;
    right: 14%;
    bottom: 14%;
    background: rgba(197, 134, 192, 0.72);
    animation: pg-orb-float-b 4.1s ease-in-out infinite;
}

.pg-carousel-nav {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 18;
}

.pg-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(8, 8, 10, 0.56);
    color: rgba(255, 255, 255, 0.86);
    cursor: pointer;
    font-size: 1.05rem;
    transition: transform 220ms ease, background 240ms ease, opacity 220ms ease;
    pointer-events: auto;
}

.pg-nav-btn:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.9);
    color: #101010;
}

.pg-nav-btn:disabled {
    opacity: 0.25;
    cursor: default;
}

.pg-progress {
    position: absolute;
    left: 50%;
    bottom: 0.2rem;
    transform: translateX(-50%);
    padding: 0.36rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.03));
    backdrop-filter: blur(14px) saturate(145%);
    -webkit-backdrop-filter: blur(14px) saturate(145%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 12px 30px rgba(0, 0, 0, 0.32);
    display: flex;
    align-items: center;
    gap: 0.62rem;
    z-index: 19;
}

.pg-progress-step {
    --step-width: 10px;
    width: var(--step-width);
    height: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    border-radius: 999px;
    overflow: hidden;
    transition: width 380ms cubic-bezier(0.22, 1, 0.36, 1), transform 260ms ease;
}

.pg-progress-core {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.18) 55%, rgba(255, 255, 255, 0.1) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -2px 5px rgba(0, 0, 0, 0.16);
    transition: background 320ms ease, box-shadow 340ms ease, border-color 320ms ease;
}

.pg-progress-step.is-active {
    --step-width: 42px;
    transform: translateY(-0.5px);
}

.pg-progress-step.is-active .pg-progress-core {
    border-color: rgba(201, 235, 255, 0.74);
    background:
        linear-gradient(90deg, rgba(121, 211, 255, 0.92) 0%, rgba(197, 134, 192, 0.9) 100%),
        linear-gradient(160deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.08));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        0 0 12px rgba(121, 211, 255, 0.4),
        0 0 22px rgba(197, 134, 192, 0.34);
}

@keyframes pg-track-left {
    from {
        transform: translate3d(0, 0, 0);
    }

    to {
        transform: translate3d(-100%, 0, 0);
    }
}

@keyframes pg-track-right {
    from {
        transform: translate3d(-100%, 0, 0);
    }

    to {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes pg-pill-jelly {

    0%,
    100% {
        transform: translateY(0) scaleX(1) scaleY(1);
    }

    35% {
        transform: translateY(-2px) scaleX(1.02) scaleY(0.98);
    }

    68% {
        transform: translateY(1px) scaleX(0.99) scaleY(1.012);
    }
}

@keyframes pg-panel-jelly-in {
    0% {
        transform: translateY(36px) scaleX(0.95) scaleY(1.06);
    }

    48% {
        transform: translateY(-4px) scaleX(1.015) scaleY(0.982);
    }

    100% {
        transform: translateY(0) scaleX(1) scaleY(1);
    }
}

@keyframes pg-btn-jelly {

    0%,
    100% {
        transform: scale(1);
    }

    40% {
        transform: scaleX(1.05) scaleY(0.95);
    }

    70% {
        transform: scaleX(0.98) scaleY(1.03);
    }
}

@keyframes pg-pulse {

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

    50% {
        transform: scale(1.4);
        opacity: 0.55;
    }
}

@keyframes pg-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pg-orb-float-a {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(14px, -10px);
    }
}

@keyframes pg-orb-float-b {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(-10px, 9px);
    }
}

/* Responsive tuning for new sections */
@media (max-width: 1024px) {
    .pg-track {
        left: -28vw;
        width: 160vw;
    }

    .pg-card {
        width: min(88vw, 860px);
        height: min(450px, 58vh);
    }

    .pg-card.pg-rail-prev {
        transform: translate(-50%, -50%) translateX(-52%) scale(0.9);
    }

    .pg-card.pg-rail-next {
        transform: translate(-50%, -50%) translateX(52%) scale(0.9);
    }
}

@media (max-width: 768px) {
    #service-flow-strip {
        padding-bottom: 2rem;
    }

    .flow-strip-shell {
        min-height: 88px;
    }

    .flow-item {
        font-size: clamp(1.25rem, 6.2vw, 2rem);
    }

    .flow-item-outline {
        -webkit-text-stroke-width: 1px;
    }

    #ui-playground-gate {
        --pg-top-closed: 33%;
        --pg-bottom-closed: 64%;
        --pg-top-open: 6%;
        --pg-bottom-open: 90%;
        min-height: 74vh;
        margin-top: 2.2rem;
        padding: 3.7rem 0 3.1rem;
    }

    #ui-playground-gate.is-open {
        min-height: 820px;
    }

    .pg-track {
        left: -42vw;
        width: 184vw;
        gap: 0.6rem;
    }

    .pg-track-top {
        transform: rotate(-8deg);
    }

    .pg-track-bottom {
        transform: rotate(7deg);
    }

    .pg-pill {
        padding: 0.64rem 1.24rem;
        font-size: clamp(1.15rem, 6.8vw, 2rem);
    }

    .pg-pill-outline {
        -webkit-text-stroke-width: 1px;
    }

    .pg-launch-shell {
        border-radius: 22px;
        padding: 1.2rem 1rem 1.3rem;
    }

    .pg-panel {
        border-radius: 24px;
    }

    #ui-playground-gate.is-open .pg-panel {
        max-height: 900px;
    }

    .pg-panel-head {
        padding: 1.1rem 0.9rem 0.8rem;
    }

    .pg-panel-head p {
        font-size: 0.84rem;
    }

    .pg-showcase-wrapper {
        height: clamp(450px, 58vh, 560px);
        padding: 0 0.3rem 3rem;
        margin: 0.1rem 0.25rem 1rem;
    }

    .pg-card {
        width: min(92vw, 720px);
        height: min(400px, 48vh);
        padding: 0.95rem;
    }

    .pg-card.pg-rail-prev {
        transform: translate(-50%, -50%) translateX(-50%) scale(0.88);
        opacity: 0.14;
        filter: saturate(0.55) brightness(0.55) blur(1px);
    }

    .pg-card.pg-rail-next {
        transform: translate(-50%, -50%) translateX(50%) scale(0.88);
        opacity: 0.14;
        filter: saturate(0.55) brightness(0.55) blur(1px);
    }

    .pg-progress-step.is-active {
        --step-width: 34px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .flow-strip-track,
    .pg-track-run,
    .pg-pill,
    .pg-pulse-dot,
    .pg-loader,
    .pg-orb {
        animation: none !important;
    }

    .pg-card,
    .pg-launch-shell,
    .pg-panel {
        transition: none !important;
    }
}
