:root {
  --bg: #ffffff;
  --surface: #f7f9fc;
  --surface-2: #f1f5f9;
  --text: #263241;
  --muted: #718096;
  --heading: #182230;
  --primary: #6d8fb3;
  --primary-dark: #52779d;
  --accent: #9bb6d0;
  --border: #e5eaf0;
  --shadow: 0 18px 50px rgba(40, 58, 80, .08);
  --radius: 22px;
  --container: 1120px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

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

.container {
  width: min(100% - 40px, var(--container));
  margin-inline: auto;
}

.section { padding: 110px 0; }

.section-soft { background: var(--surface); }

.header {
  position: fixed;
  top: 0; left: 0; width: 100%;
  z-index: 1000;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: .3s ease;
}

.header.scrolled { border-color: var(--border); box-shadow: 0 5px 25px rgba(40,58,80,.05); }

.nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--heading);
  letter-spacing: -.04em;
}

.logo span {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  margin-right: 7px;
  border-radius: 10px;
  color: #fff;
  background: var(--primary);
}

.nav-menu { display: flex; align-items: center; gap: 28px; }

.nav-menu a {
  font-size: .86rem;
  color: var(--muted);
  font-weight: 600;
  transition: color .2s;
}

.nav-menu a:hover { color: var(--primary-dark); }

.nav-contact {
  padding: 10px 17px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
}

.nav-toggle { display: none; border: 0; background: transparent; cursor: pointer; }
.nav-toggle span { display:block; width:25px; height:2px; margin:5px; background:var(--heading); }

.hero { padding-top: 170px; min-height: 760px; display:flex; align-items:center; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  gap: 70px;
}

.eyebrow {
  color: var(--primary-dark);
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .16em;
  margin-bottom: 14px;
}

.hero h1 {
  max-width: 760px;
  color: var(--heading);
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 1.04;
  letter-spacing: -.065em;
}

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

