/* ==========================================================================
   CSS SYSTEM DESIGN - PORTFOLIO GIANSL.DEV
   ========================================================================== */

/* 1. Global Custom Properties (Design Tokens) */
:root {
    /* Color Palette - Premium HSL Dark Mode */
    --bg-deep: hsl(222, 47%, 6%);       /* Fondo profundo */
    --bg-surface: hsl(222, 40%, 10%);   /* Superficie de tarjetas/componentes */
    --bg-surface-hover: hsl(222, 35%, 15%);
    --bg-glass: rgba(15, 23, 42, 0.7);   /* Backdrop blur */
    
    /* Accents & Status */
    --color-indigo: hsl(239, 84%, 67%);
    --color-violet: hsl(271, 91%, 65%);
    --color-emerald: hsl(150, 84%, 37%);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--color-indigo) 0%, var(--color-violet) 100%);
    --gradient-emerald: linear-gradient(135deg, hsl(150, 84%, 37%) 0%, hsl(160, 84%, 45%) 100%);
    
    /* Borders & Outlines */
    --border-light: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(99, 102, 241, 0.2);
    
    /* Typography */
    --text-primary: hsl(210, 40%, 98%);
    --text-secondary: hsl(215, 20%, 75%);
    --text-muted: hsl(215, 15%, 55%);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;
    
    /* Animation & Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 2. Base Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--bg-deep);
    color: var(--text-primary);
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Typography elements */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

p {
    color: var(--text-secondary);
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-smooth);
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* 3. Button Component Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.6rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-spring);
    border: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--bg-surface-hover);
    border-color: var(--color-indigo);
    transform: translateY(-3px);
}

.btn-secondary-small {
    padding: 0.5rem 1.2rem;
    font-size: 0.875rem;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-weight: 500;
}

.btn-secondary-small:hover {
    background: var(--gradient-primary);
    color: #fff;
    border-color: transparent;
}

.btn-block {
    display: width;
    width: 100%;
}

/* 4. Header & Navigation (Glassmorphic) */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition-smooth);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.logo-accent {
    color: var(--color-indigo);
}

.nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

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

/* Mobile Nav Toggle */
.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1100;
}

.mobile-nav-toggle .bar {
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    transition: var(--transition-smooth);
}

/* 5. Hero Section Styling */
.hero {
    padding-top: 180px;
    padding-bottom: 80px;
    background-image: 
        radial-gradient(ellipse at 50% -20%, rgba(99, 102, 241, 0.15), transparent 70%),
        radial-gradient(circle at 10% 40%, rgba(168, 85, 247, 0.05), transparent 40%);
}

.hero-container {
    display: flex;
    justify-content: center;
    text-align: center;
}

.hero-content {
    max-width: 850px;
}

.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-indigo);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 50px;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4.2rem);
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-weight: 400;
    line-height: 1.5;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* 6. Quick Stats Section */
