/* Styles for the home page (index.html).
   page.css repeats the colour tokens below for the project pages and the blog; change a token in both. */

:root {
    --dark-bg: #0a0e17;
    --navy-bg: #1a2033;
    --accent-green: #5ceba5;
    --accent-green-transparent: rgba(92, 235, 165, 0.2);
    --accent-blue: #0d99ff;
    --accent-purple: #8A2BE2;
    --text-color: #e1e7ef;
    --glass-bg: rgba(26, 32, 51, 0.7);
    --glass-dark-bg: rgba(26, 32, 51, 0.3);
    --glass-border: rgba(92, 235, 165, 0.3);
    --neon-shadow: 0 0 10px var(--accent-green), 0 0 20px rgba(92, 235, 165, 0.5);
}

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

body {
    background-color: var(--dark-bg);
    color: var(--text-color);
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.6;
    overflow-x: hidden;
}

#background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    padding: 5rem 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-container img {
    height: 50px;
    width: auto;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(90deg, var(--text-color), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

.logo-text::after {
    content: 'MILANDROID';
    position: absolute;
    left: 2px;
    top: 0;
    color: var(--accent-blue);
    z-index: -1;
    filter: blur(4px);
    opacity: 0.5;
    -webkit-text-fill-color: var(--accent-blue);
}

nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    padding: 0.5rem 1rem;
    position: relative;
    transition: all 0.3s ease;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-green), transparent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

nav a:hover {
    color: var(--accent-green);
}

nav a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 6rem 0;
    align-items: center;
}

.hero-content {
    position: relative;
}

.hero-content::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    width: 40px;
    height: 40px;
    border-top: 2px solid var(--accent-green);
    border-left: 2px solid var(--accent-green);
}

.hero-content::after {
    content: '';
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 40px;
    height: 40px;
    border-bottom: 2px solid var(--accent-green);
    border-right: 2px solid var(--accent-green);
}

.hero-greeting {
    font-size: 1rem;
    color: var(--accent-green);
    margin-bottom: 0.5rem;
    display: inline-block;
    position: relative;
    padding-left: 20px;
}

.hero-greeting::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--accent-green);
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--accent-green);
    margin-bottom: 2rem;
    letter-spacing: 1px;
}

.hero-description {
    margin-bottom: 2rem;
    position: relative;
    padding-left: 1rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-left: 2px solid var(--accent-green-transparent);
    background-color: var(--glass-dark-bg);
}

.cta-button {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: transparent;
    color: var(--accent-green);
    border: 2px solid var(--accent-green);
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 2px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s ease;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--accent-green-transparent);
    z-index: -1;
    transition: all 0.3s ease;
}

.cta-button:hover {
    color: var(--dark-bg);
}

.cta-button:hover::before {
    left: 0;
    background: var(--accent-green);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.social-link:hover {
    transform: translateY(-5px);
    box-shadow: var(--neon-shadow);
}

.social-link img {
    width: 20px;
    height: 20px;
    filter: invert(1) sepia(0.08) saturate(5000%) hue-rotate(150deg);
}

.social-link img.social-icon-mail {
    filter: invert(1) sepia(0.08) saturate(5000%) hue-rotate(300deg);
}

/* Tech Stack Section - New Hexagonal Grid */
.tech-stack-section {
    padding: 1rem 0;
    position: relative;
    min-height: 100dvh;
}

.tech-stack-title {
    font-size: 2rem;
    color: var(--accent-green);
    text-align: center;
    position: relative;
}

.tech-stack-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent-green);
}

.hexagon-grid {
    display: flex;
    flex-wrap: wrap;
    width: 90%;
    margin: 0 auto;
    justify-content: center;
    padding: 2rem 0;
    gap: 1rem;
}

.hexagon-item {
    position: relative;
    width: 100px;
    height: 115px;
    margin: 10px 5px;
    transition: all 0.3s ease;
}

.hexagon {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--glass-bg);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.hexagon:hover {
    transform: translateY(-10px);
    box-shadow: var(--neon-shadow);
    background: var(--accent-green-transparent);
}

.tech-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 6px;
}

.tech-icon-sm {
    width: 28px;
    height: 28px;
    margin-bottom: 6px;
}

.tech-name {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--text-color);
    text-align: center;
}

/* About Section */
.about-section {
    padding: 6rem 0;
}

.section-header {
    position: relative;
    margin-bottom: 3rem;
    display: inline-block;
}

.section-title {
    font-size: 2rem;
    color: var(--accent-green);
    margin-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--accent-green);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--accent-green), transparent);
}

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

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

.skill-groups {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr 1fr;
}

.skill-group {
    padding: 1.5rem;
    margin-bottom: 0;
}

.skill-group-title {
    font-size: 1rem;
    color: var(--accent-green);
    margin-bottom: 1rem;
}

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

.skill-languages {
    margin-top: 1.5rem;
    text-align: center;
    /* On phones the line wraps; balancing it stops one word ending up alone. */
    text-wrap: balance;
}

/* Projects Section */
.projects-section {
    padding: 1rem 0;
    min-height: 100vh;
}

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

