/* ============================================
   📻 PORTFOLIO RETRO VINTAGE - TEMA SEPIA
   ============================================ */

/* ========== VARIABLES Y COLORES ========== */
:root {
    /* Colores Vintage */
    --primary: #d4794a;           /* Naranja quemado */
    --primary-light: #e89566;
    --primary-dark: #a85f38;
    --secondary: #9b8b4f;         /* Verde oliva */
    --accent: #c9a96e;            /* Dorado suave */
    --success: #7a9b59;
    --danger: #b85450;
    
    /* Fondos Papel Viejo */
    --bg-dark: #f5e6d3;           /* Beige papel */
    --bg-primary: #ffe8cc;        /* Crema */
    --bg-secondary: #f0d9b5;      /* Beige oscuro */
    --bg-tertiary: #d4c4a8;       /* Café con leche */
    
    /* Textos Sepia */
    --text-primary: #3d3228;
    --text-secondary: #5a4a3a;
    --text-muted: #8b7355;
    
    /* Efectos Vintage */
    --shadow-sm: 2px 2px 4px rgba(61, 50, 40, 0.2);
    --shadow-md: 3px 3px 8px rgba(61, 50, 40, 0.25);
    --shadow-lg: 5px 5px 15px rgba(61, 50, 40, 0.3);
    --shadow-xl: 8px 8px 25px rgba(61, 50, 40, 0.35);
    
    /* Bordes Retro */
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 6px;
    --radius-xl: 8px;
    --spacing: 1rem;
    
    /* Transiciones Vintage (más mecánicas) */
    --transition-fast: all 0.15s ease-in;
    --transition: all 0.25s ease-out;
    --transition-slow: all 0.4s ease-in-out;
}

/* ========== RESET Y BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Courier New', 'Courier', monospace;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-dark);
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(61, 50, 40, 0.03) 2px, rgba(61, 50, 40, 0.03) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(61, 50, 40, 0.03) 2px, rgba(61, 50, 40, 0.03) 4px),
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="n"><feTurbulence baseFrequency="0.9" numOctaves="3" /></filter><rect width="100" height="100" filter="url(%23n)" opacity="0.05" /></svg>');
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
}

/* ========== SCROLLBAR RETRO ========== */
::-webkit-scrollbar {
    width: 14px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-left: 2px solid var(--text-muted);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border: 2px solid var(--bg-dark);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ========== SELECCIÓN DE TEXTO ========== */
::selection {
    background: rgba(212, 121, 74, 0.35);
    color: var(--text-primary);
}

/* ========== CONTAINER ========== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ========== NAVEGACIÓN RETRO ========== */
nav {
    background: var(--bg-primary);
    border-bottom: 3px double var(--primary);
    border-top: 3px double var(--primary);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
}

nav .logo {
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--primary-dark);
    text-shadow: 2px 2px 0px var(--accent);
    letter-spacing: 2px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
}

nav .logo::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

nav .logo:hover::after {
    width: 100%;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

nav a::before {
    content: '▸ ';
    position: absolute;
    left: -15px;
    opacity: 0;
    transition: all 0.2s ease;
}

nav a:hover {
    color: var(--primary-dark);
    transform: translateX(5px);
}

nav a:hover::before {
    opacity: 1;
    left: -20px;
}

/* ========== HERO SECTION VINTAGE ========== */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 4rem 0;
    border-bottom: 3px double var(--primary);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(155, 139, 79, 0.05) 35px, rgba(155, 139, 79, 0.05) 70px);
    pointer-events: none;
}

.hero::after {
    content: '✦';
    position: absolute;
    font-size: 15rem;
    color: rgba(212, 121, 74, 0.08);
    bottom: -50px;
    right: -50px;
    transform: rotate(15deg);
    pointer-events: none;
}