.stats {
    padding: 40px 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    background: rgba(15, 23, 42, 0.3);
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.stat-card:hover {
    border-color: var(--border-glow);
    transform: translateY(-2px);
}

.stat-number {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 3vw, 3rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.stat-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
}

.stat-indicator.esmeralda {
    background: var(--color-emerald);
}

.stat-indicator.indigo {
    background: var(--color-indigo);
}

.stat-indicator.violeta {
    background: var(--color-violet);
}

/* 7. Case Studies Section (STAR Tabbed Panel) */
.projects {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.projects-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.tab-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 1rem 2rem;
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    text-align: left;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.tab-btn .tab-meta {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.tab-btn.active {
    background: var(--bg-surface-hover);
    border-color: var(--color-indigo);
    color: var(--text-primary);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
}

.tab-btn.active .tab-meta {
    color: var(--color-indigo);
}

/* Project Panels */
.project-panel {
    display: none;
    animation: fadeIn 0.5s ease;
}

.project-panel.active {
    display: block;
}

.project-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 3rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    color: var(--text-secondary);
    font-weight: 500;
}

.project-panel-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    line-height: 1.25;
}

.project-description {
    font-size: 1.05rem;
    margin-bottom: 2rem;
}

/* STAR Timeline Node layout */
.star-structure {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    border-left: 2px solid var(--border-light);
    padding-left: 1.5rem;
    margin-left: 0.5rem;
}

.star-node {
    position: relative;
}

.star-badge {
    position: absolute;
    left: -2.35rem;
    top: 0.2rem;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.8rem;
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.badge-situation { background: hsl(350, 75%, 50%); }
.badge-task { background: hsl(35, 85%, 50%); }
.badge-action { background: var(--color-indigo); }
.badge-result { background: var(--color-emerald); }

.star-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.star-text strong {
    color: var(--text-primary);
}

/* Visual Mockup column */
.project-visual {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    justify-content: center;
}

.metric-highlight {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.metric-num {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
}

.text-emerald { color: var(--color-emerald); }
.text-indigo { color: var(--color-indigo); }
.text-violet { color: var(--color-violet); }

.metric-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Mockup Terminal */
.visual-mockup {
    background: #050811;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.mockup-header {
    height: 32px;
    background: #0d1324;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.mockup-header .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff5f56;
}

.mockup-header .dot:nth-child(2) { background: #ffbd2e; }
.mockup-header .dot:nth-child(3) { background: #27c93f; }

.mockup-url {
    margin-left: 1rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.code-editor {
    padding: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #cbd5e1;
    overflow-x: auto;
}

.code-keyword { color: #f472b6; }
.code-class { color: #60a5fa; }
.code-comment { color: #64748b; font-style: italic; }
.code-str { color: #34d399; }
.code-key { color: #818cf8; }

/* 8. Tech Stack Habilidades Section */
.habilidades {
    padding: 100px 0;
    background: rgba(15, 23, 42, 0.2);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

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

.skill-category {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    transition: var(--transition-spring);
}

.skill-category:hover {
    border-color: var(--border-glow);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.05);
}

.category-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-light);
}

.category-icon.text-indigo { color: var(--color-indigo); }
.category-icon.text-emerald { color: var(--color-emerald); }
.category-icon.text-violet { color: var(--color-violet); }

.category-title {
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
}

.category-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    min-height: 45px;
}

.skill-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.skill-name {
    font-size: 0.95rem;
    font-weight: 500;
}

.skill-level {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tag-advanced {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-emerald);
}

.tag-intermediate {
    background: rgba(99, 102, 241, 0.1);
    color: var(--color-indigo);
}

.tag-proven {
    background: rgba(168, 85, 247, 0.1);
    color: var(--color-violet);
}

.tag-learning {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

/* 9. Sobre Mí Section */
.sobre-mi {
    padding: 100px 0;
}

.sobre-mi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.sobre-mi-text .section-title {
    text-align: left;
    margin-bottom: 1.5rem;
}

.sobre-mi-text p {
    margin-bottom: 1.25rem;
    font-size: 1rem;
}

.sobre-mi-text .lead-text {
    font-size: 1.2rem;
    color: var(--text-primary);
    font-weight: 500;
}

.profile-card-mockup {
    background: #050811;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.profile-card-header {
    height: 40px;
    background: #0d1324;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.profile-card-header .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.profile-card-header .dot.red { background: #ff5f56; }
.profile-card-header .dot.yellow { background: #ffbd2e; }
.profile-card-header .dot.green { background: #27c93f; }

.terminal-title {
    margin-left: 1rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.profile-card-body {
    padding: 2rem;
}

/* 10. Contact Section */
.contacto {
    padding: 100px 0;
    background-image: radial-gradient(circle at 90% 80%, rgba(99, 102, 241, 0.08), transparent 50%);
}

.contacto-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 4rem;
    align-items: center;
}

.contacto-lead {
    font-size: 1.15rem;
    margin-top: 1.5rem;
    margin-bottom: 2.5rem;
}

.contacto-links {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.contacto-link-item {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.05rem;
    color: var(--text-secondary);
}

.contacto-link-item:hover {
    color: var(--text-primary);
}

.link-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-indigo);
}

/* Form Styling */
.contacto-form-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 3rem;
}

.contacto-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    background: var(--bg-deep);
    border: 1px solid var(--border-light);
    padding: 0.85rem;
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--color-indigo);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

.form-status {
    font-size: 0.9rem;
    text-align: center;
    margin-top: 0.5rem;
}

.form-status.success {
    color: var(--color-emerald);
}

.form-status.error {
    color: #ff5f56;
}

/* 11. Footer */
.footer {
    border-top: 1px solid var(--border-light);
    padding: 40px 0;
    background: #070a12;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

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

/* Scroll Reveal base styles */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Keyframes */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 1s ease forwards;
}

/* Delay for Hero items load */
.hero-content .badge { animation-delay: 0.1s; }
.hero-content .hero-title { animation-delay: 0.2s; }
.hero-content .hero-subtitle { animation-delay: 0.3s; }
.hero-content .hero-actions { animation-delay: 0.4s; }

/* 12. Responsive Adjustments */
@media (max-width: 1024px) {
    .project-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem;
    }
    
    .sobre-mi-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .contacto-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    /* Responsive Navigation */
    .mobile-nav-toggle {
        display: flex;
    }
    
    .nav {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--bg-deep);
        z-index: 999;
        transition: var(--transition-smooth);
        border-top: 1px solid var(--border-light);
    }
    
    .nav.active {
        left: 0;
    }
    
    .nav-list {
        flex-direction: column;
        justify-content: center;
        height: 100%;
        gap: 3rem;
        padding: 2rem;
    }
    
    .nav-link {
        font-size: 1.25rem;
    }
    
    /* Stats grid */
    .stats-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Skills grid */
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .projects-tabs {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .tab-btn {
        width: 100%;
        text-align: center;
    }
    
    .footer-container {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .mobile-nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .mobile-nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}
