/* Home page enhancements - fx namespace */

.fx-typescale {
    --fx-step--1: clamp(0.95rem, 0.8rem + 0.4vw, 1.05rem);
    --fx-step-0: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
    --fx-step-1: clamp(1.15rem, 1rem + 0.8vw, 1.4rem);
    --fx-step-2: clamp(1.4rem, 1.2rem + 1vw, 1.8rem);
    --fx-step-3: clamp(1.8rem, 1.6rem + 1.4vw, 2.4rem);
}

.fx-typescale .fx-text-sm { font-size: var(--fx-step--1); }
.fx-typescale .fx-text-md { font-size: var(--fx-step-0); line-height: 1.75; }
.fx-typescale .fx-text-lg { font-size: var(--fx-step-1); line-height: 1.4; }
.fx-typescale .fx-text-xxl { font-size: var(--fx-step-3); line-height: 1.1; }

.fx-reveal {
    opacity: 0;
    transform: translateY(8px);
    transition: transform 0.65s ease, opacity 0.65s ease;
}

.fx-reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

.fx-tilt {
    transition: transform 0.45s ease, box-shadow 0.45s ease;
    transform-style: preserve-3d;
}

.fx-tilt:hover {
    transform: perspective(900px) rotateX(1.2deg) rotateY(-1.2deg);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.25);
}

.fx-wrap {
    flex-wrap: wrap !important;
}

.fx-auto-gap {
    gap: clamp(0.75rem, 0.6rem + 1vw, 1.5rem) !important;
}

.fx-grid-hints {
    gap: clamp(1rem, 0.75rem + 1.2vw, 1.8rem);
}

.fx-hero-tight {
    position: relative;
}

main.main-content > .fx-hero-tight:first-child {
    margin-top: -2.75rem;
}

.fx-hero-tight .row.align-items-center {
    padding-top: clamp(1.25rem, 0.85rem + 1.5vw, 2rem) !important;
    padding-bottom: clamp(1.5rem, 1.05rem + 2vw, 2.5rem) !important;
    min-height: min(84vh, 720px);
}

.fx-hero-tight .container {
    padding-left: clamp(1.25rem, 3vw, 2rem);
    padding-right: clamp(1.25rem, 3vw, 2rem);
}

.hero-contact-card.fx-reveal { transition-delay: 0.12s; }
.hero-contact-card.fx-reveal:nth-of-type(2) { transition-delay: 0.18s; }
.hero-contact-card.fx-reveal:nth-of-type(3) { transition-delay: 0.24s; }
.hero-contact-card.fx-reveal:nth-of-type(4) { transition-delay: 0.3s; }

.fx-contact-line + .fx-contact-line {
    margin-top: 0.3rem;
}

.fx-accent {
    display: inline-flex;
    margin-left: 0.4rem;
    pointer-events: none;
}

.fx-accent-space {
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0) 65%);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.65);
    animation: fx-twinkle 3.5s ease-in-out infinite;
}

.fx-accent-cloud {
    position: relative;
    width: 1.1rem;
    height: 0.7rem;
    border-radius: 0.45rem;
    background: rgba(255,255,255,0.75);
    overflow: hidden;
}

.fx-accent-cloud::before,
.fx-accent-cloud::after {
    content: '';
    position: absolute;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
}

.fx-accent-cloud::before {
    width: 0.55rem;
    height: 0.55rem;
    top: 0;
    left: 0.1rem;
}

.fx-accent-cloud::after {
    width: 0.85rem;
    height: 0.5rem;
    bottom: 0;
    left: 0;
    border-radius: 0.4rem;
    animation: fx-cloud-drift 14s linear infinite;
}


.fx-accent-ai {
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.35);
    transition: box-shadow 0.6s ease;
}

.fx-accent-ai:hover {
    animation: fx-ai-pulse 3s ease-in-out infinite;
}

.fx-accent-linux {
    width: 1rem;
    height: 1rem;
    background: conic-gradient(from 180deg, rgba(255,255,255,0.95) 0deg, rgba(255,255,255,0) 180deg);
    mask: radial-gradient(circle at 50% 0%, transparent 30%, #000 31%);
    animation: fx-linux-spin 12s linear infinite;
}

.fx-accent-science {
    width: 1rem;
    height: 1rem;
    position: relative;
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
}

.fx-accent-science::before,
.fx-accent-science::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.85);
}

.fx-accent-science::before {
    width: 0.75rem;
    height: 0.4rem;
    bottom: 0.05rem;
    border-radius: 0.3rem 0.3rem 0.05rem 0.05rem;
}

.fx-accent-science::after {
    width: 0.18rem;
    height: 0.18rem;
    bottom: 0.45rem;
    animation: fx-bubble 2.8s ease-in-out infinite;
}

.fx-accent-science span {
    display: none;
}

#fx-starfield {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.8;
}

@keyframes fx-twinkle {
    0%, 100% { opacity: 0.2; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); }
}

@keyframes fx-cloud-drift {
    0% { transform: translateX(0); }
    100% { transform: translateX(6px); }
}

@keyframes fx-ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.25); }
    50% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
}

@keyframes fx-linux-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fx-bubble {
    0% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(-6px); opacity: 1; }
    100% { transform: translateY(-12px); opacity: 0; }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .fx-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .fx-tilt:hover {
        transform: none;
        box-shadow: none;
    }
    .fx-accent-space,
    .fx-accent-cloud::after,
    .fx-accent-ai,
    .fx-accent-linux,
    .fx-accent-science::after {
        animation: none;
    }
}

@media (max-width: 992px) {
    .fx-hero-tight .row.align-items-center {
        min-height: min(92vh, 680px);
    }
}

@media (max-width: 768px) {
    .fx-hero-tight .row.align-items-center {
        padding-top: clamp(1rem, 0.8rem + 2vw, 1.5rem) !important;
        padding-bottom: clamp(1rem, 0.8rem + 2vw, 1.5rem) !important;
        min-height: auto;
    }
    
    main.main-content > .fx-hero-tight:first-child {
        margin-top: -1rem;
    }
    
    .fx-typescale .fx-text-xxl { 
        font-size: clamp(1.75rem, 4vw, 2.25rem);
        line-height: 1.2;
    }
    
    .fx-typescale .fx-text-lg { 
        font-size: clamp(1rem, 3vw, 1.25rem);
        line-height: 1.3;
    }
    
    .fx-typescale .fx-text-md { 
        font-size: clamp(0.9rem, 2.5vw, 1rem);
        line-height: 1.6;
    }
    
    .hero-contact-grid {
        gap: 0.75rem !important;
        margin: 1.25rem 0 !important;
    }
    
    .fx-tilt:hover {
        transform: none;
        box-shadow: var(--shadow);
    }
    
    .nebula {
        opacity: 0.2;
        filter: blur(4px);
    }
    
    .hero-particle-canvas {
        opacity: 0.3;
    }
}

@media (max-width: 576px) {
    .fx-hero-tight .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .hero-contact-card {
        padding: 0.6rem 0.75rem;
    }
    
    .fx-typescale .fx-text-xxl { 
        font-size: 1.5rem;
    }
    
    .fx-typescale .fx-text-lg { 
        font-size: 0.95rem;
    }
    
    .fx-accent {
        margin-left: 0.2rem;
    }
    
    .fx-accent-space,
    .fx-accent-cloud,
    .fx-accent-ai,
    .fx-accent-linux,
    .fx-accent-science {
        width: 0.7rem;
        height: 0.7rem;
    }
    
    .nebula {
        display: none;
    }
}
