/* ============================================
   JUAN IGNACIO FULPONI — PORTFOLIO STYLES
   ============================================ */

/* --- Reset & Variables --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a12;
    --bg-secondary: #0f0f1a;
    --bg-card: #14141f;
    --bg-card-hover: #1a1a28;
    --accent: #00d4aa;
    --accent-dim: rgba(0, 212, 170, 0.15);
    --accent-glow: rgba(0, 212, 170, 0.25);
    --accent-secondary: #0088ff;
    --text-primary: #e8e8f0;
    --text-secondary: #7a7a95;
    --text-muted: #50506a;
    --border: rgba(255, 255, 255, 0.06);
    --border-accent: rgba(0, 212, 170, 0.2);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 4px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --container: 1100px;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: #33e0be;
}

::selection {
    background: var(--accent);
    color: var(--bg-primary);
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 20px 0;
    transition: all var(--transition);
}

.nav.scrolled {
    background: rgba(10, 10, 18, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

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

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition);
}

/* Mobile menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: rgba(10, 10, 18, 0.98);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

.mobile-menu a {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

/* --- Hero --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#networkCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.4;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 0 24px;
}

.hero-greeting {
    font-size: 1rem;
    font-weight: 400;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.hero-name {
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -2px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary) 0%, rgba(232, 232, 240, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 500px;
    margin: 0 auto 32px;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 40px;
}

.hero-badges {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.badge {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.02);
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-line {
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.5); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 100px;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: #33e0be;
    color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

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

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 20px;
    font-size: 0.8125rem;
}

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

.btn-ghost:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* --- Sections --- */
.section {
    padding: 120px 0;
}

.section-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 16px;
}

.section-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 60px;
    max-width: 600px;
}

/* --- About --- */
.about {
    background: var(--bg-secondary);
}

.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 80px;
    align-items: start;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 0.9375rem;
}

.about-text p strong {
    color: var(--text-primary);
    font-weight: 600;
}

.about-lead {
    font-size: 1.25rem !important;
    color: var(--text-primary) !important;
    line-height: 1.5;
    margin-bottom: 20px !important;
}

.about-links {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    transition: all var(--transition);
}

.stat-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-4px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
    display: inline;
}

.stat-suffix {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* --- Projects --- */
.project {
    margin-bottom: 48px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
}

.project:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.project-featured {
    border-color: var(--border-accent);
    box-shadow: 0 0 60px -20px var(--accent-dim);
}

.project-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 32px 0;
}

