/*
Theme Name: CT Portfolio
Theme URI: https://cesarterrero.dev
Author: Cesar Terrero
Author URI: https://cesarterrero.dev
Description: Portfolio profesional para WordPress Developer. Theme custom con soporte para CPT de proyectos, ACF, y optimización de rendimiento.
Version: 1.0.2
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ct-portfolio
Tags: portfolio, dark, custom-colors, custom-menu, custom-logo, featured-images, full-width-template, responsive-layout, translation-ready
*/

/* ============================================================
   VARIABLES GLOBALES
   ============================================================ */
:root {
    --clr-bg:          #0e0e0e;
    --clr-surface:     #161616;
    --clr-surface2:    #1e1e1e;
    --clr-border:      rgba(255,255,255,0.08);
    --clr-border-md:   rgba(255,255,255,0.14);
    --clr-accent:      #1D9E75;
    --clr-accent-dim:  rgba(29,158,117,0.10);
    --clr-accent-brd:  rgba(29,158,117,0.28);
    --clr-accent-glow: rgba(29,158,117,0.16);
    --clr-text:        #e8e8e8;
    --clr-text-muted:  #888;
    --clr-text-dim:    #555;
    --clr-white:       #ffffff;
    --font-sans:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display:    'Syne', sans-serif;
    --font-mono:       'JetBrains Mono', 'Fira Code', monospace;
    --radius-sm:   6px;
    --radius-md:   10px;
    --radius-lg:   14px;
    --radius-xl:   20px;
    --shadow-card: 0 0 0 0.5px var(--clr-border);
    --max-w:       1100px;
    --section-pad: 80px 0;
    /* Easings precisos — no genéricos */
    --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-in-out:    cubic-bezier(0.65, 0, 0.35, 1);
    --transition:      0.25s cubic-bezier(0.25, 1, 0.5, 1);
    --transition-slow: 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    color: var(--clr-text);
    background-color: var(--clr-bg);
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--clr-accent); text-decoration: none; transition: color var(--transition), opacity var(--transition); }
a:hover { opacity: 0.8; }
ul, ol { list-style: none; }
button, input, textarea, select { font-family: inherit; }

/* ============================================================
   TIPOGRAFÍA
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--clr-white);
    line-height: 1.15;
    letter-spacing: -0.03em;
}
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 600; }
p { color: var(--clr-text-muted); line-height: 1.75; }

/* ============================================================
   LAYOUT HELPERS
   ============================================================ */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
}

.section { padding: var(--section-pad); }
.section + .section { border-top: 0.5px solid var(--clr-border); }

.section__label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--clr-accent);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
/* Línea izquierda animada — se expande cuando el contenedor es visible */
.section__label::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 1px;
    background: var(--clr-accent);
    transition: width 0.6s var(--ease-out-expo);
    flex-shrink: 0;
}
.fade-up.visible .section__label::before {
    width: 20px;
}

.section__title {
    margin-bottom: 48px;
}

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

/* Shine sweep en hover — sutil, no llamativo */
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255,255,255,0.07) 50%,
        transparent 100%
    );
    transform: translateX(-110%);
    transition: transform 0.7s var(--ease-out-expo);
    pointer-events: none;
}
.btn:hover::after {
    transform: translateX(110%);
}

.btn--primary {
    background: var(--clr-accent);
    color: #fff;
}
.btn--primary:hover {
    background: #178a65;
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(29,158,117,0.3);
}

.btn--ghost {
    background: transparent;
    color: var(--clr-text);
    border: 0.5px solid var(--clr-border-md);
}
.btn--ghost:hover {
    background: var(--clr-accent-dim);
    border-color: var(--clr-accent-brd);
    color: var(--clr-accent);
    opacity: 1;
    transform: translateY(-1px);
}

.btn--sm {
    padding: 7px 14px;
    font-size: 12px;
}

/* ============================================================
   TAGS / BADGES
   ============================================================ */
.tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--clr-accent);
    background: var(--clr-accent-dim);
    border: 0.5px solid var(--clr-accent-brd);
    padding: 3px 9px;
    border-radius: 4px;
    transition: all var(--transition);
}

.tag--gray {
    color: var(--clr-text-dim);
    background: transparent;
    border-color: var(--clr-border);
}
.tag--gray:hover {
    color: var(--clr-accent);
    border-color: var(--clr-accent-brd);
    background: var(--clr-accent-dim);
    transform: translateY(-1px);
    opacity: 1;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--clr-surface);
    border: 0.5px solid var(--clr-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition:
        border-color var(--transition),
        transform 0.35s var(--ease-out-expo),
        box-shadow 0.35s var(--ease-out-expo);
}
.card:hover {
    border-color: var(--clr-accent-brd);
    transform: translateY(-4px);
    box-shadow:
        0 20px 40px rgba(0,0,0,0.35),
        0 0 0 0.5px var(--clr-accent-brd);
}

/* ============================================================
   SITE HEADER / NAV
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(14,14,14,0.85);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border-bottom: 0.5px solid var(--clr-border);
    transition: border-color var(--transition), background var(--transition);
}
.site-header.scrolled {
    background: rgba(14,14,14,0.96);
    border-bottom-color: rgba(255,255,255,0.12);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 24px;
}

.site-logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    color: var(--clr-white) !important;
    letter-spacing: -0.5px;
    flex-shrink: 0;
    opacity: 1 !important;
    transition: opacity var(--transition);
}
.site-logo:hover { opacity: 0.75 !important; }
.site-logo span { color: var(--clr-accent); }

/* Custom logo image (set via WordPress customizer) */
.custom-logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    opacity: 1 !important;
    transition: opacity var(--transition);
}
.custom-logo-link:hover { opacity: 0.75 !important; }
.custom-logo-link .custom-logo {
    display: block;
    height: 88px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}

/* Menú principal */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 2px;
}
.nav-menu a {
    font-size: 13px;
    font-weight: 400;
    color: var(--clr-text-muted);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
    opacity: 1 !important;
    position: relative;
}
.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 12px;
    right: 12px;
    height: 1px;
    background: var(--clr-accent);
    transform: scaleX(0);
    transition: transform 0.3s var(--ease-out-expo);
    transform-origin: center;
}
.nav-menu a:hover,
.nav-menu .current-menu-item a,
.nav-menu a.is-active {
    color: var(--clr-white);
    background: transparent;
    opacity: 1 !important;
}
.nav-menu a:hover::after,
.nav-menu .current-menu-item a::after,
.nav-menu a.is-active::after {
    transform: scaleX(1);
}

/* Botón CTA en nav */
.nav-cta {
    font-size: 13px;
    font-weight: 500;
    background: var(--clr-accent);
    color: #fff !important;
    padding: 8px 18px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
    opacity: 1 !important;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    position: relative;
    overflow: hidden;
}
.nav-cta::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transform: translateX(-110%);
    transition: transform 0.6s var(--ease-out-expo);
}
.nav-cta:hover {
    background: #178a65;
    opacity: 1 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(29,158,117,0.3);
}
.nav-cta:hover::after { transform: translateX(110%); }

/* ============================================================
   LANGUAGE SWITCHER — Polylang
   ============================================================ */
.lang-switcher {
    flex-shrink: 0;
}
.lang-switcher ul {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
}
.lang-switcher a,
.lang-switcher span {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--clr-text-dim);
    padding: 4px 7px;
    border-radius: var(--radius-sm);
    border: 0.5px solid transparent;
    transition: all var(--transition);
    opacity: 1 !important;
    text-decoration: none;
}
.lang-switcher a:hover {
    color: var(--clr-white);
    border-color: var(--clr-border-md);
    opacity: 1 !important;
}
/* Idioma activo */
.lang-switcher .current-lang a,
.lang-switcher .current-lang span {
    color: var(--clr-accent);
    border-color: var(--clr-accent-brd);
    background: var(--clr-accent-dim);
    cursor: default;
}

