/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none !important;
}

:root {
    --brand-blue: #3b82f6;
    --brand-teal: #2dd4bf;
    --bg-black: #000000;
}

html {
    background-color: var(--bg-black);
}

body {
    background-color: var(--bg-black);
    color: #fff;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Background Decorations */
.noise-bg {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    filter: contrast(150%) brightness(1000%);
}

.bg-grid {
    background-image: radial-gradient(circle at center, rgba(255,255,255,0.08) 1px, transparent 1px),
                      linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), black 0%, transparent 80%);
}

/* Typography Custom */
.hero-title {
    text-shadow: 0 0 50px rgba(59, 130, 246, 0.2);
}

.text-outline {
    -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.2);
    transition: -webkit-text-stroke 0.5s ease;
}

.hero-title:hover .text-outline {
    -webkit-text-stroke: 1.5px rgba(59, 130, 246, 0.3);
}

.hero-title span {
    display: inline-block;
    transition: color 0.5s ease, filter 0.5s ease;
}

.hero-title:hover span:not(.dot) {
    color: var(--brand-blue);
    filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.4));
}

/* Glass Cards Optimization */
.project-card, .timeline-item > div {
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0) 100%);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    overflow: hidden;
}

.project-card::after, .timeline-item > div::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--card-mouse-x, 50%) var(--card-mouse-y, 50%), rgba(59, 130, 246, 0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.project-card:hover::after, .timeline-item > div:hover::after {
    opacity: 1;
}

/* Glow Border Effect */
.glow-border {
    position: relative;
}

.glow-border::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: conic-gradient(from var(--border-angle, 0deg), transparent 0%, var(--brand-blue) 25%, transparent 50%);
    border-radius: inherit;
    padding: 1px;
    -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;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.glow-border:hover::before {
    opacity: 0.5;
}

/* Language Selector Fixes */
#lang-selector {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
    appearance: none;
    -webkit-appearance: none;
    color-scheme: dark; /* Force browser to use dark UI for dropdown */
    background-color: rgba(255, 255, 255, 0.05);
}

#lang-selector option {
    background-color: #000;
    color: #fff;
}

/* 10. Philosophy Section: Scroll Highlight Optimization */
.word {
    display: inline-block;
    margin-right: 0.25em;
    filter: blur(8px);
    opacity: 0;
    transform: translateY(20px);
    transition: filter 0.8s cubic-bezier(0.2, 1, 0.3, 1), 
                opacity 0.8s cubic-bezier(0.2, 1, 0.3, 1), 
                transform 0.8s cubic-bezier(0.2, 1, 0.3, 1);
    will-change: filter, opacity, transform;
}

.word.active {
    filter: blur(0);
    opacity: 1;
    transform: translateY(0);
    color: #fff;
}

/* 11. Staggered Reveal Defaults */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    filter: blur(10px);
    will-change: transform, opacity, filter;
}

/* 12. Transitions */
#page-curtain {
    transform: translateX(100%);
    will-change: transform;
}

/* 13. Hero Artifacts */
.hero-artifact {
    animation: float-artifact 6s infinite ease-in-out;
    animation-delay: calc(var(--d) * 10s);
    will-change: transform;
    z-index: 0;
}

@keyframes float-artifact {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(10px, -20px) rotate(5deg); }
    66% { transform: translate(-10px, 10px) rotate(-5deg); }
}

/* 14. Cursor Magnetic */
#cursor.magnetic {
    background: transparent;
    border: 1.5px solid var(--brand-blue);
    mix-blend-mode: difference;
}

#cursor.magnetic::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--brand-blue);
    opacity: 0.1;
}
