@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300..700&family=Share+Tech+Mono&display=swap');

/* --- THEME DEFINITIONS --- */
:root {
    --theme-bg-color: #111;
    --theme-primary-color: #1a1a1a;
    --theme-primary-color-rgb: 26, 26, 26;
    --theme-secondary-color: #222;
    --theme-accent-color: #a0c4ff;
    --theme-text-color: #e0e0e0;
    --theme-text-secondary-color: #999;
    --theme-border-color: rgba(255, 255, 255, 0.1);
    --theme-glow-color: #00ff00;
    --font-main: 'Space Grotesk', sans-serif;
    --font-hacker: 'Share Tech Mono', monospace;
}

body.theme-light {
    --theme-bg-color: #f0f2f5;
    --theme-primary-color: #ffffff;
    --theme-primary-color-rgb: 255, 255, 255;
    --theme-secondary-color: #e9ecef;
    --theme-accent-color: #0056b3;
    --theme-text-color: #212529;
    --theme-text-secondary-color: #6c757d;
    --theme-border-color: rgba(0, 0, 0, 0.1);
    --theme-glow-color: #28a745;
}

body.theme-hacker {
    --theme-bg-color: #000;
    --theme-primary-color: #0a0a0a;
    --theme-primary-color-rgb: 10, 10, 10;
    --theme-secondary-color: #141414;
    --theme-accent-color: #00ff00;
    --theme-text-color: #00ff00;
    --theme-text-secondary-color: #00bb00;
    --theme-border-color: rgba(0, 255, 0, 0.2);
    --theme-glow-color: #00ff00;
    --font-main: 'Share Tech Mono', monospace;
}

/* --- BASE & iOS NATIVE FEEL --- */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
}
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-main);
    background-color: var(--theme-bg-color);
    color: var(--theme-text-color);
    line-height: 1.7;
    overflow-x: hidden;
    cursor: none;
    transition: background-color 0.4s, color 0.4s;
    padding-top: 80px; 
}
body.theme-hacker { font-family: var(--font-hacker); }
.container { width: 90%; max-width: 900px; margin: auto; padding: 20px; position: relative; }
h1,h2,h3,p,a,span,div { transition: color 0.4s, background-color 0.4s, border-color 0.4s, text-shadow 0.4s; }

/* --- SPRING-LOADED UI FEEDBACK --- */
nav a, .bouncing-ball, .skill-tag, .close-btn, .project-link {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}
nav a:active, .bouncing-ball:active, .skill-tag:active, .close-btn:active, .project-link:active {
    transform: scale(0.96);
    opacity: 0.8;
}

/* --- CURSOR --- */
#cursor { position: fixed; width: 0; height: 0; border-left: 16px solid transparent; border-right: 16px solid transparent; border-bottom: 27.7px solid var(--theme-accent-color); pointer-events: none; transform: translate(-50%, -50%); transition: transform 0.1s ease, border-color 0.4s; filter: drop-shadow(-4px 4px 8px rgba(128, 128, 128, 0.7)); z-index: 9999; opacity: 0.8; }

/* --- AMBIENT EFFECTS & INTERACTIVES --- */
.wave-container, .dust-container { z-index: -1; }
.wave-container { position: fixed; bottom: 0; left: 0; width: 100%; height: 150px; overflow: hidden; }
.dust-container { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; pointer-events: none; }
.dust-container span { position: absolute; background-color: rgba(255, 215, 0, 0.1); border-radius: 50%; box-shadow: 0 0 10px rgba(255, 215, 0, 0.1); transition: transform 0.5s ease-out; }

.bouncing-ball { 
    position: fixed; 
    bottom: 20px; 
    right: 20px; 
    width: 50px; 
    height: 50px; 
    background-color: var(--theme-glow-color); 
    border-radius: 50%; 
    box-shadow: 0 0 20px var(--theme-glow-color), 0 0 40px var(--theme-glow-color); 
    z-index: 1000; 
    animation: bounce 4s infinite alternate cubic-bezier(0.5, 0.05, 0.5, 0.95); 
    cursor: pointer; 
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
}
.bouncing-ball:hover { transform: scale(1.2); }
.bouncing-ball i { font-size: 1.5em; }

