/* BASE RESET & VARIABLES */
:root {
    --bg-main: #0a0a0a;
    --bg-secondary: #121212;
    --bg-card: rgba(255, 255, 255, 0.03);
    --text-main: #f0f0f0;
    --text-secondary: #a0a0a0;
    --accent: #34d399; /* Emerald/Green */
    --accent-glow: rgba(52, 211, 153, 0.15);
    --border-color: rgba(255, 255, 255, 0.1);
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    /* Subtle grain effect */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* TYPOGRAPHY */
h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.2;
}

.massive-text {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    letter-spacing: -0.02em;
    font-weight: 800;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    margin-bottom: 3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.mono-label {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.accent {
    color: var(--accent);
}

.accent-text {
    background: linear-gradient(90deg, var(--text-main), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* NAVIGATION */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    transition: var(--transition);
    padding: 1.5rem 0;
}

.navbar.scrolled {
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.2rem;
    letter-spacing: 0.1em;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--text-main);
}

.nav-links a.active-nav {
    color: var(--accent);
    position: relative;
}

.nav-links a.active-nav::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--accent);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
}

/* BUTTONS */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-decoration: none;
    text-transform: uppercase;
    transition: var(--transition);
    border-radius: 2px;
}

.btn-primary {
    background-color: var(--text-main);
    color: var(--bg-main);
}

.btn-primary:hover {
    background-color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* PAGE HEADER */
.page-header {
    padding-top: 10rem;
    padding-bottom: 4rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4rem;
}

.page-title {
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.page-subtitle {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    color: var(--text-secondary);
    max-width: 600px;
}

/* HERO SECTION (HOME) */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 5rem;
    position: relative;
    overflow: hidden;
}

.hero-bg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.hero-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.15;
    filter: grayscale(100%) contrast(1.2);
}

.relative-container {
    position: relative;
    z-index: 1;
}

.hero-metadata {
    margin-bottom: 2rem;
}

