/* ============================================
   DANILO DÍAZ TARASCÓ — Portfolio
   Modern Dark Theme with 3D & Glassmorphism
   ============================================ */

:root {
    --bg: #0a0a0f;
    --bg-alt: #111118;
    --surface: rgba(255, 255, 255, 0.03);
    --surface-hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.08);
    --text: #e8e8ef;
    --text-muted: #8888a0;
    --accent: #00d4ff;
    --accent-alt: #7b61ff;
    --gradient: linear-gradient(135deg, #00d4ff, #7b61ff);
    --font: 'Space Grotesk', -apple-system, sans-serif;
    --mono: 'JetBrains Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg);
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ---- Canvas Container (Three.js) ---- */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#canvas-container canvas {
    display: block;
}

/* ---- Custom Cursor ---- */
#cursor, #cursor-follower {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: transform 0.15s ease;
}

#cursor {
    width: 8px;
    height: 8px;
    background: #fff;
    transform: translate(-50%, -50%);
}

#cursor-follower {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, border-color 0.3s;
}

#cursor-follower.hover {
    width: 56px;
    height: 56px;
    border-color: var(--accent);
}

/* ---- Loader ---- */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loader-text {
    text-align: center;
}

.loader-text span {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 700;
    letter-spacing: 0.3em;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loader-bar {
    margin-top: 1.5rem;
    width: 200px;
    height: 2px;
    background: var(--border);
    border-radius: 1px;
    overflow: hidden;
    margin-left: auto;
    margin-right: auto;
}

.loader-progress {
    width: 0%;
    height: 100%;
    background: var(--gradient);
    border-radius: 1px;
    transition: width 0.1s ease;
}

/* ---- Navigation ---- */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    transition: background 0.3s, padding 0.3s, backdrop-filter 0.3s;
}

#navbar.scrolled {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1rem 3rem;
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

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

.nav-link {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.3s;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.3s;
}

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

.nav-link:hover::after {
    width: 100%;
}

/* ---- Language Toggle ---- */
.nav-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    transition: border-color 0.3s;
}

.lang-toggle:hover {
    border-color: var(--accent);
}

.lang-option {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    transition: color 0.3s;
}

.lang-option.active {
    color: var(--accent);
    font-weight: 500;
}

.lang-divider {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--border);
}

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

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ---- Mobile Menu ---- */
#mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.97);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    transition: right 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}

#mobile-menu.open {
    right: 0;
}

.mobile-link {
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    transition: color 0.3s;
}

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

.mobile-socials {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
}

.mobile-socials a {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ---- Hero Section ---- */
#hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3rem;
    z-index: 1;
}

.hero-content {
    text-align: center;
    max-width: 900px;
}

.hero-tag {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--accent);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    opacity: 0;
}

.hero-title {
    font-size: clamp(3rem, 9vw, 7rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
}

.hero-title .line {
    display: block;
    overflow: hidden;
}

.hero-title .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
}

.hero-subtitle {
    font-family: var(--mono);
    font-size: clamp(0.75rem, 1.5vw, 0.95rem);
    color: var(--text-muted);
    letter-spacing: 0.1em;
    margin-bottom: 2.5rem;
    opacity: 0;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    opacity: 0;
}

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    padding: 0.9rem 2.2rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background: var(--gradient);
    color: var(--bg);
    font-weight: 500;
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.3);
}

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

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

/* ---- Scroll Indicator ---- */
.scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
}

.scroll-indicator span {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: var(--border);
    position: relative;
    overflow: hidden;
}

.scroll-line::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent);
    animation: scrollDown 2s ease-in-out infinite;
}

@keyframes scrollDown {
    0% { top: -100%; }
    50% { top: 0; }
    100% { top: 100%; }
}

/* ---- Section Common ---- */
.section {
    position: relative;
    padding: 8rem 0;
    z-index: 1;
}

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

.section-label {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--accent);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 3rem;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 3rem;
}

/* ---- About Section ---- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 5rem;
    align-items: start;
}

.image-wrapper {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    position: relative;
    z-index: 2;
    filter: grayscale(20%);
    transition: filter 0.4s;
}

.image-wrapper:hover img {
    filter: grayscale(0%);
}

.image-border {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent);
    border-radius: 20px;
    z-index: 1;
    transition: transform 0.4s;
}

.image-wrapper:hover .image-border {
    transform: translate(-4px, -4px);
}

.about-text h2 {
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.about-desc {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.about-stats {
    display: flex;
    gap: 3rem;
    margin: 2rem 0;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.stat {
    text-align: left;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-plus {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    display: block;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.25rem;
}

/* ---- Experience / Timeline ---- */
.timeline {
    position: relative;
    padding-left: 2rem;
    border-left: 1px solid var(--border);
}