@keyframes typewriter {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes vintage-float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

.hero h1 {
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: bold;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--primary-dark);
    text-shadow: 3px 3px 0px var(--accent);
    animation: fadeInUp 0.6s ease-out 0.2s both;
    letter-spacing: 3px;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    border: 4px double var(--primary);
    padding: 1rem;
    display: inline-block;
    background: var(--bg-primary);
}

.hero h3 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: normal;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    animation: fadeInUp 0.6s ease-out 0.3s both;
    font-style: italic;
    letter-spacing: 1px;
}

.hero p {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 650px;
    line-height: 1.9;
    animation: fadeInUp 0.6s ease-out 0.4s both;
    border-left: 4px solid var(--primary);
    padding-left: 1.5rem;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== BOTONES VINTAGE ========== */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    border: 3px solid var(--primary-dark);
    cursor: pointer;
    position: relative;
    overflow: visible;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
}

.btn::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    width: 100%;
    height: 100%;
    background: var(--text-muted);
    z-index: -1;
    transition: all 0.2s ease;
}

.btn:hover::before {
    top: 8px;
    left: 8px;
}

.btn:not(.btn-outline) {
    background: var(--primary);
    color: var(--bg-dark);
    box-shadow: var(--shadow-md);
}

.btn:not(.btn-outline):hover {
    background: var(--primary-dark);
    transform: translate(-3px, -3px);
    box-shadow: var(--shadow-lg);
}

.btn:not(.btn-outline):active {
    transform: translate(0, 0);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: var(--secondary) !important;
    border-color: var(--secondary) !important;
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    background: #8a7a45 !important;
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: var(--bg-dark);
    color: var(--primary-dark);
    border: 3px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
    color: var(--bg-dark);
    border-color: var(--primary-dark);
    transform: translate(-3px, -3px);
}

/* ========== CARDS VINTAGE ========== */
.card {
    background: var(--bg-primary);
    border: 3px solid var(--primary-dark);
    border-radius: var(--radius-sm);
    padding: 2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.card::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    border: 1px dashed var(--accent);
    opacity: 0.3;
    pointer-events: none;
}

.card::after {
    content: '✿';
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 2rem;
    color: var(--accent);
    opacity: 0.2;
    pointer-events: none;
}

.card:hover {
    transform: translate(-5px, -5px);
    box-shadow: 8px 8px 0px var(--text-muted);
    border-color: var(--primary);
}

.card:hover::before,
.card:hover::after {
    opacity: 0.5;
}

.card h3 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.5rem;
}

.card h4 {
    color: var(--text-primary);
    font-weight: bold;
    font-style: italic;
}

.card p {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ========== GRID SYSTEM ========== */
.grid {
    display: grid;
    gap: 2.5rem;
}

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

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ========== SECTIONS VINTAGE ========== */
section {
    padding: 6rem 0;
    position: relative;
    border-bottom: 2px dashed var(--accent);
}

section h1, section h2 {
    text-align: center;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: bold;
    margin-bottom: 1rem;
    color: var(--primary-dark);
    text-shadow: 3px 3px 0px var(--accent);
    position: relative;
    display: inline-block;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 3px;
}

section h2::after {
    content: '✦ ✦ ✦';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    color: var(--primary);
}

section h3 {
    color: var(--primary-dark);
    font-weight: bold;
    font-size: 1.75rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

section > p {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 700px;
    margin: 3rem auto 4rem;
    font-style: italic;
}

/* ========== TECHNOLOGY CARDS VINTAGE ========== */
.card i[class^="devicon"],
.card i[class*=" devicon"] {
    transition: transform 0.3s ease, filter 0.3s ease;
    display: block;
    filter: sepia(30%) drop-shadow(3px 3px 5px rgba(61, 50, 40, 0.3));
    transform: scale(1);
}

.card:hover i[class^="devicon"],
.card:hover i[class*=" devicon"] {
    transform: scale(1.1) rotate(-5deg);
    filter: sepia(50%) drop-shadow(5px 5px 8px rgba(61, 50, 40, 0.5));
}

@keyframes vintage-pulse {
    0%, 100% {
        transform: scale(1.1) rotate(-5deg);
    }
    50% {
        transform: scale(1.15) rotate(-3deg);
    }
}

/* ========== PROJECT CARDS VINTAGE ========== */
.project-card {
    position: relative;
    overflow: hidden;
    background: var(--bg-primary);
    border: 3px solid var(--primary-dark);
}

.project-card img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: var(--transition);
    filter: sepia(20%) brightness(0.9);
    border-bottom: 2px solid var(--accent);
}

.project-card:hover img {
    transform: scale(1.05);
    filter: sepia(40%) brightness(1);
}

.tech-tag {
    background: var(--primary-light);
    color: var(--bg-dark);
    padding: 0.4rem 1rem;
    border: 2px solid var(--primary-dark);
    font-size: 0.8rem;
    font-weight: bold;
    transition: var(--transition);
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: var(--shadow-sm);
}

.tech-tag:hover {
    background: var(--primary-dark);
    color: var(--bg-dark);
    transform: translate(-2px, -2px);
    box-shadow: 3px 3px 0px var(--text-muted);
}

/* ========== FORMS VINTAGE ========== */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

input,
textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    background: var(--bg-primary);
    border: 2px solid var(--primary-dark);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: inset 2px 2px 4px rgba(61, 50, 40, 0.1);
}

