/* style.css - Optimized for mobile with binary tunnel effect */

/* ── CSS Variables ── */
:root {
  --bg-primary: #030712;
  --brand: #00d4ff;
  --accent: #a855f7;
  --text-primary: #f8fafc;
  --transition-slow: 1000ms;
}

/* Modern CSS reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Ensure no scroll - critical for full-screen hero */
body {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* Three.js canvas positioning - behind all content */
#three-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

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

/* ── Selection ── */
::selection {
    background: rgba(0, 212, 255, 0.2);
    color: #e0f7ff;
}

/* ── Focus Styles ── */
:focus-visible {
    outline: 2px solid rgba(0, 212, 255, 0.5);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Main content container */
main {
    position: relative;
    z-index: 10;
    pointer-events: none;
}

/* Text overlay - centered and fadeable */
#text-overlay {
    pointer-events: none;
    will-change: opacity;
}

#text-overlay.visible {
    opacity: 1 !important;
}

/* Gradient text effect - cyan to purple */
.gradient-text {
    background: linear-gradient(135deg, #00d4ff 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-glow {
    text-shadow: 0 0 60px rgba(0, 212, 255, 0.25);
}

/* Hero text with subtle effects */
.hero-text {
    /* Improve font rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtitle styling */
.subtitle {
    background: linear-gradient(90deg, #00d4ff, #a855f7, #00d4ff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 5s linear infinite;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Shimmer animation for subtitle */
@keyframes shimmer {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* ── Entrance Animations ── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Modern CSS: responsive font hierarchy using clamp() */
h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.2rem, 2vw, 1.8rem);
}

h1, h2, h3 {
    text-wrap: balance;
}

p, li {
    text-wrap: pretty;
}

/* Prefers reduced motion - disable non-essential animations */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .hero-text,
    .subtitle {
        animation: none !important;
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    h1 {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }
    
    .subtitle {
        font-size: clamp(1rem, 5vw, 1.5rem);
    }
}

@media (max-width: 360px) {
    h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
}

/* Large screens */
@media (min-width: 1536px) {
    h1 {
        font-size: 7rem;
    }
}

/* Scrollbar hiding */
::-webkit-scrollbar {
    display: none;
}

* {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Print styles */
@media print {
    #three-canvas {
        display: none;
    }
    
    body {
        background-color: white;
        color: black;
    }
    
    .hero-text {
        background: black;
        -webkit-background-clip: unset;
        background-clip: unset;
        -webkit-text-fill-color: unset;
        color: black;
    }
    
    .gradient-text {
        background: black;
        -webkit-background-clip: unset;
        background-clip: unset;
        -webkit-text-fill-color: unset;
        color: black;
    }
}
