/* ==========================================================================
   a-vasquez.com — Sistema de diseño
   Tokens, tipografía fluida, componentes y micro-interacciones
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens (tema oscuro por defecto)
   -------------------------------------------------------------------------- */
:root {
    color-scheme: dark;

    /* Paleta */
    --bg: #0b1220;
    --bg-elevated: #0f1a30;
    --surface: #131f38;
    --surface-2: #1a2a4a;
    --border: rgba(148, 163, 184, 0.14);
    --border-strong: rgba(148, 163, 184, 0.3);
    --heading: #f8fafc;
    --text: #dbe3f0;
    --text-muted: #8fa0bd;
    --primary: #38bdf8;
    --primary-strong: #0ea5e9;
    --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
    --success: #34d399;
    --danger: #f87171;

    /* Sombras */
    --shadow-sm: 0 2px 8px rgba(2, 6, 23, 0.35);
    --shadow-md: 0 10px 30px -12px rgba(2, 6, 23, 0.55);
    --shadow-lg: 0 26px 64px -18px rgba(2, 6, 23, 0.65);
    --glow: 0 10px 32px -10px rgba(56, 189, 248, 0.4);

    /* Superficies dependientes del tema (alias de compatibilidad) */
    --bg-color: var(--bg);
    --text-color: var(--text);
    --card-bg: var(--surface);
    --accent-color: var(--primary);
    --navbar-bg: rgba(11, 18, 32, 0.82);

    /* Tipografía fluida */
    --fs-display: clamp(2.25rem, 6vw, 3.9rem);
    --fs-h1: clamp(1.85rem, 4.5vw, 3rem);
    --fs-h2: clamp(1.5rem, 3.4vw, 2.25rem);
    --fs-h3: clamp(1.15rem, 2vw, 1.35rem);
    --fs-body: clamp(1rem, 1.4vw, 1.075rem);
    --fs-small: 0.9rem;

    /* Métrica */
    --container: 76rem;
    --navbar-h: 4.25rem;
    --section-pad: clamp(4rem, 9vw, 6.5rem);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-full: 999px;
}

/* Tema claro */
[data-theme="light"] {
    color-scheme: light;

    --bg: #f5f8fc;
    --bg-elevated: #ffffff;
    --surface: #ffffff;
    --surface-2: #f0f5fb;
    --border: rgba(15, 23, 42, 0.1);
    --border-strong: rgba(15, 23, 42, 0.2);
    --heading: #0f172a;
    --text: #334155;
    --text-muted: #5b6b84;
    --primary: #0284c7;
    --primary-strong: #0369a1;
    --accent-gradient: linear-gradient(135deg, #0284c7 0%, #6366f1 100%);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 12px 32px -14px rgba(15, 23, 42, 0.18);
    --shadow-lg: 0 28px 64px -20px rgba(15, 23, 42, 0.22);
    --glow: 0 10px 32px -10px rgba(2, 132, 199, 0.3);

    --bg-color: var(--bg);
    --text-color: var(--text);
    --card-bg: var(--surface);
    --accent-color: var(--primary);
    --navbar-bg: rgba(255, 255, 255, 0.84);
}

/* --------------------------------------------------------------------------
   2. Reset y base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--navbar-h) + 0.5rem);
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
        Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: var(--fs-body);
    line-height: 1.65;
    transition: background-color 0.35s ease, color 0.35s ease;
    -webkit-font-smoothing: antialiased;
}

main {
    flex: 1 0 auto;
    width: 100%;
}

section[id],
[data-anchor] {
    scroll-margin-top: calc(var(--navbar-h) + 0.5rem);
}

img,
svg,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--heading);
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { text-wrap: pretty; }

::selection {
    background: var(--primary);
    color: #fff;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* --------------------------------------------------------------------------
   3. Barra de navegación
   -------------------------------------------------------------------------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: var(--navbar-h);
    padding: 0.5rem 10%;
    background-color: var(--navbar-bg);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
    border-bottom: 1px solid var(--border);
    transition: box-shadow 0.3s ease, background-color 0.35s ease;
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .navbar { background-color: var(--bg-elevated); }
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo a { display: flex; }

.logo img {
    height: 2.6rem;
    width: auto;
    border-radius: 10px;
    object-fit: contain;
}

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

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    list-style: none;
}

.nav-links a {
    position: relative;
    color: var(--text);
    font-weight: 600;
    font-size: 0.98rem;
    padding: 0.25rem 0;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    text-decoration: none;
}

.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

/* Botón de tema */
.theme-btn {
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--surface-2);
    color: var(--heading);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.theme-btn:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

/* Hamburguesa */
.nav-toggle {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 2.6rem;
    height: 2.6rem;
    padding: 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--surface-2);
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.2s ease;
}

