/* ─── BASE ───────────────────────────────────── */

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

:root {
    --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --color-text: #000;
    --color-muted: #6A7282;
    --color-bg: #fff;
    --color-nav-bg: #FBFBFB;
    --color-nav-border: rgba(0, 0, 0, 0.1);
    --color-accent: #79eb59;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-mono);
    font-size: 1rem;
    line-height: 1.625;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
    background-image: radial-gradient(circle, rgba(0, 0, 0, 0.15) 1px, transparent 1px);
    background-size: 24px 24px;
}

main, .nav-wrapper {
    position: relative;
    z-index: 1;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

img {
    display: block;
    max-width: 100%;
}

/* ─── NAV ────────────────────────────────────── */

.nav-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
}

/* Spacer blanco de 32px encima de la caja del nav */
.nav-spacer {
    height: 32px;
    background-color: var(--color-bg);
}

/* Caja centrada con border en los 4 lados */
.nav-box {
    height: 52px;
    max-width: 720px;
    margin: 0 auto;
    background-color: var(--color-nav-bg);
    border: 1px solid var(--color-nav-border);
    animation: slideDown 0.5s ease-out forwards;
}

.nav-inner {
    max-width: 720px;
    height: 100%;
    margin: 0 auto;
    padding: 0 0.8rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

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

.nav-links {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    font-size: 14px;
}

.nav-links a:hover {
    text-decoration: underline;
    
}

/* ─── ANIMACIONES ────────────────────────────── */

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to   { transform: translateY(1px); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.fade-in-element {
    animation: fadeIn 1s ease-in forwards;
    animation-delay: 0.5s;
    opacity: 0;
}

/* ─── MAIN CONTENT ───────────────────────────── */

.main-content {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1.5rem;
    margin-top: 85px;
}

/* ─── HERO ───────────────────────────────────── */

.hero {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.terminal-window {
    width: 100%;
    background-color: var(--color-bg);
    border: 1px solid var(--color-nav-border);
    font-size: 0.8125rem;
    margin-bottom: 1.5rem;
}

.terminal-tabs {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    background-color: var(--color-nav-bg);
    border-bottom: 1px solid var(--color-nav-border);
    padding: 0.4rem 0.75rem 0;
    gap: 0.3rem;
}



.terminal-tabs-nav {
    display: flex;
    align-items: flex-end;
    gap: 0.25rem;
}

.terminal-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    background-color: var(--color-bg);
    color: var(--color-muted);
    font-size: 0.75rem;
    border: 1px solid var(--color-nav-border);
    border-radius: 4px 4px 0 0;
    margin-bottom: -1px;
    font-family: var(--font-mono);
    text-decoration: none;
}

.terminal-tab:hover {
    color: var(--color-text);
}

.terminal-tab--active {
    background-color: var(--color-bg);
    color: var(--color-text);
    border-bottom: none;
}

.terminal-body {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem 0.75rem;
}

.badge-path {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #16a34a;
}

.badge-dir {
    font-weight: 500;
}

.badge-branch {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--color-muted);
}

.terminal-prompt {
    color: var(--color-muted);
    font-weight: 400;
}

.terminal-text {
    flex: 1;
    color: var(--color-text);
}

.terminal-cursor {
    display: inline-block;
    width: 0.4em;
    height: 1.1em;
    background-color: var(--color-text);
    margin-left: 2px;
    vertical-align: -0.15em;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

.hero-desc {
    font-size: 0.8rem;
    color: var(--color-muted);
}

/* ─── SECCIONES ──────────────────────────────── */

.content-section {
    margin-bottom: 0.5rem;
    max-width: 400px;
}

.content-section:has(.visible) {
    margin-bottom: 2.5rem;
}

.content-section h2 {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.content-section:has(.visible) h2 {
    margin-bottom: 1rem;
}

/* ─── EXPERIENCIA ────────────────────────────── */

/* La sección de experiencia puede ser más ancha */
.content-section:has(.exp-list),
.content-section:has(.stack-list),
.content-section:has(.hero-desc),
.content-section:has(.projects-list) {
    max-width: 100%;
}

.exp-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.exp-item,
.project-item,
.stack-list li {
    display: none;
}

.exp-item.visible {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 0 2rem;
}

.project-item.visible {
    display: block;
}

.stack-list li.visible {
    display: inline;
}

.exp-date {
    font-size: 0.75rem;
    color: var(--color-muted);
    padding-top: 0.2rem;
    line-height: 1.5;
    white-space: pre-line;
}

.exp-content {
    display: block;
}

.exp-content h3 {
    display: inline;
    font-size: 0.875rem;
    font-weight: 600;
}

.exp-role {
    display: inline;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-muted);
}

.exp-role:not(:empty)::before {
    content: ' > ';
    color: var(--color-muted);
}

.exp-desc {
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--color-muted);
    margin-top: 0.35rem;
}

.exp-desc strong {
    color: var(--color-text);
    font-weight: 600;
}

.exp-tech {
    font-size: 0.72rem;
    color: var(--color-muted);
    margin-top: 0.35rem;
    opacity: 0.75;
}

.exp-item--more {
    display: none !important;
}

.exp-load-more {
    display: none;
    width: 100%;
    height: 1.2rem;
    margin-top: 1.5rem;
    background-color: var(--color-nav-bg);
    border: 1px solid var(--color-nav-border);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-muted);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.exp-load-more i {
    margin-top: auto;
    display: flex;
}

.exp-load-more:hover {
    color: var(--color-text);
}


/* ─── PROYECTOS ──────────────────────────────── */

.projects-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

.project-item a {
    display: inline-flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    cursor: default;
    align-items: flex-start;
}

.project-item h3 {
    font-size: 0.875rem;
    font-weight: 500;
    transition: opacity 0.15s;
}

.project-item h3:hover {
    opacity: 0.6;
    text-decoration: underline;
}

.project-item p {
    font-size: 0.8rem;
    color: var(--color-muted);
}

/* ─── STACK ──────────────────────────────────── */

.stack-list {
    display: flex;
    flex-wrap: wrap;
    color: var(--color-muted);
}

.stack-list li {
    font-size: 0.8rem;
    font-weight: 400;
    transition: color 0.15s;
    cursor: default;
}

.stack-list li::after {
    content: '·';
    padding: 0 0.4rem;
    color: var(--color-muted);
}

.stack-list li:last-child::after {
    content: '';
}

.stack-list li:hover {
    color: #000;
}

/* ─── RESPONSIVE ─────────────────────────────── */

@media (max-width: 640px) {
    .main-content {
        margin-top: 1rem;
        padding: 0 1rem;
    }


    /* Tabs: solo iconos en mobile */
    .terminal-tabs {
        padding: 0.4rem 1rem 0;
    }

    .terminal-body {
        padding: 0.6rem 1rem 0.75rem;
    }

    .terminal-tabs-nav .terminal-tab span,
    .terminal-tabs-nav .terminal-tab {
        font-size: 0;
    }

    .terminal-tabs-nav .terminal-tab i {
        font-size: 0.85rem;
    }

    .terminal-tabs-nav .terminal-tab {
        padding: 0.3rem 0.6rem;
    }

    .exp-item {
        grid-template-columns: 1fr;
    }

    .exp-date {
        margin-bottom: 0.25rem;
    }

    .content-section h2 {
        font-size: 0.75rem;
    }
}
