/* =========================
   VARIABLES Y RESET
   ========================= */
:root {
    --orange-50: #fff8f0;
    --orange-100: #ffe6cc;
    --orange-200: #ffd4a8;
    --orange-300: #ffb366;
    --orange-400: #ff9933;
    --orange-500: #ff8000;
    --orange-600: #cc6600;
    --orange-700: #994c00;
    --orange-800: #663300;
    --orange-900: #331a00;
    --black-50: #f2f2f2;
    --black-100: #e6e6e6;
    --black-200: #cccccc;
    --black-300: #b3b3b3;
    --black-400: #999999;
    --black-500: #666666;
    --black-600: #4d4d4d;
    --black-700: #333333;
    --black-800: #1a1a1a;
    --black-900: #000000;
    --white: #ffffff;
    --gray-light: #f5f5f5;
    --gray: #dddddd;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Poppins', Arial, sans-serif;
    background: var(--white);
    color: var(--black-700);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

ul {
    list-style: none;
}

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

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* =========================
   LOGO PRINCIPAL EN HEADER
   ========================= */
.logo-portfolio {
    display: flex;
    align-items: center;
    height: 100%;
    max-width: 160px; /* Mobile first */
}
.logo-portfolio img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 40px; /* Mobile first */
}
@media (min-width: 600px) {
    .logo-portfolio {
        max-width: 240px;
    }
    .logo-portfolio img {
        max-height: 70px;
    }
}
@media (min-width: 900px) {
    .logo-portfolio {
        max-width: 320px;
    }
    .logo-portfolio img {
        max-height: 50px;
    }
}

/* =========================
   SVG DECORATIVO CENTRADO EN ABOUT
   ========================= */
.about-svg-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 1.5rem;
}
.about-svg-logo svg {
    display: block;
    margin: 0 auto;
    width: 100%;
    max-width: 600px;
    height: auto;
}
.key {
    fill: #111;
    stroke: #333;
    stroke-width: 3;
}
.letter {
    fill: #fff;
    font-family: Arial, sans-serif;
    font-size: 42px;
    font-weight: bold;
    text-anchor: middle;
    dominant-baseline: middle;
}
/* Animación tipo tecleo */
@keyframes press {
    0% { transform: translateY(0); fill: #111; }
    30% { transform: translateY(5px); fill: #222; }
    100% { transform: translateY(0); fill: #111; }
}
.press-1 { animation: press 1s infinite; animation-delay: 0s; }
.press-2 { animation: press 1s infinite; animation-delay: 0.2s; }
.press-3 { animation: press 1s infinite; animation-delay: 0.4s; }
.press-4 { animation: press 1s infinite; animation-delay: 0.6s; }
.press-5 { animation: press 1s infinite; animation-delay: 0.8s; }
.press-6 { animation: press 1s infinite; animation-delay: 1s; }
.press-7 { animation: press 1s infinite; animation-delay: 1.2s; }

/* =========================
   TIPOGRAFÍA
   ========================= */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.7em;
    color: var(--black-900);
}
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }

.section-title {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 0.7rem;
    font-size: 1.4rem;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--orange-500);
    border-radius: 2px;
}

/* =========================
   HEADER Y NAVEGACIÓN
   ========================= */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
}
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
    padding: 0.5rem 0;
}
.nav-links {
    display: none;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 56px;
    left: 0;
    width: 100%;
    background: var(--white);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    z-index: 999;
}
.nav-links li {
    border-bottom: 1px solid var(--black-50);
    text-align: center;
}
.nav-links li:last-child {
    border-bottom: none;
}
.nav-links a {
    display: block;
    padding: 1rem 0;
    font-weight: 500;
    color: var(--black-700);
    font-size: 1rem;
}
.nav-links a:hover {
    color: var(--orange-500);
}
.hamburger {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
    z-index: 1100;
    padding: 10px;
}
.bar {
    width: 25px;
    height: 3px;
    background: var(--black-700);
    border-radius: 2px;
    transition: all 0.3s;
}
/* Animación del hamburger */
.hamburger.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}
.hamburger.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}
/* Mostrar menú en mobile cuando está activo */
.nav-links.active {
    display: flex;
}

