/* ====================================================
   PORTFOLIO — Enrique Sandoval
   Clean modern design: navy bg, indigo accent, Inter/DM Sans
   ==================================================== */

/* ---- IMPORTS ---- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Inter:wght@300;400;500;600&display=swap');

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

:root {
    --bg-deep:      #0A0F1A;
    --bg-surface:   #111827;
    --bg-card:      #161F30;
    --bg-card-hover:#1A2540;
    --border:       #1E2D45;
    --border-light: #243249;

    --text-primary: #EEF0F5;
    --text-secondary:#8A96A8;
    --text-muted:   #5A6678;

    --accent:       #6366F1;
    --accent-light: #818CF8;
    --accent-dim:   rgba(99,102,241,0.12);

    --teal:         #14B8A6;
    --teal-dim:     rgba(20,184,166,0.12);
    --amber:        #F59E0B;
    --amber-dim:    rgba(245,158,11,0.10);
    --rose:         #F43F5E;
    --rose-dim:     rgba(244,63,94,0.10);

    --radius-sm:    6px;
    --radius-md:    12px;
    --radius-lg:    16px;

    --font-display: 'DM Sans', sans-serif;
    --font-body:    'Inter', sans-serif;

    --nav-h: 64px;
    --max-w: 1120px;
    --section-gap: 112px;
}

/* ---- LIGHT THEME OVERRIDES ---- */
[data-theme="light"] {
    --bg-deep:      #F7F8FA;
    --bg-surface:   #FFFFFF;
    --bg-card:      #FFFFFF;
    --bg-card-hover:#F0F2F5;
    --border:       #E2E6ED;
    --border-light: #D4DAE3;

    --text-primary: #161B26;
    --text-secondary:#5C6878;
    --text-muted:   #94A0B2;

    --accent:       #6366F1;
    --accent-light: #4F52E0;
    --accent-dim:   rgba(99,102,241,0.08);

    --teal:         #0D9488;
    --teal-dim:     rgba(13,148,136,0.10);
    --amber:        #D97706;
    --amber-dim:    rgba(217,119,6,0.08);
    --rose:         #E11D48;
    --rose-dim:     rgba(225,29,72,0.08);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-h);
}

body {
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.25s ease, color 0.25s ease;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ---- NAV ---- */
.nav-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10,15,26,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: var(--nav-h);
}

.nav-container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    color: var(--accent-light);
    letter-spacing: 0.04em;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--accent);
    border-radius: var(--radius-sm);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    transition: color 0.2s;
}

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

.nav-cta {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--accent-light) !important;
    border: 1px solid rgba(99,102,241,0.5);
    border-radius: var(--radius-sm);
    padding: 7px 16px;
    transition: background 0.2s, border-color 0.2s !important;
}

.nav-cta:hover {
    background: var(--accent-dim);
    border-color: var(--accent) !important;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.theme-toggle:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: var(--accent-dim);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-toggle .icon-sun {
    display: none;
}

.theme-toggle .icon-moon {
    display: block;
}

[data-theme="light"] .theme-toggle .icon-sun {
    display: block;
}

[data-theme="light"] .theme-toggle .icon-moon {
    display: none;
}

.nav-mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-right-mobile {
    display: none;
    align-items: center;
    gap: 12px;
}

.nav-mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: background 0.2s;
}

.nav-mobile-menu {
    display: none;
    flex-direction: column;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 12px 0;
}

.nav-mobile-menu.open {
    display: flex;
}

.nav-mobile-menu a {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.nav-mobile-menu a:hover {
    color: var(--text-primary);
}

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

.section-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-light);
    margin-bottom: 12px;
}

.section-heading {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.section-heading em {
    font-style: italic;
    color: var(--accent-light);
}

.section-subheading {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 56px;
    line-height: 1.7;
}

/* ---- HERO ---- */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    top: -160px;
    left: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99,102,241,0.10) 0%, transparent 70%);
    pointer-events: none;
}

