/* ============================================
   EDUARDO ARENAS - PORTFOLIO STYLES
   Cloud Infrastructure · DevSecOps · SRE
   ============================================ */

/* ---------- CSS VARIABLES ---------- */
:root {
    --bg: #0a0c10;
    --bg-soft: #111318;
    --bg-card: rgba(17, 19, 24, 0.82);
    --border: rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.1);

    --text: #e4e4e7;
    --muted: #71717a;
    --muted-2: #52525b;

    --primary: #5b9bd5;
    --primary-soft: rgba(91, 155, 213, 0.12);
    --primary-glow: rgba(91, 155, 213, 0.25);
    --accent: #4ade80;
    --warning: #d97706;

    --radius-xl: 20px;
    --radius-lg: 14px;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    --container: 1180px;

    --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

    --transition: 0.25s ease;
}

/* ---------- RESET & BASE ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    min-height: 100vh;
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
            linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
            linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.3), transparent 85%);
    z-index: -1;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
            radial-gradient(circle at 50% 0%, rgba(91, 155, 213, 0.04), transparent 60%),
            radial-gradient(circle at 80% 20%, rgba(91, 155, 213, 0.03), transparent 50%);
    z-index: -1;
}

a {
    color: inherit;
    text-decoration: none;
}

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

/* ---------- UTILITIES ---------- */
.container {
    width: min(100% - 40px, var(--container));
    margin-inline: auto;
}