/* Tablet y Desktop */
@media (min-width: 768px) {
    .hamburger {
        display: none;
    }
    .nav-links {
        display: flex;
        flex-direction: row;
        position: static;
        width: auto;
        box-shadow: none;
        gap: 1.5rem;
    }
    .nav-links li {
        border-bottom: none;
    }
    .nav-links a {
        padding: 0;
    }
}

/* =========================
   HERO SECTION
   ========================= */
.hero {
    padding: 4.5rem 0 2rem 0; /* Reducido para mobile */
    background: linear-gradient(120deg, var(--orange-50) 0%, var(--black-50) 100%), url('/img/hero-bg.jpg') center/cover no-repeat;
    position: relative;
}
.hero-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem; /* Reducido para mobile */
}
.hero-content {
    text-align: center;
    width: 100%;
}
.hero h1 {
    font-size: 1.3rem; /* Reducido para mobile */
    margin-bottom: 0.5rem;
}
.hero h2 {
    font-size: 1rem; /* Reducido para mobile */
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--orange-500);
    min-height: 1.5em;
}
.hero p {
    font-size: 0.95rem; /* Reducido para mobile */
    margin-bottom: 1.2rem;
    color: var(--black-600);
}
.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    align-items: center;
}
.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 220px; /* Reducido para mobile */
}
.profile-image {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 3px solid var(--white); /* Reducido para mobile */
    background: var(--white);
    margin: 0 auto;
    display: block;
}

/* Tablet */
@media (min-width: 600px) {
    .hero {
        padding: 5rem 0 2.5rem 0;
    }
    .hero-wrapper { 
        flex-direction: row;
        gap: 2rem;
    }
    .hero h1 {
        font-size: 1.5rem;
    }
    .hero h2 {
        font-size: 1.1rem;
    }
    .hero p {
        font-size: 1rem;
    }
    .hero-image {
        max-width: 260px;
    }
    .profile-image {
        border: 4px solid var(--white);
    }
    .hero-buttons {
        flex-direction: row;
        justify-content: center;
    }
}

/* Desktop */
@media (min-width: 900px) {
    .hero {
        padding: 5.5rem 0 3rem 0;
    }
    .hero-wrapper {
        gap: 2.5rem;
    }
    .hero h1 {
        font-size: 1.8rem;
    }
    .hero h2 {
        font-size: 1.2rem;
    }
    .hero-image {
        max-width: 340px;
    }
}

/* =========================
   BOTONES
   ========================= */
.btn {
    display: inline-block;
    padding: 0.6rem 1.1rem; /* Reducido para mobile */
    border-radius: var(--border-radius-md);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 0.95rem; /* Reducido para mobile */
    width: 100%; /* Full width en mobile */
    max-width: 250px; /* Limitar ancho máximo */
}
.btn-primary {
    background-color: var(--orange-500);
    color: var(--white);
}
.btn-primary:hover {
    background-color: var(--orange-600);
}
.btn-secondary {
    background-color: var(--black-800);
    color: var(--white);
}
.btn-secondary:hover {
    background-color: var(--black-900);
}
.btn-small {
    padding: 0.4rem 0.9rem; /* Reducido para mobile */
    font-size: 0.85rem; /* Reducido para mobile */
    max-width: 120px;
}

/* Tablet */
@media (min-width: 600px) {
    .btn {
        padding: 0.65rem 1.2rem;
        font-size: 0.95rem;
        width: auto; /* Auto width en tablet */
    }
    .btn-small {
        padding: 0.45rem 0.95rem;
        font-size: 0.9rem;
    }
}

/* Desktop */
@media (min-width: 900px) {
    .btn {
        padding: 0.7rem 1.3rem;
        font-size: 1rem;
    }
    .btn-small {
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
    }
}

/* =========================
   ABOUT SECTION
   ========================= */
