:root {
    --bg: #FAF6F5;
    --surface: #FFFFFF;
    --ink: #1A1214;
    --text: #3B2E32;
    --muted: #6E3A48;
    --accent: #8E1530;
    --pink: #C2416D;
    --pink-soft: #FBEFF2;
    --pink-light: #F2A7BC;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-pixel: 'Pixelify Sans', 'Courier New', monospace;
    --font-body: 'Space Grotesk', system-ui, sans-serif;

    --max: 1200px;
    --pad: clamp(20px, 4vw, 48px);
    --border: 3px solid var(--ink);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 88px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.6;
}

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

a {
    color: var(--accent);
}

a:hover {
    color: #5C0D1F;
}

:focus-visible {
    outline: 3px solid var(--pink);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    background: var(--ink);
    color: #fff;
    padding: 8px 14px;
    z-index: 100;
}

.skip-link:focus {
    left: 8px;
}

.accent {
    color: var(--accent);
}

/* ---------- Cabecera ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(250, 246, 245, 0.92);
    backdrop-filter: blur(6px);
    border-bottom: 2px solid var(--ink);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    padding: 12px var(--pad);
}

.logo {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 900;
    font-size: 40px;
    line-height: 1;
    color: var(--accent);
    text-decoration: none;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    font-family: var(--font-pixel);
    font-size: 16px;
}

.nav-link {
    color: var(--ink);
    text-decoration: none;
    padding: 4px 2px;
    border-bottom: 2px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ---------- Secciones ---------- */

.section {
    max-width: var(--max);
    margin: 0 auto;
    padding: 56px var(--pad);
}

.section-title {
    margin: 0 0 28px;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 900;
    font-size: clamp(44px, 6vw, 64px);
    line-height: 1;
}

.prompt {
    margin: 0;
    font-family: var(--font-pixel);
    font-size: 18px;
    color: var(--muted);
}

.prompt--light {
    color: var(--pink-light);
}

.cursor {
    animation: blink 1s steps(1) infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cursor {
        animation: none;
    }
}

/* ---------- Botones ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 10px 22px;
    font-family: var(--font-pixel);
    font-size: 17px;
    text-decoration: none;
    border: var(--border);
    transition: transform 0.12s, box-shadow 0.12s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 4px 4px 0 var(--ink);
}

.btn-outline {
    background: var(--surface);
    color: var(--ink);
    box-shadow: 4px 4px 0 var(--pink);
}

.btn-primary:hover,
.btn-outline:hover {
    color: inherit;
    transform: translate(-2px, -2px);
}

.btn-primary:hover {
    color: #fff;
    box-shadow: 6px 6px 0 var(--ink);
}

.btn-outline:hover {
    color: var(--ink);
    box-shadow: 6px 6px 0 var(--pink);
}

.btn-light {
    background: var(--bg);
    color: var(--ink);
    border-color: var(--bg);
}

.btn-light:hover {
    color: var(--accent);
}

.btn-ghost {
    background: transparent;
    color: var(--bg);
    border-color: var(--bg);
}

.btn-ghost:hover {
    color: var(--pink-light);
    border-color: var(--pink-light);
}

/* ---------- Ventanas retro ---------- */

.window {
    background: var(--surface);
    border: var(--border);
}

.window--shadow-pink {
    box-shadow: 8px 8px 0 var(--pink);
}

.window--shadow-dark {
    box-shadow: 6px 6px 0 var(--ink);
}

.window-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    background: var(--ink);
    color: #fff;
    font-family: var(--font-pixel);
    font-size: 15px;
    border-bottom: var(--border);
}

.window-bar h2 {
    margin: 0;
    font: inherit;
}

.window-bar--pink {
    background: var(--pink);
}

.window-menu {
    display: flex;
    gap: 16px;
    padding: 4px 12px;
    font-family: var(--font-pixel);
    font-size: 13px;
    border-bottom: 2px solid var(--ink);
}

.window-body {
    padding: clamp(20px, 3vw, 32px);
}

/* ---------- Hero ---------- */

.hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 48px;
    padding-top: 48px;
}

.hero-text {
    flex: 1 1 480px;
    min-width: 0;
}

.hero-title {
    margin: 6px 0 0;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 900;
    font-size: clamp(64px, 10vw, 140px);
    line-height: 0.95;
}

.hero-lead {
    margin: 24px 0 0;
    max-width: 560px;
    font-size: 19px;
    color: var(--text);
}

.chips {
    list-style: none;
    margin: 24px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-family: var(--font-pixel);
    font-size: 15px;
}

.chips li {
    padding: 4px 14px;
    border: 2px solid var(--ink);
    background: var(--surface);
}