.project-number {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.project-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 4px 12px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-body {
    display: grid;
    grid-template-columns: 0.4fr 0.6fr;
    gap: 0;
}

.project-visual {
    padding: 24px 24px 32px 32px;
}

.project-visual-inner {
    height: 100%;
    min-height: 280px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.gradient-1 { background: linear-gradient(135deg, #1a3a4a 0%, #0d2233 50%, #14293d 100%); }
.gradient-2 { background: linear-gradient(135deg, #1a2a4a 0%, #0d1833 50%, #142a3d 100%); }
.gradient-3 { background: linear-gradient(135deg, #2a1a4a 0%, #1d0d33 50%, #2a143d 100%); }
.gradient-4 { background: linear-gradient(135deg, #1a4a3a 0%, #0d3322 50%, #143d2a 100%); }
.gradient-5 { background: linear-gradient(135deg, #4a3a1a 0%, #33280d 50%, #3d2a14 100%); }
.gradient-6 { background: linear-gradient(135deg, #2a3a1a 0%, #1a2d0d 50%, #253d14 100%); }
.gradient-7 { background: linear-gradient(135deg, #3a1a2a 0%, #2d0d1a 50%, #3d1425 100%); }

.project-icon {
    width: 120px;
    height: 80px;
    opacity: 0.9;
}

.visual-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-info {
    padding: 24px 32px 32px 16px;
}

.project-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 8px;
}

.project-tagline {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 24px;
}

.project-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.detail-block h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.detail-block p,
.detail-block li {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.detail-block ul {
    list-style: none;
    padding: 0;
}

.detail-block li {
    position: relative;
    padding-left: 14px;
    margin-bottom: 4px;
}

.detail-block li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.5;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tech-tag {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 100px;
}

.project-links {
    display: flex;
    gap: 12px;
}

.project-orgs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.org-tag {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 4px 12px;
    border-radius: 100px;
    letter-spacing: 0.3px;
}

/* --- Publications --- */
.publications {
    background: var(--bg-secondary);
}

.pub-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.pub-item {
    display: flex;
    gap: 24px;
    padding: 28px 0;
    border-bottom: 1px solid var(--border);
    transition: all var(--transition);
}

.pub-item:first-child {
    border-top: 1px solid var(--border);
}

.pub-item:hover {
    background: rgba(255, 255, 255, 0.01);
    padding-left: 16px;
}

.pub-year {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--accent);
    min-width: 48px;
    font-variant-numeric: tabular-nums;
    padding-top: 4px;
}

.pub-content {
    flex: 1;
}

.pub-type {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.pub-type--journal { background: rgba(0, 136, 255, 0.15); color: #4da6ff; }
.pub-type--working-paper { background: rgba(0, 212, 170, 0.15); color: var(--accent); }
.pub-type--conference { background: rgba(168, 85, 247, 0.15); color: #b78af0; }
.pub-type--report { background: rgba(245, 158, 11, 0.15); color: #f5b94e; }

.pub-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 6px;
}

.pub-authors {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.pub-venue {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.pub-links {
    display: flex;
    gap: 12px;
}

.pub-link {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--accent);
    opacity: 0.8;
    transition: opacity var(--transition);
}

.pub-link:hover {
    opacity: 1;
}

/* --- Paper Modal --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.modal.open {
    opacity: 1;
    pointer-events: all;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    width: 90vw;
    max-width: 900px;
    height: 85vh;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform var(--transition);
}

.modal.open .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.modal-body {
    height: 100%;
}

.modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.modal-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.modal-fallback code {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    font-size: 0.8125rem;
}

/* --- Skills --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.skill-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: all var(--transition);
}

.skill-group:hover {
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-4px);
}

.skill-group-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 100px;
    transition: all var(--transition);
}

.skill-tag:hover {
    border-color: var(--border-accent);
    color: var(--accent);
}

/* --- Experience Timeline --- */
.experience {
    background: var(--bg-secondary);
}

.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, var(--accent), var(--border), transparent);
}

.timeline-item {
    position: relative;
    padding: 0 0 40px 32px;
}

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

.timeline-item::before {
    content: '';
    position: absolute;
    left: -36px;
    top: 6px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--accent);
    transition: all var(--transition);
}

.timeline-item:hover::before {
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.timeline-date {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}

.timeline-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.timeline-role {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.timeline-loc {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* --- Contact --- */
.contact {
    padding: 120px 0 80px;
}

.contact-inner {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.contact-text {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 32px;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color var(--transition);
}

.contact-link:hover {
    color: var(--accent);
}

.contact-link svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.contact-link:hover svg {
    opacity: 1;
}

/* --- Footer --- */
.footer {
    padding: 32px 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer p {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ============================================
   ANIMATIONS
   ============================================ */

/* Hero entrance */
.anim-fade-up {
    opacity: 0;
    transform: translateY(24px);
    animation: fadeUp 0.8s ease forwards;
}

.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }
.delay-4 { animation-delay: 0.6s; }
.delay-5 { animation-delay: 0.8s; }

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

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

@media (max-width: 1024px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .about-stats {
        grid-template-columns: repeat(4, 1fr);
    }

    .project-body {
        grid-template-columns: 1fr;
    }

    .project-visual {
        padding: 24px 32px 0;
    }

    .project-visual-inner {
        min-height: 180px;
    }

    .project-info {
        padding: 24px 32px 32px;
    }

    .project-details {
        grid-template-columns: 1fr 1fr;
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .section {
        padding: 80px 0;
    }

    .hero-name {
        letter-spacing: -1px;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .about-stats {
        grid-template-columns: 1fr 1fr;
    }

    .project-details {
        grid-template-columns: 1fr;
    }

    .project-header {
        padding: 20px 20px 0;
    }

    .project-visual {
        padding: 20px 20px 0;
    }

    .project-info {
        padding: 20px;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .pub-item {
        flex-direction: column;
        gap: 8px;
    }

    .pub-year {
        min-width: auto;
    }

    .timeline {
        padding-left: 24px;
    }

    .timeline-item {
        padding-left: 24px;
    }

    .timeline-item::before {
        left: -28px;
    }

    .modal-content {
        width: 95vw;
        height: 90vh;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero-badges {
        gap: 8px;
    }

    .badge {
        font-size: 0.6875rem;
        padding: 4px 10px;
    }

    .about-stats {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 20px 16px;
    }

    .stat-number {
        font-size: 2rem;
    }
}