.about {
    padding: 2.5rem 0 1.5rem 0;
    background-color: var(--white);
}
.about-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}
@media (min-width: 600px) {
    .about-content { flex-direction: row; gap: 2.5rem; }
}
.about-image .image-placeholder {
    width: 120px;
    height: 120px;
    background: var(--orange-200);
    border-radius: 50%;
    overflow: hidden; /* Para asegurar que la imagen se mantenga dentro del círculo */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto; /* Centrar el contenedor */
}

.about-image .image-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Para que la imagen cubra todo el espacio */
    border-radius: 50%; /* Asegurar que la imagen también sea redonda */
}

/* Tablet */
@media (min-width: 600px) {
    .about-image .image-placeholder {
        width: 150px;
        height: 150px;
    }
}

/* Desktop */
@media (min-width: 900px) {
    .about-image .image-placeholder {
        width: 180px;
        height: 180px;
    }
}
.about-text h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--black-800);
}
.about-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}
@media (min-width: 600px) {
    .about-details { flex-direction: row; }
}
.detail {
    text-align: center;
    padding: 1rem;
    border-radius: var(--border-radius-md);
    background-color: var(--gray-light);
    box-shadow: var(--shadow-sm);
}
.detail i {
    font-size: 1.5rem;
    color: var(--orange-500);
    margin-bottom: 0.5rem;
}
.detail h4 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

/* =========================
   SKILLS SECTION
   ========================= */
.skills {
    padding: 2rem 0 1.5rem 0;
    background-color: var(--black-50);
}
.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columnas en mobile */
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}
.skill-col {
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    padding: 1rem 0.5rem;
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.skill-col-title {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-align: center;
    font-weight: 600;
}
.skill-list li {
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    text-align: center;
}
.skill-list i {
    margin-right: 0.3rem;
}
.in-progress {
    font-size: 0.75rem;
    color: var(--orange-500);
    font-style: italic;
}

/* Tablet */
@media (min-width: 600px) {
    .skills {
        padding: 2.2rem 0 1.5rem 0;
    }
    .skills-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columnas en tablet */
        gap: 1rem;
    }
    .skill-col {
        padding: 1.1rem 0.8rem;
    }
    .skill-col-title {
        font-size: 1rem;
    }
    .skill-list li {
        font-size: 0.9rem;
    }
}

/* Desktop */
@media (min-width: 900px) {
    .skills {
        padding: 2.5rem 0 1.5rem 0;
    }
    .skills-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 columnas en desktop */
        gap: 1.2rem;
        margin-bottom: 2rem;
    }
    .skill-col {
        padding: 1.2rem 1rem;
    }
    .skill-col-title {
        font-size: 1.1rem;
    }
    .skill-list li {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
}

/* =========================
   CARRUSEL DE LOGOS DE PROYECTOS (ACTUALIZADO MOBILE FIRST)
   ========================= */