.section {
    padding: 88px 0;
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* ---------- NAVBAR ---------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(10, 12, 16, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.nav-inner {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--primary);
    color: #0a0c10;
    font-weight: 800;
    font-size: 15px;
}

.brand-text {
    color: white;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.nav-link {
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: white;
}

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

.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: var(--transition);
}

/* ---------- BUTTONS ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: rgba(17, 19, 24, 0.7);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    letter-spacing: 0.01em;
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-1px);
    border-color: rgba(91, 155, 213, 0.4);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: var(--primary);
    border: 1px solid rgba(91, 155, 213, 0.5);
    color: #0a0c10;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(91, 155, 213, 0.15);
}

.btn-primary:hover {
    background: #6aa8dd;
    box-shadow: 0 12px 32px rgba(91, 155, 213, 0.2);
}

.btn-ghost {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.08);
}

.nav-cta {
    display: inline-flex;
}

/* ---------- BADGE ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: rgba(17, 19, 24, 0.7);
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.03em;
    backdrop-filter: blur(14px);
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

.dot-pulse {
    animation: pulse 2.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ---------- HERO ---------- */
.hero {
    padding: 96px 0 92px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 56px;
    align-items: center;
}

.hero-content h1 {
    margin-top: 24px;
    font-size: clamp(44px, 7.5vw, 84px);
    line-height: 0.94;
    letter-spacing: -0.07em;
}

.gradient-text {
    background: linear-gradient(135deg, #ffffff 0%, #a0c4e8 40%, #6b9cc8 70%, #d4d4d8 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.hero-copy {
    max-width: 680px;
    margin-top: 24px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.85;
    font-weight: 400;
}

.hero-copy strong {
    color: white;
    font-weight: 600;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 36px;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 46px;
}

.metric {
    padding: 20px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: rgba(17, 19, 24, 0.5);
}

.metric strong {
    display: block;
    font-size: 26px;
    letter-spacing: -0.04em;
    color: white;
}

.metric span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

/* ---------- TERMINAL ---------- */
.terminal-card {
    position: relative;
    padding: 20px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, #14161c 0%, #0d0f14 100%);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.terminal-top {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-dots {
    display: flex;
    gap: 7px;
}

.terminal-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal-dots span:nth-child(1) { background: #ef4444; }
.terminal-dots span:nth-child(2) { background: #d97706; }
.terminal-dots span:nth-child(3) { background: #4ade80; }

.terminal-title {
    color: var(--muted-2);
    font-size: 11px;
    font-family: var(--font-mono);
}

.terminal-body {
    position: relative;
    padding: 20px 0 0;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.9;
    color: #a1a1aa;
}

.terminal-line {
    opacity: 0;
    transform: translateX(-8px);
    transition: all 0.3s ease;
}

.terminal-line.visible {
    opacity: 1;
    transform: translateX(0);
}

.command { color: #7eb8da; }
.ok { color: #6ee7b7; }
.warn { color: #d4a853; }

.dashboard-grid {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.dash-card {
    min-height: 120px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    background: rgba(10, 12, 16, 0.6);
}

.dash-card small {
    display: block;
    color: var(--muted-2);
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.dash-card strong {
    display: block;
    margin-top: 10px;
    font-size: 24px;
    letter-spacing: -0.04em;
    color: white;
}

.bar {
    height: 6px;
    margin-top: 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
    width: 0;
    transition: width 1.5s ease;
}

.bar span.animated {
    /* width se setea inline en el HTML */;
}

/* ---------- SECTION HEAD ---------- */
.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 40px;
}

.section-kicker {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(91, 155, 213, 0.08);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    border: 1px solid rgba(91, 155, 213, 0.15);
}

.section-title {
    margin-top: 14px;
    font-size: clamp(30px, 5.5vw, 52px);
    line-height: 1.06;
    letter-spacing: -0.06em;
}

.section-desc {
    max-width: 540px;
    color: var(--muted);
    line-height: 1.8;
    font-size: 15px;
}

/* ---------- CARDS ---------- */
.cards-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: rgba(17, 19, 24, 0.7);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    padding: 26px;
    transition: transform var(--transition), border-color var(--transition);
}

.card:hover {
    transform: translateY(-3px);
    border-color: rgba(91, 155, 213, 0.25);
}

.card-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    border-radius: 12px;
    background: rgba(91, 155, 213, 0.1);
    color: var(--primary);
    font-size: 20px;
}

.card h3 {
    font-size: 20px;
    letter-spacing: -0.03em;
}

.card p {
    margin-top: 12px;
    color: var(--muted);
    line-height: 1.7;
    font-size: 14px;
}

/* ---------- PROBLEM → SOLUTION ---------- */
.problem-solution {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: start;
    margin-top: 18px;
    padding: 14px;
    border-radius: var(--radius-lg);
    background: rgba(10, 12, 16, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.ps-col {
    font-size: 12px;
    line-height: 1.7;
}

.ps-label {
    display: block;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 10px;
    margin-bottom: 4px;
}

.ps-label.problem { color: #d97706; }
.ps-label.solution { color: var(--accent); }

.ps-arrow {
    align-self: center;
    color: var(--muted-2);
    font-size: 18px;
}

/* ---------- TAGS ---------- */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 18px;
}

.tag {
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(91, 155, 213, 0.08);
    border: 1px solid rgba(91, 155, 213, 0.18);
    color: #b0cfe0;
    font-size: 11px;
    font-weight: 500;
}

/* ---------- IMPACT ---------- */
.impact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.impact-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: rgba(17, 19, 24, 0.5);
    padding: 26px;
    position: relative;
    overflow: hidden;
}

.impact-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    opacity: 0.6;
}

.impact-number {
    font-size: 44px;
    font-weight: 900;
    letter-spacing: -0.06em;
    color: rgba(91, 155, 213, 0.25);
}

.impact-card h3 {
    margin-top: 4px;
    font-size: 18px;
    letter-spacing: -0.02em;
}

.impact-card p {
    margin-top: 10px;
    color: var(--muted);
    line-height: 1.7;
    font-size: 14px;
}

.impact-result {
    display: inline-block;
    margin-top: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(74, 222, 128, 0.08);
    border: 1px solid rgba(74, 222, 128, 0.2);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
}

/* ---------- ARQUITECTURA ---------- */
.architecture-modern {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 16px;
    align-items: stretch;
}

.arch-diagram {
    position: relative;
    min-height: 480px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: rgba(10, 12, 16, 0.6);
    overflow: hidden;
    padding: 24px;
}

.arch-layer-wrapper {
    position: relative;
    padding-left: 70px;
    margin-bottom: 24px;
}

.arch-layer-label {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    color: var(--muted-2);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.arch-layer {
    position: relative;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.arch-box {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(17, 19, 24, 0.7);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    min-width: 90px;
    color: #d4d4d8;
}

.arch-box small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-weight: 400;
    font-size: 10px;
}

.arch-box.highlight {
    border-color: rgba(91, 155, 213, 0.35);
    background: rgba(91, 155, 213, 0.06);
}

.arch-arrows {
    display: flex;
    justify-content: center;
    color: var(--muted-2);
    font-size: 20px;
    margin: 4px 0;
}

.arch-arrow-inline {
    align-self: center;
    color: var(--muted-2);
}

.arch-intro {
    margin-top: 14px;
    color: var(--muted);
    line-height: 1.7;
    font-size: 14px;
}

.case-list-compact {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.case-item-compact {
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(10, 12, 16, 0.4);
    border-left: 2px solid var(--primary);
}

.case-item-compact strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.case-item-compact span {
    color: var(--muted);
    line-height: 1.6;
    font-size: 12px;
}

/* ---------- SKILLS ---------- */
.skills-modern {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.skill-group {
    padding: 22px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: rgba(17, 19, 24, 0.35);
}

.skill-group h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    margin-bottom: 14px;
    letter-spacing: -0.02em;
    font-size: 14px;
}

.skill-group ul {
    list-style: none;
    display: grid;
    gap: 8px;
}

.skill-group li {
    color: var(--muted);
    font-size: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.skill-group li::before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
}

/* ---------- CONTACTO ---------- */
.contact {
    text-align: center;
    padding: 68px 28px;
    border-radius: 24px;
    border: 1px solid var(--border-strong);
    background: rgba(17, 19, 24, 0.6);
    box-shadow: var(--shadow);
}

.contact h2 {
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1.06;
    letter-spacing: -0.05em;
    margin-top: 16px;
}

.contact p {
    max-width: 680px;
    margin: 20px auto 0;
    color: var(--muted);
    line-height: 1.8;
    font-size: 16px;
}

.contact-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
}

/* ---------- FOOTER ---------- */
footer {
    padding: 44px 0 60px;
    color: var(--muted-2);
    font-size: 13px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-grid nav {
    display: flex;
    gap: 20px;
}

.footer-grid nav a {
    color: var(--muted);
    font-size: 12px;
    transition: color 0.2s;
}

.footer-grid nav a:hover {
    color: white;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
    .cards-3,
    .impact-grid,
    .skills-modern {
        grid-template-columns: repeat(2, 1fr);
    }
    .architecture-modern {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 44px;
    }
    .hero h1 {
        font-size: clamp(36px, 10vw, 58px);
    }
    .section-head {
        display: block;
    }
    .section-desc {
        margin-top: 16px;
    }
    .nav-links {
        display: none;
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        background: rgba(10, 12, 16, 0.95);
        backdrop-filter: blur(24px);
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid var(--border);
    }
    .nav-links.active {
        display: flex;
    }
    .nav-cta {
        display: none;
    }
    .mobile-toggle {
        display: flex;
    }
    .hero-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
    .cards-3,
    .impact-grid,
    .skills-modern {
        grid-template-columns: 1fr;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .problem-solution {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .problem-solution .ps-arrow {
        transform: rotate(90deg);
        justify-self: center;
    }
}

@media (max-width: 480px) {
    .container {
        width: min(100% - 24px, var(--container));
    }
    .hero {
        padding-top: 56px;
    }
    .hero-metrics {
        grid-template-columns: 1fr;
    }
    .terminal-body {
        font-size: 13px;
        line-height: 1.7;
    }
}