:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #06b6d4;
    --accent: #ec4899;
    --bg-dark: #0f0f1e;
    --bg-light: #1a1a2e;
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --border: #2d3748;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* GRADIENT BACKGROUND */
.gradient-bg {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -2;
    background:
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.12), transparent),
        radial-gradient(circle at 80% 30%, rgba(6, 182, 212, 0.08), transparent),
        radial-gradient(circle at 50% 100%, rgba(236, 72, 153, 0.04), transparent),
        var(--bg-dark);
}

/* CANVAS 3D */
#three-canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    display: block;
}

/* HEADER/NAV */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(15, 15, 30, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem 2rem;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--primary);
}

/* HERO */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-direction: column;
    position: relative;
    padding-top: 80px;
}

.hero-content {
    max-width: 900px;
    z-index: 1;
    flex-direction: column;
}

.hero-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
}

.hero-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    margin: 0 auto 1.2rem;
    display: block;
}

@media (min-width: 900px) {
    .hero-content {
        display: flex;
        align-items: center;
        gap: 2rem;
        text-align: left;
    }

    .hero-avatar {
        margin: 0;
        flex-shrink: 0;
    }
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero h1 span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
    font-weight: 400;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.2rem;
}

.tech-badge {
    padding: 0.35rem 0.9rem;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--primary);
}

.cta-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta {
    padding: 12px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.cta-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.28);
}

.cta-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.cta-secondary:hover {
    background: rgba(99, 102, 241, 0.08);
    transform: translateY(-2px);
}

/* SECTIONS */
.section {
    padding: 120px 20px;
    max-width: 1000px;
    margin: 0 auto;
}

h2 {
    font-size: clamp(1.8rem, 5vw, 3rem);
    margin-bottom: 1rem;
    font-weight: 700;
}

h2 span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 2rem;
    max-width: 680px;
}

/* GRID */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card {
    padding: 1.6rem;
    background: rgba(26, 26, 46, 0.4);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
    transition: left 0.3s;
}

.card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.08);
}

.card:hover::before {
    left: 100%;
}

.card-title {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.card-company {
    color: var(--primary);
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}

.card-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* PROJECT THUMBNAILS */
.project-thumb {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    margin-bottom: 1rem;
}

/* SKILLS */
.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.skill-tag {
    padding: 0.5rem 1.2rem;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid var(--primary);
    border-radius: 20px;
    color: var(--primary);
    font-size: 0.9rem;
}

/* CONTACT SECTION */
.contact-section {
    text-align: center;
}

.contact-email {
    font-size: 1.3rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
    margin: 1.5rem 0;
}

.contact-email:hover {
    transform: scale(1.03);
}

.social-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.social-link {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
}

.social-link svg {
    width: 20px;
    height: 20px;
    display: block;
}

.social-link:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-3px);
}

/* FOOTER */
footer {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}

/* FORMULARIO DE CONTACTO */
.contacto__container {
    display: flex;
    justify-content: center;
    flex-direction: column;
}

.contact-form {
    width: 80%;
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group input,
.form-group textarea {
    padding: 0.9rem 1.2rem;
    background: rgba(26, 26, 46, 0.4);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-secondary);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.contact-form button {
    align-self: center;
    margin-top: 0.5rem;
}

.contact-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* TOAST */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    z-index: 1000;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px) translateX(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0) translateX(0);
    pointer-events: auto;
}

.toast-success {
    background: rgba(34, 197, 94, 0.9);
    color: white;
}

.toast-error {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}