:root {
    /* Hybrid Colors from DS5 */
    --bg-page: #020617;
    /* tech-950 */
    --bg-surface: #0f172a;
    /* tech-900 */
    --bg-card: #0A0A0C;
    --primary: #06b6d4;
    /* delta-500 */
    --primary-glow: rgba(6, 182, 212, 0.5);
    --accent: #f97316;
    --tech-cyan: #00f5ff;
    --tech-purple: #9d00ff;
    --text-main: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --glass: rgba(255, 255, 255, 0.03);
    --beam-color: #06b6d4;
    --grid-color: rgba(255, 255, 255, 0.04);
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Ambient Grid & Beams (ds4 / ds5) --- */
.ambient-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.03) 1px, transparent 0);
    background-size: 32px 32px;
}

.grid-line-v {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--grid-color);
}

.grid-line-h {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--grid-color);
}

@keyframes beam-v {
    0% {
        top: -20%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 120%;
        opacity: 0;
    }
}

@keyframes beam-h {
    0% {
        left: -20%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        left: 120%;
        opacity: 0;
    }
}

.beam-v {
    position: absolute;
    width: 1px;
    height: 35vh;
    background: linear-gradient(180deg, transparent, var(--beam-color), transparent);
    z-index: 10;
    opacity: 0;
}

.beam-h {
    position: absolute;
    height: 1px;
    width: 40vw;
    background: linear-gradient(90deg, transparent, var(--beam-color), transparent);
    z-index: 10;
    opacity: 0;
}

/* --- Premium Liquid Aura (ds5) --- */
.bg-aura-wrapper {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-aura-wrapper .aura {
    position: absolute;
    width: 75vw;
    height: 75vw;
    border-radius: 50%;
    filter: blur(160px);
    opacity: 0.35;
    mix-blend-mode: plus-lighter;
}

.aura-1 {
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    top: -15%;
    right: -10%;
    animation: liquidMove-1 30s infinite alternate ease-in-out;
}

.aura-2 {
    background: radial-gradient(circle, #6366f1 0%, transparent 70%);
    bottom: -15%;
    left: -10%;
    animation: liquidMove-2 35s infinite alternate ease-in-out;
}

@keyframes liquidMove-1 {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    100% {
        transform: translate(-10%, 20%) scale(1.1) rotate(10deg);
    }
}

@keyframes liquidMove-2 {
    0% {
        transform: translate(0, 0) scale(1.05);
    }

    100% {
        transform: translate(15%, -15%) scale(1);
    }
}

/* --- Glassmorphism --- */
.glass-dark {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.4) 0%, rgba(2, 6, 23, 0.8) 100%);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

/* --- Text Gradients & Animations --- */
.text-gradient {
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-image: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    background-size: 200% 200%;
    animation: gradient-shift 8s ease infinite;
}

@keyframes gradient-shift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes blurReveal {
    0% {
        opacity: 0;
        transform: translateY(40px);
        filter: blur(12px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0px);
    }
}

.animate-blur-reveal {
    opacity: 0;
    animation: blurReveal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

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

.animate-marquee {
    animation: marquee 35s linear infinite;
    display: flex;
    width: max-content;
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

/* --- Scroll Reveal --- */
.scroll-blur {
    opacity: 0;
    transform: translateY(40px);
    filter: blur(12px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-blur.is-visible {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* --- Button Beam --- */
.btn-beam {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 54px;
    padding: 0 2rem;
    background: #020617;
    color: white;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    border: none;
    z-index: 1;
}

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

@keyframes lines-slide {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 24px 0;
    }
}

.btn-beam .beam-border {
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: transparent;
    -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;
    z-index: -2;
}

.btn-beam .beam-border::after {
    content: "";
    position: absolute;
    inset: -100%;
    background: conic-gradient(from 0deg, transparent 0% 80%, var(--primary) 100%);
    animation: beam-spin 3s linear infinite;
}

.btn-beam .btn-content-bg {
    position: absolute;
    top: 1px;
    right: 1px;
    bottom: 1px;
    left: 1px;
    background: #0B0F19;
    border-radius: inherit;
    overflow: hidden;
    z-index: -1;
}

.btn-beam .lines-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.1;
    mix-blend-mode: plus-lighter;
    background-image: repeating-linear-gradient(90deg, #fff, #fff 1px, transparent 1px, transparent 8px);
    background-size: 24px 100%;
    animation: lines-slide 1.5s linear infinite;
}

.btn-beam .bottom-glow {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 50%);
    width: 80%;
    height: 60%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 75%);
    filter: blur(15px);
    opacity: 0.4;
    transition: opacity 0.4s;
}

.btn-beam:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 15px 35px -10px var(--primary-glow);
}

.btn-beam:hover .bottom-glow {
    opacity: 0.8;
}

/* --- Project Card Tilt --- */
.project-card {
    position: relative;
    background: rgba(10, 10, 15, 0.4);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.1s ease-out, box-shadow 0.5s ease, border-color 0.5s ease;
    transform-style: preserve-3d;
}

.project-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(6, 182, 212, 0.15), transparent 40%);
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.project-card:hover {
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(6, 182, 212, 0.05);
}

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

.ds-section {
    padding: 7rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    position: relative;
    z-index: 10;
}

/* Image Masking for Backgrounds */
.img-overlay-dark {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.6) 50%, rgba(2, 6, 23, 0.4) 100%);
    z-index: 1;
}