.hero-title {
    font-size: clamp(3.5rem, 8vw, 7rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 2rem;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 3rem;
}

.hero-technical {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border-color);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 3rem;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0.5; transform: scale(0.8); }
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ABOUT SECTION (ABOUT PAGE) */
.about-section {
    padding-bottom: 6rem;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-text p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.about-text p.manifesto {
    font-weight: 600;
    color: var(--text-main);
    font-size: 1.5rem;
    line-height: 1.4;
    border-left: 2px solid var(--accent);
    padding-left: 1.5rem;
    margin-bottom: 3rem;
}

.about-education {
    margin-top: 4rem;
}

.edu-item {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}
.edu-item:last-child {
    border-bottom: none;
}

.edu-title {
    font-size: 1.2rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}
.edu-school {
    color: var(--text-secondary);
    font-size: 1rem;
}

.photo-container {
    width: 100%;
    height: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.photo-container img {
    width: 100%;
    height: auto;
    display: block;
    filter: grayscale(100%) contrast(1.1);
    transition: var(--transition);
}

.photo-container img:hover {
    filter: grayscale(0%);
}

.photo-placeholder {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
    gap: 1rem;
    opacity: 0;
}

.placeholder-active .photo-placeholder {
    opacity: 1;
}

/* PROJECTS (WORK PAGE) */
.projects-section {
    padding-bottom: 6rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.project-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 3rem;
    border-radius: 4px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: var(--border-color);
    transition: var(--transition);
}

.project-card:hover {
    background: rgba(255, 255, 255, 0.02);
    transform: translateY(-5px);
}

.project-card:hover::before {
    background: var(--accent);
}

.project-card.featured {
    border-color: rgba(52, 211, 153, 0.3);
}
.project-card.featured::before {
    background: var(--accent);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.project-status {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.project-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.project-desc {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 800px;
}

.project-tech {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tech-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
}

/* LAB SECTION */
.lab-section {
    padding-bottom: 6rem;
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 5rem;
}

.skill-list {
    list-style: none;
    margin-top: 1.5rem;
}

.skill-list li {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border-color);
    transition: var(--transition);
}

.skill-list li:hover {
    color: var(--text-main);
    border-left-color: var(--accent);
}

.interactive-graph-container {
    width: 100%;
    height: auto;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2rem;
    overflow: hidden;
}

.learning-graph {
    width: 100%;
    height: 100%;
    min-height: 300px;
}

.graph-line {
    stroke: var(--border-color);
    stroke-width: 1;
    transition: var(--transition);
}

.graph-node {
    cursor: crosshair;
}

.node-circle {
    fill: var(--bg-main);
    stroke: var(--border-color);
    stroke-width: 2;
    transition: var(--transition);
}

.core-node {
    stroke: var(--accent);
}

.node-text {
    font-family: var(--font-mono);
    font-size: 10px;
    fill: var(--text-secondary);
    text-anchor: middle;
    pointer-events: none;
    transition: var(--transition);
}

.core-text {
    fill: var(--text-main);
    font-weight: bold;
}

.node-tooltip {
    font-family: var(--font-sans);
    font-size: 12px;
    fill: var(--accent);
    text-anchor: middle;
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}

.graph-node:hover .node-circle {
    stroke: var(--accent);
    fill: var(--accent-glow);
}

.graph-node:hover .node-text {
    fill: var(--text-main);
}

.graph-node:hover .node-tooltip {
    opacity: 1;
}

.interactive-graph-container:hover .graph-line {
    stroke: url(#lineGrad);
    stroke-width: 2;
}

/* EXPERIENCE (TIMELINE) */
.timeline-section {
    padding-bottom: 6rem;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-left: 3rem;
    padding-bottom: 4rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -4px;
    width: 10px;
    height: 10px;
    background: var(--bg-main);
    border: 2px solid var(--accent);
    border-radius: 50%;
    z-index: 2;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-role {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.timeline-company {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.timeline-work {
    list-style: none;
}

.timeline-work li {
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    position: relative;
    padding-left: 1.5rem;
}

.timeline-work li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-family: var(--font-mono);
}

/* ACHIEVEMENTS */
.achievements-section {
    padding-bottom: 6rem;
}

.achievement-block {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 2rem;
    padding: 4rem 0;
    border-bottom: 1px solid var(--border-color);
    align-items: start;
}

.achievement-block:last-child {
    border-bottom: none;
}

.achievement-number {
    font-family: var(--font-mono);
    font-size: 3rem;
    color: var(--border-color);
    font-weight: 700;
    line-height: 1;
}

.achievement-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.achievement-meta {
    font-family: var(--font-mono);
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.achievement-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
}

/* CONTACT PAGE */
.contact-page-section {
    padding-bottom: 10rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 60vh;
}

.contact-huge {
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: 4rem;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.social-link {
    font-size: 2rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 1rem;
}

.social-link::after {
    content: '→';
    font-family: var(--font-mono);
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--transition);
    font-size: 1.5rem;
}

.social-link:hover {
    color: var(--text-main);
}

.social-link:hover::after {
    opacity: 1;
    transform: translateX(0);
    color: var(--accent);
}

/* FOOTER */
footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ANIMATIONS (Safely degrade if JS is missing) */
.fade-in, .slide-up, .scroll-reveal {
    transition: opacity 0.8s ease, transform 0.8s ease, clip-path 0.8s ease;
}

/* Javascript will add class 'js-enabled' to body to enable initial hidden states */
body.js-enabled .fade-in {
    opacity: 0;
}
body.js-enabled .fade-in.visible {
    opacity: 1;
}

body.js-enabled .slide-up {
    opacity: 0;
    transform: translateY(30px);
}
body.js-enabled .slide-up.visible {
    opacity: 1;
    transform: translateY(0);
}

body.js-enabled .scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
}
body.js-enabled .scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* MEDIA QUERIES */
@media (max-width: 768px) {
    .about-grid, .achievement-block {
        grid-template-columns: 1fr;
    }
    .achievement-number {
        margin-bottom: 1rem;
    }
    .photo-container {
        max-width: 400px;
        margin: 0 auto;
    }
    .menu-toggle {
        display: block;
    }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(10, 10, 10, 0.95);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        border-bottom: 1px solid var(--border-color);
    }
    .nav-links.active {
        display: flex;
    }
    .projects-grid {
        grid-template-columns: 1fr;
    }
}
