@import url('./fonts.css');

/* ════════════════════════════════════════
   VARIABLES
════════════════════════════════════════ */
:root {
    --blue-deep:    #1A3A5C;
    --blue-tech:    #2E7EC7;
    --blue-light:   #7AAED4;
    --black-tech:   #0F1C2E;
    --gray-neutral: #F4F6F8;
    --sidebar-w:    280px;

    --bg:           #F4F6F8;
    --surface:      #FFFFFF;
    --text:         #0F1C2E;
    --text-muted:   #5A7A9A;
    --border:       rgba(26,58,92,0.12);
    --accent:       #2E7EC7;
}

/* ════════════════════════════════════════
   RESET
════════════════════════════════════════ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
    text-decoration: none;
}

ul { list-style: none; }
img { max-width: 100%; display: block; }

body {
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    background: var(--bg);
    color: var(--text);
}

/* ════════════════════════════════════════
   LAYOUT
════════════════════════════════════════ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--blue-deep);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 24px;
    z-index: 100;
    overflow-y: auto;
}

.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
}

/* ════════════════════════════════════════
   SIDEBAR — LOGO
════════════════════════════════════════ */
.logo {
    font-family: 'DM Mono', monospace;
    font-size: 22px;
    font-weight: 500;
    color: #fff;
    letter-spacing: -0.5px;
    margin-bottom: 32px;
    text-align: center;
}

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

/* ════════════════════════════════════════
   SIDEBAR — FOTO Y NOMBRE
════════════════════════════════════════ */
.sidebar-photo {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(122,174,212,0.4);
    margin-bottom: 16px;
}

.sidebar-name {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    text-align: center;
    margin-bottom: 4px;
}

.sidebar-title {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--blue-light);
    text-align: center;
    letter-spacing: 0.08em;
    margin-bottom: 32px;
}

/* ════════════════════════════════════════
   SIDEBAR — NAV
════════════════════════════════════════ */
.nav {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 400;
    color: rgba(255,255,255,0.65);
    transition: all 0.2s ease;
}

.nav a i {
    font-size: 15px;
    width: 18px;
    text-align: center;
}

.nav a:hover,
.nav a.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.nav a.active { color: var(--blue-light); }

/* ════════════════════════════════════════
   SIDEBAR — CONTACTO RÁPIDO
════════════════════════════════════════ */
.sidebar-contact {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-contact a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255,255,255,0.55);
    transition: color 0.2s;
}

.sidebar-contact a:hover { color: var(--blue-light); }
.sidebar-contact a i { font-size: 13px; width: 16px; }

/* ════════════════════════════════════════
   NAV TOGGLER MOBILE
════════════════════════════════════════ */
.nav-toggler {
    display: none;
    position: fixed;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    background: var(--blue-deep);
    border-radius: 8px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    z-index: 200;
    border: none;
}

.nav-toggler span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ════════════════════════════════════════
   OVERLAY MOBILE
════════════════════════════════════════ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
}

.sidebar-overlay.active { display: block; }

/* ════════════════════════════════════════
   SECCIONES BASE
════════════════════════════════════════ */
.section {
    padding: 80px 60px;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
}

.section .container {
    max-width: 860px;
    width: 100%;
    animation: fadeUp 0.5s ease both;
}

#portfolio .container {
    max-width: 1100px;
}

.section-label {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.section-title {
    font-size: 38px;
    font-weight: 300;
    color: var(--blue-deep);
    line-height: 1.2;
    margin-bottom: 48px;
}

.section-title strong { font-weight: 500; }

/* ════════════════════════════════════════
   HOME
════════════════════════════════════════ */
#home {
    background: var(--surface);
    align-items: center;
    min-height: 100vh;
}

.home-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 60px;
    align-items: center;
}

.home-eyebrow {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    color: var(--accent);
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}

.home-headline {
    font-size: 48px;
    font-weight: 300;
    color: var(--blue-deep);
    line-height: 1.15;
    margin-bottom: 8px;
}

