:root {
    --primary-color: #0a192f;
    --secondary-color: #00a57f;
    --accent-color: #ff4c60;
    --light-color: #f5f7fa;
    --dark-color: #1a2233;
    --text-color: #22272e;
    --text-light: #e6f1ff;
    --console-bg: #0a192f;
    --card-bg: #112240;
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --transition: 0.3s cubic-bezier(.4, 2, .6, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Fira Mono', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f8f9fa;
    color: var(--text-color);
    line-height: 1.6;
}

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

header {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-light);
}

.logo span {
    color: var(--secondary-color);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

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

.hamburger {
    display: none;
    cursor: pointer;
}

.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
    color: var(--text-light);
    padding-top: 80px;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 600px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero h1 span {
    color: var(--secondary-color);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.btn {
    display: inline-block;
    background-color: var(--secondary-color);
    color: var(--text-light);
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: #2980b9;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--secondary-color);
    margin-left: 1rem;
}

.btn-outline:hover {
    background-color: var(--secondary-color);
}

.section {
    padding: 6rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    color: var(--primary-color);
}

.section-title span {
    color: var(--secondary-color);
}

.about-content {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.about-img {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.about-img img {
    width: 100%;
    height: auto;
    display: block;
}

.about-text {
    flex: 1;
}

.about-text h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.about-text p {
    margin-bottom: 1.5rem;
}

.skills {
    margin-top: 2rem;
}

.skills h4 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.skill-tag {
    background-color: var(--secondary-color);
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.stack {
    background-color: var(--light-color);
}

.stack-container {
    max-width: 100%;
    padding: 0 2vw;
}

.stack-category {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.stack-category:hover {
    transform: translateY(-10px);
}

.stack-category h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.stack-category h3 i {
    margin-right: 0.8rem;
    color: var(--secondary-color);
}

.stack-list {
    list-style: none;
}

.stack-list li {
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
}

.stack-list li::before {
    content: "▹";
    color: var(--secondary-color);
    margin-right: 0.5rem;
}

.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.project-img {
    height: 200px;
    overflow: hidden;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.project-card:hover .project-img img {
    transform: scale(1.1);
}

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.project-info p {
    margin-bottom: 1rem;
    color: #666;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-tag {
    background-color: var(--light-color);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: color 0.3s;
}

.project-links a:hover {
    color: var(--secondary-color);
}

.project-links a i {
    margin-right: 0.3rem;
}

.darkmode-toggle-container {
    display: flex;
    align-items: center;
    margin-left: 1.5rem;
}

#dark-mode-toggle {
    background: var(--secondary-color);
    color: #091426;
    border: none;
    border-radius: 0.5rem;
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: background var(--transition), color var(--transition), transform var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    position: static;
    z-index: 1102;
}

#dark-mode-toggle:hover {
    background: var(--accent-color);
    color: #fff;
    transform: scale(1.1) rotate(-10deg);
}

/* Responsive: coloca el botón junto al menú hamburguesa en móvil */
@media (max-width: 768px) {
    nav {
        position: relative;
    }

    .hamburger {
        position: absolute;
        right: 60px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1100;
    }

    #dark-mode-toggle {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1101;
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.7) translateY(60px);
    }

    60% {
        opacity: 1;
        transform: scale(1.05) translateY(-10px);
    }

    80% {
        transform: scale(0.98) translateY(4px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

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

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    80% {
        opacity: 1;
        transform: scale(1.05);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-in {
    animation: fadeUp 1s cubic-bezier(.4, 2, .6, 1) forwards;
}

.hero-content,
.about-img,
.about-text,
.project-card,
.certification-card,
.stack-category,
.tech-card {
    opacity: 0;
    animation: bounceIn 1.1s cubic-bezier(.4, 2, .6, 1) forwards;
}

.hero-content {
    animation-delay: 0.2s;
}

.about-img {
    animation-delay: 0.4s;
}

.about-text {
    animation-delay: 0.6s;
}

.project-card {
    animation-delay: 0.8s;
}

.certification-card {
    animation-delay: 1s;
}

.stack-category,
.tech-card {
    animation: popIn 0.9s cubic-bezier(.4, 2, .6, 1) forwards;
}

@media (max-width: 768px) {
    nav {
        position: relative;
    }

    .hamburger {
        position: absolute;
        right: 60px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1100;
    }

    #dark-mode-toggle {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1101;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background-color: var(--primary-color);
        flex-direction: column;
        align-items: center;
        padding-top: 2rem;
        transition: left 0.3s;
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        margin: 1rem 0;
    }

    .hamburger {
        display: block;
    }

    .about-content {
        flex-direction: column;
    }

    .contact-container {
        flex-direction: column;
    }

    .hero h1 {
        font-size: 2.5rem;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.fade-in {
    animation: fadeIn 1s ease forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

.title {
    margin-bottom: 4rem;
    text-align: center;
    font-size: 2rem;
    font-weight: 500;
}

.main .about-me {
    padding-top: 1.5rem;
    color: #000000;
    margin-bottom: 1.5rem;
}

.main .about-me .container-about-me .text {
    padding: 1.5rem 0;
    background: var(--console-bg);
    color: white;
    font-family: console, monospace, Arial;
    min-height: 27.5rem;
    margin: 0 auto;
    border-radius: 0.625rem;
}

.main .about-me .container-about-me .text #pow-txt {
    display: none;
    color: #e3e3e3;
    font-weight: 100;
}

.main .about-me .container-about-me .text .path {
    margin-bottom: 1rem;
}

.main .about-me .container-about-me .text #pow-txt {
    margin-bottom: 1rem;
}

.main .about-me .container-about-me .text .description {
    color: grey;
    font-weight: 100;
    line-height: 1.5;
}

.main .about-me .container-about-me .text p {
    width: 90%;
    margin: 0 auto;
}

.skill-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.badge,
.filter-btn {
    display: inline-block;
    padding: 0.3em 0.9em;
    font-size: 0.95em;
    font-family: 'Segoe UI', 'Liberation Sans', Arial, sans-serif;
    background: #f5f5f5;
    color: #24292f;
    border: 1px solid #d1d5da;
    border-radius: 0.5em;
    box-shadow: 0 1px 2px rgba(27, 31, 35, 0.04);
    transition: background 0.2s;
    user-select: none;
}

.badge:hover {
    background: #e1e4e8;
}

.tech-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.filter-btn.active {
    background: var(--secondary-color);
    color: white;
}

.filter-btn:hover {
    background: #ddd;
}

.filter-btn.active:hover {
    background: var(--secondary-color);
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.tech-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.tech-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.tech-logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tech-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tech-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.tech-info p {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: #666;
}

.tech-projects {
    font-size: 0.8rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    width: 100%;
    justify-items: center;
    align-items: stretch;
}

.tech-card {
    width: 400px;
    max-width: 100%;
}

#matrix-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    opacity: 0.18;
    pointer-events: none;
}

.hero {
    position: relative;
    overflow: hidden;
}

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



.certifications-grid {
    max-width: 800px;
    margin: 0 auto;
}

.certification-card {
    background: white;
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s;
}

.certification-card.active {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.certification-header {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
}

.certification-card.active .certification-header {
    background: #f9f9f9;
}

.institution-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1.5rem;
}

.certification-title {
    flex: 1;
}

.certification-title h3 {
    margin-bottom: 0.3rem;
    color: var(--primary-color);
}

.institution {
    font-style: italic;
    color: #666;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.date {
    color: var(--secondary-color);
    font-weight: 500;
    font-size: 0.9rem;
}

.certification-header i {
    font-size: 1.2rem;
    color: var(--secondary-color);
    transition: transform 0.3s;
}

.certification-card.active .certification-header i {
    transform: rotate(180deg);
}

.certification-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.details-content {
    padding: 0 1.5rem 1.5rem;
}

.details-content p {
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.skills-learned {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.skill-tag {
    background: #f0f0f0;
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.main-footer {
    background: var(--primary-color);
    color: var(--text-light);
    padding: 1rem 0 0.5rem 0;
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.07);
}

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

.footer-col {
    flex: 1 1 200px;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}

.footer-contact-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-contact-desc {
    font-size: 1rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.footer-social {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
}

.footer-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary-color);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 0.5rem;
    font-size: 1.5rem;
    margin: 0 0.2rem;
    transition: background 0.2s, transform 0.2s, color 0.2s;
    border: none;
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    cursor: pointer;
    text-decoration: none;
}

.footer-social-btn:hover,
.footer-scrolltop-btn:hover {
    background: var(--primary-color-color);
    color: #fff;
    transform: translateY(-4px) scale(1.08);
}

.footer-top-btn {
    align-items: flex-end;
    justify-content: flex-end;
}

.footer-scrolltop-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary-color);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 0.5rem;
    font-size: 1.5rem;
    border: none;
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, color 0.2s;
}

.subfooter {
    background: var(--dark-color);
    color: var(--text-light);
    text-align: center;
    padding: 0;
    font-size: 1rem;
}

.subfooter-content {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    align-items: center;
}

.footer-phrase {
    font-size: 0.98rem;
    color: #bfc9d1;
    margin-top: 0.3rem;
    font-style: italic;
}

body.dark-mode {
    background: var(--dark-color);
    color: var(--text-light);
}

body.dark-mode header,
body.dark-mode .main-footer,
body.dark-mode .subfooter {
    background: #091426;
    color: var(--text-light);
}

body.dark-mode .section,
body.dark-mode .stack-category {
    background: var(--card-bg);
    color: var(--text-light);
    box-shadow: var(--shadow);
}

body.dark-mode .btn,
body.dark-mode .footer-scrolltop-btn,
body.dark-mode .footer-social-btn {
    background: var(--secondary-color);
    color: #091426;
}

body.dark-mode .btn-outline {
    background: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
}

body.dark-mode .btn-outline:hover {
    background: var(--secondary-color);
    color: #091426;
}

body.dark-mode .badge,
body.dark-mode .filter-btn,
body.dark-mode .skill-tag {
    background: #233554;
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

body.dark-mode .project-links a {
    color: var(--secondary-color);
}

body.dark-mode .project-links a:hover {
    color: var(--accent-color);
}

body.dark-mode .institution-logo {
    background: #233554;
}

body.dark-mode .certification-header {
    background: #f9f9f9;
    color: var(--primary-color);
}

body.dark-mode .certification-card.active .certification-header {
    background: #233554;
}



body.dark-mode .about-img img {
    box-shadow: 0 0 0 4px var(--secondary-color);
}

body.dark-mode .footer-phrase {
    color: #7fffd4;
}

body.dark-mode h2,
body.dark-mode .section-title {
    color: var(--text-light);
}

body.dark-mode .section-title span {
    color: var(--accent-color);
}

@media (max-width: 900px) {
    .footer-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
        padding: 0 1rem;
    }

    .footer-col {
        align-items: center;
        text-align: center;
    }

    .footer-top-btn {
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .main-footer {
        padding: 1.5rem 0 1rem 0;
        border-radius: 1rem 1rem 0 0;
    }

    .footer-social-btn,
    .footer-scrolltop-btn {
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
    }

    .footer-contact-title {
        font-size: 1rem;
    }

    .footer-contact-desc {
        font-size: 0.95rem;
    }

    .footer-phrase {
        font-size: 0.93rem;
    }
}

body.dark-mode .project-card {
    background: #fff;
    color: var(--primary-color);
}

body.dark-mode .certification-card,
body.dark-mode .certification-card *,
body.dark-mode .certification-card .certification-header,
body.dark-mode .certification-card .certification-title h3,
body.dark-mode .certification-card .institution,
body.dark-mode .certification-card .date,
body.dark-mode .certification-card .details-content,
body.dark-mode .certification-card .skills-learned .skill-tag {
    background: #fff !important;
    color: var(--primary-color) !important;
    border-color: #e0e0e0 !important;
}

body.dark-mode .certification-card .certification-header i,
body.dark-mode .certification-card .date {
    color: var(--secondary-color) !important;
}

body.dark-mode .certification-card .skills-learned .skill-tag {
    background: #f0f0f0 !important;
    color: var(--primary-color) !important;
}