/* ==========================================================
   RESET & BASE
   ========================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.65;
    background-image: url('/images/snowday.jpeg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: #0f172a;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    line-height: 1.2;
    color: #0f172a;
}

p { color: #0f172a; margin-bottom: 0.75rem; }

a { text-decoration: none; color: inherit; }

/* ==========================================================
   PRELOADER
   ========================================================== */

.preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #052e16, #14532d, #166534);
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.preloader.done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-ring {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: #4ade80;
    border-radius: 50%;
    animation: preloader-spin 0.8s linear infinite;
}

@keyframes preloader-spin {
    to { transform: rotate(360deg); }
}

.preloader-text {
    position: absolute;
    bottom: 30%;
    font-family: 'DM Serif Display', serif;
    font-size: 1.1rem;
    color: rgba(255,255,255,0.7);
    letter-spacing: 0.2em;
    animation: preloader-pulse 1.5s ease-in-out infinite;
}

@keyframes preloader-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ==========================================================
   SCROLL PROGRESS BAR
   ========================================================== */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #16a34a, #4ade80, #22c55e);
    z-index: 10000;
    width: 0%;
    transition: width 0.1s linear;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

/* ==========================================================
   PAGE TINT
   ========================================================== */

.page-tint {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    z-index: -1;
}

/* ==========================================================
   GLASS CARD (exact user code)
   ========================================================== */

.glass-card {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1),
        inset 0 0 34px 17px rgba(255, 255, 255, 0.07);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.8),
        transparent
    );
    z-index: 2;
}

.glass-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.8),
        transparent,
        rgba(255, 255, 255, 0.3)
    );
    z-index: 2;
}

/* ==========================================================
   3D TILT CARD
   ========================================================== */

.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.tilt-card .tilt-shine {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: radial-gradient(
        600px circle at var(--shine-x, 50%) var(--shine-y, 50%),
        rgba(255, 255, 255, 0.15),
        transparent 40%
    );
}

.tilt-card:hover .tilt-shine { opacity: 1; }

/* ==========================================================
   NAVBAR
   ========================================================== */

.glass-nav {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    transform: translateY(-100%);
    animation: nav-slide-in 0.6s ease 1.8s forwards;
}

@keyframes nav-slide-in {
    to { transform: translateY(0); }
}