.home-headline strong {
    font-weight: 500;
    display: block;
}

.home-sub {
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
    letter-spacing: 0.03em;
}

.home-description {
    font-size: 17px;
    color: var(--text-muted);
    max-width: 520px;
    line-height: 1.75;
    margin-bottom: 36px;
}

.home-img-wrap {
    width: 220px;
    flex-shrink: 0;
}

.home-img-wrap img {
    width: 220px;
    height: 280px;
    object-fit: cover;
    border-radius: 16px;
}

/* ════════════════════════════════════════
   BOTONES
════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-family: 'DM Sans', sans-serif;
}

.btn-primary {
    background: var(--blue-deep);
    color: #fff;
}

.btn-primary:hover { background: var(--blue-tech); }

.btn-outline {
    background: transparent;
    color: var(--blue-deep);
    border: 1.5px solid var(--blue-deep);
}

.btn-outline:hover {
    background: var(--blue-deep);
    color: #fff;
}

.btn-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ════════════════════════════════════════
   ABOUT
════════════════════════════════════════ */
#about { background: var(--bg); }

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
}

.about-text p {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.8;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-item {
    display: flex;
    gap: 8px;
    font-size: 14px;
}

.info-item .label {
    color: var(--text-muted);
    min-width: 90px;
    flex-shrink: 0;
}

.info-item .value {
    color: var(--text);
    font-weight: 500;
}

.info-item .value a { color: var(--accent); }
.info-item .value a:hover { text-decoration: underline; }

/* ════════════════════════════════════════
   SKILLS
════════════════════════════════════════ */
.skills-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-family: 'DM Mono', monospace;
    margin-bottom: 16px;
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.skill-tag {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--blue-deep);
    font-weight: 500;
}

.skill-tag .skill-cat {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 2px;
    letter-spacing: 0.06em;
}

/* ════════════════════════════════════════
   TIMELINE
════════════════════════════════════════ */
.timeline-section {
    margin-top: 40px;
}

.timeline-section h3 {
    font-size: 18px;
    font-weight: 500;
    color: var(--blue-deep);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.timeline {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-left: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding: 0 0 24px 24px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 7px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
}

.timeline-date {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.timeline-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--blue-deep);
    margin-bottom: 2px;
}

.timeline-org {
    font-size: 13px;
    color: var(--accent);
    margin-bottom: 6px;
}

.timeline-text {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.65;
}

/* ════════════════════════════════════════
   SERVICIOS
════════════════════════════════════════ */
#services { background: var(--surface); }

.services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.service-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px 24px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.service-card:hover {
    border-color: var(--blue-light);
    box-shadow: 0 4px 24px rgba(26,58,92,0.08);
}

.service-icon {
    width: 44px;
    height: 44px;
    background: rgba(46,126,199,0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.service-icon i {
    font-size: 20px;
    color: var(--accent);
}

.service-card h4 {
    font-size: 16px;
    font-weight: 500;
    color: var(--blue-deep);
    margin-bottom: 8px;
}

.service-card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.65;
}

/* ════════════════════════════════════════
   STACK PILLS
════════════════════════════════════════ */
.service-stack,
.portfolio-tech {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.stack-pill {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    padding: 3px 8px;
    background: rgba(26,58,92,0.07);
    color: var(--blue-deep);
    border-radius: 4px;
    letter-spacing: 0.04em;
}

/* ════════════════════════════════════════
   PORTAFOLIO
════════════════════════════════════════ */
#portfolio { background: var(--bg); }

.portfolio-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.portfolio-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.portfolio-card:hover {
    box-shadow: 0 8px 32px rgba(26,58,92,0.12);
    transform: translateY(-2px);
}

.portfolio-img {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--blue-deep);
}

.portfolio-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.portfolio-card:hover .portfolio-img img { transform: scale(1.04); }

.portfolio-body {
    padding: 20px;
}

.portfolio-label {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--accent);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.portfolio-body h4 {
    font-size: 16px;
    font-weight: 500;
    color: var(--blue-deep);
    margin-bottom: 6px;
}

.portfolio-body p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 14px;
}

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