.timeline-item {
    position: relative;
    padding: 0 0 3rem 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.35rem;
    top: 0.5rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.timeline-date {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--accent);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.timeline-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.timeline-company {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.75rem;
}

.timeline-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ---- Skills Grid ---- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.skill-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: transform 0.3s, border-color 0.3s, background 0.3s;
    will-change: transform;
}

.skill-card:hover {
    border-color: rgba(0, 212, 255, 0.3);
    background: var(--surface-hover);
    transform: translateY(-4px);
}

.skill-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1.25rem;
    color: var(--accent);
}

.skill-icon svg {
    width: 100%;
    height: 100%;
}

.skill-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.skill-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ---- Certifications ---- */
.certifications {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
}

.cert-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.cert-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.cert-item {
    font-family: var(--mono);
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    transition: border-color 0.3s, color 0.3s;
}

.cert-item:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ---- Projects List ---- */
.projects-group-title {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.projects-group-title:first-of-type {
    margin-top: 0;
}

.projects-list {
    display: flex;
    flex-direction: column;
}

.project-item {
    display: grid;
    grid-template-columns: 60px 1fr auto 40px;
    gap: 2rem;
    align-items: center;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s;
}

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

.project-item:hover {
    padding-left: 1rem;
}

.project-item:hover .project-arrow svg {
    transform: translate(4px, -4px);
}

.project-item:hover .project-index {
    color: var(--accent);
}

.project-index {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: color 0.3s;
}

.project-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.project-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.project-tags span {
    font-family: var(--mono);
    font-size: 0.7rem;
    padding: 0.35rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.project-arrow {
    width: 24px;
    height: 24px;
    color: var(--text-muted);
}

.project-arrow svg {
    width: 100%;
    height: 100%;
    transition: transform 0.3s;
}

.project-private {
    color: var(--text-muted);
    opacity: 0.5;
    display: flex;
    align-items: center;
}

/* ---- Contact Section ---- */
.contact-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    align-items: start;
}

.contact-text p {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

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

.contact-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    transition: padding 0.3s;
}

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

.contact-link:hover {
    padding-left: 0.5rem;
}

.contact-link-label {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.contact-link-value {
    font-size: 1rem;
    color: var(--text);
    transition: color 0.3s;
}

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

.contact-socials {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 4rem;
}

.social-pill {
    display: inline-block;
    padding: 1rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    transition: all 0.3s;
}

.social-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateX(8px);
}

/* ---- Footer ---- */
#footer {
    position: relative;
    z-index: 1;
    padding: 3rem 0;
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-quote {
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-copy {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* ---- Reveal Animations ---- */
.reveal-text {
    opacity: 0;
    transform: translateY(30px);
}

.reveal-up {
    opacity: 0;
    transform: translateY(40px);
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

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

    .contact-socials {
        flex-direction: row;
        flex-wrap: wrap;
        padding-top: 0;
    }
}

@media (max-width: 768px) {
    #navbar {
        padding: 1rem 1.5rem;
    }

    #navbar.scrolled {
        padding: 0.75rem 1.5rem;
    }

    .nav-links {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    #hero {
        padding: 0 1.5rem;
    }

    .container {
        padding: 0 1.5rem;
    }

    .section {
        padding: 5rem 0;
    }

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

    .project-item {
        grid-template-columns: 40px 1fr 30px;
        gap: 1rem;
    }

    .project-tags {
        display: none;
    }

    .about-stats {
        gap: 2rem;
    }

    .footer-inner {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

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

    /* Hide custom cursor on touch devices */
    #cursor, #cursor-follower {
        display: none;
    }

    .timeline {
        padding-left: 1.5rem;
    }

    .timeline-item {
        padding-left: 1.5rem;
    }

    .timeline-item::before {
        left: -1.85rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(2.2rem, 12vw, 3.5rem);
    }

    .about-stats {
        flex-direction: column;
        gap: 1.5rem;
    }

    .stat {
        text-align: center;
    }

    .image-wrapper {
        width: 200px;
        height: 200px;
    }
}
