:root {
    --bg: #0f0f0f;
    --surface: #141414;
    --text: #ebebeb;
    --muted: #444;
    --border: #1e1e1e;
    --accent: #90caf9;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--muted) transparent;
}

::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--muted);
    border-radius: 99px;
    transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

@font-face {
    font-family: terminalF4;
    src: url(../fonts/Terminal\ F4.ttf);
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.5;
}

/* ── Typing cursor ── */
.terminal {
    font-family: terminalF4;
    color: yellowgreen;
}

.blink {
    animation: blink 0.5s infinite;
}

@keyframes blink {
    to { opacity: 0; }
}

/* ── Root layout ── */
.layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ════════════════════════════════
   LEFT — scroll-snap roller
   ════════════════════════════════ */
.sidebar {
    width: 42%;
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    /* fade items out toward the top and bottom edges */
    mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 22%,
        black 78%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 22%,
        black 78%,
        transparent 100%
    );
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.nav-list {
    list-style: none;
    /* top/bottom padding so first and last items can scroll to center */
    padding-block: 43vh;
    padding-inline: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nav-item {
    scroll-snap-align: center;
    width: 100%;
    padding: 1.1rem 0;
    cursor: pointer;
    text-align: center;
    /* JS drives opacity/transform live; will-change avoids repaint */
    will-change: opacity, transform;
    /* short transition smooths the snap "landing" */
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Title item ─ big typing animation */
.nav-title {
    padding: 2rem 0;
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.15;
}

/* Section headers */
.nav-section {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
}

/* Project items */
.nav-project {
    font-size: 1.05rem;
    font-weight: 400;
}

/* ── Divider ── */
.divider {
    width: 1px;
    height: 100vh;
    flex-shrink: 0;
    background: var(--border);
}

/* ════════════════════════════════
   RIGHT — content panels
   ════════════════════════════════ */
.content {
    flex: 1;
    height: 100vh;
    background: transparent;
    position: relative;
    overflow: hidden;
}

.panel {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3.5rem 4rem;
    opacity: 0;
    pointer-events: none;
    /* WAAPI drives all enter/exit animations */
}

.panel.active {
    opacity: 1;
    pointer-events: all;
}

/* ── Intro panel ── */
.hero-subtitle {
    font-size: 1.7rem;
    font-weight: 300;
    color: #888;
    line-height: 1.55;
}

/* ── Section panels (tech blobs) ── */
.panel-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.tecnologias {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
}

.tecnologias li {
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    background: rgba(144, 202, 249, 0.07);
    border: 1px solid rgba(144, 202, 249, 0.22);
    color: var(--accent);
}

/* ── Project panels ── */
.project-content {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
}

.project-img {
    width: 52%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: top;
    border-radius: 8px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.project-img.centrado {
    object-position: center;
}

.project-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-info h3 {
    font-size: 1.4rem;
    font-weight: 600;
}

.project-info p {
    font-size: 0.95rem;
    color: #888;
    line-height: 1.65;
}

.btn-ver {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(144, 202, 249, 0.28);
    border-radius: 6px;
    padding: 0.45rem 1rem;
    width: fit-content;
    transition: background 0.2s, border-color 0.2s;
}

.btn-ver:hover {
    background: rgba(144, 202, 249, 0.09);
    border-color: var(--accent);
}

/* ── Contact panel ── */
.lista-contacto {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 360px;
}

.lista-contacto li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.lista-contacto li a i {
    font-size: 1.2rem;
    color: var(--accent);
}

.lista-contacto li a:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(144, 202, 249, 0.06);
}

/* ════════════════════════════════
   MOBILE — stacked layout
   ════════════════════════════════ */
@media (max-width: 768px) {
    html, body {
        overflow: hidden;
    }

    .layout {
        flex-direction: column;
    }

    /* Top: nav roller */
    .sidebar {
        width: 100%;
        height: 42vh;
        /* re-center mask for shorter vertical space */
        mask-image: linear-gradient(
            to bottom,
            transparent 0%,
            black 18%,
            black 82%,
            transparent 100%
        );
        -webkit-mask-image: linear-gradient(
            to bottom,
            transparent 0%,
            black 18%,
            black 82%,
            transparent 100%
        );
    }

    .nav-list {
        /* padding ≈ half of 42vh so first/last items can reach center */
        padding-block: 19vh;
    }

    /* Horizontal divider */
    .divider {
        width: 100%;
        height: 1px;
    }

    /* Bottom: content panels */
    .content {
        flex: 1;
        height: auto;
    }

    .panel {
        padding: 2rem 1.75rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    /* Stack image above text in project panels */
    .project-content {
        flex-direction: column;
        gap: 1.25rem;
        overflow-y: auto;
    }

    .project-img {
        width: 100%;
    }

    .lista-contacto {
        max-width: 100%;
    }
}