/* Hamburger mobile */
.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--clr-text);
    transition: color var(--transition);
}
.nav-toggle:hover { color: var(--clr-white); }
.nav-toggle svg { display: block; }

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
    padding: 100px 0 80px;
    position: relative;
    overflow: hidden;
}

/* Orbes de fondo — dan profundidad sin ruido visual */
.hero::before,
.hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.hero::before {
    width: 560px;
    height: 560px;
    background: radial-gradient(circle at center, rgba(29,158,117,0.07) 0%, transparent 65%);
    top: -120px;
    right: -80px;
}
.hero::after {
    width: 360px;
    height: 360px;
    background: radial-gradient(circle at center, rgba(29,158,117,0.04) 0%, transparent 65%);
    bottom: -60px;
    left: 5%;
}

.hero > .container { position: relative; z-index: 1; }

.hero__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

/* Status badge */
.hero__status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--clr-accent);
    background: var(--clr-accent-dim);
    border: 0.5px solid var(--clr-accent-brd);
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 24px;
}
.hero__status-dot {
    width: 7px;
    height: 7px;
    background: var(--clr-accent);
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse-ring 2.4s ease-in-out infinite;
}

@keyframes pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgba(29,158,117,0.55); }
    60%  { box-shadow: 0 0 0 5px rgba(29,158,117,0); }
    100% { box-shadow: 0 0 0 0 rgba(29,158,117,0); }
}

.hero__title { margin-bottom: 20px; }
.hero__title span { color: var(--clr-accent); }

/* Word-split: palabras envueltas en JS para animación de entrada */
.word-outer {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
}
.word-inner {
    display: inline-block;
    transform: translateY(108%);
    will-change: transform;
    transition: transform 0.75s var(--ease-out-expo);
}
.hero__title.words-visible .word-inner {
    transform: translateY(0);
}

.hero__desc {
    font-size: 16px;
    line-height: 1.75;
    color: var(--clr-text-muted);
    margin-bottom: 32px;
    max-width: 480px;
}

.hero__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.hero__stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.hero__stack .tag--gray { font-size: 11px; padding: 4px 10px; }

/* Hero visual */
.hero__visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero__code-card {
    background: var(--clr-surface);
    border: 0.5px solid var(--clr-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    width: 100%;
    max-width: 420px;
    animation: float 7s ease-in-out infinite;
    box-shadow: 0 24px 48px rgba(0,0,0,0.4), 0 0 0 0.5px var(--clr-border);
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33%       { transform: translateY(-10px) rotate(0.3deg); }
    66%       { transform: translateY(-6px) rotate(-0.2deg); }
}

.hero__code-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-bottom: 0.5px solid var(--clr-border);
    background: var(--clr-surface2);
}
.hero__code-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.hero__code-filename {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--clr-text-dim);
    margin-left: 4px;
}