.hero-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 48px;
}

.hero-text {
    flex: 1 1 0;
    min-width: 0;
}

.hero-bottom {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}

.hero-bottom .hero-stats {
    margin-bottom: 0;
}

.hero-bottom .hero-actions {
    margin-bottom: 0;
}

.hero-portrait {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    height: 320px;
    width: 320px;
    flex: 0 0 320px;
    overflow: hidden;
}

.hero-portrait-img {
    position: relative;
    width: 100%;
    max-width: 300px;
    height: auto;
    object-fit: contain;
    display: block;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--teal);
    margin-bottom: 24px;
    letter-spacing: 0.04em;
}

.hero-eyebrow::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 10px var(--teal);
    animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.hero-name {
    font-family: var(--font-display);
    font-size: clamp(44px, 8vw, 80px);
    font-weight: 700;
    line-height: 1.0;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.hero-title {
    font-size: clamp(14px, 2vw, 17px);
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 28px;
    letter-spacing: 0.01em;
}

.hero-divider {
    color: var(--border-light);
    margin: 0 6px;
}

.hero-desc {
    font-size: clamp(16px, 2vw, 18px);
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.75;
    margin-bottom: 48px;
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 48px;
    flex-wrap: wrap;
    row-gap: 24px;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    padding: 0 32px 0 0;
}

.hero-stat:first-child {
    padding-left: 0;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.hero-stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border);
    margin-right: 32px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-primary {
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    padding: 13px 28px;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
    transition: background 0.2s, transform 0.15s;
    display: inline-block;
}

.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
}

.btn-secondary {
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    padding: 13px 28px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    transition: border-color 0.2s, color 0.2s, transform 0.15s;
    display: inline-block;
}

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

/* ---- ABOUT ---- */
.about-section {
    padding: var(--section-gap) 0;
    border-top: 1px solid var(--border);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: start;
    margin-top: 8px;
}

.about-text p {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 18px;
}

.about-text p:last-child {
    margin-bottom: 0;
}

.about-pillars {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.pillar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: border-color 0.2s;
}

.pillar:hover {
    border-color: var(--border-light);
}

.pillar-icon {
    font-size: 20px;
    margin-bottom: 10px;
}

.pillar-title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.pillar-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ---- PROJECTS ---- */
.projects-section {
    padding: var(--section-gap) 0;
    border-top: 1px solid var(--border);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.25s, transform 0.2s, box-shadow 0.2s;
    border-left-width: 3px;
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}

.accent-indigo { border-left-color: var(--accent); }
.accent-teal   { border-left-color: var(--teal); }
.accent-amber  { border-left-color: var(--amber); }
.accent-rose   { border-left-color: var(--rose); }

.accent-indigo:hover { border-color: var(--accent); }
.accent-teal:hover   { border-color: var(--teal); }
.accent-amber:hover  { border-color: var(--amber); }
.accent-rose:hover   { border-color: var(--rose); }

.project-header {
    padding: 28px 28px 0;
}

.project-category {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.project-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.25;
}

.project-body {
    padding: 20px 28px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.project-block-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.project-block p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.65;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.project-tech span {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.project-impact {
    display: flex;
    gap: 0;
    border-top: 1px solid var(--border);
}

.impact-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px 12px;
    text-align: center;
    border-right: 1px solid var(--border);
}

.impact-item:last-child {
    border-right: none;
}

.impact-value {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.accent-indigo .impact-value { color: var(--accent-light); }
.accent-teal   .impact-value { color: var(--teal); }
.accent-amber  .impact-value { color: var(--amber); }
.accent-rose   .impact-value { color: var(--rose); }

.impact-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
    line-height: 1.3;
}

/* ---- SKILLS ---- */
.skills-section {
    padding: var(--section-gap) 0;
    border-top: 1px solid var(--border);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-top: 8px;
}

.skill-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px 20px;
    transition: border-color 0.2s;
}

