/* Variables y Tema General */
:root {
    --bg-dark: #050814;
    --primary-cyan: #00f0ff;
    --primary-purple: #7000ff;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --front-color: #00d4ff;
    --back-color: #10b981;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Canvas */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    background: radial-gradient(circle at center, #11142b 0%, #050814 100%);
}

#bg-canvas {
    width: 100%;
    height: 100%;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2.5rem;
    background: linear-gradient(90deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.highlight {
    color: var(--primary-cyan);
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 2rem;
}

/* Glassmorphism Utilities */
.glass-nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(5, 8, 20, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    transition: all 0.3s ease;
}

.glass-nav.scrolled {
    padding: 1rem 5%;
    background: rgba(5, 8, 20, 0.85);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

/* Navigation */
.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-cyan);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: 0 20px;
}

.hero-content {
    max-width: 800px;
    z-index: 2;
}

.glitch {
    font-size: 5vw;
    font-weight: 800;
    position: relative;
    text-shadow: 0.05em 0 0 rgba(255,0,0,0.75),
                -0.025em -0.05em 0 rgba(0,255,0,0.75),
                0.025em 0.05em 0 rgba(0,0,255,0.75);
    animation: glitch 2500ms infinite;
}

@keyframes glitch {
    0% { text-shadow: 0.05em 0 0 rgba(255,0,0,0.75), -0.05em -0.025em 0 rgba(0,255,0,0.75), -0.025em 0.05em 0 rgba(0,0,255,0.75); }
    14% { text-shadow: 0.05em 0 0 rgba(255,0,0,0.75), -0.05em -0.025em 0 rgba(0,255,0,0.75), -0.025em 0.05em 0 rgba(0,0,255,0.75); }
    15% { text-shadow: -0.05em -0.025em 0 rgba(255,0,0,0.75), 0.025em 0.025em 0 rgba(0,255,0,0.75), -0.05em -0.05em 0 rgba(0,0,255,0.75); }
    49% { text-shadow: -0.05em -0.025em 0 rgba(255,0,0,0.75), 0.025em 0.025em 0 rgba(0,255,0,0.75), -0.05em -0.05em 0 rgba(0,0,255,0.75); }
    50% { text-shadow: 0.025em 0.05em 0 rgba(255,0,0,0.75), 0.05em 0 0 rgba(0,255,0,0.75), 0 -0.05em 0 rgba(0,0,255,0.75); }
    99% { text-shadow: 0.025em 0.05em 0 rgba(255,0,0,0.75), 0.05em 0 0 rgba(0,255,0,0.75), 0 -0.05em 0 rgba(0,0,255,0.75); }
    100% { text-shadow: -0.025em 0 0 rgba(255,0,0,0.75), -0.025em -0.025em 0 rgba(0,255,0,0.75), -0.025em -0.05em 0 rgba(0,0,255,0.75); }
}

.hero p.subtitle {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.cta-btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: linear-gradient(45deg, var(--primary-purple), var(--primary-cyan));
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(0, 240, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(0, 240, 255, 0.4);
}

/* Sections */
.section {
    padding: 100px 5%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    margin-bottom: 3rem;
}

.tag {
    display: inline-block;
    padding: 0.3rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary-cyan);
    margin-bottom: 1rem;
}

/* Layouts */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.text-content p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.rounded-img {
    width: 100%;
    border-radius: 15px;
    border: 1px solid var(--glass-border);
}

.floating-img {
    animation: float 6s ease-in-out infinite;
}

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

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-card {
    padding: 2.5rem;
}

.frontend-theme:hover { border-color: var(--front-color); }
.backend-theme:hover { border-color: var(--back-color); }

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.frontend-theme .card-icon { color: var(--front-color); }
.backend-theme .card-icon { color: var(--back-color); }

.skill-list {
    list-style: none;
}

.skill-list li {
    margin-bottom: 1.5rem;
}

.skill-name {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    border-radius: 4px;
    transition: width 1.5s ease-out;
}

.frontend-theme .progress { background: linear-gradient(90deg, #0052d4, var(--front-color)); }
.backend-theme .progress { background: linear-gradient(90deg, #11998e, var(--back-color)); }

/* Blog Posts */
.blog-posts {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.post-card {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    padding: 2rem;
    align-items: center;
}

.post-card.reverse {
    grid-template-columns: 1.5fr 1fr;
}

.post-card.reverse .post-img-wrapper {
    order: 2;
}

.post-img-wrapper {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    height: 100%;
    min-height: 250px;
}

.post-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-img-wrapper img {
    transform: scale(1.05);
}

.post-category {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
}

.frontend-bg { background: var(--front-color); color: #000; }
.backend-bg { background: var(--back-color); color: #000; }

.frontend-text { color: var(--front-color); }
.backend-text { color: var(--back-color); }

.post-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.post-content p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.read-more {
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Code Tabs */
.code-tabs {
    background: rgba(0,0,0,0.3);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.tab-buttons {
    display: flex;
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid var(--glass-border);
}

.tab-btn {
    padding: 1rem 2rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: rgba(255,255,255,0.1);
    color: var(--text-main);
    border-bottom: 2px solid var(--primary-cyan);
}

.tab-content {
    display: none;
    padding: 0;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.code-header {
    background: #1a1a1a;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #333;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.filename {
    margin-left: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #888;
}

pre[class*="language-"] {
    margin: 0 !important;
    border-radius: 0 0 15px 15px !important;
    background: transparent !important;
}

/* Mockups */
.mockup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.mockup-item {
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    text-align: center;
}

.mockup-item img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 1rem;
}

/* Resources */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.resource-card {
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.hover-glow:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 240, 255, 0.1);
    border-color: rgba(0, 240, 255, 0.3);
}

.resource-icon {
    font-size: 2.5rem;
    color: var(--primary-purple);
}

.resource-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-grow: 1;
}

.resource-type {
    align-self: flex-start;
    font-size: 0.75rem;
    padding: 0.2rem 0.8rem;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Footer */
.glass-footer {
    padding: 2rem 5%;
    border-top: 1px solid var(--glass-border);
    background: rgba(5, 8, 20, 0.8);
    backdrop-filter: blur(10px);
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

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

.fade-in-up {
    animation: fadeInUp 1s ease-out forwards;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive */
@media (max-width: 900px) {
    .content-grid, .post-card, .post-card.reverse, .mockup-grid {
        grid-template-columns: 1fr;
    }
    .post-card.reverse .post-img-wrapper {
        order: 0;
    }
    h2 { font-size: 2rem; }
    .glitch { font-size: 3rem; }
    .nav-links { display: none; } /* Mobile menu needed for production */
}
