/* Custom styles that complement Tailwind (CDN) */
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #6366f1; border-radius: 999px; }

::selection { background: #6366f1; color: #fff; }

.hero-grid {
    background-image:
        linear-gradient(to right, rgba(148,163,184,.25) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(148,163,184,.25) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
            mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}

/* Navbar glass effect after scrolling */
#navbar-inner.scrolled {
    background: rgba(255,255,255,.75);
    border-color: rgba(148,163,184,.25);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 10px 30px -12px rgba(15,23,42,.25);
}
.dark #navbar-inner.scrolled { background: rgba(15,23,42,.7); border-color: rgba(255,255,255,.1); }

.nav-link { position: relative; }
.nav-link::after {
    content: ''; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
    background: #6366f1; border-radius: 2px; transition: width .25s;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link.active { color: #6366f1; }

.card-lift { transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease; }
.card-lift:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -20px rgba(99,102,241,.35); border-color: rgba(99,102,241,.4); }

.skill-bar { transition: width 1.2s cubic-bezier(.22,1,.36,1); }

.filter-btn:hover { border-color: #6366f1; color: #6366f1; }
.filter-btn.active { background: #6366f1; border-color: #6366f1; color: #fff; }
.project-card.hidden-card { display: none; }

.slider-dot.active { width: 1.75rem; background: #6366f1; }

.form-input {
    width: 100%; padding: .7rem 1rem; border-radius: .75rem; font-size: .95rem;
    border: 1px solid #e2e8f0; background: #f8fafc; color: #0f172a; outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.form-input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.2); }
.dark .form-input { background: #020617; border-color: rgba(255,255,255,.12); color: #f1f5f9; }
.form-input.invalid { border-color: #ef4444; }

#preloader { transition: opacity .5s ease, visibility .5s ease; }
#preloader.hide { opacity: 0; visibility: hidden; }

#back-to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }

.cursor-blink::after { content: '▍'; margin-left: 2px; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Stop sideways scrolling on small screens (AOS slide-in animations push elements past the edge) */
html, body { max-width: 100%; overflow-x: clip; }
@supports not (overflow: clip) {
    html, body { overflow-x: hidden; }
}

/* Let long words, emails and URLs wrap instead of stretching the page */
main p, main li, main a, main h1, main h2, main h3, main h4 { overflow-wrap: anywhere; }

/* Images and embeds never wider than their container */
img, video, iframe, svg { max-width: 100%; }