.nav-toggle:hover { border-color: var(--primary); }

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background-color: var(--heading);
    transition: transform 0.28s ease, opacity 0.2s ease;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   4. Hero
   -------------------------------------------------------------------------- */
.hero-section {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    min-height: 100svh;
    padding: calc(var(--navbar-h) + var(--section-pad)) 10% var(--section-pad);
    overflow: hidden;
}

/* Cuadrícula sutil */
.hero-section::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 25%, transparent 78%);
    mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 25%, transparent 78%);
    opacity: 0.55;
}

/* Resplandores de acento */
.hero-section::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: -140px;
    right: -120px;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.17), transparent 66%);
    filter: blur(24px);
    pointer-events: none;
}

[data-theme="light"] .hero-section::after {
    background: radial-gradient(circle, rgba(2, 132, 199, 0.13), transparent 66%);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: var(--container);
    margin: 0 auto;
}

.hero-content h1 {
    font-size: var(--fs-h1);
    margin-bottom: 1.1rem;
}

/* ------------------------------------------------------------------
   Portada (solo página de inicio)
   ------------------------------------------------------------------ */
.hero-home h1 { font-size: var(--fs-display); }

.hero-home h1 span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-home h2 {
    font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
    font-size: clamp(1.05rem, 2.4vw, 1.4rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--primary);
    margin-bottom: 1.25rem;
}

.hero-home > p {
    max-width: 58ch;
    color: var(--text-muted);
    font-size: 1.075rem;
    margin-bottom: 1.75rem;
}

/* ------------------------------------------------------------------
   Contenido largo dentro del hero (páginas legales)
   ------------------------------------------------------------------ */
.hero-content > p {
    margin-bottom: 1rem;
}

.hero-content ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.9;
}

.hero-content ul li { margin-bottom: 0.35rem; }

.hero-content .alert {
    margin: 1.5rem 0;
    padding: 1.25rem 1.5rem;
    border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.hero-content .alert p { margin: 0; }

/* --------------------------------------------------------------------------
   5. Botones
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.25s ease,
        background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:hover { text-decoration: none; }

.btn:active { transform: translateY(1px) scale(0.985); }

.btn.primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: var(--glow);
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px -12px color-mix(in srgb, var(--primary) 70%, transparent);
}

.btn.secondary {
    border: 1px solid var(--border-strong);
    color: var(--heading);
    background-color: transparent;
}

.btn.secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.btn.download-btn {
    border: 1.5px dashed var(--primary-strong);
    color: var(--primary-strong);
    background-color: transparent;
}

.btn.download-btn:hover {
    background-color: var(--primary-strong);
    border-style: solid;
    color: #fff;
    transform: translateY(-2px);
}

.cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* --------------------------------------------------------------------------
   6. Redes sociales
   -------------------------------------------------------------------------- */
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-bottom: 1.75rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.55rem 1.1rem;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.social-links a:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   7. Secciones y títulos
   -------------------------------------------------------------------------- */
.skills-section,
.portfolio-section,
#contacto {
    padding: var(--section-pad) 10%;
}

.section-title {
    text-align: center;
    font-size: var(--fs-h2);
    margin-bottom: 1rem;
    position: relative;
}

.section-title::after {
    content: "";
    display: block;
    width: 68px;
    height: 4px;
    margin: 0.9rem auto 0;
    border-radius: 4px;
    background: var(--accent-gradient);
}

.portfolio-section > p,
#contacto > p {
    max-width: 64ch;
    text-align: center;
    margin: 0 auto 2.5rem;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   8. Cards (habilidades y proyectos)
   -------------------------------------------------------------------------- */
.skills-grid,
.portfolio-grid {
    display: grid;
    gap: clamp(1.25rem, 3vw, 2rem);
}

.skills-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.portfolio-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
}

