/* Color Palette & Variables */
:root {
    --bg-anthracite: #1a1a1a;
    --bg-card: #242424;
    --accent-purple: #9d50bb;
    --accent-orange: #ff9966;
    --accent-green: #00ff88;
    --glow-green: rgba(0, 255, 136, 0.6);
    --text-white: #ffffff;
    --text-dim: #b3b3b3;
    --transition: all 0.3s ease;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-anthracite);
    color: var(--text-white);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Layout Utilities */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
}

section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 50px;
    height: 4px;
    background: linear-gradient(to right, var(--accent-purple), var(--accent-orange));
    border-radius: 2px;
}

/* Alignment for sections linked on the left of Home */
/* .section-title.align-right {
    display: block;
    text-align: right;
}

.section-title.align-right::after {
    left: auto;
    right: 0;
    background: linear-gradient(to left, var(--accent-purple), var(--accent-orange));
} */

/* Navigation */
nav {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    background-color: rgba(26, 26, 26, 0.95);
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a:hover {
    color: var(--accent-orange);
    transition: var(--transition);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.logo span {
    color: var(--accent-purple);
}

/* Hero Section with Animation */
#home {
    height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; 
    text-align: center;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-anthracite);
    cursor: crosshair;
}

/* GREEN PATH CONTAINER */
.green-path-container {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 35vh; 
    z-index: 1;
}

.green-line {
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--accent-green));
    position: relative;
    overflow: hidden; 
}

.green-line::after {
    content: '';
    position: absolute;
    top: -100px;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to bottom, transparent, #fff, transparent);
    opacity: 0.5;
    animation: pulseDown 2s infinite ease-in-out;
}

.green-dot {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 0%); 
    width: 8px;
    height: 8px;
    background-color: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 15px 5px var(--glow-green);
    animation: dotPulse 2s infinite ease-in-out;
    z-index: 2;
}

/* NEW: Hero Navigation - Positioned below the line */
.hero-nav {
    position: absolute;
    top: calc(35vh + 25px); 
    left: 0;
    right: 0; /* Cover full width to find true absolute center */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    white-space: nowrap;
}

/* Two groups sharing equal space to force 'Home' to the exact center */
.hero-nav .nav-side {
    display: flex;
    gap: 2.5rem;
    flex: 1;
}

.hero-nav .nav-side.left {
    justify-content: flex-end;
    padding-right: 1.25rem; /* Matches half the gap to center 'Home' precisely */
}

.hero-nav .nav-side.right {
    justify-content: flex-start;
    padding-left: 1.25rem; /* Matches half the gap to center 'Home' precisely */
}

.hero-nav a {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    color: var(--text-dim);
    transition: var(--transition);
    position: relative;
    padding: 5px 10px;
}

/* Specifically styling 'Home' to be the visual anchor */
.hero-nav a[href="#home"] {
    color: var(--text-white);
}

.hero-nav a:hover {
    color: var(--accent-orange);
}

.hero-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent-orange);
    transition: var(--transition);
}

.hero-nav a:hover::after {
    width: 100%;
}

/* INTERACTIVE SPLIT STYLES */
.branch-root {
    position: absolute;
    width: 2px;
    background: var(--accent-green);
    z-index: 1;
}

.branch-horizontal {
    position: absolute;
    height: 2px;
    background: var(--accent-green);
    width: 0;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 8px var(--glow-green);
}

.branch-vertical {
    position: absolute;
    width: 2px;
    height: 0;
    background: linear-gradient(to bottom, var(--accent-green), var(--accent-green), transparent);
    transition: height 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 8px var(--glow-green);
}

.branch-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 12px 3px var(--glow-green);
    opacity: 0;
    transition: opacity 0.3s ease;
}

@keyframes pulseDown {
    0% { top: -100px; opacity: 0; }
    10% { opacity: 0.5; }
    90% { opacity: 0.5; }
    100% { top: 100%; opacity: 0; }
}

@keyframes dotPulse {
    0%, 100% { transform: translate(-50%, 0%) scale(1); box-shadow: 0 0 15px 5px var(--glow-green); }
    50% { transform: translate(-50%, 0%) scale(1.4); box-shadow: 0 0 25px 8px var(--glow-green); }
}

/* Background Animated Blobs */
#home::before, #home::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0; 
    opacity: 0.4;
    animation: floatGlow 15s infinite alternate ease-in-out;
}

#home::before { background: var(--accent-purple); top: -10%; right: -10%; }
#home::after { background: var(--accent-orange); bottom: -10%; left: -10%; animation-delay: -7s; }

@keyframes floatGlow {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(10%, 15%) scale(1.1); }
    66% { transform: translate(-5%, 20%) scale(0.9); }
    100% { transform: translate(5%, -10%) scale(1.05); }
}

.hero-content {
    margin-top: calc(35vh + 100px); /* Pushed further down to accommodate links */
    transition: margin-top 0.5s ease;
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, var(--text-dim));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-dim);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(45deg, var(--accent-purple), var(--accent-orange));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    filter: brightness(1.1);
}

/* Projects Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--bg-card);
    border-radius: 15px;
    padding: 2rem;
    transition: var(--transition);
    border: 1px solid rgba(255,255,255,0.05);
    position: relative;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-purple);
}

.project-card h3 { margin-bottom: 1rem; color: var(--accent-orange); }
.project-card p { color: var(--text-dim); font-size: 0.95rem; }

.tag-list { margin-top: 1.5rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    background: rgba(157, 80, 187, 0.1);
    color: var(--accent-purple);
    border-radius: 4px;
    border: 1px solid rgba(157, 80, 187, 0.2);
}

.skills-container { display: flex; flex-wrap: wrap; gap: 1rem; }
.skill-badge {
    padding: 0.5rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    transition: var(--transition);
}

.skill-badge:hover { background: var(--accent-orange); color: var(--bg-anthracite); font-weight: bold; }

.contact-content { display: grid; grid-template-columns: 1fr 1.5fr; gap: 4rem; }
form { display: flex; flex-direction: column; gap: 1rem; }
input, textarea {
    width: 100%;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: white;
    outline: none;
}

footer {
    padding: 3rem 0;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.05);
    color: var(--text-dim);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .hero-content h1 { font-size: 2.5rem; }
    .contact-content { grid-template-columns: 1fr; }
    #home::before, #home::after { width: 300px; height: 300px; }
    .green-path-container { height: 20vh; }
    .hero-nav { top: calc(20vh + 25px); gap: 1rem; font-size: 0.75rem; }
    .hero-content { margin-top: calc(20vh + 80px); }
}