/* Noise Texture Overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Gradient Mesh Background */
.gradient-mesh {
    background:
        radial-gradient(at 18% 18%, rgba(34, 34, 34, 0.08) 0px, transparent 42%),
        radial-gradient(at 82% 12%, rgba(84, 84, 84, 0.1) 0px, transparent 46%),
        radial-gradient(at 26% 82%, rgba(34, 34, 34, 0.05) 0px, transparent 40%),
        radial-gradient(at 88% 78%, rgba(123, 123, 123, 0.07) 0px, transparent 42%),
        linear-gradient(180deg, #ffffff 0%, var(--brand-cloud) 100%);
}

/* Smooth Transitions */
.transition-smooth {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.transition-fast {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Text Gradient */
.text-gradient {
    background: var(--brand-gradient-strong);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-accent {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Magnetic Button Effect */
.magnetic-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.magnetic-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--brand-gradient);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.magnetic-btn:hover::before {
    opacity: 1;
}

.magnetic-btn span {
    position: relative;
    z-index: 1;
}

/* Hover Lift Effect */
.hover-lift {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.15);
}

/* Card Shine Effect */
.card-shine {
    position: relative;
    overflow: hidden;
}

.card-shine::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 40%,
        rgba(255, 255, 255, 0.8) 50%,
        transparent 60%
    );
    transform: translateX(-100%) rotate(45deg);
    transition: transform 0.6s ease;
}

.card-shine:hover::before {
    transform: translateX(100%) rotate(45deg);
}

/* Project Card */
.project-card {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    min-height: 300px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-card-image {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover .project-card-image {
    transform: translateY(-4px);
}

.project-card-overlay {
    display: none;
}

.project-card-content {
    position: static;
    padding: 0;
    transform: none;
    opacity: 1;
    margin-top: auto;
}

.project-card:hover .project-card-content {
    transform: none;
    opacity: 1;
}

/* Section Number */
.section-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #6b7280;
}

/* Mobile Menu */
.mobile-menu {
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-menu.active {
    transform: translateX(0);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger {
    opacity: 0;
    transform: translateY(40px);
}

.reveal-stagger.visible {
    animation: revealStagger 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Hero Text Animation */
.hero-title {
    overflow: hidden;
}

.hero-title-line {
    display: block;
    transform: translateY(100%);
    animation: slideUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
    }
}

/* Badge */
.badge-glow {
    position: relative;
}

.badge-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--brand-ink), var(--brand-graphite), var(--brand-silver), var(--brand-ink));
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    filter: blur(8px);
    transition: opacity 0.4s ease;
    background-size: 300% 300%;
    animation: gradientShift 3s ease infinite;
}

.badge-glow:hover::before {
    opacity: 0.6;
}

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

/* Floating Animation */
.float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Marquee */
.marquee {
    display: flex;
    overflow: hidden;
    user-select: none;
}

.marquee-content {
    display: flex;
    animation: marquee 30s linear infinite;
    flex-shrink: 0;
}

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* Blur Circle Decoration */
.blur-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    pointer-events: none;
}

/* Service Card Hover */
.service-card {
    position: relative;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-card:hover {
    background: rgba(255,255,255,0.95);
    border-color: rgba(0,0,0,0.1);
    transform: translateY(-4px);
}

.service-card-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 72px;
    font-weight: 700;
    line-height: 1;
    -webkit-text-stroke: 1px #e5e7eb;
    -webkit-text-fill-color: transparent;
    transition: all 0.4s ease;
}

.service-card:hover .service-card-number {
    -webkit-text-stroke-color: #9ca3af;
}

/* Process Step */
.process-step {
    position: relative;
}

.process-step::after {
    content: '';
    position: absolute;
    top: 28px;
    left: 100%;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, #e5e7eb 0%, transparent 100%);
}

.process-step:last-child::after {
    display: none;
}

/* Tech Stack Item */
.tech-item {
    padding: 16px 28px;
    background: white;
    border: 1px solid #f3f4f6;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tech-item:hover {
    background: #f9fafb;
    border-color: #e5e7eb;
    transform: translateY(-2px);
}

/* Split Text Effect */
.split-text {
    display: inline-block;
    overflow: hidden;
}

.split-text span {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
}

.split-text.visible span {
    animation: splitReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Interactive Grid */
.interactive-grid {
    display: grid;
    gap: 1px;
    background: #f3f4f6;
}

.interactive-grid > * {
    background: white;
}

/* Underline Animation */
.underline-hover {
    position: relative;
}

.underline-hover::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.underline-hover:hover::after {
    width: 100%;
}

/* Glass Card */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* Dot Pattern */
.dot-pattern {
    background-image: radial-gradient(#d1d5db 1px, transparent 1px);
    background-size: 24px 24px;
}

.hero-callout {
    z-index: 2;
}

.hero-callout-status {
    min-width: 220px;
}

.hero-callout-live {
    min-width: 180px;
}

main > section:nth-of-type(n + 2) {
    content-visibility: auto;
    contain-intrinsic-size: 1px 960px;
}

@media (max-width: 767px) {
    .noise-overlay {
        display: none;
    }

    .blur-circle {
        filter: blur(56px);
        opacity: 0.22;
    }

    .float {
        animation: none;
    }

    .hero-visual-card {
        display: flex;
        flex-direction: column;
        gap: 14px;
        padding: 20px;
        aspect-ratio: auto;
        min-height: 0;
    }

    .hero-code-window {
        margin-bottom: 0;
    }

    .hero-callout {
        position: static;
        width: 100%;
        max-width: 100%;
        transform: none;
    }

    .hero-callout-status {
        align-self: center;
        max-width: min(280px, 100%);
    }

    .hero-callout-live {
        display: none;
    }
}

@media (hover: none), (prefers-reduced-motion: reduce) {
    .badge-glow::before,
    .card-shine::before,
    .hero-title-line,
    .marquee-content,
    .float {
        animation: none;
        transition: none;
    }

    .reveal,
    .reveal-stagger {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