/* Smooth Slider Transitions */
.slide-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease-in-out;
    position: absolute;
    inset: 0;
}

.slide-active {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 1s ease-in-out;
    position: absolute;
    inset: 0;
    z-index: 10;
}

/* --- Netflix Catalog Shelf --- */
.catalog-shelf {
    display: flex;
    align-items: center;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 2rem 0 3rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
    cursor: grab;
    /* Show grab cursor */
}

.catalog-shelf:active {
    cursor: grabbing;
}

.catalog-shelf.is-dragging {
    scroll-snap-type: none;
    /* Disable snap during drag */
    scroll-behavior: auto;
}

.hide-arrow {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: scale(0.8) translateY(-50%) !important;
}

.catalog-shelf::-webkit-scrollbar {
    display: none;
}

.catalog-card {
    position: relative;
    flex: 0 0 clamp(280px, 28vw, 360px);
    aspect-ratio: 2/3;
    border-radius: 1.25rem;
    overflow: hidden;
    scroll-snap-align: start;
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.45s ease,
        border-color 0.45s ease,
        z-index 0s;
    will-change: transform;
    z-index: 1;
    background: #0A0A0C;
}

.catalog-card:hover {
    transform: scale(1.05);
    /* Slightly less dramatic scale to prevent overlapping issues since they're closer */
    z-index: 20;
}

/* Per-theme glow on hover */
.catalog-card[data-theme="delta"]:hover {
    border-color: rgba(6, 182, 212, 0.5);
    box-shadow: 0 0 35px rgba(6, 182, 212, 0.25), 0 20px 50px rgba(0, 0, 0, 0.6);
}

.catalog-card[data-theme="emerald"]:hover {
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 35px rgba(16, 185, 129, 0.25), 0 20px 50px rgba(0, 0, 0, 0.6);
}

.catalog-card[data-theme="orange"]:hover {
    border-color: rgba(249, 115, 22, 0.5);
    box-shadow: 0 0 35px rgba(249, 115, 22, 0.25), 0 20px 50px rgba(0, 0, 0, 0.6);
}

.catalog-card[data-theme="blue"]:hover {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 35px rgba(59, 130, 246, 0.25), 0 20px 50px rgba(0, 0, 0, 0.6);
}

.catalog-card[data-theme="purple"]:hover {
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 35px rgba(168, 85, 247, 0.25), 0 20px 50px rgba(0, 0, 0, 0.6);
}

.catalog-card[data-theme="emerald-alt"]:hover {
    border-color: rgba(52, 211, 153, 0.5);
    box-shadow: 0 0 35px rgba(52, 211, 153, 0.25), 0 20px 50px rgba(0, 0, 0, 0.6);
}

.catalog-card canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.catalog-card .card-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.55) 45%, transparent 100%);
    z-index: 2;
    pointer-events: none;
}

.catalog-card .card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.catalog-card .card-info .card-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.catalog-card .card-icon {
    width: 40px;
    height: 40px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
    transition: transform 0.3s ease, background 0.3s ease;
}

.catalog-card:hover .card-icon {
    transform: scale(1.1);
}

.catalog-card .card-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    line-height: 1.3;
}

.catalog-card .card-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.5;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.catalog-card:hover .card-desc {
    max-height: 80px;
    opacity: 1;
}

.catalog-card .card-cta {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.35s ease 0.1s, transform 0.35s ease 0.1s;
}

.catalog-card:hover .card-cta {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .catalog-card {
        flex: 0 0 85vw;
    }

    .catalog-shelf {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@keyframes statement-float {

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

    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

.statement-icon-wrapper {
    position: absolute;
    z-index: 5;
    opacity: 0;
    transform: translateY(30px) scale(0.8);
    filter: blur(10px);
}

.statement-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(10, 10, 12, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(6, 182, 212, 0.05);
    overflow: hidden;
    animation: statement-float 7s ease-in-out infinite;
}

.statement-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .statement-icon-wrapper.hide-mobile {
        display: none;
    }

    .statement-icon {
        width: 48px;
        height: 48px;
        border-radius: 10px;
    }
}

.contact-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.625rem;
    padding: 0.6rem 0.8rem;
    color: #fff;
    /* 16px prevents iOS auto-zoom on focus */
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    width: 100%;
}

/* Scale font down visually on bigger screens */
@media (min-width: 640px) {
    .contact-input {
        font-size: 0.875rem;
    }
}

.contact-input::placeholder {
    color: rgba(148, 163, 184, 0.55);
}

.contact-input:focus {
    border-color: rgba(6, 182, 212, 0.55);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
    background: rgba(6, 182, 212, 0.04);
}

.contact-input:hover:not(:focus) {
    border-color: rgba(255, 255, 255, 0.18);
}

/* Mobile: slide up from bottom */
@media (max-width: 639px) {
    #contact-modal-card {
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
    }

    #modal-contact.active-modal #contact-modal-card {
        transform: translateY(0) !important;
    }
}