/* =========================
   VARIABLES
========================= */
:root {
    --accent-color: #4f46e5;
    --link-hover: #3730a3;
    --bg-light: #ffffff;
    --bg-dark: #1e1e1e;      /* gris oscuro más suave que #121212 */
    --card-light: #f9f9f9;
    --card-dark: #2a2a2a;    /* ligeramente más claro que el bg-dark para contraste */
    --text-light: #111111;
    --text-dark: #e0e0e0;    /* un gris claro más suave que #eee */
    --highlight-bg-light: #f0f4ff;   /* suave, no blanco puro */
    --highlight-bg-dark: #242424;    /* contraste sutil */
    --highlight-border: rgba(79, 70, 229, 0.25);
    --link-primary: var(--accent-color);
    --link-primary-hover: var(--link-hover);
}
a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
    color: var(--link-hover);
}

body.dark-mode a {
    color: var(--link-primary);
}

body.dark-mode a:hover {
    color: var(--link-hover);
}


/* =========================
   BASE
========================= */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--bg-light);
    color: var(--text-light);
    transition: background-color 0.3s ease, color 0.3s ease;
    padding-bottom: 180px; /* espacio para el footer fijo */
}

body.dark-mode {
    background-color: var(--bg-dark);
    color: var(--text-dark);
    --link-primary: #8b85ff;   /* un poco más luminoso */
    --link-primary-hover: #a5a0ff;
}

main {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* =========================
   HEADER & NAV
========================= */
header {
    background-color: var(--bg-light);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    position: fixed;
    top: 0;
    left: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 1000;
    width: 100%;
    margin: -20px -20px 20px -20px;
    padding: 0 20px;
    transition: background-color 0.3s ease;
}

body.dark-mode header {
    background-color: #1e1e1e;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

nav {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
}

.logo img {
    height: 40px;
    display: block;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

nav a {
    text-decoration: none;
    color: var(--link-primary);
    font-weight: bold;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--link-primary-hover);
}

body.dark-mode nav a {
    color: #a5b4fc;
}

body.dark-mode nav a:hover {
    color: #7c3aed;
}

/* =========================
   HERO
========================= */
#hero {
    padding: 60px 0;
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

h2 {
    color: #666;
    font-weight: 300;
}

/* =========================
   FEATURED PROJECTS
========================= */
.project-grid {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: space-between;
}

.mini-card {
    flex: 1 1 calc(33.333% - 1rem);
    background-color: var(--card-light);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: var(--link-primary);
}

body.dark-mode .mini-card {
    background-color: var(--card-dark);
    color: var(--text-dark);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}
body.dark-mode .mini-card:hover {
    box-shadow: 0 10px 28px rgba(79, 70, 229, 0.25); /* glow sutil del accent */
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.mini-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.mini-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.placeholder-img {
    width: 100%;
    height: 150px;
    background: #f6f8fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.mini-card-content {
    padding: 15px;
}

.mini-card-content h4 {
    margin-bottom: 10px;
    color: var(--link-primary);
}

.mini-card-content p {
    font-size: 0.85rem;
    color: #586069;
    margin-bottom: 15px;
}

/* =========================
   BUTTONS & LINKS
========================= */
.link-btn {
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--link-primary);
    border: 1px solid #e1e4e8;
    padding: 6px 12px;
    border-radius: 6px;
     transition: color 0.2s ease, transform 0.2s ease;
}

.link-btn:hover {
    background-color: #f3f4f6;
    color: var(--link-primary-hover);
    transform: translateX(2px);
}

/* =========================
   THEME TOGGLE
========================= */
#theme-toggle {
    background: none;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: var(--accent-color);
    transition: all 0.3s ease;
}

#theme-toggle:hover {
    background-color: var(--accent-color);
    color: white;
    transform: scale(1.1);
}

body.dark-mode #theme-toggle {
    border-color: #a5b4fc;
    color: #a5b4fc;
}

body.dark-mode #theme-toggle:hover {
    background-color: #a5b4fc;
    color: #111;
}

/* =========================
   FOOTER
========================= */

footer {
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-light);
    border-top: 1px solid rgba(255,255,255,0.08);
    z-index: 1000;
}
.footer-icons {
    display: flex;
    gap: 1.2rem;
    justify-content: center;
    margin-bottom: 0.8rem;
}

.footer-icon {
    width: 26px;
    height: 26px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
}

.footer-icons a {
    font-size: 1.4rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.footer-icon:hover {
    transform: translateY(-2px);
    opacity: 0.85;
}

.footer-icons a:hover {
    color: var(--accent);
}

body.dark-mode footer {
    background-color: var(--bg-dark);
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 900px) {
    .mini-card {
        flex: 1 1 100%;
    }

    nav ul {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* =========================
   ANIMATIONS
========================= */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--link-primary);
    display: inline-block;
    margin-bottom: 0.3rem;
}

.mini-meta {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

/* Imágenes responsivas */
.project-image img, 
.mini-card img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto; /* centra la imagen */
    border-radius: 8px;
}

/* Secciones generales */
.section-card {
    padding: 24px;
    border-radius: 12px;
    margin-top: 40px;
    background-color: var(--card-light);
     transition: background-color 0.3s ease;
}

/* Dark mode */
body.dark-mode .section-card {
    background-color: var(--card-dark);
}


body.dark-mode .mini-meta {
    color: #9ca3af;
}

#skills,
#download {
    background: var(--highlight-bg-light);
    padding: 32px;
    border-radius: 16px;
    margin: 64px auto 0 auto;
    max-width: 1100px;

    border: 1px solid var(--highlight-border);
    transition: background 0.25s ease, border-color 0.25s ease;
}

body.dark-mode #skills,
body.dark-mode #download {
    background: var(--highlight-bg-dark);
    border-color: rgba(129, 140, 255, 0.25);
}