.carousel-container {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    width: 100%;
    background: var(--white);
    margin: 0.5rem 0 2rem 0; /* Reducido margen superior y añadido margen inferior */
    padding: 1rem 0;
    min-height: 90px;
}
.carousel-track {
    display: flex;
    width: max-content;
    animation: scroll-carousel 25s linear infinite;
    align-items: center;
    gap: 24px;
}
.carousel-track a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    min-width: 90px;
    height: 90px;
    min-height: 90px;
    background: var(--gray-light);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
    margin: 0;
    padding: 0;
}
.carousel-track a:hover {
    box-shadow: var(--shadow-md);
}
.carousel-track img {
    max-width: 60px;
    max-height: 60px;
    width: auto;
    height: auto;
    margin: auto;
    display: block;
    filter: grayscale(1) brightness(0.85);
    opacity: 0.85;
    transition: filter 0.2s, transform 0.2s, opacity 0.2s;
    border-radius: 8px;
    background: transparent;
}
.carousel-track img:hover {
    filter: grayscale(0) brightness(1) drop-shadow(0 2px 8px var(--orange-200));
    opacity: 1;
    transform: scale(1.12);
}
@keyframes scroll-carousel {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
/* Tablet */
@media (min-width: 600px) {
    .carousel-container { min-height: 110px; }
    .carousel-track a,
    .carousel-track a:visited {
        width: 110px;
        min-width: 110px;
        height: 110px;
        min-height: 110px;
    }
    .carousel-track img {
        max-width: 80px;
        max-height: 80px;
    }
    .carousel-track { gap: 36px; }
}
/* Desktop */
@media (min-width: 900px) {
    .carousel-container { min-height: 130px; }
    .carousel-track a,
    .carousel-track a:visited {
        width: 130px;
        min-width: 130px;
        height: 130px;
        min-height: 130px;
    }
    .carousel-track img {
        max-width: 100px;
        max-height: 100px;
    }
    .carousel-track { gap: 48px; }
}

/* =========================
   PROJECTS SECTION
   ========================= */
.projects {
    padding: 2rem 0 1.5rem 0; /* Reducido para mobile */
    background-color: var(--white);
}
.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* Reducido para mobile */
}
.project-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s, box-shadow 0.3s;
}
.project-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}
.project-image {
    width: 100%;
    background: var(--black-200);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px; /* Reducido para mobile */
    overflow: hidden;
}
.project-image img,
.project-image .image-placeholder {
    width: 100%;
    height: 160px; /* Reducido para mobile */
    object-fit: contain;
    border-top-left-radius: var(--border-radius-lg);
    border-top-right-radius: var(--border-radius-lg);
    background-color: var(--black-200);
    display: block;
}
.project-info {
    padding: 1rem; /* Reducido para mobile */
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Reducido para mobile */
}
.project-info h3 {
    font-size: 1rem; /* Reducido para mobile */
    margin-bottom: 0.2rem;
}
.project-info p {
    font-size: 0.9rem; /* Reducido para mobile */
}
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem; /* Reducido para mobile */
    margin: 0.3rem 0;
}
.project-tags span {
    background-color: var(--orange-100);
    color: var(--orange-700);
    padding: 0.2rem 0.6rem; /* Reducido para mobile */
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem; /* Reducido para mobile */
    font-weight: 500;
}
.project-links {
    display: flex;
    flex-direction: column; /* Columna en mobile */
    gap: 0.5rem; /* Reducido para mobile */
    margin-top: 0.3rem;
    width: 100%;
}
.project-links .btn {
    width: 100%; /* Full width en mobile */
}

/* Tablet */
@media (min-width: 600px) {
    .projects {
        padding: 2.2rem 0 1.5rem 0;
    }
    .projects-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.8rem;
    }
    .project-card {
        height: 100%;
    }
    .project-image,
    .project-image img,
    .project-image .image-placeholder {
        min-height: 170px;
        height: 170px;
    }
    .project-info {
        padding: 1.1rem;
        gap: 0.6rem;
    }
    .project-info h3 {
        font-size: 1.05rem;
    }
    .project-info p {
        font-size: 0.95rem;
    }
    .project-tags span {
        padding: 0.22rem 0.65rem;
        font-size: 0.82rem;
    }
    .project-links {
        flex-direction: row; /* Fila en tablet */
        justify-content: flex-start;
    }
    .project-links .btn {
        width: auto; /* Auto width en tablet */
    }
}

