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

:root {
    /* --bg: #080808; */
    --bg: #161616;
    --bg2: #0f0f0f;
    --bg3: #161616;
    --surface: #1a1a1a;
    --wine: #8B1535;
    --wine-dim: #6B0F27;
    --wine-glow: rgba(139, 21, 53, 0.15);
    --wine-border: rgba(139, 21, 53, 0.35);
    --text: #ededed;
    --muted: #737373;
    --subtle: #404040;
    --border: rgba(255, 255, 255, 0.07);
    --border2: rgba(255, 255, 255, 0.12);
    --display: 'Bricolage Grotesque', sans-serif;
    --body: 'Instrument Sans', system-ui, sans-serif;
}

html {
    scroll-behavior: smooth
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--body);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased
}

::selection {
    background: var(--wine-glow);
    color: var(--text)
}

::-webkit-scrollbar {
    width: 5px
}

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

::-webkit-scrollbar-thumb {
    background: var(--surface);
    border-radius: 10px
}

/* NAV */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    height: 56px;
    border-bottom: 1px solid var(--border);
    background: rgba(8, 8, 8, 0.88);
    backdrop-filter: blur(20px) saturate(150%)
}

.nav-logo {
    font-family: var(--display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem
}

.nav-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--wine);
    box-shadow: 0 0 8px var(--wine);
    flex-shrink: 0
}

.nav-links {
    display: flex;
    gap: 0;
    list-style: none
}

.nav-links a {
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--muted);
    text-decoration: none;
    padding: 0 1rem;
    height: 56px;
    display: flex;
    align-items: center;
    transition: color 0.15s;
    border-left: 1px solid var(--border)
}

.nav-links a:last-child {
    border-right: 1px solid var(--border)
}

.nav-links a:hover {
    color: var(--text)
}

/* HERO */
#hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 7rem 5% 4rem;
    overflow: hidden
}

.grid-bg {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 100%);
    pointer-events: none
}

.hero-glow {
    position: absolute;
    width: 700px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(139, 21, 53, 0.12) 0%, transparent 70%);
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted);
    border: 1px solid var(--border2);
    background: var(--bg2);
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 2rem;
    width: fit-content;
    letter-spacing: 0.02em
}

.hero-badge span.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--wine);
    animation: blink 2.5s ease-in-out infinite;
    flex-shrink: 0
}

@keyframes blink {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0.3
    }
}

.hero-badge em {
    color: var(--text);
    font-style: normal
}

h1.hero-title {
    font-family: var(--display);
    font-size: clamp(3.2rem, 7.5vw, 6.8rem);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.04em;
    color: var(--text);
    margin-bottom: 1.5rem
}

h1.hero-title .wine {
    color: var(--wine)
}

h1.hero-title .dim {
    color: var(--subtle);
    font-weight: 300
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap
}

.hero-meta-item {
    font-size: 0.82rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.35rem
}

.hero-meta-sep {
    color: var(--subtle)
}

.hero-desc {
    max-width: 520px;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.75;
    margin-bottom: 2.5rem
}

.hero-ctas {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap
}

.btn-primary {
    padding: 0.6rem 1.4rem;
    background: var(--wine);
    color: #fff;
    font-family: var(--body);
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s
}

.btn-primary:hover {
    background: #A01D40;
    box-shadow: 0 0 24px rgba(139, 21, 53, 0.35);
    transform: translateY(-1px)
}

.btn-ghost {
    padding: 0.6rem 1.4rem;
    background: transparent;
    color: var(--text);
    font-family: var(--body);
    font-size: 0.85rem;
    font-weight: 400;
    border: 1px solid var(--border2);
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s
}

.btn-ghost:hover {
    background: var(--bg3);
    transform: translateY(-1px)
}

.hero-scroll {
    position: absolute;
    bottom: 2.5rem;
    left: 5%;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.75rem;
    color: var(--subtle);
    letter-spacing: 0.08em;
    text-transform: uppercase
}

.hero-scroll svg {
    width: 14px;
    height: 14px;
    animation: bounce 2s ease-in-out infinite
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(4px)
    }
}

/* SECTIONS */
.sw {
    max-width: 1080px;
    margin: 0 auto;
    padding: 5rem 5%;
    position: relative
}

.s-eye {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--wine);
    margin-bottom: 0.5rem
}

h2.s-head {
    font-family: var(--display);
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    line-height: 1.1;
    margin-bottom: 2.5rem
}

h2.s-head span {
    color: var(--subtle);
    font-weight: 300
}

hr.rule {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0
}

/* ABOUT */
.about-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    align-items: start
}

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

