:root {
    --primary-color: #00aeff;
    --primary-color-light: rgba(0, 174, 255, 0.1);
    --dark-bg: #0a0a0a;
    --dark-card-bg: #141414;
    --dark-text: #ecf0f1;
    --light-bg: #f4f4f9;
    --light-card-bg: #ffffff;
    --light-text: #222;
    --font-sans: 'Poppins', sans-serif;
    --font-mono: 'Roboto Mono', monospace;
    --header-height: 80px;
    --bg-color: var(--dark-bg);
    --card-bg-color: var(--dark-card-bg);
    --text-color: var(--dark-text);
    --header-bg: rgba(10, 10, 10, 0.7);
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
body.light-mode {
    --bg-color: var(--light-bg);
    --card-bg-color: var(--light-card-bg);
    --text-color: var(--light-text);
    --header-bg: rgba(244, 244, 249, 0.7);
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }
.cursor, .cursor-follower { display: none; }
@media (pointer: fine) {
    .cursor { display: block; width: 8px; height: 8px; background-color: var(--primary-color); border-radius: 50%; position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999; }
    .cursor-follower { display: block; width: 20px; height: 20px; border: 2px solid var(--primary-color); border-radius: 50%; position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999; transition: transform 0.3s ease-out, width 0.3s ease-out, height 0.3s ease-out, opacity 0.3s ease-out; }
    .cursor-follower.hovered { width: 50px; height: 50px; opacity: 0.5; }
    body { cursor: none; }
}
#header { position: fixed; width: 100%; top: 0; left: 0; z-index: 1000; background: var(--header-bg); backdrop-filter: blur(10px); padding: 1rem 0; transition: transform 0.3s ease; transform: translateY(-100%); }
body.loaded #header { transform: translateY(0); transition-delay: 0.5s; }
#header .container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-family: var(--font-mono); font-size: 1.8rem; font-weight: 700; color: var(--primary-color); text-decoration: none; }
.nav-links { list-style: none; display: flex; align-items: center; gap: 1.5rem; }
.nav-link { color: var(--text-color); text-decoration: none; font-weight: 600; transition: color 0.3s ease; }
.nav-link:hover { color: var(--primary-color); }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #555; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(20px); }
.hamburger { display: none; cursor: pointer; z-index: 1005; }
.hamburger .bar { display: block; width: 25px; height: 3px; margin: 5px auto; transition: all 0.3s ease-in-out; background-color: var(--text-color); border-radius: 3px; }
#hero { min-height: 100vh; display: flex; justify-content: center; align-items: center; text-align: center; position: relative; padding: var(--header-height) 0 6rem 0; }
#particles-js { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; }
.hero-content { position: relative; z-index: 1; max-width: 800px; }
.hero-content h1 { font-size: clamp(1.8rem, 5vw, 3rem); font-family: var(--font-mono); margin-bottom: 0.5rem; }
.hero-role-title { font-size: clamp(2.2rem, 6vw, 4rem); font-weight: 700; color: var(--text-color); margin-bottom: 1.5rem; min-height: 120px; display: flex; justify-content: center; align-items: center; }
.role { color: var(--primary-color); display: inline-block; }
@keyframes text-fade-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes text-fade-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(10px); } }
.role-text-anim-out { animation: text-fade-out 0.5s forwards; }
.role-text-anim-in { animation: text-fade-in 0.5s forwards; }
.hero-content p { max-width: 600px; margin: 0 auto 2rem auto; font-size: clamp(0.9rem, 2.5vw, 1rem); }
.cta-button { display: inline-block; border: 2px solid var(--primary-color); color: var(--primary-color); padding: 0.8rem 2.2rem; text-decoration: none; border-radius: 5px; font-weight: 600; transition: all 0.3s ease; }
.cta-button:hover { background-color: var(--primary-color-light); box-shadow: 0 0 20px var(--primary-color-light); }
.cta-button i { margin-left: 0.5rem; }
.reveal-from-bottom { transform: translateY(40px); opacity: 0; transition: transform 1s ease, opacity 1s ease; }
.reveal-from-left { transform: translateX(-40px); opacity: 0; transition: transform 1s ease, opacity 1s ease; }
.reveal-from-right { transform: translateX(40px); opacity: 0; transition: transform 1s ease, opacity 1s ease; }
.scroll-section.visible .reveal-from-left, .scroll-section.visible .reveal-from-right, .scroll-section.visible .reveal-from-bottom, body.loaded .reveal-from-bottom { transform: translate(0); opacity: 1; }
.hero-content > *:nth-child(2) { transition-delay: 0.2s; }
.hero-content > *:nth-child(3) { transition-delay: 0.4s; }
.hero-content > *:nth-child(4) { transition-delay: 0.6s; }
.scroll-section { padding: 6rem 0; opacity: 0; transition: opacity 0.6s ease-out; }
.scroll-section.visible { opacity: 1; }
.section-title { font-size: clamp(2rem, 5vw, 2.5rem); margin-bottom: 4rem; text-align: center; font-weight: 700; }
.section-title span { font-family: var(--font-mono); color: var(--primary-color); }
#about .about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 50px; align-items: center; }
.about-image { border: 5px solid var(--primary-color); border-radius: 10px; overflow: hidden; }
.about-image img { width: 100%; display: block; filter: grayscale(50%); transition: filter 0.3s ease; }
.about-image:hover img { filter: grayscale(0%); }
.tilt-effect { transform-style: preserve-3d; transition: transform 0.5s; will-change: transform; }
#skills .skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.skill-category { background-color: var(--card-bg-color); padding: 2.5rem; border-radius: 15px; box-shadow: var(--box-shadow); }
.skill-category h3 { font-size: 1.5rem; margin-bottom: 2rem; }
.skill { margin-bottom: 1.5rem; }
.skill-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; }
.skill-info i { font-size: 1.8rem; margin-right: 12px; color: var(--primary-color); }
.progress-bar { width: 100%; background-color: #333; border-radius: 10px; height: 10px; }
body.light-mode .progress-bar { background-color: #e0e0e0; }
.progress { height: 100%; background: var(--primary-color); border-radius: 10px; width: 0; transition: width 1.5s cubic-bezier(0.25, 1, 0.5, 1); }
.work-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }
.work-item { position: relative; overflow: hidden; border-radius: 10px; display: block; }
.work-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease; }
.work-overlay { position: absolute; bottom: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to top, rgba(0,0,0,0.95), rgba(0,0,0,0.6)); padding: 1.5rem; transform: translateY(100%); transition: transform 0.5s ease; display: flex; flex-direction: column; justify-content: flex-end; color: white; }
.work-text h3 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.work-text p { font-size: 0.9rem; color: #ccc; margin-bottom: 1.5rem; }
.work-links { display: flex; gap: 1rem; }
.work-link-btn { text-decoration: none; color: white; background: rgba(255, 255, 255, 0.1); padding: 0.5rem 1rem; border-radius: 5px; font-size: 0.9rem; font-weight: 600; transition: background 0.3s ease; }
.work-link-btn:hover { background: var(--primary-color); }
.work-link-btn i { margin-left: 0.5rem; }
.work-item:hover img { transform: scale(1.1); }
.work-item:hover .work-overlay { transform: translateY(0); }
#contact .contact-content { max-width: 600px; margin: 0 auto; text-align: center; }
#contact p { margin-bottom: 3rem; }
.contact-form .form-group { position: relative; margin-bottom: 2.5rem; }
.contact-form input, .contact-form textarea { width: 100%; padding: 10px 0; background: transparent; border: none; border-bottom: 2px solid var(--text-color); color: var(--text-color); font-size: 1rem; outline: none; transition: border-color 0.3s ease; }
.contact-form label { position: absolute; top: 10px; left: 0; pointer-events: none; transition: all 0.3s ease; }
.contact-form input:focus ~ label, .contact-form input:valid ~ label, .contact-form textarea:focus ~ label, .contact-form textarea:valid ~ label { top: -20px; font-size: 0.8rem; color: var(--primary-color); }
footer { padding: 4rem 0 2rem; text-align: center; }
.social-links { margin-bottom: 1.5rem; display: flex; justify-content: center; gap: 2rem; }
.social-links a { color: var(--text-color); font-size: 1.5rem; display: inline-block; transition: color 0.3s, transform 0.3s; }
.social-links a:hover { color: var(--primary-color); }
.magnetic-item { transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
@media (max-width: 768px) {
    body { cursor: auto; }
    .container { padding: 0 1.5rem; }
    .scroll-section { padding: 4rem 0; }
    .section-title { margin-bottom: 3rem; }
    .hamburger { display: block; }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
    .nav-links { position: fixed; right: -100%; top: 0; height: 100vh; width: 70%; max-width: 300px; background: var(--dark-card-bg); flex-direction: column; justify-content: center; gap: 2.5rem; transition: right 0.4s cubic-bezier(0.23, 1, 0.32, 1); box-shadow: -10px 0 30px rgba(0,0,0,0.2); }
    body.light-mode .nav-links { background-color: var(--light-card-bg); }
    .nav-links.active { right: 0; }
    .nav-link { font-size: 1.2rem; }
    .nav-links li:last-child { margin-top: 1rem; }
    @media (max-width: 480px) { .hero-role-title { min-height: 80px; } }
    #about .about-grid { grid-template-columns: 1fr; }
    .about-text { order: 2; text-align: center; }
    .about-image-container { order: 1; margin-bottom: 2rem; display: flex; justify-content: center; }
    .about-image { max-width: 300px; }
    #skills .skills-grid { grid-template-columns: 1fr; }
    .skill-category { padding: 2rem; }
    .work-grid { grid-template-columns: 1fr; }
    .work-overlay { padding: 1rem; }
    .work-text h3 { font-size: 1.2rem; }
    .work-text p { margin-bottom: 1rem; }
    .work-links { flex-direction: column; }
    .work-link-btn { text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .role-text-anim-out, .role-text-anim-in { animation: none; }
  .reveal-from-bottom, .reveal-from-left, .reveal-from-right { transform: none; opacity: 1; }
}