/* Desktop */
@media (min-width: 900px) {
    .projects {
        padding: 2.5rem 0 1.5rem 0;
    }
    .projects-grid {
        gap: 2rem;
    }
    .project-image,
    .project-image img,
    .project-image .image-placeholder {
        min-height: 180px;
        height: 180px;
    }
    .project-info {
        padding: 1.2rem;
        gap: 0.7rem;
    }
    .project-info h3 {
        font-size: 1.1rem;
    }
    .project-info p {
        font-size: 1rem;
    }
    .project-tags {
        gap: 0.5rem;
    }
    .project-tags span {
        padding: 0.25rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Desktop: tres columnas */
@media (min-width: 1000px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* =========================
   CONTACT SECTION
   ========================= */
.contact {
    padding: 2rem 0 1.5rem 0; /* Reducido para mobile */
    background-color: var(--black-50);
}
.contact-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* Reducido para mobile */
}
.contact-info h3 {
    margin-bottom: 0.6rem; /* Reducido para mobile */
    font-size: 1.1rem; /* Reducido para mobile */
}
.contact-info p {
    font-size: 0.9rem; /* Reducido para mobile */
}
.contact-details {
    margin: 0.8rem 0; /* Reducido para mobile */
}
.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.6rem; /* Reducido para mobile */
}
.contact-item i {
    font-size: 1rem; /* Reducido para mobile */
    color: var(--orange-500);
    margin-right: 0.6rem; /* Reducido para mobile */
    width: 20px; /* Reducido para mobile */
}
.contact-item span {
    font-size: 0.9rem; /* Reducido para mobile */
}
.social-links {
    display: flex;
    gap: 0.8rem; /* Reducido para mobile */
    margin-top: 0.6rem; /* Reducido para mobile */
}
.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; /* Reducido para mobile */
    height: 36px; /* Reducido para mobile */
    border-radius: 50%;
    background-color: var(--black-800);
    color: var(--white);
    transition: background-color 0.3s;
}
.social-link:hover {
    background-color: var(--orange-500);
}
.contact-form {
    background-color: var(--white);
    padding: 1.2rem; /* Reducido para mobile */
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
}
.form-group {
    margin-bottom: 0.8rem; /* Reducido para mobile */
}
.form-group label {
    display: block;
    margin-bottom: 0.4rem; /* Reducido para mobile */
    font-weight: 500;
    font-size: 0.9rem; /* Reducido para mobile */
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.6rem; /* Reducido para mobile */
    border: 1px solid var(--gray);
    border-radius: var(--border-radius-sm);
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem; /* Reducido para mobile */
    transition: border-color 0.3s;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--orange-500);
}

/* Tablet */
@media (min-width: 600px) {
    .contact {
        padding: 2.2rem 0 1.5rem 0;
    }
    .contact-content { 
        flex-direction: row; 
        gap: 2rem; 
    }
    .contact-info h3 {
        margin-bottom: 0.65rem;
        font-size: 1.15rem;
    }
    .contact-info p {
        font-size: 0.95rem;
    }
    .contact-details {
        margin: 0.9rem 0;
    }
    .contact-item {
        margin-bottom: 0.65rem;
    }
    .contact-item i {
        font-size: 1.05rem;
        margin-right: 0.65rem;
        width: 21px;
    }
    .contact-item span {
        font-size: 0.95rem;
    }
    .contact-form {
        padding: 1.3rem;
    }
    .form-group {
        margin-bottom: 0.9rem;
    }
    .form-group label {
        margin-bottom: 0.45rem;
        font-size: 0.95rem;
    }
    .form-group input,
    .form-group textarea {
        padding: 0.65rem;
        font-size: 0.95rem;
    }
}

/* Desktop */
@media (min-width: 900px) {
    .contact {
        padding: 2.5rem 0 1.5rem 0;
    }
    .contact-content { 
        gap: 2.5rem; 
    }
    .contact-info h3 {
        margin-bottom: 0.7rem;
        font-size: 1.2rem;
    }
    .contact-info p {
        font-size: 1rem;
    }
    .contact-details {
        margin: 1rem 0;
    }
    .contact-item {
        margin-bottom: 0.7rem;
    }
    .contact-item i {
        font-size: 1.1rem;
        margin-right: 0.7rem;
        width: 22px;
    }
    .contact-item span {
        font-size: 1rem;
    }
    .social-links {
        gap: 1rem;
        margin-top: 0.7rem;
    }
    .social-link {
        width: 38px;
        height: 38px;
    }
    .contact-form {
        padding: 1.5rem;
    }
    .form-group {
        margin-bottom: 1rem;
    }
    .form-group label {
        margin-bottom: 0.5rem;
        font-size: 1rem;
    }
    .form-group input,
    .form-group textarea {
        padding: 0.7rem;
        font-size: 1rem;
    }
}

/* =========================
   FOOTER
   ========================= */