.about-text strong {
    color: var(--text);
    font-weight: 500
}

.about-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem
}

.acard {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg2);
    padding: 1.1rem 1.3rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: border-color 0.2s, background 0.2s
}

.acard:hover {
    border-color: var(--wine-border);
    background: var(--bg3)
}

.acard-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--wine-glow);
    border: 1px solid var(--wine-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0
}

.acard-text strong {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.15rem
}

.acard-text span {
    font-size: 0.78rem;
    color: var(--muted)
}

/* SKILLS */
.skills-table {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden
}

.sc {
    padding: 1.4rem 1.5rem;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transition: background 0.2s
}

.sc:hover {
    background: var(--bg2)
}

.sc:nth-child(3n) {
    border-right: none
}

.sc:nth-last-child(-n+3) {
    border-bottom: none
}

.sc-label {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--wine);
    margin-bottom: 0.75rem
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem
}

.pill {
    font-size: 0.77rem;
    color: var(--muted);
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 0.18rem 0.55rem;
    transition: color 0.15s, border-color 0.15s
}

.pill:hover {
    color: var(--text);
    border-color: var(--border2)
}

.pill.on {
    color: #5f343f;
    background: rgba(139, 21, 53, 0.1);
    border-color: var(--wine-border)
}

/* PROJECTS */
.prow {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    padding: 1.5rem 1.75rem;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1.5rem;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 0.75rem;
    position: relative;
    overflow: hidden
}

.prow::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: transparent;
    transition: background 0.2s
}

.prow:hover {
    border-color: var(--border2);
    background: var(--bg2)
}

.prow:hover::before {
    background: var(--wine)
}

.prow-num {
    font-size: 0.7rem;
    color: var(--subtle);
    margin-bottom: 0.3rem;
    letter-spacing: 0.05em
}

.prow h3 {
    font-family: var(--display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem
}

.prow p {
    font-size: 0.84rem;
    color: var(--muted);
    line-height: 1.6;
    max-width: 560px;
    margin-bottom: 0.75rem
}

.p-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap
}

.p-tag {
    font-size: 0.71rem;
    color: var(--subtle);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.12rem 0.45rem;
    font-family: 'Courier New', monospace
}

.p-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end
}

.p-link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: var(--muted);
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem 0.75rem;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s
}

.p-link:hover {
    color: var(--text);
    border-color: var(--border2)
}

.p-link svg {
    width: 12px;
    height: 12px
}

.prow.wip {
    opacity: 0.5
}

.prow.wip::after {
    content: 'En desarrollo';
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--wine);
    background: var(--wine-glow);
    border: 1px solid var(--wine-border);
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase
}

/* CONTACT */
.contact-block {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--bg2);
    padding: 3.5rem;
    text-align: center;
    position: relative;
    overflow: hidden
}

.contact-block::after {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--wine), transparent)
}

.contact-block h2 {
    font-family: var(--display);
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-bottom: 0.6rem
}

.contact-block p {
    color: var(--muted);
    font-size: 0.9rem;
    max-width: 400px;
    margin: 0 auto 2rem
}

.c-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: center
}

.c-btn {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.1rem;
    font-size: 0.82rem;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg3);
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s, background 0.15s
}

.c-btn:hover {
    color: var(--text);
    border-color: var(--border2);
    background: var(--surface)
}

.c-btn svg {
    width: 15px;
    height: 15px
}

/* FOOTER */
footer {
    border-top: 1px solid var(--border);
    max-width: 1080px;
    margin: 0 auto;
    padding: 1.25rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem
}

footer span,
footer a {
    font-size: 0.78rem;
    color: var(--subtle);
    text-decoration: none
}

footer a:hover {
    color: var(--muted)
}

/* REVEAL */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.55s ease, transform 0.55s ease
}

.reveal.in {
    opacity: 1;
    transform: none
}

.d1 {
    transition-delay: 0.08s
}

.d2 {
    transition-delay: 0.16s
}

.d3 {
    transition-delay: 0.24s
}

@media(max-width:768px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem
    }

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

    .sc:nth-child(3n) {
        border-right: 1px solid var(--border)
    }

    .sc:nth-child(2n) {
        border-right: none
    }

    .sc:nth-last-child(-n+3) {
        border-bottom: 1px solid var(--border)
    }

    .sc:nth-last-child(-n+2) {
        border-bottom: none
    }

    .prow {
        grid-template-columns: 1fr
    }

    .p-links {
        flex-direction: row;
        align-items: flex-start
    }

    .contact-block {
        padding: 2rem 1.5rem
    }

    .nav-links {
        display: none
    }
}