.glass-nav.scrolled {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

.nav-link {
    position: relative;
    padding: 4px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #16a34a, #4ade80);
    border-radius: 1px;
    transition: width 0.3s ease, left 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
    left: 0;
}

/* Magnetic button effect container */
.magnetic-wrap {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ==========================================================
   GRADIENT TEXT
   ========================================================== */

.gradient-text {
    color: #16a34a;
    text-shadow:
        -1px -1px 0 rgba(0,0,0,0.8),
         1px -1px 0 rgba(0,0,0,0.8),
        -1px  1px 0 rgba(0,0,0,0.8),
         1px  1px 0 rgba(0,0,0,0.8);
}

.nav-name {
    text-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

/* ==========================================================
   SECTION LABEL
   ========================================================== */

.section-label {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #166534;
}

/* ==========================================================
   DIVIDER
   ========================================================== */

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(22, 163, 74, 0.3), transparent);
}

/* ==========================================================
   HERO LETTER ANIMATION
   ========================================================== */

.split-letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(60px) rotateX(-90deg);
    animation: letter-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes letter-in {
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

.hero-subtitle-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: word-in 0.5s ease forwards;
}

@keyframes word-in {
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================
   SHIMMER TEXT
   ========================================================== */

@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.shimmer-text {
    background: linear-gradient(90deg, #15803d, #22c55e, #16a34a, #22c55e, #15803d);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shimmer 4s linear infinite;
    filter: drop-shadow(-1px -1px 0 rgba(0,0,0,0.8)) drop-shadow(1px -1px 0 rgba(0,0,0,0.8)) drop-shadow(-1px 1px 0 rgba(0,0,0,0.8)) drop-shadow(1px 1px 0 rgba(0,0,0,0.8));
}

/* ==========================================================
   TYPED CURSOR
   ========================================================== */

.typed-cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background: #22c55e;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ==========================================================
   CAROUSEL
   ========================================================== */

.carousel-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #111;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.carousel-slide {
    flex: 0 0 100%;
    min-width: 0;
}

.carousel-slide img,
.carousel-slide video {
    display: block;
    width: 100%;
    height: 420px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.carousel-slide:hover img {
    transform: scale(1.03);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.85);
    color: #166534;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.carousel-wrap:hover .carousel-btn { opacity: 1; }
.carousel-btn:hover { background: #fff; transform: translateY(-50%) scale(1.15); }
.carousel-btn.prev { left: 14px; }
.carousel-btn.next { right: 14px; }

.carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 999px;
    z-index: 10;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-dot.active {
    background: #22c55e;
    width: 24px;
    border-radius: 4px;
}

/* ==========================================================
   CURSOR BALL + TRAIL
   ========================================================== */

.cursor-ball {
    position: fixed;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(34, 197, 94, 0.6);
    background: transparent;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease, background 0.3s ease;
    will-change: transform;
    mix-blend-mode: normal;
}

.cursor-ball.hovering {
    width: 44px;
    height: 44px;
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.08);
}

.cursor-dot {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    will-change: transform;
}

.cursor-trail {
    position: fixed;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.4);
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: opacity 0.4s ease;
}

/* ==========================================================
   PARTICLES (enhanced)
   ========================================================== */

.particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: drift linear infinite;
}

@keyframes drift {
    0%   { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
    8%   { opacity: 1; }
    50%  { transform: translateY(-55vh) translateX(20px) rotate(180deg); opacity: 0.8; }
    85%  { opacity: 0.6; }
    100% { transform: translateY(-110vh) translateX(-10px) rotate(360deg); opacity: 0; }
}

/* Glow particles */
.particle-glow {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(2px);
    animation: drift-glow linear infinite;
}

@keyframes drift-glow {
    0%   { transform: translateY(0) scale(0.5); opacity: 0; }
    10%  { opacity: 0.7; transform: translateY(-10vh) scale(1); }
    90%  { opacity: 0.3; }
    100% { transform: translateY(-110vh) scale(0.3); opacity: 0; }
}

/* ==========================================================
   SCROLL REVEAL ANIMATIONS
   ========================================================== */

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.revealed { opacity: 1; transform: translateY(0); }

/* Transform-only reveal for elements with backdrop-filter (avoids opacity/blur pop) */
.reveal-slide {
    transform: translateY(40px);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-slide.revealed { transform: translateY(0); }

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-left.revealed { opacity: 1; transform: translateX(0); }

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-right.revealed { opacity: 1; transform: translateX(0); }

.reveal-scale {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-scale.revealed { opacity: 1; transform: scale(1); }

.reveal-rotate {
    opacity: 0;
    transform: translateY(30px) rotate(3deg);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-rotate.revealed { opacity: 1; transform: translateY(0) rotate(0); }

/* Stagger children */
.stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger.revealed > *:nth-child(1)  { transition-delay: 0s;    opacity: 1; transform: translateY(0); }
.stagger.revealed > *:nth-child(2)  { transition-delay: 0.06s; opacity: 1; transform: translateY(0); }
.stagger.revealed > *:nth-child(3)  { transition-delay: 0.12s; opacity: 1; transform: translateY(0); }
.stagger.revealed > *:nth-child(4)  { transition-delay: 0.18s; opacity: 1; transform: translateY(0); }
.stagger.revealed > *:nth-child(5)  { transition-delay: 0.24s; opacity: 1; transform: translateY(0); }
.stagger.revealed > *:nth-child(6)  { transition-delay: 0.30s; opacity: 1; transform: translateY(0); }
.stagger.revealed > *:nth-child(7)  { transition-delay: 0.36s; opacity: 1; transform: translateY(0); }
.stagger.revealed > *:nth-child(8)  { transition-delay: 0.42s; opacity: 1; transform: translateY(0); }
.stagger.revealed > *:nth-child(9)  { transition-delay: 0.48s; opacity: 1; transform: translateY(0); }
.stagger.revealed > *:nth-child(10) { transition-delay: 0.54s; opacity: 1; transform: translateY(0); }

/* ==========================================================
   SKILL PILLS
   ========================================================== */

.skill-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    cursor: default;
    overflow: hidden;
    min-width: 0;
}

.skill-pill:hover {
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(34, 197, 94, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.12);
}

.skill-pill:hover .skill-icon { transform: scale(1.2) rotate(5deg); }

.skill-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(34, 197, 94, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #16a34a;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

/* ==========================================================
   MARQUEE (skills ticker)
   ========================================================== */

.marquee-track {
    display: flex;
    gap: 24px;
    width: max-content;
    animation: marquee-scroll 30s linear infinite;
}

.marquee-track:hover { animation-play-state: paused; }

@keyframes marquee-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.marquee-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    white-space: nowrap;
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.marquee-item:hover {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(34, 197, 94, 0.4);
    transform: scale(1.05);
}

.marquee-item i { color: #166534; }

/* ==========================================================
   FOCUS TAGS
   ========================================================== */

.focus-tag {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #0f172a;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    cursor: default;
}

.focus-tag:hover {
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(34, 197, 94, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.1);
}

/* ==========================================================
   FORM INPUTS
   ========================================================== */

.form-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 2px solid rgba(100, 116, 139, 0.4);
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(4px);
    color: #1e293b;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
}

.form-input::placeholder { color: #64748b; }

textarea.form-input { resize: none; }

.form-input:hover { border-color: rgba(100, 116, 139, 0.6); }

.form-input:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15), 0 4px 12px rgba(34, 197, 94, 0.1);
    background: rgba(255, 255, 255, 0.4);
}

/* ==========================================================
   CONTACT LINKS
   ========================================================== */

.contact-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.contact-link:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(4px);
}

.contact-link:hover .contact-icon { transform: scale(1.15) rotate(-5deg); }

.contact-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(34, 197, 94, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #16a34a;
    font-size: 1rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

/* ==========================================================
   SECTION NAV DOTS (side indicator)
   ========================================================== */

.section-dots {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(100, 116, 139, 0.3);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.section-dot::before {
    content: attr(data-label);
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    background: rgba(255,255,255,0.8);
    padding: 2px 8px;
    border-radius: 4px;
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.section-dot:hover::before { opacity: 1; }

.section-dot.active {
    background: #22c55e;
    border-color: #22c55e;
    transform: scale(1.4);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

/* ==========================================================
   COUNTER ANIMATION
   ========================================================== */

.counter-value {
    font-family: 'DM Serif Display', serif;
    font-size: 2.5rem;
    line-height: 1;
    background: linear-gradient(135deg, #166534, #22c55e);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ==========================================================
   TEXT SCRAMBLE
   ========================================================== */

.scramble-text {
    cursor: default;
    transition: color 0.2s ease;
}

/* ==========================================================
   RIPPLE BUTTON
   ========================================================== */

.ripple-btn {
    position: relative;
    overflow: hidden;
}

.ripple-btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    animation: ripple-effect 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-effect {
    to { transform: scale(4); opacity: 0; }
}

/* ==========================================================
   FLOATING SHAPES (decorative)
   ========================================================== */

.floating-shape {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.06;
    filter: blur(40px);
}

.float-1 { animation: float-bob 8s ease-in-out infinite; }
.float-2 { animation: float-bob 10s ease-in-out infinite reverse; }
.float-3 { animation: float-bob 12s ease-in-out infinite 2s; }

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

/* ==========================================================
   PARALLAX
   ========================================================== */

.parallax-layer {
    will-change: transform;
    transition: transform 0.1s linear;
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 768px) {
    .carousel-slide img,
    .carousel-slide video { height: 260px; }

    .carousel-btn { width: 34px; height: 34px; font-size: 12px; opacity: 0.8; }

    .section-dots { display: none; }

    .cursor-ball, .cursor-dot { display: none !important; }

    .hero-card { margin: 0 12px; }
}

@media (max-width: 480px) {
    .carousel-slide img,
    .carousel-slide video { height: 220px; }

    .counter-value { font-size: 2rem; }
}
