/* --- Variables & Reset --- */
:root {
    /* SysAdmin Palette */
    --bg-body: #0f172a;
    /* Slate 900 */
    --bg-card: #1e293b;
    /* Slate 800 */
    --bg-terminal: #020617;
    /* Slate 950 */

    --text-main: #f8fafc;
    /* Slate 50 */
    --text-muted: #94a3b8;
    /* Slate 400 */

    --accent-primary: #3b82f6;
    /* Electric Blue */
    --accent-success: #22c55e;
    /* Green 500 */
    --accent-warning: #eab308;
    /* Yellow 500 */
    --accent-danger: #ef4444;
    /* Red 500 */

    --font-heading: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --border-color: #334155;
    --shadow-glow: 0 0 15px rgba(59, 130, 246, 0.15);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-heading);
    line-height: 1.6;
}

/* --- Typography --- */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-main);
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: all 0.2s;
}

a:hover {
    color: var(--accent-success);
}

code,
.mono {
    font-family: var(--font-mono);
}

/* --- Utilities --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 80px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.text-muted {
    color: var(--text-muted);
}

/* --- Navbar --- */
.navbar {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

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

.nav-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-primary);
}

/* --- Hero Section (Terminal Interface) --- */
.hero {
    padding: 100px 0 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-visual {
    position: relative;
    margin-bottom: 2rem;
}

.logo-img {
    width: 140px;
    border-radius: 50%;
    border: 3px solid var(--accent-primary);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-family: var(--font-mono);
    color: var(--accent-primary);
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

.terminal-prompt {
    display: inline-block;
    background: var(--bg-terminal);
    padding: 1rem 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-family: var(--font-mono);
    color: var(--text-muted);
    box-shadow: var(--shadow-glow);
}

.cmd {
    color: var(--accent-success);
    margin-right: 0.5rem;
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background: var(--accent-success);
    vertical-align: middle;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

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

.bento-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    transition: transform 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.bento-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.bento-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bento-card h3::before {
    content: '//';
    color: var(--accent-primary);
    font-family: var(--font-mono);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.skill-tag:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* --- Projects (System Logs) --- */
.system-logs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.log-card {
    background: var(--bg-terminal);
    border-left: 4px solid var(--accent-primary);
    padding: 1.5rem;
    font-family: var(--font-mono);
    position: relative;
}

.log-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.log-title {
    color: var(--accent-success);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.log-entry {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: flex;
}

.log-entry .label {
    min-width: 100px;
    color: var(--accent-primary);
}

.log-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.log-link:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* --- Education (Kernel Boot Log) --- */
.boot-log {
    background: var(--bg-terminal);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-family: var(--font-mono);
    max-width: 800px;
    margin: 0 auto;
}

.boot-entry {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: baseline;
}

.timestamp {
    color: var(--text-muted);
    min-width: 140px;
}

.status-ok {
    color: var(--accent-success);
    font-weight: bold;
}

.boot-message {
    color: var(--text-main);
    flex: 1;
}

/* --- Footer --- */
footer {
    padding: 4rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

.social-btns {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn-terminal {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 0.8rem 1.5rem;
    font-family: var(--font-mono);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-terminal:hover {
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
    text-decoration: none;
}


/* --- Education Pipeline (Visual Diagram) --- */
.pipeline-container {
    padding: 2rem 0;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

/* Vertical line connecting everything */
.pipeline-container::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 2rem;
    /* Aligned with nodes */
    width: 4px;
    background: var(--border-color);
    z-index: 0;
}

.pipeline-node {
    position: relative;
    margin-bottom: 3rem;
    padding-left: 5rem;
    /* Space for the line/node */
    z-index: 1;
}

.pipeline-node:last-child {
    margin-bottom: 0;
}

/* The circular node */
.pipeline-marker {
    position: absolute;
    left: 1.1rem;
    /* Center connecting line (2rem) - half width (1.8rem/2) ? No, needs manual tune */
    left: 1.15rem;
    top: 0;
    width: 2rem;
    height: 2rem;
    background: var(--bg-body);
    border: 3px solid var(--text-muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 2;
}

/* Status Colors for Markers */
.status-completed .pipeline-marker {
    border-color: var(--accent-success);
    background: var(--bg-body);
    color: var(--accent-success);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.2);
}

.status-current .pipeline-marker {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
    animation: pulse 2s infinite;
}

.pipeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    transition: transform 0.2s;
}

.pipeline-content::before {
    /* Arrow pointing to node */
    content: '';
    position: absolute;
    left: -10px;
    top: 1rem;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid var(--border-color);
}

.pipeline-content:hover {
    transform: translateX(5px);
    border-color: var(--accent-primary);
}

.pipeline-content:hover::before {
    border-right-color: var(--accent-primary);
}

.pipeline-title {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pipeline-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    font-family: var(--font-mono);
    text-transform: uppercase;
}

.badge-completed {
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent-success);
    border: 1px solid var(--accent-success);
}

.badge-loading {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
}

.pipeline-date {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: block;
}

/* Branching for Certs */
.cert-branch {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
}

.cert-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.cert-icon {
    color: var(--accent-warning);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 0;
    }

    .nav-links {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        justify-content: flex-start;
        padding: 0.5rem 0 1rem 0;
        /* extra padding for scrollbar */
        gap: 1.5rem;
        -webkit-overflow-scrolling: touch;
    }

    /* Custom scrollbar for nav links - sysadmin thematic */
    .nav-links::-webkit-scrollbar {
        height: 4px;
    }

    .nav-links::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 4px;
    }

    .nav-links::-webkit-scrollbar-thumb {
        background: var(--accent-primary);
        border-radius: 4px;
    }

    .hero {
        padding: 60px 0 40px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .terminal-prompt {
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
    }

    .section {
        padding: 60px 0;
    }

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

    .boot-entry {
        flex-direction: column;
        gap: 0.2rem;
    }

    .pipeline-container::before {
        left: 1rem;
    }

    .pipeline-node {
        padding-left: 3.5rem;
        margin-bottom: 2rem;
    }

    .pipeline-marker {
        left: 0;
        width: 1.7rem;
        height: 1.7rem;
    }

    .pipeline-content {
        padding: 1.2rem;
    }

    .pipeline-content::before {
        left: -8px;
        top: 1.2rem;
        border-right: 8px solid var(--border-color);
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
    }

    .pipeline-content:hover::before {
        border-right-color: var(--accent-primary);
    }

    .log-card {
        padding: 1.2rem;
    }

    .log-entry {
        flex-direction: column;
    }

    .log-entry .label {
        margin-bottom: 0.2rem;
    }

    .social-btns {
        flex-wrap: wrap;
    }

    .btn-terminal {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero-visual {
        margin-bottom: 1.5rem;
    }

    .logo-img {
        width: 100px;
    }

    .terminal-prompt {
        font-size: 0.75rem;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 2rem !important;
    }

    .pipeline-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Make embedded Credly badge responsive without forcing limits */
    .bento-card [data-iframe-width] {
        transform: scale(0.9);
        transform-origin: center top;
    }
}

/* --- Language Toggle --- */
.lang-en {
    display: none;
}

.lang-es {
    display: inline;
}

body.english-mode .lang-en {
    display: inline;
}

body.english-mode .lang-es {
    display: none;
}