.projects-more {
    margin-top: 2rem;
    text-align: center;
}

.project-card {
    height: 320px;
    padding: 0;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--neon-shadow);
}

.project-image {
    width: 100%;
    height: 100%;
    padding-bottom: 130px;
    box-sizing: border-box;
    background-color: var(--navy-bg);
    background-origin: content-box;
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    position: relative;
}

.project-image-manyue {
    background-image: url('/assets/images/projects/manyue-home.webp');
}

.project-image-burnedfile {
    background-image: url('/assets/images/projects/burnedfile-home.webp');
}

.project-image-uigrid {
    background-image: url('/assets/images/projects/ui-grid.webp');
}

.project-image-elecciones {
    background-image: url('/assets/images/projects/EleccionesHonduras2025.webp');
}

.project-image-hmon {
    background-image: url('/assets/images/projects/hmon.webp');
}

.project-image-mftp {
    background-image: url('/assets/images/projects/mftp-session.webp');
}

.project-card:hover .project-image {
    filter: brightness(0.3);
    transition: all 0.3s ease;
}

.project-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(10, 14, 23, 0.9), transparent);
    transform: translateY(calc(100% - 130px));
    transition: all 0.3s ease;
}

.project-card:hover .project-overlay {
    transform: translateY(0);
}

.project-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--accent-green);
}

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

/* Skills reuse the project chips so both read as the same kind of label. */
.project-tag,
.skill-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
}

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

.project-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.8rem;
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.project-link:hover {
    background: var(--accent-green-transparent);
    color: var(--accent-green);
}

/* Contact Section */
.contact-section {
    padding: 6rem 0;
}

.contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-control {
    width: 100%;
    padding: 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    color: var(--text-color);
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 10px rgba(92, 235, 165, 0.3);
}

textarea.form-control {
    resize: vertical;
    min-height: 150px;
}

.submit-btn {
    background: transparent;
    color: var(--accent-green);
    border: 2px solid var(--accent-green);
    padding: 1rem 2rem;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--accent-green-transparent);
    z-index: -1;
    transition: all 0.3s ease;
}

.submit-btn:hover::before {
    left: 0;
    background: var(--accent-green);
}

.submit-btn:hover {
    color: var(--dark-bg);
}

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

.footer-text {
    font-size: 0.9rem;
    color: rgba(225, 231, 239, 0.7);
}

.footer-text a {
    color: var(--accent-green);
    text-decoration: none;
}

/* Terminal Effect */
.terminal-text {
    position: relative;
    font-family: 'Space Mono', monospace;
    line-height: 1.5;
}

.terminal-text-variable {
    color: var(--accent-green);
}

.terminal-text::before {
    content: '$';
    color: var(--accent-green);
    margin-right: 0.5rem;
}

.blinking-cursor {
    display: inline-block;
    width: 8px;
    height: 20px;
    background: var(--accent-green);
    animation: blink 1s infinite;
    vertical-align: middle;
    margin-left: 5px;
}

/* Responsive */
@media (max-width: 992px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content::before,
    .hero-content::after {
        display: none;
    }

    .hexagon-grid {
        justify-content: center;
    }

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

    /* Upright tablets get the phone header. The logo, four menu links and the language switch
       do not share their row: in Spanish "Sobre mí" broke onto two lines and ran into the logo.
       The blog stays reachable from the link under the project cards. */
    nav ul {
        display: none;
    }
}

@media (max-width: 768px) {
    .skill-groups {
        grid-template-columns: 1fr;
    }

    /* A smaller logo leaves room beside it for the language switch; on the narrowest
       phones the switch wraps below instead of running off the screen. */
    .logo-text {
        font-size: 1.3rem;
    }

    header {
        flex-wrap: wrap;
        row-gap: 1rem;
    }

    .mobile-menu-btn {
        display: block;
    }

    .hexagon-item {
        width: 120px;
        height: 138px;
        margin: 15px 5px;
    }

    .tech-name {
        font-size: 0.7rem;
    }
}

.hero {
    line-height: 1;
    display: inline-block;
    z-index: 2
}

.layers {
    position: relative
}

.layers:before,
.layers:after {
    content: attr(data-text);
    position: absolute;
    width: 110%;
    z-index: -1
}

.layers:before {
    top: 10px;
    left: 15px;
    color: #e0287d
}

.layers:after {
    top: 5px;
    left: -10px;
    color: #1bc7fb
}

.glitch div,
.glitch img {
    animation: paths 5s step-end infinite
}

.glitch:before {
    animation: paths 5s step-end infinite, opacity 5s step-end infinite, font 8s step-end infinite, movement 10s step-end infinite
}

.glitch:after {
    animation: paths 5s step-end infinite, opacity 5s step-end infinite, font 7s step-end infinite, movement 8s step-end infinite
}

@keyframes font {
    0% {
        font-weight: 100;
        color: #e0287d;
        filter: blur(3px)
    }

    20% {
        font-weight: 500;
        color: #fff;
        filter: blur(0)
    }

    50% {
        font-weight: 300;
        color: #1bc7fb;
        filter: blur(2px)
    }

    60% {
        font-weight: 700;
        color: #fff;
        filter: blur(0)
    }

    90% {
        font-weight: 500;
        color: #e0287d;
        filter: blur(6px)
    }
}