.skill-card,
.project-card {
    position: relative;
    overflow: hidden;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* Línea de acento superior */
.skill-card::before,
.project-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.skill-card:hover,
.project-card:hover {
    transform: translateY(-5px);
    border-color: color-mix(in srgb, var(--primary) 40%, transparent);
    box-shadow: var(--shadow-md);
}

.skill-card:hover::before,
.project-card:hover::before { opacity: 1; }

.skill-card h3,
.project-card h3 {
    color: var(--primary);
    margin-bottom: 0.9rem;
}

.skill-card p,
.project-card p {
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}

.skill-card p:last-child,
.project-card p:last-child { margin-bottom: 0; }

/* Etiquetas de tecnologías (lista dentro de cards) */
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.skill-tags li {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
    border-radius: var(--radius-full);
    padding: 0.28rem 0.75rem;
}

/* --------------------------------------------------------------------------
   9. Contacto
   -------------------------------------------------------------------------- */
#contacto .portfolio-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
}

.tu-clase-grupo {
    margin-bottom: 1.25rem;
}

#contacto label {
    display: inline-block;
    font-weight: 700;
    color: var(--heading);
    margin-bottom: 0.5rem;
}

#contacto input[type="text"],
#contacto input[type="email"],
#contacto textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-strong);
    background-color: var(--surface-2);
    color: var(--text);
    font: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#contacto input[type="text"]:focus,
#contacto input[type="email"]:focus,
#contacto textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}

#contacto textarea {
    min-height: 140px;
    resize: vertical;
}

/* Checkbox de términos alineado */
#contacto .tu-clase-grupo:has(> input[type="checkbox"]) {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.95rem;
}

#contacto input[type="checkbox"] {
    margin-top: 0.25rem;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.boton-contenedor {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-top: 0.5rem;
}

#contacto #btnEnviar {
    padding: 0.9rem 2.2rem;
    border-radius: 12px;
    border: 0;
    background: var(--accent-gradient);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: var(--glow);
    transition: transform 0.2s ease, box-shadow 0.25s ease, filter 0.2s ease;
}

#contacto #btnEnviar:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

#contacto #btnEnviar:disabled {
    background: var(--surface-2);
    color: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
}

/* Spinner */
.spinner {
    display: none;
    width: 22px;
    height: 22px;
    border: 3px solid var(--border-strong);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner.show { display: inline-block; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* canales de comunicación */
#contacto .project-card a {
    color: var(--text);
    font-weight: 600;
    display: inline-block;
    transition: color 0.2s ease, transform 0.2s ease;
}

#contacto .project-card a:hover {
    color: var(--primary);
    transform: translateX(3px);
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   10. WhatsApp flotante
   -------------------------------------------------------------------------- */
.whatsapp-btn {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background-color: #25d366;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.whatsapp-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(37, 211, 102, 0.55);
    animation: pulse-ring 2.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite;
}

.whatsapp-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 30px rgba(37, 211, 102, 0.5);
}

.whatsapp-btn img {
    width: 32px;
    height: 32px;
}

@keyframes pulse-ring {
    0%   { transform: scale(1); opacity: 0.8; }
    70%  { transform: scale(1.45); opacity: 0; }
    100% { transform: scale(1.45); opacity: 0; }
}

/* --------------------------------------------------------------------------
   11. Páginas de detalle de proyecto (SEO)
   -------------------------------------------------------------------------- */