input:focus,
textarea:focus {
    outline: none;
    background: var(--bg-dark);
    border-color: var(--primary);
    box-shadow: 3px 3px 0px var(--accent);
    transform: translate(-2px, -2px);
}

textarea {
    min-height: 180px;
    resize: vertical;
}

/* ========== FOOTER VINTAGE ========== */
footer {
    background: var(--bg-secondary);
    border-top: 3px double var(--primary);
    padding: 3rem 0 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: repeating-linear-gradient(90deg, var(--primary), var(--primary) 10px, var(--accent) 10px, var(--accent) 20px);
}

footer p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

footer a {
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: bold;
    transition: var(--transition);
    position: relative;
    border-bottom: 2px dotted var(--primary);
}

footer a:hover {
    color: var(--primary);
    border-bottom-style: solid;
}

footer a::after {
    content: '';
    display: none;
}

/* ========== MESSAGES/ALERTS VINTAGE ========== */
.messages {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 2000;
    max-width: 400px;
}

.alert {
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
    border: 3px solid;
    animation: slideInRight 0.3s ease-out;
    box-shadow: var(--shadow-lg);
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-success {
    background: #c8e6c9;
    color: #2e7d32;
    border-color: #2e7d32;
}

.alert-error {
    background: #ffcdd2;
    color: #c62828;
    border-color: #c62828;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }
    
    nav .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav ul {
        gap: 1.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero {
        min-height: 80vh;
        text-align: center;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero h3 {
        font-size: 1.5rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    section {
        padding: 4rem 0;
    }
    
    section h2 {
        font-size: 2rem;
    }
    
    .btn {
        padding: 0.9rem 2rem;
        font-size: 0.95rem;
    }
}

/* ========== ANIMACIONES VINTAGE ========== */
@keyframes vintage-glow {
    0%, 100% {
        box-shadow: 3px 3px 8px rgba(61, 50, 40, 0.3);
    }
    50% {
        box-shadow: 5px 5px 12px rgba(61, 50, 40, 0.5);
    }
}

/* ========== UTILIDADES VINTAGE ========== */
.text-gradient {
    color: var(--primary-dark);
    text-shadow: 2px 2px 0px var(--accent);
}

.glow {
    animation: vintage-glow 2s ease-in-out infinite;
}

/* ========== BLOG IMAGES VINTAGE ========== */
.card img {
    transition: transform 0.3s ease;
    filter: sepia(20%);
    border: 3px solid var(--accent);
}

.card:hover img {
    transform: scale(1.03);
    filter: sepia(35%);
}

article.card img {
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

article.card:hover img {
    box-shadow: var(--shadow-lg);
    transform: scale(1.02);
}