.footer {
    background-color: var(--black-900);
    color: var(--white);
    padding: 1.8rem 0 1rem 0; /* Reducido para mobile */
}
.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem; /* Reducido para mobile */
    margin-bottom: 1rem;
}
.footer-logo {
    font-size: 1.1rem; /* Reducido para mobile */
    font-weight: 700;
    color: var(--orange-500);
    margin-bottom: 0.5rem; /* Añadido para mobile */
}
.footer-links {
    display: flex;
    gap: 0.8rem; /* Reducido para mobile */
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 0.5rem; /* Añadido para mobile */
}
.footer-links a {
    color: var(--gray);
    font-size: 0.9rem; /* Reducido para mobile */
    transition: color 0.3s;
    padding: 0.3rem 0.5rem; /* Añadido para mobile para mejor área táctil */
}
.footer-links a:hover {
    color: var(--orange-500);
}
.footer-social {
    display: flex;
    gap: 0.8rem; /* Reducido para mobile */
    margin-bottom: 0.5rem; /* Añadido para mobile */
}
.footer-bottom {
    text-align: center;
    padding-top: 0.8rem; /* Reducido para mobile */
    border-top: 1px solid var(--black-700);
    font-size: 0.85rem; /* Reducido para mobile */
    color: var(--gray);
}

/* Tablet */
@media (min-width: 600px) {
    .footer {
        padding: 1.9rem 0 1rem 0;
    }
    .footer-content { 
        flex-direction: row; 
        gap: 2rem;
        justify-content: space-between;
    }
    .footer-logo {
        font-size: 1.15rem;
        margin-bottom: 0;
    }
    .footer-links {
        gap: 1rem;
        margin-bottom: 0;
    }
    .footer-links a {
        font-size: 0.95rem;
        padding: 0.2rem 0.4rem;
    }
    .footer-social {
        gap: 0.9rem;
        margin-bottom: 0;
    }
    .footer-bottom {
        padding-top: 0.9rem;
        font-size: 0.9rem;
    }
}

/* Desktop */
@media (min-width: 900px) {
    .footer {
        padding: 2rem 0 1rem 0;
    }
    .footer-content { 
        gap: 2.5rem; 
    }
    .footer-logo {
        font-size: 1.2rem;
    }
    .footer-links {
        gap: 1.2rem;
    }
    .footer-links a {
        font-size: 1rem;
        padding: 0;
    }
    .footer-social {
        gap: 1rem;
    }
    .footer-bottom {
        padding-top: 1rem;
        font-size: 0.95rem;
    }
}

/* =========================
   EFECTO TYPEWRITER
   ========================= */
#hero-title {
    display: inline-block;
    position: relative;
    min-height: 1.5em;
    color: var(--orange-500);
    overflow: hidden;
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: 0.12em; /* Reducido para mobile */
    animation: typing 3.5s steps(40, end);
    max-width: 100%; /* Asegura que no desborde en pantallas pequeñas */
}
#hero-title::after {
    content: '|';
    position: absolute;
    right: -5px;
    color: var(--orange-500);
    animation: blink 0.7s infinite;
    border-right: 0.12em solid var(--orange-500); /* Reducido para mobile */
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

/* Tablet */
@media (min-width: 600px) {
    #hero-title {
        letter-spacing: 0.14em;
    }
    #hero-title::after {
        border-right: 0.14em solid var(--orange-500);
    }
}

/* Desktop */
@media (min-width: 900px) {
    #hero-title {
        letter-spacing: 0.15em;
    }
    #hero-title::after {
        border-right: 0.15em solid var(--orange-500);
    }
}

/* =========================
   EXTRA SMALL DEVICES
   ========================= */
@media (max-width: 400px) {
    .container { padding: 0 0.3rem; }
    .hero { padding: 4.5rem 0 1.5rem 0; }
    .hero h1 { font-size: 1.3rem; }
    .hero p { font-size: 0.95rem; }
    .btn { font-size: 0.95rem; }
    .about-image .image-placeholder { width: 100px; height: 100px; }
    .project-image img,
    .project-image .image-placeholder { height: 150px; }
}