#fleeing-orb {
    position: fixed;
    width: 25px;
    height: 25px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 15px #fff, 0 0 30px #fff;
    z-index: -1;
    opacity: 0.7;
    transition: bottom 0.5s ease, right 0.5s ease, left 0.5s ease, top 0.5s ease;
}

/* --- NAVIGATION & MARQUEE --- */
nav { position: fixed; top: 0; left: 0; width: 100%; z-index: 1006; padding: 0.5rem 0; height: 40px; background: rgba(var(--theme-primary-color-rgb, 26, 26, 26), 0.7); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--theme-border-color);}
nav ul { list-style: none; display: flex; justify-content: center; align-items: center; margin: 0; padding: 0; height: 100%; }
nav ul li { margin: 0 1.5rem; }
nav ul li a { color: var(--theme-text-color); text-decoration: none; font-weight: 500; padding: 0.5rem 0; position: relative; font-size: 1.2em; }
nav ul li a:hover { color: var(--theme-accent-color); }
nav ul li a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background-color: var(--theme-accent-color); transform: scaleX(0); transition: transform 0.4s ease; }
nav ul li a:hover::after { transform: scaleX(1); }

.marquee-container { position: fixed; top: 40px; left: 0; width: 100%; z-index: 1005; overflow: hidden; background: transparent; padding: 0.5rem 0; border-bottom: 1px solid var(--theme-border-color); }
.marquee-container p { white-space: nowrap; display: inline-block; padding-left: 100%; animation: marquee 35s linear infinite; color: var(--theme-text-secondary-color); font-size: 0.9em; }

/* --- HEADER & PROFILE --- */
header { text-align: center; padding: 2rem 0 3rem; }
#subtitle-cycler { cursor: pointer; transition: color 0.3s ease, text-shadow 0.3s ease; }
#subtitle-cycler:hover { color: var(--theme-accent-color); text-shadow: 0 0 5px var(--theme-accent-color); }

.profile-pic-container { position: relative; width: 200px; height: 200px; border-radius: 40% 85% 55% 45% / 45% 85% 55% 40%; margin: 0 auto 20px; box-shadow: 0 10px 20px rgba(0,0,0,0.2); transition: all 0.5s ease-in-out; overflow: hidden; }
.profile-pic-container:hover { border-radius: 45% 95% 45% 55% / 55% 95% 45% 45%; }
.profile-pic-container::before { content: ''; position: absolute; top: 50%; left: 50%; width: 100%; height: 100%; transform: translate(-50%, -50%) scale(1.5); background: repeating-conic-gradient(from 0deg, #FFD700 0deg 5deg, #008000 5deg 10deg, #B22222 10deg 15deg); animation: spin 8s linear; animation-play-state: paused; opacity: 0; transition: all 0.5s ease-in-out; z-index: 1; }
.profile-pic-container:hover::before { transform: translate(-50%, -50%) scale(1.5); animation-play-state: running; opacity: 1; border-radius: 45% 95% 45% 55% / 55% 95% 45% 45%; }
.profile-pic-container img { position: relative; z-index: 2; width: 100%; height: 100%; object-fit: cover; border-radius: 40% 85% 55% 45% / 45% 85% 55% 40%; transition: all 0.5s ease-in-out; transform: scale(1); }

/* --- POPUP & SECTIONS --- */
.popup-backdrop { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); z-index: 1010; opacity: 0; pointer-events: none; transition: opacity 0.4s ease; }
.popup-backdrop.visible { opacity: 1; pointer-events: all; }

section {
    background: transparent;
    position: relative;
    margin-bottom: 30px; 
    padding: 30px; 
}
section.popup-active { position: fixed; top: 10%; left: 50%; transform: translateX(-50%); width: 90vw; max-width: 900px; height: 80vh; overflow-y: auto; z-index: 1011; transition: transform 0.4s ease, opacity 0.4s ease; }
section::before { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1; background: rgba(var(--theme-primary-color-rgb, 26, 26, 26), 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); margin: -1px; border-radius: 30px; border: 1px solid var(--theme-border-color); }

section .close-btn { position: absolute; top: 15px; right: 25px; background: none; border: none; color: var(--theme-text-color); font-size: 2.5rem; cursor: pointer; transition: opacity 0.3s, transform 0.3s; opacity: 0; pointer-events: none; }
section.popup-active .close-btn { opacity: 1; pointer-events: all; }
section.popup-active .close-btn:hover { transform: scale(1.2); color: var(--theme-accent-color); }

/* --- SCROLL REVEAL --- */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  filter: blur(5px);
  transition: all 0.8s cubic-bezier(0.215, 0.61, 0.355, 1);
}
.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