@keyframes paths {
    0% {
        clip-path: polygon(0% 43%, 83% 43%, 83% 22%, 23% 22%, 23% 24%, 91% 24%, 91% 26%, 18% 26%, 18% 83%, 29% 83%, 29% 17%, 41% 17%, 41% 39%, 18% 39%, 18% 82%, 54% 82%, 54% 88%, 19% 88%, 19% 4%, 39% 4%, 39% 14%, 76% 14%, 76% 52%, 23% 52%, 23% 35%, 19% 35%, 19% 8%, 36% 8%, 36% 31%, 73% 31%, 73% 16%, 1% 16%, 1% 56%, 50% 56%, 50% 8%)
    }

    5% {
        clip-path: polygon(0% 29%, 44% 29%, 44% 83%, 94% 83%, 94% 56%, 11% 56%, 11% 64%, 94% 64%, 94% 70%, 88% 70%, 88% 32%, 18% 32%, 18% 96%, 10% 96%, 10% 62%, 9% 62%, 9% 84%, 68% 84%, 68% 50%, 52% 50%, 52% 55%, 35% 55%, 35% 87%, 25% 87%, 25% 39%, 15% 39%, 15% 88%, 52% 88%)
    }

    30% {
        clip-path: polygon(0% 53%, 93% 53%, 93% 62%, 68% 62%, 68% 37%, 97% 37%, 97% 89%, 13% 89%, 13% 45%, 51% 45%, 51% 88%, 17% 88%, 17% 54%, 81% 54%, 81% 75%, 79% 75%, 79% 76%, 38% 76%, 38% 28%, 61% 28%, 61% 12%, 55% 12%, 55% 62%, 68% 62%, 68% 51%, 0% 51%, 0% 92%, 63% 92%, 63% 4%, 65% 4%)
    }

    45% {
        clip-path: polygon(0% 33%, 2% 33%, 2% 69%, 58% 69%, 58% 94%, 55% 94%, 55% 25%, 33% 25%, 33% 85%, 16% 85%, 16% 19%, 5% 19%, 5% 20%, 79% 20%, 79% 96%, 93% 96%, 93% 50%, 5% 50%, 5% 74%, 55% 74%, 55% 57%, 96% 57%, 96% 59%, 87% 59%, 87% 65%, 82% 65%, 82% 39%, 63% 39%, 63% 92%, 4% 92%, 4% 36%, 24% 36%, 24% 70%, 1% 70%, 1% 43%, 15% 43%, 15% 28%, 23% 28%, 23% 71%, 90% 71%, 90% 86%, 97% 86%, 97% 1%, 60% 1%, 60% 67%, 71% 67%, 71% 91%, 17% 91%, 17% 14%, 39% 14%, 39% 30%, 58% 30%, 58% 11%, 52% 11%, 52% 83%, 68% 83%)
    }

    76% {
        clip-path: polygon(0% 26%, 15% 26%, 15% 73%, 72% 73%, 72% 70%, 77% 70%, 77% 75%, 8% 75%, 8% 42%, 4% 42%, 4% 61%, 17% 61%, 17% 12%, 26% 12%, 26% 63%, 73% 63%, 73% 43%, 90% 43%, 90% 67%, 50% 67%, 50% 41%, 42% 41%, 42% 46%, 50% 46%, 50% 84%, 96% 84%, 96% 78%, 49% 78%, 49% 25%, 63% 25%, 63% 14%)
    }

    90% {
        clip-path: polygon(0% 41%, 13% 41%, 13% 6%, 87% 6%, 87% 93%, 10% 93%, 10% 13%, 89% 13%, 89% 6%, 3% 6%, 3% 8%, 16% 8%, 16% 79%, 0% 79%, 0% 99%, 92% 99%, 92% 90%, 5% 90%, 5% 60%, 0% 60%, 0% 48%, 89% 48%, 89% 13%, 80% 13%, 80% 43%, 95% 43%, 95% 19%, 80% 19%, 80% 85%, 38% 85%, 38% 62%)
    }

    1%,
    7%,
    33%,
    47%,
    78%,
    93% {
        clip-path: none
    }
}

@keyframes movement {
    0% {
        top: 0;
        left: -20px
    }

    15% {
        top: 10px;
        left: 10px
    }

    60% {
        top: 5px;
        left: -10px
    }

    75% {
        top: -5px;
        left: 20px
    }

    to {
        top: 10px;
        left: 5px
    }
}

/* The header logo: a framed photo and the name, each carrying the glitch effect, side by side.
   These come last because the logo reuses .hero, which also lays out the hero section, and
   .logo-glitch must override its grid and padding. */
.logo-frame {
    border: 2px solid var(--accent-green);
    border-radius: 5px;
    margin-right: 1.6rem;
}

.logo-glitch {
    margin: 0;
    padding: 0;
    display: flex;
}

.logo-photo {
    padding: 5px;
}
