* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    scroll-behavior: smooth;
}

/* Underwater Effect Background - Lowest Layer */
.underwater-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -10;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.4) 0%, rgba(10, 10, 20, 0.6) 50%, rgba(5, 5, 15, 0.8) 100%);
    animation: underwater-wave 8s ease-in-out infinite;
}

@keyframes underwater-wave {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(10px); }
}

/* Mesh Pattern Background */
.mesh-pattern {
    background-image: 
        radial-gradient(circle, rgba(20, 184, 166, 0.08) 1px, transparent 1px),
        radial-gradient(circle, rgba(20, 184, 166, 0.06) 1px, transparent 1px);
    background-size: 50px 50px, 80px 80px;
    background-position: 0 0, 25px 25px;
    z-index: -9;
}

/* Particle Canvas - Below Content */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -8;
}

/* Sunlight Effect */
.sunlight-effect {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 600px;
    pointer-events: none;
    z-index: -7;
    background: radial-gradient(ellipse at center, rgba(255, 220, 100, 0.15) 0%, transparent 70%);
    filter: blur(80px);
    opacity: 1;
    transition: opacity 0.3s ease;
}

.sunlight-effect.hidden {
    opacity: 0;
}

/* By default, visuals are hidden. They will be enabled only when the hero
   (intro) section is visible. Toggle by adding `visuals-active` to `body`. */
.underwater-bg,
.mesh-pattern,
#particle-canvas,
.sunlight-effect {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s ease, visibility 0.45s;
}

body.visuals-active .underwater-bg,
body.visuals-active .mesh-pattern,
body.visuals-active #particle-canvas,
body.visuals-active .sunlight-effect {
    opacity: 1;
    visibility: visible;
}

/* Ensure body is black with proper z-index */
body {
    background-color: #0A0A0A;
    position: relative;
    z-index: 0;
}

/* Ensure all sections and content are above background */
section {
    position: relative;
    z-index: 10;
}

nav {
    position: relative;
    z-index: 50;
}

footer {
    position: relative;
    z-index: 10;
}

/* Smooth transitions */
a, button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0A0A0A;
}

::-webkit-scrollbar-thumb {
    background: #14B8A6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0D9488;
}

/* Firefox Scrollbar */
* {
    scrollbar-color: #14B8A6 #0A0A0A;
    scrollbar-width: thin;
}

/* Card Glow Effect */
.group:hover {
    box-shadow: 0 0 20px rgba(20, 184, 166, 0.1);
}

/* Section Cards Neon Glow */
.group {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.group:hover {
    box-shadow: 0 0 20px rgba(20, 184, 166, 0.2), 0 0 40px rgba(20, 184, 166, 0.1), inset 0 0 15px rgba(20, 184, 166, 0.05);
    border-color: rgba(20, 184, 166, 0.6) !important;
}

/* Custom text gradient */
.gradient-text {
    background: linear-gradient(135deg, #14B8A6 0%, #06B6D4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Pulse animation for subtle effects */
@keyframes pulse-soft {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Focus states for accessibility */
input:focus,
textarea:focus {
    outline: none;
    border-color: #14B8A6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

/* Button transitions */
button {
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::before {
    width: 300px;
    height: 300px;
}

/* Neon Glow on Buttons */
button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button:hover {
    box-shadow: 0 0 20px rgba(20, 184, 166, 0.4), 0 0 40px rgba(20, 184, 166, 0.2), inset 0 0 20px rgba(20, 184, 166, 0.1);
}

/* Neon Glow on Links */
a:not(nav a) {
    position: relative;
}

a:not(nav a):hover {
    text-shadow: 0 0 10px rgba(20, 184, 166, 0.6), 0 0 20px rgba(20, 184, 166, 0.3);
}

/* Nav Link Neon Glow */
nav a {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

nav a:hover {
    text-shadow: 0 0 10px rgba(20, 184, 166, 0.5), 0 0 20px rgba(20, 184, 166, 0.3);
}

/* Input Focus Glow */
input:focus,
textarea:focus {
    outline: none;
    border-color: #14B8A6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1), 0 0 20px rgba(20, 184, 166, 0.3);
}

/* Glow Badge */
.inline-block.px-4.py-2.bg-teal-900\/30:hover {
    box-shadow: 0 0 15px rgba(20, 184, 166, 0.3);
}

/* Tab Glow Effect */
.group:focus-within {
    box-shadow: 0 0 30px rgba(20, 184, 166, 0.2), inset 0 0 20px rgba(20, 184, 166, 0.08);
}

/* Link hover underline effect */
a {
    position: relative;
}

a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: #14B8A6;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease-in-out;
}

a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Exclude nav links from underline effect */
nav a::after {
    display: none;
}

/* Nav Link Neon Glow */
nav a {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

nav a:hover {
    text-shadow: 0 0 10px rgba(20, 184, 166, 0.5), 0 0 20px rgba(20, 184, 166, 0.3);
}

/* Section animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(20, 184, 166, 0.1);
    }
    50% {
        box-shadow: 0 0 40px rgba(20, 184, 166, 0.2);
    }
}

section {
    animation: fadeInUp 0.6s ease-out forwards;
}

section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.2s; }
section:nth-child(4) { animation-delay: 0.3s; }
section:nth-child(5) { animation-delay: 0.4s; }

/* Mobile responsiveness */
@media (max-width: 768px) {
    .mesh-pattern {
        background-size: 40px 40px, 60px 60px;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
}

/* Dark mode specific adjustments */
@media (prefers-color-scheme: dark) {
    body {
        color-scheme: dark;
    }
}

/* High contrast mode support */
@media (prefers-contrast: more) {
    .mesh-pattern {
        background-image: 
            radial-gradient(circle, rgba(20, 184, 166, 0.15) 1px, transparent 1px),
            radial-gradient(circle, rgba(20, 184, 166, 0.12) 1px, transparent 1px);
    }
    
    body {
        background-color: #000000;
    }

    /* Enhanced glow in high contrast mode */
    button:hover,
    .group:hover {
        box-shadow: 0 0 30px rgba(20, 184, 166, 0.5), 0 0 60px rgba(20, 184, 166, 0.3);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .mesh-pattern,
    nav,
    footer {
        display: none;
    }
    
    body {
        background-color: white;
        color: black;
    }
}