/* --- OTHER STYLES --- */
h2 { font-size: 2.8em; text-align: center; margin-bottom: 3rem; color: var(--theme-text-color); border-bottom: 2px solid var(--theme-border-color); padding-bottom: 1rem; }
#skills-shuffler { cursor: pointer; transition: color 0.3s, text-shadow 0.3s; }
#skills-shuffler:hover { color: var(--theme-accent-color); text-shadow: 0 0 5px var(--theme-accent-color); }
#skills-shuffler i { font-size: 0.7em; margin-left: 1rem; opacity: 0.7; transition: transform 0.3s; }
#skills-shuffler:hover i { transform: rotate(15deg); }

.skills-split-container { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 768px) { .skills-split-container { grid-template-columns: 1fr 1fr; } }
.skills-category h3 { font-size: 1.5em; color: var(--theme-text-secondary-color); margin-bottom: 1rem; border-bottom: 1px solid var(--theme-border-color); padding-bottom: 0.5rem; }
.skills-container { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.project-item { background: var(--theme-secondary-color); padding: 1.5rem; border-radius: 15px; border: 1px solid var(--theme-border-color); margin-top: 1rem; }
blockquote { font-style: italic; color: var(--theme-text-secondary-color); border-left: 3px solid var(--theme-accent-color); padding-left: 1.5rem; margin: 1rem 0; font-size: 1.1em; }
.skill-tag { background-color: var(--theme-secondary-color); color: var(--theme-text-color); padding: 10px 18px; border-radius: 15px; border: 1px solid var(--theme-border-color); font-size: 1.1em; }
.contact-intro {
    text-align: center;
    font-size: 1.2em;
    color: var(--theme-text-secondary-color);
    margin-bottom: 2rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-item i {
    font-size: 2em;
    color: var(--theme-text-secondary-color);
    width: 30px;
    text-align: center;
}

.contact-item a {
    font-size: 1.2em;
    color: var(--theme-text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.contact-item a:hover {
    color: var(--theme-accent-color);
}

footer { color: var(--theme-text-secondary-color); text-align: center; padding: 1.5rem 0; }

body.theme-hacker::after { content: ''; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: repeating-linear-gradient(0deg, rgba(0,0,0,0.3) 0px, rgba(0,0,0,0.3) 1px, transparent 1px, transparent 2px); z-index: 999; pointer-events: none; animation: flicker 0.15s infinite; }
@keyframes flicker { 0% { opacity: 0.2; } 20% { opacity: 0.6; } 40% { opacity: 0.3; } 60% { opacity: 0.7; } 80% { opacity: 0.2; } 100% { opacity: 0.5; } }
@keyframes wave { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@keyframes spin { 0% { transform: translate(-50%, -50%) rotate(0deg); } 100% { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes bounce { from { transform: translateY(0) scale(1); } to { transform: translateY(-100px) scale(1.1); } }
@keyframes marquee { 0% { transform: translateX(0%); } 100% { transform: translateX(-100%); } }
.tooltip { position: fixed; background-color: #000; color: #fff; padding: 0.5rem 1rem; border-radius: 5px; z-index: 10000; opacity: 0; transition: opacity 0.3s ease; pointer-events: none; transform: translate(-50%, -150%); }
.tooltip.visible { opacity: 1; }