/* #region RESET */
* {
    box-sizing: border-box;
}

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

body {
    max-width: 1920px;
    margin: 0 auto;
    font: 500 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
    color: #ced4da;
    background: #0b0f17;
}

a {
    color: #9ddcff;
    text-decoration: none;
}

a:hover {
    color: #ffd100;
    text-decoration: underline;
}

/* #region HEADER */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    height: 90px;
    z-index: 1000;
    background: linear-gradient(90deg, #0B263D, #1C3A55);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.35);
}

.nav {
    max-width: 1920px;
    margin: 0 auto;
    height: 100%;
    display: grid;
    grid-template-columns: 160px 1fr;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
}

.logo img {
    width: 150px;
    display: block;
}

.menu {
    list-style: none;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 0;
    padding: 0;
}

.menu li {
    height: 90px;
    line-height: 90px;
    padding: 0 25px;
    border-right: 1px solid rgba(254, 250, 224, 0.2);
    font-weight: 600;
}

.menu li:last-child {
    border-right: none;
}

.menu a {
    color: #D4AF37;
}

.menu li:hover {
    background: rgba(255, 255, 255, 0.18);
}

.menu li:hover a {
    color: #ffd100;
}

/* #region HERO */
.hero {
    position: relative;
    min-height: 100vh;
    padding: 120px 24px 60px;
    display: grid;
    place-items: center;
    text-align: center;
    overflow: hidden;
    background: radial-gradient(1200px 800px at 20% 10%, #121a2b 0%, #0b0f17 35%, #0f1726 100%);
}

#particles-js {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-card {
    position: relative;
    z-index: 1;
    width: min(90%, 1100px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: clamp(20px, 5vw, 48px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.title {
    margin: 0 0 10px;
    font-size: clamp(28px, 6vw, 56px);
    font-weight: 800;
    line-height: 1.1;
    background: linear-gradient(90deg, #6ee7ff, #a78bfa);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.cursor {
    display: inline-block;
    width: 1ch;
    margin-left: 2px;
    animation: blink 1s steps(1, end) infinite;
}

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

.subtitle {
    margin: 0 auto 16px;
    max-width: 900px;
    font-size: clamp(18px, 2.5vw, 24px);
    color: #ced4da;
    opacity: 0.95;
}

.intro {
    margin: 0 auto 18px;
    max-width: 900px;
    color: #ced4da;
    opacity: 0.9;
}

.avatar {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #ced4da;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

/* #region MAIN */
.content {
    background: linear-gradient(180deg, #0B263D 0%, #111a28 50%, #0b0f17 100%);
    color: #ced4da;
    padding: 60px 24px 100px;
    width: 100%;
    margin: 0;
    border-radius: 0;
}

.content > h2,
#sobre_mi > h2,
#contacto > h2 {
    margin-top: 0;
}

.content h2 {
    position: relative;
    font-size: clamp(26px, 3.6vw, 34px);
    font-weight: 700;
    color: #ced4da;
    text-align: left;
    margin: 0 0 28px;
    letter-spacing: 0.3px;
    padding-left: 18px;
}

.content h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    width: 4px;
    height: 80%;
    background: #D4AF37;
    border-radius: 2px;
}


/* #region MAIN → Tarjetas de herramientas */
.grid-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin: 18px 0 32px;
}

.tool {
    padding: 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ced4da;
    text-align: center;
    transition: all 0.3s ease;
}

.tool:hover {
    border-color: #D4AF37;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.25);
    transform: translateY(-4px);
}

.tool img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.tool:hover img {
    transform: scale(1.3);
    filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.5))
        drop-shadow(0 0 10px rgba(255, 209, 0, 0.25));
}

.tool h3 {
    margin: 8px 0;
}

/* #region MAIN → Sobre mí */
.sobre-mi-wide {
    background: transparent;
    padding: 60px 0 40px;
    border-top: none;
}

.sm-container {
    width: 100%;
    margin: 0;
    padding: 0;
}

.sobre-mi-wide h2 {
    position: relative;
    font-size: clamp(26px, 3.2vw, 34px);
    font-weight: 700;
    color: #ced4da;
    margin: 0 0 22px;
    letter-spacing: 0.3px;
    padding-left: 18px;
}

.sobre-mi-wide h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    width: 4px;
    height: 80%;
    background: #D4AF37;
    border-radius: 2px;
}

.sm-grid {
    display: block;
    color: #ced4da;
    line-height: 1.7;
    width: 100%;
    max-width: none;
}

.sm-grid p {
    margin-bottom: 18px;
    font-weight: 400;
    max-width: none;
}

.sobre-mi-wide strong {
    color: #D4AF37;
}

.sobre-mi-wide em {
    color: #9ddcff;
    font-style: italic;
}

.sm-bullets {
    margin-top: 16px;
    padding-left: 24px;
}

.sm-bullets li {
    margin: 6px 0;
    list-style: disc;
}

.sm-bullets li::marker {
    color: #D4AF37;
}

/* #region MAIN → Contacto */
.contact-section {
    padding: 60px 0 80px;
}

.contact-head {
    padding: 0;
}

#contacto h2 {
    position: relative;
    font-size: clamp(26px, 3.2vw, 34px);
    font-weight: 700;
    color: #ced4da;
    margin: 0 0 22px;
    letter-spacing: 0.3px;
    padding-left: 18px;
}

#contacto h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    width: 4px;
    height: 80%;
    background: #D4AF37;
    border-radius: 2px;
}

.contact-quick {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 12px 0 22px;
}

