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

:root {
    --panel: #111214;
    --border: #34363b;
    --text: #ededee;
    --dim: #9a9ca1;
    --mint: #6fe3bb;
    --amber: #d9a05b;
    --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

html {
    background: #050505;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #050505;
    color: #fff;
    overflow-x: hidden;
}

header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(10 10 10 / 14%);
    backdrop-filter: blur(10px);
}

.logo {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
}

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

nav a {
    color: #fff;
    text-decoration: none;
    margin-left: 30px;
    font-size: 16px;
    transition: color 0.3s;
}

nav a:hover {
    color: #f39c12;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #fff;
    margin: 4px 0;
    transition: all 0.3s;
    border-radius: 3px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

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

#hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 50px;
    overflow: hidden;
}

#particles-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: 800px;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: 1;
    object-fit: cover;
}

#hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-content h1 {
    font-size: 80px;
    font-weight: 300;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 20px;
    color: #bbb;
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-contact {
    display: inline-block;
    padding: 15px 40px;
    border: 2px solid #fff;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s;
}

.btn-contact:hover {
    background: #f2cc8f;
    color: #0a0a0a;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 40px;
    background: #25D366;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s;
    border: 2px solid #25D366;
}

.btn-whatsapp:hover {
    background: #128C7E;
    border-color: #128C7E;
}

section {
    padding: 40px 50px;
    position: relative;
}

#inicio {
    padding: 0;
}

#scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#contacto,
#proyectos,
#habilidades {
    z-index: 1;
    background: transparent;
    scroll-margin-top: 76px;
}

.section-title {
    font-size: 48px;
    margin-bottom: 50px;
    font-weight: 300;
}

#contacto {
    padding: 8vh 5vw 6vh;
}

#contacto > .section-title {
    width: auto;
    margin-right: 0;
    margin-left: 0;
    text-align: left;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    width: min(100%, 1100px);
    margin-inline: auto;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 14px 16px;
    color: inherit;
    text-decoration: none;
    background: rgba(17, 18, 20, 0.86);
    border: 1px solid var(--border);
    border-radius: 12px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.contact-card:hover {
    transform: translateY(-2px);
    border-color: var(--amber);
    background: rgba(24, 22, 18, 0.9);
}

.contact-icon {
    display: flex;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: var(--amber);
    background: rgba(217, 160, 91, 0.12);
    border-radius: 9px;
}

.contact-icon svg {
    width: 18px;
    height: 18px;
}

.contact-text {
    min-width: 0;
}

.contact-label,
.contact-value {
    display: block;
}

.contact-label {
    margin-bottom: 2px;
    color: var(--amber);
    font-size: 13px;
    font-weight: 700;
}