.hero__code-body {
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.8;
}
.code-ln  { color: var(--clr-text-dim); user-select: none; margin-right: 16px; }
.code-kw  { color: #C792EA; }
.code-fn  { color: #82AAFF; }
.code-str { color: #C3E88D; }
.code-cmt { color: var(--clr-text-dim); font-style: italic; }
.code-acc { color: #1D9E75; }

/* Cursor parpadeante al final del código */
.code-cursor {
    display: inline-block;
    width: 2px;
    height: 14px;
    background: var(--clr-accent);
    margin-left: 2px;
    vertical-align: middle;
    animation: blink 1.1s step-end infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ============================================================
   PROJECTS SECTION
   ============================================================ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.project-card { display: flex; flex-direction: column; }

.project-card__thumb {
    height: 180px;
    background: var(--clr-surface2);
    border-bottom: 0.5px solid var(--clr-border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.project-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s var(--ease-out-quart);
}
.project-card:hover .project-card__thumb img { transform: scale(1.06); }

/* Overlay sutil al hacer hover sobre la imagen */
.project-card__thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 30%, rgba(22,22,22,0.5) 100%);
    opacity: 0;
    transition: opacity 0.4s var(--ease-out-quart);
    pointer-events: none;
}
.project-card:hover .project-card__thumb::after { opacity: 1; }

.project-card__thumb-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--clr-text-dim);
}
.project-card__thumb-placeholder svg { opacity: 0.4; }

.project-card__body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-card__type {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--clr-accent);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 6px;
    transition: letter-spacing var(--transition);
}
.project-card:hover .project-card__type { letter-spacing: 2px; }

.project-card__title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--clr-white);
    margin-bottom: 8px;
    line-height: 1.25;
    transition: color var(--transition);
}
.project-card:hover .project-card__title { color: #fff; }

.project-card__excerpt {
    font-size: 13px;
    color: var(--clr-text-muted);
    line-height: 1.65;
    flex: 1;
    margin-bottom: 16px;
}

.project-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 16px;
}

.project-card__links {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

/* ============================================================
   SKILLS SECTION
   ============================================================ */

/* ── Layout: categorías apiladas ── */
.skills-wrapper {
    display: flex;
    flex-direction: column;
    gap: 44px;
}

.skill-category { display: flex; flex-direction: column; gap: 16px; }

/* ── Cabecera de categoría ── */
.skill-category__head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-category__badge {
    width: 26px;
    height: 26px;
    background: var(--clr-accent-dim);
    border: 1px solid var(--clr-accent-brd);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--clr-accent);
    flex-shrink: 0;
}
.skill-category__badge svg { width: 12px; height: 12px; stroke-width: 1.9; }

.skill-category__label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--clr-accent);
    letter-spacing: 2.5px;
    text-transform: uppercase;
    font-weight: 500;
    white-space: nowrap;
}

.skill-category__rule {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--clr-border-md) 0%, transparent 100%);
}

/* ── Grid de tarjetas ── */
.skill-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 10px;
}

/* ── Tarjeta individual ── */
.skill-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    padding: 20px 12px 15px;
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    cursor: default;
    transition:
        transform    0.4s var(--ease-out-expo),
        border-color 0.3s,
        box-shadow   0.4s var(--ease-out-expo);
}

/* Glow radial en hover */
.skill-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 10%, rgba(29,158,117,0.11) 0%, transparent 68%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.skill-card:hover {
    transform: translateY(-8px);
    border-color: var(--clr-accent-brd);
    box-shadow:
        0 22px 52px rgba(0,0,0,0.38),
        0 0 0 1px var(--clr-accent-brd),
        0 0 24px rgba(29,158,117,0.09),
        inset 0 1px 0 rgba(255,255,255,0.05);
}
.skill-card:hover::after { opacity: 1; }

/* ── Contenedor del anillo SVG ── */
.skill-card__visual {
    position: relative;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}

/* SVG ring: rotado para que empiece desde arriba */
.skill-ring {
    width: 64px;
    height: 64px;
    transform: rotate(-90deg);
}

.skill-ring__track {
    fill: none;
    stroke: var(--clr-surface2);
    stroke-width: 2.5;
}

.skill-ring__fill {
    fill: none;
    stroke: var(--clr-accent);
    stroke-width: 2.5;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.4s var(--ease-out-expo);
    filter: drop-shadow(0 0 5px rgba(29,158,117,0.55));
}

/* Icono centrado dentro del anillo */
.skill-card__icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.skill-card__icon i {
    font-size: 22px;
    display: block;
    transition: transform 0.4s var(--ease-out-expo);
}
.skill-card:hover .skill-card__icon i { transform: scale(1.14); }
.skill-card__icon svg {
    width: 19px;
    height: 19px;
    color: var(--clr-text-muted);
    stroke-width: 1.7;
    transition: color 0.3s, transform 0.4s var(--ease-out-expo);
}
.skill-card:hover .skill-card__icon svg {
    color: var(--clr-accent);
    transform: scale(1.14);
}