.skill-group:hover {
    border-color: var(--border-light);
}

.skill-group-icon {
    font-size: 20px;
    color: var(--accent-light);
    margin-bottom: 10px;
    font-family: var(--font-display);
    font-weight: 700;
}

.skill-group h3 {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
}

.tag-primary {
    border-color: rgba(99,102,241,0.4);
    background: rgba(99,102,241,0.08);
    color: var(--accent-light);
}

.tag em {
    font-style: normal;
    font-size: 11px;
    color: var(--text-muted);
}

/* ---- CONTACT ---- */
.contact-section {
    padding: var(--section-gap) 0;
    border-top: 1px solid var(--border);
}

.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 64px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.contact-card::before {
    content: '';
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(99,102,241,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.contact-card .section-label {
    justify-content: center;
    display: flex;
}

.contact-card .section-heading {
    text-align: center;
}

.contact-desc {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.contact-links {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 12px 22px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.contact-link:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: var(--accent-dim);
}

.contact-link-icon {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-light);
    font-family: var(--font-display);
}

/* ---- FOOTER ---- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 28px 0;
}

.site-footer .section-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.footer-divider {
    color: var(--border-light);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

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

    .hero-top {
        flex-direction: column-reverse;
        align-items: center;
        text-align: center;
        gap: 32px;
    }

    .hero-portrait {
        flex: 0 0 auto;
        padding: 16px 16px 0;
    }

    .hero-desc {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-actions {
        justify-content: center;
    }

    .skills-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --section-gap: 72px;
    }

    .nav-links {
        display: none;
    }

    .nav-right-mobile {
        display: flex;
    }

    .nav-mobile-toggle {
        display: flex;
    }

    .nav-header {
        height: auto;
        min-height: var(--nav-h);
    }

    .nav-container {
        height: var(--nav-h);
    }

    .hero-section {
        min-height: 100vh;
        height: auto;
        align-items: center;
        padding: calc(var(--nav-h) + 24px) 0 72px;
    }

    .hero-portrait {
        height: auto;
        width: auto;
        min-height: 110px;
        min-width: 110px;
        max-width: 250px;
        max-height: 250px;
    }

    .hero-top {
        gap: 16px;
    }

    .hero-eyebrow {
        margin-bottom: 12px;
    }

    .hero-name {
        font-size: clamp(32px, 11vw, 48px);
        margin-bottom: 8px;
    }

    .hero-stats {
        flex-direction: column;
        align-items: center;
    }

    .hero-stat-divider {
        display: none;
    }

    .hero-stat {
        padding: 0;
    }

    .about-pillars {
        grid-template-columns: 1fr 1fr;
    }

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

    .contact-card {
        padding: 40px 24px;
    }

    .project-impact {
        flex-wrap: wrap;
    }

    .impact-item {
        flex-basis: 50%;
    }
}

@media (max-width: 480px) {
    .about-pillars {
        grid-template-columns: 1fr;
    }

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

    .hero-actions {
        flex-direction: column;
    }

    .btn-primary, .btn-secondary {
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .hero-eyebrow::before { animation: none; }
    .project-card:hover, .btn-primary:hover, .btn-secondary:hover {
        transform: none;
    }
}

/* ---- LIGHT THEME FINE-TUNING ---- */
[data-theme="light"] .project-card:hover {
    box-shadow: 0 16px 40px rgba(22,27,38,0.08);
}

[data-theme="light"] .project-tech span,
[data-theme="light"] .tag {
    background: var(--bg-card-hover);
}

[data-theme="light"] .nav-header {
    background: rgba(247,248,250,0.85);
}

[data-theme="light"] .hero-glow {
    background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 70%);
}

[data-theme="light"] .contact-card::before {
    background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 70%);
}

[data-theme="light"] .hero-portrait {
    background: var(--accent-light);
    box-shadow: 0 8px 24px rgba(22,27,38,0.06);
}