.portfolio-link {
    font-size: 12px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    white-space: nowrap;
}

.portfolio-link:hover { text-decoration: underline; }

.portfolio-private {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Caso de estudio destacado ── */
.portfolio-featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--surface);
    border: 1.5px solid var(--blue-tech);
    border-radius: 12px;
    overflow: hidden;
    min-height: 360px;
}

.portfolio-featured .portfolio-img {
    aspect-ratio: auto;
    height: 100%;
    min-height: 360px;
    overflow: hidden;
    background: #0F1C2E;
}

.portfolio-featured .portfolio-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left top;
}

.portfolio-featured .portfolio-body {
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(46,126,199,0.1);
    color: var(--accent);
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
    width: fit-content;
}

/* ════════════════════════════════════════
   CONTACTO
════════════════════════════════════════ */
#contact {
    background: var(--blue-deep);
    color: #fff;
}

#contact .section-label { color: var(--blue-light); }
#contact .section-title { color: #fff; }

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
}

.contact-intro {
    font-size: 16px;
    color: rgba(255,255,255,0.65);
    line-height: 1.8;
    margin-bottom: 32px;
}

.contact-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.contact-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-item-icon i { font-size: 16px; color: var(--blue-light); }

.contact-item-label {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    font-family: 'DM Mono', monospace;
    letter-spacing: 0.06em;
}

.contact-item-value {
    font-size: 14px;
    color: #fff;
    font-weight: 500;
}

.contact-item-value a { color: var(--blue-light); }
.contact-item-value a:hover { text-decoration: underline; }

/* ── Formulario ── */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    font-size: 14px;
    color: #fff;
    font-family: 'DM Sans', sans-serif;
    transition: border-color 0.2s;
}

.form-control::placeholder { color: rgba(255,255,255,0.35); }
.form-control:focus { border-color: var(--blue-light); }

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

/* ════════════════════════════════════════
   FOOTER
════════════════════════════════════════ */
.footer-copy {
    font-size: 12px;
    color: rgba(255,255,255,0.3);
    text-align: center;
    margin-top: 48px;
    font-family: 'DM Mono', monospace;
}

/* ════════════════════════════════════════
   ANIMACIÓN
════════════════════════════════════════ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════
   RESPONSIVE — 1280px+
════════════════════════════════════════ */
@media (min-width: 1280px) {
    .portfolio-featured {
        min-height: 420px;
    }

    .portfolio-featured .portfolio-img {
        min-height: 420px;
    }
}

/* ════════════════════════════════════════
   RESPONSIVE — 1024px
════════════════════════════════════════ */
@media (max-width: 1024px) {
    .section { padding: 60px 40px; }
    .home-grid { grid-template-columns: 1fr; }
    .home-img-wrap { display: none; }
    .about-grid { grid-template-columns: 1fr; }
    .portfolio-featured { grid-template-columns: 1fr; }
    .portfolio-featured .portfolio-img {
        height: 260px;
        min-height: 260px;
    }
}

/* ════════════════════════════════════════
   RESPONSIVE — 768px
════════════════════════════════════════ */
@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 260px;
    }

    .sidebar.open { transform: translateX(0); }

    .main-content { margin-left: 0; }

    .nav-toggler { display: flex; }

    .section { padding: 60px 20px; }

    .home-headline { font-size: 34px; }
    .section-title { font-size: 28px; }

    .services-grid,
    .portfolio-grid,
    .contact-grid { grid-template-columns: 1fr; }

    .portfolio-featured {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .portfolio-featured .portfolio-img {
        height: 220px;
        min-height: 220px;
    }

    .portfolio-featured .portfolio-img img {
        object-position: center 15%;
    }

    .form-row { grid-template-columns: 1fr; }

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

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