/* Nombre */
.skill-card__name {
    font-size: 11px;
    color: var(--clr-text-muted);
    text-align: center;
    line-height: 1.35;
    font-weight: 500;
    transition: color 0.25s;
}
.skill-card:hover .skill-card__name { color: var(--clr-white); }

/* Porcentaje */
.skill-card__pct {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--clr-text-dim);
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: color 0.25s;
}
.skill-card:hover .skill-card__pct { color: var(--clr-accent); }

/* ============================================================
   ABOUT SECTION
   ============================================================ */
.about__inner {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 60px;
    align-items: start;
}

.about__photo {
    aspect-ratio: 1;
    background: var(--clr-surface);
    border: 0.5px solid var(--clr-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.4s var(--ease-out-expo), box-shadow 0.4s var(--ease-out-expo);
}
.about__photo:hover {
    border-color: var(--clr-accent-brd);
    box-shadow: 0 0 0 4px var(--clr-accent-glow);
}
.about__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out-expo);
}
.about__photo:hover img { transform: scale(1.04); }
.about__photo-placeholder {
    font-family: var(--font-display);
    font-size: 56px;
    font-weight: 800;
    color: var(--clr-accent);
}

.about__content h2 { margin-bottom: 20px; }
.about__content p { margin-bottom: 16px; }

.about__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 32px 0;
}
.about__stat {
    background: var(--clr-surface);
    border: 0.5px solid var(--clr-border);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    transition:
        border-color var(--transition),
        transform 0.35s var(--ease-out-expo),
        box-shadow 0.35s var(--ease-out-expo);
}
.about__stat:hover {
    border-color: var(--clr-accent-brd);
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.25), 0 0 0 0.5px var(--clr-accent-brd);
}
.about__stat-num {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--clr-accent);
    display: block;
    transition: color var(--transition);
}
.about__stat:hover .about__stat-num { color: #23bf8e; }
.about__stat-label {
    font-size: 12px;
    color: var(--clr-text-dim);
    margin-top: 2px;
}

/* ============================================================
   CONTACT SECTION
   ============================================================ */
.contact__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.contact__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--clr-text-muted);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color var(--transition);
}
.form-group:focus-within label {
    color: var(--clr-accent);
}
.form-group input,
.form-group textarea,
.form-group select {
    background: var(--clr-surface);
    border: 0.5px solid var(--clr-border-md);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--clr-text);
    font-size: 14px;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--clr-accent);
    /* Glow de enfoque — feedback claro, no exagerado */
    box-shadow: 0 0 0 3px var(--clr-accent-glow);
}
.form-group textarea { min-height: 130px; }

.contact__info { display: flex; flex-direction: column; gap: 20px; }
.contact__info h3 { margin-bottom: 8px; }
.contact__links { display: flex; flex-direction: column; gap: 10px; }
.contact__link {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--clr-text-muted);
    text-decoration: none;
    transition: color var(--transition), transform var(--transition);
    opacity: 1 !important;
}
.contact__link:hover {
    color: var(--clr-accent);
    transform: translateX(4px);
    opacity: 1 !important;
}
.contact__link svg { flex-shrink: 0; }

/* ============================================================
   SITE FOOTER
   ============================================================ */
.site-footer {
    background: #0a0a0a;
    border-top: 0.5px solid var(--clr-border);
    padding: 32px 0;
}
.site-footer__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}
.site-footer__copy {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--clr-text-dim);
}
.site-footer__links { display: flex; gap: 20px; }
.site-footer__links a {
    font-size: 12px;
    color: var(--clr-text-dim);
    transition: color var(--transition);
    opacity: 1 !important;
}
.site-footer__links a:hover { color: var(--clr-accent); opacity: 1 !important; }

/* ============================================================
   BLOG / SINGLE POST
   ============================================================ */