.contact-value {
    overflow: hidden;
    color: var(--dim);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sql-demo {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: min(100%, 700px);
    margin: clamp(48px, 8vh, 90px) auto 0;
}

.sql-panel {
    width: 100%;
    min-width: 0;
    background: rgba(17, 18, 20, 0.9);
    border: 1px solid var(--border);
    border-radius: 14px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.sql-table-panel {
    padding: 22px 24px 26px;
}

.sql-table-title {
    margin: 0 0 16px;
    color: var(--dim);
    font-size: 15px;
    font-weight: 400;
}

.sql-table-scroll {
    width: 100%;
    overflow-x: hidden;
}

.sql-demo table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 13px;
}

.sql-demo th,
.sql-demo td {
    padding: 14px 12px;
    font-weight: 400;
    text-align: center;
    border: 1px solid var(--border);
}

.sql-demo th {
    color: var(--dim);
    font-size: 12px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.sql-demo td {
    overflow-wrap: anywhere;
    white-space: normal;
}

.sql-demo .empty-row td {
    height: 56px;
    color: var(--dim);
    font-style: italic;
}

.sql-demo .row-in {
    opacity: 0;
    animation: rowIn 0.5s ease forwards;
}

@keyframes rowIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sql-query-panel {
    align-self: center;
    width: min(100%, 560px);
    padding: 20px 22px 22px;
}

.sql-query-code {
    max-width: 100%;
    margin: 0 0 18px;
    overflow-x: auto;
    color: #c9cbd1;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.7;
    white-space: pre;
}

.alias {
    color: var(--mint);
}

.field {
    color: #c9cbd1;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.project-card {
    background: rgba(17, 18, 20, 0.88);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: var(--amber);
    background: rgba(24, 22, 18, 0.9);
}

.project-chart {
    height: 300px;
    background: rgba(0, 0, 0, 0.3);
}

.project-info {
    padding: 30px;
}

.project-info h3 {
    font-size: 24px;
    margin-bottom: 15px;
}

.project-info p {
    color: #bbb;
    line-height: 1.6;
    margin-bottom: 20px;
}

.project-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(243, 156, 18, 0.1);
    border: 1px solid #f2cc8f;
    color: #f2cc8f;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.3s;
}

.project-link:hover {
    background: #f2cc8f;
    color: #0a0a0a;
    transform: translateY(-2px);
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.modal-content {
    position: relative;
    margin: 50px auto;
    width: 90%;
    max-width: 1200px;
    background: #1a1a1a;
    border-radius: 10px;
    padding: 40px;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #f39c12;
}

.modal h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.modal p {
    color: #bbb;
    line-height: 1.8;
    margin-bottom: 30px;
}

.modal-chart {
    height: 500px;
    margin: 30px 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

#proyectos,
#habilidades {
    padding: 8vh 5vw 10vh;
}

.skills-title {
    background: linear-gradient(90deg, #ffffff, #9fd8ff 60%, var(--mint));
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: stretch;
    max-width: 1100px;
    margin: 0 auto;
}

.skills-grid .panel {
    min-width: 0;
    background: rgba(17, 18, 20, 0.88);
    border: 1px solid var(--border);
    border-radius: 14px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.code-panel {
    display: flex;
    flex-direction: column;
    padding: 20px 22px 22px;
}

.query-code {
    margin: 0 0 18px;
    overflow-x: auto;
    color: #c9cbd1;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.7;
    white-space: pre;
}

.code-panel .query-code {
    flex: 1;
}

.kw {
    color: #f2f2f2;
    font-weight: 700;
}

.str {
    color: #e5b567;
}

.run-btn {
    display: block;
    margin: 0 auto;
    padding: 12px 26px;
    color: #08130f;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    background: var(--mint);
    border: 0;
    border-radius: 8px;
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.run-btn:hover {
    background: #84eec9;
    box-shadow: 0 0 24px rgba(111, 227, 187, 0.35);
}

.run-btn:active {
    transform: scale(0.96);
}

.run-btn:disabled {
    color: #0c1a15;
    cursor: default;
    background: #4a6f61;
    box-shadow: none;
}

.status {
    min-height: 14px;
    margin-top: 10px;
    color: var(--dim);
    font-family: var(--mono);
    font-size: 11px;
    text-align: center;
}

.chart-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 380px;
    padding: 18px;
}

#radarSvg {
    width: 100%;
    height: 100%;
    max-width: 100%;
    overflow: visible;
}

.radar-fill {
    transform-origin: 200px 200px;
    transition: fill 0.5s ease, stroke 0.5s ease;
}

.radar-fill.spin {
    animation: radarSpin 0.9s ease;
}

@keyframes radarSpin {
    0% { transform: rotate(0deg) scale(1); }
    45% { transform: rotate(190deg) scale(0.86); }
    100% { transform: rotate(360deg) scale(1); }
}

.radar-grid-line {
    stroke: rgba(255, 255, 255, 0.16);
    stroke-width: 1;
}

.radar-grid-ring {
    fill: none;
    stroke: rgba(255, 255, 255, 0.14);
    stroke-width: 1;
}

.radar-label {
    fill: var(--text);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 11px;
}

.radar-tick {
    fill: var(--dim);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 9px;
}

.radar-dot {
    transition: fill 0.5s ease;
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: rgba(10, 10, 10, 0.98);
        width: 100%;
        text-align: center;
        transition: left 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 20px 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu a {
        margin: 15px 0;
        font-size: 18px;
    }

    .hero-content h1 {
        font-size: 42px;
    }

    .hero-subtitle {
        font-size: 16px;
        line-height: 1.4;
    }

    .hero-content {
        padding: 0 20px;
    }

    .btn-contact,
    .btn-whatsapp {
        padding: 12px 30px;
        font-size: 14px;
    }

    .hero-buttons {
        gap: 10px;
    }

    header {
        padding: 20px;
    }

    section {
        padding: 60px 20px;
    }

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

    .modal-content {
        padding: 20px;
        margin: 20px;
    }

    .modal h2 {
        font-size: 24px;
    }

    .modal-chart {
        height: 300px;
    }
}

@media (max-width: 1000px) {
    .contact-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .skills-grid {
        grid-template-columns: 1fr;
    }

    .chart-panel {
        min-height: 320px;
    }
}

@media (max-width: 640px) {
    #contacto,
    #proyectos,
    #habilidades {
        padding-right: 20px;
        padding-left: 20px;
    }

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

    .query-code {
        font-size: 11px;
    }

    .sql-table-panel,
    .sql-query-panel {
        padding: 18px 14px 20px;
    }

    .sql-demo table {
        min-width: 520px;
        font-size: 11px;
    }

    .sql-table-scroll {
        overflow-x: auto;
    }

    .sql-demo th,
    .sql-demo td {
        padding: 9px 6px;
    }

    .sql-query-code {
        font-size: 11px;
    }
}

@media (max-width: 420px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

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

@media (max-width: 430px) {
    .hero-content h1 {
        font-size: 36px;
        line-height: 1.1;
    }

    .hero-subtitle {
        font-size: 14px;
    }

    #hero {
        padding: 0 20px;
    }

    .btn-contact,
    .btn-whatsapp {
        padding: 10px 25px;
        font-size: 13px;
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}