.hero-text {
  max-width: 620px;
  margin: 25px 0 30px;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions { display:flex; gap:12px; flex-wrap:wrap; }

.btn {
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:13px 20px;
  border-radius:12px;
  font-size:.9rem;
  font-weight:700;
  transition:.25s ease;
}

.btn-primary { background:var(--primary); color:#fff; box-shadow:0 10px 25px rgba(109,143,179,.22); }
.btn-primary:hover { background:var(--primary-dark); transform:translateY(-2px); }

.btn-secondary { border:1px solid var(--border); background:#fff; color:var(--heading); }
.btn-secondary:hover { border-color:var(--accent); transform:translateY(-2px); }

.hero-links { display:flex; gap:22px; margin-top:28px; }
.hero-links a { color:var(--muted); font-size:.82rem; font-weight:600; }
.hero-links a:hover { color:var(--primary-dark); }

.profile-card {
  background:#fff;
  border:1px solid var(--border);
  border-radius:28px;
  padding:30px;
  box-shadow:var(--shadow);
  transform:rotate(1.2deg);
}

.profile-top { display:flex; justify-content:space-between; align-items:center; }

.avatar {
    width: 105px;
    height: 105px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;

    border: 2px solid #ffffff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);

    background: #eaf0f6;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 12%;
    display: block;
}

.status { color:#718096; font-size:.75rem; font-weight:700; }
.status i { display:inline-block; width:8px; height:8px; border-radius:50%; background:#8dbd9c; margin-right:5px; }

.profile-card h2 { margin-top:28px; color:var(--heading); font-size:1.5rem; }
.profile-card > p { color:var(--primary-dark); font-weight:600; }

.code-window {
  margin-top:25px;
  overflow:hidden;
  border-radius:16px;
  background:#f8fafc;
  border:1px solid var(--border);
}

.code-bar { padding:11px 14px; border-bottom:1px solid var(--border); }
.code-bar i { display:inline-block; width:7px; height:7px; border-radius:50%; background:#c8d2dc; margin-right:4px; }

pre {
  padding:22px;
  overflow:auto;
  font: .78rem/1.8 "SFMono-Regular", Consolas, monospace;
  color:#536274;
}

.keyword { color:#708fb2; }
.key { color:#607a94; }
.string { color:#849e8b; }

.section-heading { max-width:720px; margin-bottom:55px; }
.section-heading.center { text-align:center; margin-inline:auto; }
.section-heading h2 { color:var(--heading); font-size:clamp(2rem,4vw,3.2rem); line-height:1.12; letter-spacing:-.045em; }
.section-heading p:not(.eyebrow) { color:var(--muted); margin-top:14px; }

.about-grid { display:grid; grid-template-columns:1.15fr .85fr; gap:80px; align-items:start; }
.about-copy p { color:var(--muted); font-size:1rem; margin-bottom:20px; }

.about-highlights { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.highlight { padding:24px; border:1px solid var(--border); border-radius:18px; background:#fff; }
.highlight strong { display:block; color:var(--primary-dark); font-size:1.8rem; letter-spacing:-.04em; }
.highlight span { color:var(--muted); font-size:.78rem; }

.tech-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:15px; }
.tech-card { padding:27px; border:1px solid var(--border); border-radius:18px; background:#fff; transition:.25s ease; }
.tech-card:hover { transform:translateY(-5px); box-shadow:var(--shadow); border-color:#d4dfe9; }
.tech-card > span { color:var(--primary-dark); font-weight:800; font-size:1.15rem; }
.tech-card h3 { margin-top:16px; color:var(--heading); font-size:1rem; }
.tech-card p { margin-top:5px; color:var(--muted); font-size:.77rem; }

.timeline { position:relative; max-width:850px; margin:auto; }
.timeline::before { content:""; position:absolute; left:8px; top:0; bottom:0; width:1px; background:#dce3ea; }
.timeline-item { position:relative; display:grid; grid-template-columns:150px 1fr; gap:35px; padding-bottom:55px; }
.timeline-dot { position:absolute; left:3px; top:5px; width:11px; height:11px; border:3px solid var(--surface); border-radius:50%; background:var(--primary); }
.timeline-date { color:var(--primary-dark); font-size:.75rem; font-weight:800; padding-left:32px; }
.timeline-content { padding-left:30px; }
.timeline-content h3 { color:var(--heading); font-size:1.2rem; }
.timeline-content h4 { color:var(--primary-dark); font-size:.88rem; margin:4px 0 12px; }
.timeline-content p { color:var(--muted); font-size:.9rem; }

.tags { display:flex; flex-wrap:wrap; gap:7px; margin-top:18px; }
.tags span { padding:5px 10px; border-radius:999px; background:#edf2f7; color:#65788b; font-size:.68rem; font-weight:700; }

.projects-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:18px; }
.project-card { position:relative; min-height:360px; padding:32px; border:1px solid var(--border); border-radius:22px; background:#fff; transition:.25s ease; }
.project-card:hover { transform:translateY(-5px); box-shadow:var(--shadow); }
.project-card.featured { grid-column:span 2; min-height:330px; background:#f9fbfd; }
.project-number { color:#b6c4d1; font-size:.75rem; font-weight:800; }
.project-content { max-width:720px; margin-top:45px; }
.project-type { color:var(--primary-dark); font-size:.68rem; font-weight:800; letter-spacing:.12em; }
.project-content h3 { color:var(--heading); font-size:1.7rem; margin:7px 0 12px; letter-spacing:-.03em; }
.project-content > p:not(.project-type) { color:var(--muted); font-size:.88rem; }
.project-links { display:flex; gap:20px; margin-top:25px; }
.project-links a { color:var(--primary-dark); font-size:.78rem; font-weight:800; }

.education-grid { display:grid; grid-template-columns:.7fr 1.3fr; gap:60px; align-items:center; }
.education-card { display:flex; gap:22px; align-items:flex-start; padding:30px; border:1px solid var(--border); border-radius:20px; background:#fff; }
.education-icon { font-size:1.8rem; }
.education-card h3 { color:var(--heading); margin:5px 0 8px; }
.education-card p:last-child { color:var(--muted); font-size:.85rem; }

.cta-section { padding-top:80px; }
.cta-card { padding:75px 30px; border:1px solid var(--border); border-radius:28px; background:#f8fafc; text-align:center; }
.cta-card h2 { max-width:700px; margin:auto; color:var(--heading); font-size:clamp(2.1rem,5vw,3.7rem); line-height:1.08; letter-spacing:-.055em; }
.cta-card > p:not(.eyebrow) { color:var(--muted); margin:17px auto 28px; max-width:550px; }
.contact-links { display:flex; justify-content:center; flex-wrap:wrap; gap:22px; margin-top:28px; }
.contact-links a { color:var(--muted); font-size:.8rem; }

.footer { padding:28px 0; border-top:1px solid var(--border); }
.footer-inner { display:flex; justify-content:space-between; gap:20px; color:#8995a3; font-size:.72rem; }

.back-top {
  position:fixed; right:22px; bottom:22px;
  width:42px; height:42px; border:1px solid var(--border);
  border-radius:12px; background:#fff; color:var(--heading);
  box-shadow:var(--shadow); cursor:pointer;
  opacity:0; pointer-events:none; transition:.25s;
}
.back-top.show { opacity:1; pointer-events:auto; }

.reveal { opacity:0; transform:translateY(22px); transition:opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity:1; transform:translateY(0); }

.hero-card {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}

.profile-card {
    width: 100%;
    max-width: 520px;
    min-width: 0;
    overflow: hidden;
}

.code-window {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.code-window pre {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 20px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 13px;
    line-height: 1.7;
}

.code-window code {
    white-space: inherit;
}

/*@media (max-width: 900px) {
  .hero-grid, .about-grid, .education-grid { grid-template-columns:1fr; }
  .hero { padding-top:130px; }
  .hero-grid { gap:45px; }
  .tech-grid { grid-template-columns:repeat(2,1fr); }
  .education-grid { gap:25px; }
}

@media (max-width: 720px) {
  .container { width:min(100% - 28px, var(--container)); }
  .section { padding:80px 0; }

  .nav-toggle { display:block; z-index:2; }
  .nav-menu {
    position:absolute; top:76px; left:14px; right:14px;
    display:flex; flex-direction:column; align-items:stretch; gap:0;
    padding:10px; border:1px solid var(--border); border-radius:18px;
    background:#fff; box-shadow:var(--shadow);
    opacity:0; visibility:hidden; transform:translateY(-10px);
    transition:.25s ease;
  }
  .nav-menu.active { opacity:1; visibility:visible; transform:translateY(0); }
  .nav-menu a { padding:13px 14px; }
  .nav-contact { border:0; }

  .hero { min-height:auto; padding-top:125px; padding-bottom:75px; }
  .hero h1 { font-size:clamp(2.5rem,13vw,4rem); }
  .profile-card { transform:none; }
  .about-highlights { grid-template-columns:1fr 1fr; }
  .tech-grid, .projects-grid { grid-template-columns:1fr; }
  .project-card.featured { grid-column:span 1; }
  .timeline-item { grid-template-columns:1fr; gap:8px; padding-left:0; }
  .timeline-date { padding-left:32px; }
  .timeline-content { padding-left:32px; }
  .footer-inner { flex-direction:column; }
}

@media (max-width: 420px) {
  .about-highlights { grid-template-columns:1fr; }
  .hero-actions .btn { width:100%; justify-content:center; }
  .hero-links { flex-wrap:wrap; gap:12px 18px; }
}*/
/* =========================================
   TABLET
========================================= */
@media (max-width: 900px) {

    .container {
        width: min(100% - 32px, var(--container));
    }

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

    .hero {
        padding-top: 120px;
        padding-bottom: 70px;
    }

    .hero-grid {
        gap: 50px;
    }

    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .education-grid {
        gap: 30px;
    }

    .profile-card {
        max-width: 500px;
        margin: 0 auto;
    }
}


/* =========================================
   CELULARES
========================================= */

@media (max-width: 720px) {

    html {
        overflow-x: hidden;
    }

    body {
        overflow-x: hidden;
    }

    .container {
        width: calc(100% - 32px);
        max-width: none;
    }

    .section {
        padding: 65px 0;
    }


    /* ---------- NAV ---------- */

    .nav-toggle {
        display: block;
        z-index: 10;
    }

    .nav-menu {
        position: absolute;
        top: 70px;
        left: 16px;
        right: 16px;

        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;

        padding: 10px;

        border: 1px solid var(--border);
        border-radius: 18px;

        background: #fff;
        box-shadow: var(--shadow);

        opacity: 0;
        visibility: hidden;

        transform: translateY(-10px);

        transition:
            opacity .25s ease,
            transform .25s ease,
            visibility .25s ease;

        z-index: 9;
    }

    .nav-menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-menu a {
        display: block;
        width: 100%;
        padding: 14px;
    }

    .nav-contact {
        border: 0;
    }


    /* ---------- HERO ---------- */

    .hero {
        min-height: auto;
        padding-top: 105px;
        padding-bottom: 60px;
    }

    .hero-grid {
        display: flex;
        flex-direction: column;
        gap: 45px;
    }

    .hero-content {
        width: 100%;
    }

    .hero h1 {
        font-size: clamp(2.3rem, 11vw, 3.5rem);
        line-height: 1.05;
        word-break: normal;
    }

    .hero p {
        font-size: 1rem;
        line-height: 1.7;
    }

    .hero-actions {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-links {
        display: flex;
        flex-wrap: wrap;
        gap: 12px 18px;
    }

    .hero-card {
        width: 100%;
        max-width: 100%;
    }

    .profile-card {
        width: 100%;
        max-width: 100%;
        padding: 20px;
        border-radius: 20px;
    }

    .profile-top {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .avatar {
        flex-shrink: 0;
    }

    .status {
        font-size: 12px;
        white-space: nowrap;
    }

    .profile-card h2 {
        font-size: 22px;
        line-height: 1.2;
        word-break: break-word;
    }

    .profile-card > p {
        font-size: 14px;
    }

    .code-window {
        width: 100%;
        border-radius: 12px;
    }

    .code-window pre {
        padding: 15px;
        font-size: 11px;
        line-height: 1.6;

        /* Evita que el código provoque overflow */
        overflow-x: auto;
        white-space: pre;
        word-break: normal;
    }


    /* ---------- PROFILE ---------- */

    /*.profile-card {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
        transform: none;
    }*/


    /* ---------- ABOUT ---------- */

    .about-highlights {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }


    /* ---------- TECHNOLOGIES ---------- */

    .tech-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }


    /* ---------- PROJECTS ---------- */

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

    .project-card.featured {
        grid-column: span 1;
    }


    /* ---------- TIMELINE ---------- */

    .timeline-item {
        grid-template-columns: 1fr;
        gap: 8px;
        padding-left: 0;
    }

    .timeline-date {
        padding-left: 32px;
    }

    .timeline-content {
        padding-left: 32px;
    }


    /* ---------- FOOTER ---------- */

    .footer-inner {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}


/* =========================================
   CELULARES PEQUEÑOS
========================================= */
@media (max-width: 420px) {

    .container {
        width: calc(100% - 24px);
    }

    .section {
        padding: 55px 0;
    }

    .hero {
        padding-top: 95px;
        padding-bottom: 50px;
    }

    .hero h1 {
        font-size: clamp(2.1rem, 12vw, 3rem);
    }

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

    .hero-actions .btn {
        width: 100%;
    }

    .hero-links {
        justify-content: center;
    }

    .profile-card {
        padding: 16px;
        border-radius: 18px;
    }

    .profile-top {
        align-items: flex-start;
    }

    .avatar {
        width: 70px;
        height: 70px;
    }

    .status {
        font-size: 11px;
    }

    .profile-card h2 {
        font-size: 20px;
    }

    .code-window pre {
        padding: 12px;
        font-size: 10px;
    }
}