.breadcrumbs {
    max-width: var(--container);
    margin: 0 auto;
    padding: 1.25rem 1.5rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.92rem;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.breadcrumbs a:hover { color: var(--primary); }

.project-detail-page {
    min-height: 70vh;
    padding-top: var(--navbar-h);
}

.project-detail {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.project-detail h1 {
    margin-bottom: 1rem;
}

.project-kicker {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.75rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.project-summary {
    font-size: 1.15rem;
    line-height: 1.75;
    color: var(--text-muted);
}

.project-detail section {
    margin-top: 2.25rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border);
}

.project-detail section h2 {
    font-size: var(--fs-h3);
    margin-bottom: 0.9rem;
}

.project-technologies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding-left: 0;
}

.project-technologies li {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
    border-radius: var(--radius-full);
    padding: 0.35rem 0.9rem;
}

/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */
footer {
    flex-shrink: 0;
    text-align: center;
    padding: 2.75rem 10%;
    background-color: var(--bg-elevated);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.92rem;
}

footer p {
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.footer-socials {
    margin-bottom: 0.9rem;
}

.footer-socials a {
    color: var(--text);
    font-weight: 600;
    margin: 0 0.4rem;
    opacity: 0.8;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.footer-socials a:hover {
    color: var(--primary);
    opacity: 1;
    text-decoration: none;
}

.legal-notice-link {
    margin-top: 0.5rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent-color);
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.legal-notice-link:hover,
.legal-notice-link:focus-visible {
    color: var(--heading);
}

/* --------------------------------------------------------------------------
   13. Animaciones de aparición (se activan con JS)
   -------------------------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* --------------------------------------------------------------------------
   14. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .navbar {
        padding: 0.45rem 5%;
    }

    .nav-toggle { display: flex; }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.5rem 5% 1.1rem;
        background-color: var(--navbar-bg);
        -webkit-backdrop-filter: blur(20px) saturate(1.3);
        backdrop-filter: blur(20px) saturate(1.3);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-12px);
        transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s;
    }

    .nav-links.open {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .nav-links li {
        width: 100%;
        border-bottom: 1px solid var(--border);
    }

    .nav-links li:last-child { border-bottom: 0; }

    .nav-links a {
        display: block;
        padding: 0.85rem 0.25rem;
        font-size: 1rem;
    }

    .nav-links a::after { display: none; }

    .hero-section,
    .skills-section,
    .portfolio-section,
    #contacto,
    footer {
        padding-left: 5%;
        padding-right: 5%;
    }

    .hero-section {
        padding-top: calc(var(--navbar-h) + 3.5rem);
    }

    .hero-home {
        min-height: 100svh;
        text-align: center;
    }

    .hero-home > p {
        margin-left: auto;
        margin-right: auto;
    }

    .social-links,
    .cta-buttons {
        justify-content: center;
    }

    .cta-buttons .btn { flex: 1 1 auto; }
}

@media (max-width: 520px) {
    :root { --navbar-h: 3.9rem; }

    .cta-buttons .btn { width: 100%; }

    .skill-card,
    .project-card { padding: 1.6rem; }

    .breadcrumbs,
    .project-detail {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .whatsapp-btn {
        width: 52px;
        height: 52px;
        bottom: 16px;
        right: 16px;
    }

    .whatsapp-btn img { width: 28px; height: 28px; }
}

/* Sin hover en táctiles */
@media (hover: none) {
    .skill-card:hover,
    .project-card:hover,
    .btn:hover,
    .social-links a:hover {
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   15. Accesibilidad: movimiento reducido
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

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

    .whatsapp-btn::after { display: none; }
}
/* --------------------------------------------------------------------------
   16. Refresh visual: portfolio premium / editorial
   -------------------------------------------------------------------------- */
:root {
    --container: 78rem;
    --radius: 18px;
    --section-pad: clamp(4.25rem, 8vw, 7rem);
}

.navbar { padding-left: max(5%, calc((100vw - 78rem) / 2)); padding-right: max(5%, calc((100vw - 78rem) / 2)); }
.nav-links { gap: clamp(.85rem, 1.5vw, 1.5rem); }
.nav-links a { font-size: .92rem; }
.theme-btn { flex: 0 0 auto; }

.hero-section {
    min-height: min(860px, 100svh);
    padding-left: max(5%, calc((100vw - 78rem) / 2));
    padding-right: max(5%, calc((100vw - 78rem) / 2));
    padding-top: calc(var(--navbar-h) + clamp(3rem, 7vw, 5.5rem));
    padding-bottom: 5.5rem;
}
.hero-section::before {
    background-size: 54px 54px;
    opacity: .34;
    -webkit-mask-image: radial-gradient(ellipse 72% 68% at 70% 38%, #000 12%, transparent 82%);
    mask-image: radial-gradient(ellipse 72% 68% at 70% 38%, #000 12%, transparent 82%);
}
.hero-section::after { top: 8%; right: 2%; width: 560px; height: 560px; opacity: .8; }
.hero-layout {
    width: 100%; max-width: var(--container); margin: 0 auto;
    display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(340px, .85fr);
    align-items: center; gap: clamp(2.5rem, 6vw, 5.5rem);
}
.hero-home { min-width: 0; max-width: 46rem; margin: 0; text-align: left; }
.hero-home h1 { max-width: 13ch; font-size: clamp(2.75rem, 5.2vw, 4.65rem); line-height: 1.04; letter-spacing: -.055em; margin: .8rem 0 1.35rem; }
.hero-home h1 span { display: block; }
.hero-home h2 { font-family: inherit; font-size: clamp(1.05rem, 1.7vw, 1.25rem); letter-spacing: 0; font-weight: 650; margin-bottom: 1rem; }
.hero-home > p { max-width: 55ch; font-size: clamp(1rem, 1.3vw, 1.12rem); line-height: 1.8; margin-bottom: 1.7rem; }
.eyebrow, .section-kicker { color: var(--primary); font-size: .76rem; font-weight: 800; letter-spacing: .16em; line-height: 1.5; }
.eyebrow { display: flex; align-items: center; gap: .65rem; }
.status-dot { display: inline-block; width: .52rem; height: .52rem; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px color-mix(in srgb, var(--success) 13%, transparent); }
.cta-buttons { gap: .8rem; margin-bottom: 1.5rem; }
.cta-buttons .btn { min-height: 3.15rem; }
.btn.primary { background: var(--accent-gradient); color: #04111f; border-color: transparent; }
[data-theme="light"] .btn.primary { color: #fff; }
.btn.download-btn { border-style: solid; border-color: var(--border-strong); color: var(--heading); }
.btn.download-btn:hover { border-color: var(--primary); color: #fff; }
.social-links { gap: .55rem; margin: 0; }
.social-links a { background: transparent; border-color: transparent; padding: .35rem .65rem; font-size: .9rem; }
.social-links a:first-child { padding-left: 0; }
.hero-visual {
    position: relative; isolation: isolate; overflow: hidden; padding: 1.15rem 1.25rem 1.3rem;
    border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
    border-radius: 22px; background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 94%, #0ea5e9 6%), var(--bg-elevated));
    box-shadow: 0 28px 90px -38px rgba(0,0,0,.65), 0 0 60px -34px color-mix(in srgb, var(--primary) 60%, transparent);
    transform: translateY(-.3rem);
}
.hero-visual::before { content: ""; position: absolute; z-index: -1; width: 240px; height: 240px; top: -145px; right: -80px; border-radius: 50%; background: color-mix(in srgb, var(--primary) 16%, transparent); filter: blur(18px); }
.visual-topline { display: flex; align-items: center; gap: .8rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); color: var(--text-muted); font: 600 .76rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.window-dots { display: inline-flex; gap: .28rem; }
.window-dots i { width: .48rem; height: .48rem; border-radius: 50%; background: #fb7185; }
.window-dots i:nth-child(2) { background: #fbbf24; }
.window-dots i:nth-child(3) { background: #34d399; }
.visual-status { margin-left: auto; color: var(--success); font-size: .62rem; white-space: nowrap; }
.visual-code { position: relative; z-index: 1; padding: 1.4rem 0 1.15rem; font: 500 clamp(.72rem, 1.2vw, .88rem)/2 ui-monospace, SFMono-Regular, Consolas, monospace; }
.visual-code p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code-line { display: inline-block; width: 2rem; color: var(--text-muted); opacity: .65; }
.code-key { color: #7dd3fc; }
.code-punct { color: var(--text-muted); padding: 0 .35rem; }
.code-value { color: #a5b4fc; }
[data-theme="light"] .code-key { color: #0369a1; }
[data-theme="light"] .code-value { color: #4f46e5; }
.visual-divider { height: 1px; background: var(--border); }
.visual-bottom { display: flex; align-items: center; gap: .85rem; padding-top: 1.15rem; }
.visual-icon { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; flex: 0 0 auto; border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent); border-radius: 12px; color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); font-size: 1.5rem; }
.visual-bottom strong, .visual-bottom small { display: block; }
.visual-bottom strong { color: var(--heading); font-size: .9rem; }
.visual-bottom small { color: var(--text-muted); font-size: .78rem; margin-top: .15rem; }
.visual-orbit { position: absolute; z-index: -1; width: 280px; height: 280px; border: 1px solid color-mix(in srgb, var(--primary) 12%, transparent); border-radius: 50%; right: -170px; bottom: -175px; }
.visual-orbit--two { width: 220px; height: 220px; right: -140px; bottom: -145px; }
.scroll-cue { position: absolute; bottom: 1.6rem; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: .55rem; color: var(--text-muted); font-size: .78rem; letter-spacing: .03em; }
.scroll-cue span { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border: 1px solid var(--border-strong); border-radius: 50%; color: var(--primary); }
.scroll-cue:hover { color: var(--primary); text-decoration: none; }

.skills-section, .portfolio-section, #contacto { padding-left: max(5%, calc((100vw - 78rem) / 2)); padding-right: max(5%, calc((100vw - 78rem) / 2)); }
.section-kicker { text-align: center; margin-bottom: .65rem; }
.section-title { margin-bottom: .8rem; letter-spacing: -.04em; }
.section-title::after { width: 48px; height: 3px; margin-top: .8rem; }
.section-intro { max-width: 60ch; text-align: center; color: var(--text-muted); margin: 0 auto 2.5rem; }
.skills-grid { margin-top: 2.2rem; }
.skill-card, .project-card { padding: clamp(1.4rem, 2.4vw, 2rem); border-radius: var(--radius); }
.skill-card { background: linear-gradient(155deg, var(--surface), color-mix(in srgb, var(--surface) 90%, var(--primary) 10%)); }
.skill-card h3, .project-card h3 { letter-spacing: -.025em; }
.project-card { display: flex; flex-direction: column; align-items: flex-start; }
.project-card p { line-height: 1.72; }
.project-card p:last-child { margin-top: auto; padding-top: .45rem; }
.project-card .btn { white-space: normal; text-align: center; }
.portfolio-grid { margin-top: 2rem; align-items: stretch; }
.portfolio-grid > .project-card { min-width: 0; }
.more-projects { margin: 2rem auto 0; max-width: 100%; border: 1px solid var(--border); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 55%, transparent); }
.more-projects summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.35rem; cursor: pointer; color: var(--heading); font-weight: 750; list-style: none; }
.more-projects summary::-webkit-details-marker { display: none; }
.more-projects summary span { color: var(--primary); font-size: 1.3rem; transition: transform .2s ease; }
.more-projects[open] summary { border-bottom: 1px solid var(--border); }
.more-projects[open] summary span { transform: rotate(45deg); }
.portfolio-grid--more { padding: 0 1.1rem 1.1rem; }
#contacto { padding-top: var(--section-pad); }
#contacto .portfolio-grid { margin-top: 2rem; }
#contacto .project-card { background: linear-gradient(150deg, var(--surface), color-mix(in srgb, var(--surface) 94%, var(--primary) 6%)); }
#contacto .tu-clase-grupo { margin-bottom: 1.1rem; }
#contacto input[type="checkbox"] { accent-color: var(--primary); }
footer { padding-left: 5%; padding-right: 5%; }
.footer-legal { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: .8rem; }
.footer-legal a { color: var(--text-muted); font-size: .85rem; }
.footer-legal a:hover { color: var(--primary); }

@media (max-width: 1050px) {
    .navbar { padding-left: 4%; padding-right: 4%; }
    .nav-links { gap: .85rem; }
    .nav-links a { font-size: .86rem; }
    .hero-layout { grid-template-columns: minmax(0, 1fr) minmax(300px, .85fr); gap: 2rem; }
    .hero-home h1 { font-size: clamp(2.6rem, 5vw, 3.8rem); }
}
@media (max-width: 900px) {
    .hero-section { min-height: auto; padding-top: calc(var(--navbar-h) + 4.5rem); padding-bottom: 5.5rem; }
    .hero-layout { grid-template-columns: 1fr; max-width: 680px; gap: 2.6rem; }
    .hero-home { text-align: center; }
    .eyebrow { justify-content: center; }
    .hero-home h1 { max-width: 15ch; margin-left: auto; margin-right: auto; font-size: clamp(2.7rem, 7vw, 4.2rem); }
    .hero-home > p { margin-left: auto; margin-right: auto; }
    .cta-buttons, .social-links { justify-content: center; }
    .hero-visual { width: 100%; max-width: 560px; margin: 0 auto; transform: none; }
    .scroll-cue { bottom: 1.2rem; }
    .skills-section, .portfolio-section, #contacto { padding-left: 5%; padding-right: 5%; }
}
@media (max-width: 520px) {
    .hero-section { padding-left: 5%; padding-right: 5%; padding-top: calc(var(--navbar-h) + 3.5rem); }
    .hero-home h1 { font-size: clamp(2.35rem, 11vw, 3.25rem); }
    .hero-home h2 { font-size: 1rem; line-height: 1.6; }
    .hero-home > p { font-size: 1rem; }
    .hero-visual { padding: 1rem; border-radius: 16px; }
    .visual-code { font-size: .67rem; }
    .visual-status { font-size: .53rem; }
    .cta-buttons .btn { width: 100%; }
    .scroll-cue { display: none; }
    .portfolio-grid--more { padding: 0 .7rem .7rem; }
    .footer-legal { flex-direction: column; gap: .65rem; }
}