.hero-actions {
    margin-top: 32px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.hero-photo {
    flex: 0 1 400px;
    min-width: 0;
    position: relative;
    margin: 0 auto;
}

.hero-photo img {
    margin: 14px;
    width: calc(100% - 28px);
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border: 2px solid var(--ink);
}

.pixel-flower--hero {
    position: absolute;
    right: -28px;
    bottom: -44px;
}

.pixel-cursor {
    position: absolute;
    left: -20px;
    top: 38%;
    fill: var(--accent);
    stroke: var(--ink);
    stroke-width: 1;
}

/* ---------- Flores pixel ---------- */

.pixel-flower {
    display: grid;
    grid-template-columns: repeat(var(--cols, 11), var(--px, 6px));
    grid-auto-rows: var(--px, 6px);
}

.flower-divider {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 24px var(--pad) 0;
}

/* ---------- Sobre mí ---------- */

.about {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    align-items: flex-start;
}

.about-text {
    flex: 1 1 480px;
    min-width: 0;
    color: var(--text);
    font-size: 18px;
}

.about-text p {
    margin: 0 0 14px;
}

.stats {
    flex: 1 1 280px;
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    text-align: center;
}

.stats li {
    border: 2px solid var(--ink);
    padding: 16px 8px;
}

.stats b {
    display: block;
    font-family: var(--font-pixel);
    font-weight: 600;
    font-size: 34px;
    line-height: 1.1;
    color: var(--accent);
}

.stats span {
    font-size: 13px;
}

/* ---------- Skills ---------- */

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 20px;
}

.skill-group {
    border: 2px solid var(--ink);
    background: var(--surface);
    padding: 20px;
}

.skill-group h3 {
    margin: 0 0 12px;
    font-family: var(--font-pixel);
    font-weight: 600;
    font-size: 18px;
    color: var(--accent);
}

.tags {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags li {
    padding: 2px 10px;
    background: var(--pink-soft);
    border: 1px solid var(--pink);
    font-size: 14px;
}

/* ---------- Experiencia ---------- */

.exp {
    border-top: var(--border);
    padding-top: 28px;
    margin-bottom: 40px;
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
}

.exp-head {
    flex: 0 1 280px;
}

.exp-head p {
    margin: 0;
}

.exp-company {
    font-family: var(--font-pixel);
    font-size: 30px;
    font-weight: 600;
}

.exp-dates {
    font-size: 14px;
    color: var(--muted);
}

.exp-about {
    margin-top: 8px !important;
    font-size: 14px;
    color: var(--text);
}

.exp-role {
    margin-top: 12px !important;
    font-weight: 700;
}

.exp-role span {
    font-weight: 400;
    font-size: 14px;
    color: var(--muted);
}

.exp-functions {
    flex: 1 1 520px;
    min-width: 0;
    margin: 0;
    display: grid;
    gap: 16px;
}

.exp-functions div {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px dashed var(--muted);
}

.exp-functions dt {
    font-family: var(--font-pixel);
    color: var(--accent);
}

.exp-functions dd {
    margin: 0;
    color: var(--text);
}

/* ---------- Proyectos ---------- */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
    gap: 28px;
}

.project h3 {
    margin: 0 0 10px;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 900;
    font-size: 32px;
    color: var(--accent);
}

.project p {
    margin: 0 0 10px;
    color: var(--text);
}

.project-stack {
    font-family: var(--font-pixel);
    font-size: 14px;
    color: var(--muted) !important;
}

.project-links {
    margin: 0 !important;
    font-family: var(--font-pixel);
}

/* ---------- Formación ---------- */

.timeline {
    list-style: none;
    margin: 0;
    padding: 0 0 0 24px;
    border-left: var(--border);
    display: grid;
    gap: 22px;
}

.timeline li {
    position: relative;
    display: grid;
    gap: 2px;
}

.timeline li::before {
    content: '';
    position: absolute;
    left: -33px;
    top: 6px;
    width: 12px;
    height: 12px;
    background: var(--pink);
    border: 2px solid var(--ink);
}

.tl-date {
    font-family: var(--font-pixel);
    font-size: 14px;
    color: var(--muted);
}

.timeline span:last-child {
    color: var(--text);
    font-size: 15px;
}

.timeline span.tl-detail {
    margin-top: 4px;
    max-width: 640px;
    color: var(--muted);
    font-size: 14px;
}

/* ---------- Contacto ---------- */

.contact {
    max-width: none;
    background: var(--ink);
    color: var(--bg);
    padding-bottom: 32px;
}

.contact-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 32px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: space-between;
    align-items: flex-end;
}

.contact-title {
    margin: 8px 0 12px;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 900;
    font-size: clamp(56px, 8vw, 96px);
    line-height: 1;
}

.contact-title span {
    color: var(--pink-light);
}

.contact-lead {
    margin: 0;
    max-width: 460px;
    color: #E9DDE0;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: min(100%, 300px);
}

.footer-note {
    max-width: var(--max);
    margin: 24px auto 0;
    padding-top: 20px;
    border-top: 1px solid #4A3A3F;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    color: #CDBFC3;
}

.footer-note p {
    margin: 0;
}

/* ---------- Móvil ---------- */

@media (max-width: 640px) {
    .site-header {
        position: static;
    }

    .exp-functions div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .pixel-flower--hero {
        right: -8px;
        bottom: -36px;
    }

    .pixel-cursor {
        left: -6px;
    }

    .flower-divider {
        gap: 12px;
    }
}