.cq-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 999px;
    color: #D4AF37;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.cq-item i {
    font-size: 18px;
    line-height: 1;
}

.cq-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
    border-color: #D4AF37;
    color: #ffd100;
}


/* Tarjeta del formulario */
.contact-card {
    width: min(100%, 520px);
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    padding: 30px 24px;
    box-shadow: 0 3px 20px rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    backdrop-filter: blur(6px);
}

.contact-card label,
.contact-card input,
.contact-card textarea,
.contact-card button {
    display: block;
    width: 100%;
}

.contact-card label {
    color: #ced4da;
    font-weight: 600;
    margin-bottom: 6px;
}

.contact-card input {
    height: 38px;
    padding: 0 12px;
    margin-bottom: 16px;
    background: rgba(206, 212, 218, 0.08);
    border: 1px solid rgba(206, 212, 218, 0.35);
    color: #ced4da;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.contact-card textarea {
    padding: 12px;
    margin-bottom: 16px;
    background: rgba(206, 212, 218, 0.08);
    border: 1px solid rgba(206, 212, 218, 0.35);
    color: #ced4da;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    resize: vertical;
}

.contact-card input::placeholder,
.contact-card textarea::placeholder {
    color: rgba(206, 212, 218, 0.6);
}

.contact-card input:focus,
.contact-card textarea:focus {
    outline: none;
    border-color: #D4AF37;
    background: rgba(206, 212, 218, 0.12);
    box-shadow: 0 0 6px rgba(212, 175, 55, 0.25);
}

/* Campos inválidos (email mal escrito, vacíos requeridos, etc.) */
.contact-card input:invalid,
.contact-card textarea:invalid {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 1px rgba(255, 107, 107, 0.35);
}

/* Campos válidos requeridos (cuando ya están bien completados) */
.contact-card input:required:valid,
.contact-card textarea:required:valid {
    border-color: #46c37b;
    box-shadow: 0 0 0 1px rgba(70, 195, 123, 0.35);
}

/* Reducir la agresividad cuando el usuario aún no tocó el campo */
.contact-card input:not(:focus):placeholder-shown,
.contact-card textarea:not(:focus):placeholder-shown {
    border-color: rgba(206, 212, 218, 0.35);
    box-shadow: none;
}

.contact-card .boton-enviar {
    height: 42px;
    background: #c9a227;
    color: #0B263D;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.1s ease;
}

.contact-card .boton-enviar:hover {
    background: #e1c15a;
}

.contact-card .boton-enviar:active {
    transform: translateY(1px);
}

/* #region FOOTER */
.site-footer {
    position: relative;
    background: radial-gradient(1200px 800px at 20% 10%, #121a2b 0%, #0b0f17 35%, #0f1726 100%);
    color: #ced4da;
    text-align: center;
    padding: 80px 24px 100px;
    overflow: hidden;
}

#particles-footer {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.footer-text {
    position: relative;
    z-index: 1;
    margin-top: 28px;
    color: #ced4da;
}

.social-icons {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 8px;
}

.social-icons a {
    color: #D4AF37;
    font-size: 28px;
    transition: transform 0.3s ease, color 0.3s ease;
}

.social-icons a:hover {
    color: #ffd100;
    transform: scale(1.2);
}

/* #region RESPONSIVE */
@media (max-width: 768px) {
    .menu li {
        padding: 0 16px;
    }

    .hero {
        padding: 100px 16px 40px;
    }

    .hero-card {
        padding: 24px;
    }

    .title {
        font-size: clamp(24px, 5vw, 42px);
    }

    .subtitle {
        font-size: clamp(16px, 2.2vw, 20px);
    }

    .intro {
        font-size: 15px;
    }
}

/* #region MENU HAMBURGUESA */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #D4AF37;
    font-size: 26px;
    cursor: pointer;
    z-index: 1001;
}

/* ======== Mobile First ======== */
@media (max-width: 768px) {
    .nav {
        grid-template-columns: 1fr auto;
    }

    .menu-toggle {
        display: block;
    }

    .menu {
        position: absolute;
        top: 90px;
        right: 0;
        background: rgba(11, 15, 23, 0.95);
        backdrop-filter: blur(8px);
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 20px 0;
        transform: translateY(-120%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.4s ease, opacity 0.4s ease;
    }

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

    .menu li {
        width: 100%;
        text-align: center;
        border: none;
        padding: 10px 0;
    }

    .menu a {
        font-size: 18px;
    }

    .menu-toggle.active i::before {
        content: "\f00d"; 
    }
}

#backToTop {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #D4AF37;
    color: #0b0f17;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

#backToTop:hover {
    background: #ffd100;
    transform: translateY(-3px);
}

#backToTop i {
    font-size: 16px;
    line-height: 1;
}

@media (max-width: 768px) {
    #backToTop {
        bottom: 18px;
        right: 18px;
        width: 44px;
        height: 44px;
    }
}

.contact-email {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 999px;
    color: #D4AF37;
    background: rgba(255, 255, 255, 0.03);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.contact-email i {
    color: #D4AF37;
    font-size: 18px;
    line-height: 1;
}

.contact-email a {
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}

.contact-email:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
    border-color: #D4AF37;
    color: #ffd100;
}

.contact-email:hover i {
    color: #ffd100;
}

.grecaptcha-badge {
    left: 14px !important;
    right: auto !important;
    bottom: 14px !important;
    z-index: 9999 !important;

    width: 70px !important;
    overflow: hidden !important;
    transition: width 0.25s ease !important;
}

.grecaptcha-badge:hover {
    width: 256px !important;
}