.post-header { padding: 60px 0 40px; border-bottom: 0.5px solid var(--clr-border); }
.post-meta {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}
.post-meta span {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--clr-text-dim);
}
.post-content { padding: 48px 0; max-width: 720px; }
.post-content h2,
.post-content h3 { margin: 32px 0 16px; }
.post-content p { margin-bottom: 20px; color: var(--clr-text); }
.post-content pre {
    background: var(--clr-surface);
    border: 0.5px solid var(--clr-border);
    border-radius: var(--radius-md);
    padding: 20px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 13px;
    margin: 24px 0;
    line-height: 1.65;
}
.post-content code {
    font-family: var(--font-mono);
    font-size: 13px;
    background: var(--clr-surface);
    border: 0.5px solid var(--clr-border);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--clr-accent);
}
.post-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--clr-text);
}

/* ============================================================
   404 PAGE
   ============================================================ */
.error-404 { text-align: center; padding: 100px 0; }
.error-404__code {
    font-family: var(--font-mono);
    font-size: 120px;
    font-weight: 700;
    color: var(--clr-accent);
    line-height: 1;
    margin-bottom: 16px;
    opacity: 0.3;
}
.error-404 h1 { margin-bottom: 16px; }
.error-404 p { margin-bottom: 32px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .hero__inner { grid-template-columns: 1fr; }
    .hero__visual { display: none; }
    .about__inner { grid-template-columns: 1fr; }
    .about__photo { max-width: 240px; }
    .contact__inner { grid-template-columns: 1fr; }
    .about__stats { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
    :root { --section-pad: 56px 0; }
    .nav-menu { display: none; }
    .nav-menu.is-open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(14,14,14,0.98);
        backdrop-filter: blur(16px);
        border-bottom: 0.5px solid var(--clr-border);
        padding: 16px 24px;
        gap: 4px;
        animation: menu-in 0.25s var(--ease-out-expo);
    }
    @keyframes menu-in {
        from { opacity: 0; transform: translateY(-8px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    .nav-toggle { display: flex; }
    .nav-cta    { display: none; }
    .projects-grid { grid-template-columns: 1fr; }
    .skill-cards { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .skill-card { padding: 16px 10px 12px; }
    .skill-card__name { font-size: 10.5px; }
    .about__stats { grid-template-columns: repeat(2, 1fr); }
    .site-footer__inner { flex-direction: column; text-align: center; }
    h1 { font-size: clamp(2rem, 10vw, 3rem); }
}

/* ============================================================
   ANIMACIONES DE ENTRADA
   ============================================================ */
.fade-up {
    opacity: 0;
    transform: translateY(22px);
    filter: blur(3px);
    transition:
        opacity  0.7s var(--ease-out-expo),
        transform 0.7s var(--ease-out-expo),
        filter   0.7s var(--ease-out-expo);
}
.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* ============================================================
   SCROLLBAR CUSTOM
   ============================================================ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--clr-bg); }
::-webkit-scrollbar-thumb {
    background: var(--clr-surface2);
    border-radius: 3px;
    transition: background var(--transition);
}
::-webkit-scrollbar-thumb:hover { background: var(--clr-text-dim); }

/* ============================================================
   SELECTION
   ============================================================ */
::selection {
    background: rgba(29,158,117,0.3);
    color: #fff;
}

/* ============================================================
   WORDPRESS: ALINEACIÓN DE BLOQUES
   ============================================================ */
.alignleft  { float: left; margin-right: 24px; margin-bottom: 16px; }
.alignright { float: right; margin-left: 24px; margin-bottom: 16px; }
.aligncenter { margin: 0 auto 16px; display: block; }
.wp-caption { font-size: 12px; color: var(--clr-text-dim); text-align: center; margin-top: 4px; }

/* ============================================================
   PREFERS-REDUCED-MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .fade-up {
        opacity: 1;
        transform: none;
        filter: none;
    }
    .hero__code-card { animation: none; }
    .word-inner { transform: none; }
}
