:root {
    --green-main: #33ff33;
    --green-soft: rgba(51, 255, 51, 0.6);

    --bg-main: #000;
    --bg-alt: #0d0d0d;
    --bg-card: #111;

    --text-main: #f8f9fa;
    --text-muted: #b5b5b5;

    --border-soft: rgba(255,255,255,0.08);
}

body {
    background: var(--bg-main);
    color: var(--text-main);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding-top: 56px;
    line-height: 1.6;
}

@media (max-width: 991.98px) {
  body {
    padding-top: 0;
  }

  .navbar {
    position: static;
  }

  .navbar-collapse {
    padding-bottom: 0.5rem;
  }
}

/* NAV */
.navbar {
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border-soft);
}

.navbar-brand {
    color: var(--green-main) !important;
    font-weight: 700;
}

.nav-link {
    color: var(--text-muted) !important;
}

.nav-link:hover {
    color: var(--green-main) !important;
}

/* HERO */
.profile-img {
    max-width: 220px;
    border-radius: 50%;
    border: 2px solid var(--green-soft);
}

/* TERMINAL */
.terminal-header {
    background: var(--bg-alt);
    padding: 10px;
    border-radius: 10px 10px 0 0;
}

.terminal-title {
    margin-left: 10px;
    font-family: 'Courier New', monospace;
    color: var(--text-muted);
}

.terminal-body {
    background: var(--bg-alt);
    padding: 30px;
    border-radius: 0 0 10px 10px;
    border: 1px solid var(--border-soft);
}

/* CURSOR DOS */
.typewriter h1::after {
    content: '_';
    margin-left: 4px;
    animation: blink 1s steps(1,end) infinite;
}

@keyframes blink {
    0%,100% { opacity:1 }
    50% { opacity:0 }
}

/* LINKS */
a {
    color: var(--green-main);
    text-decoration: none;
}

a:hover {
    color: var(--green-soft);
    text-decoration: underline;
}

/* SECTION TITLES */
section h2 {
    font-family: 'Courier New', monospace;
    color: var(--green-main);
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-bottom: 25px;

    overflow: hidden;
    white-space: nowrap;
    width: 0;
    animation: typing 1.8s steps(30,end) forwards;
}

@keyframes typing {
    from { width:0 }
    to { width:100% }
}

/* CARDS */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
}

/* EXPERIENCE */
#experiencia h4 {
    font-weight: 600;
    font-size: 1.05rem;
}

#experiencia h4 span {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.experience-logo {
    width: 80px;
    height: 80px;
    min-width: 80px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
}

.experience-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.85;
}

.experience-stack {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* SOCIAL */
.social-links .btn {
    border: 1px solid var(--green-soft);
    color: var(--green-main);
    margin-right: 6px;
}

.social-links .btn:hover {
    background: var(--green-main);
    color: #000;
}

/* CONTACT */
.feature {
    width: 2.6rem;
    height: 2.6rem;
    border: 1px solid var(--green-soft);
    color: var(--green-main);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* SECTIONS */
section {
    padding: 90px 0;
}

.bg-light {
    background: var(--bg-alt) !important;
}

/* Nombre en el hero */
.terminal-body h1 {
    color: var(--green-main);
}

/* Cursor DOS para títulos de sección */
section h2::after {
    content: '_';
    margin-left: 6px;
    animation: blink-section-cursor 1s steps(1, end) infinite;
}

/* Blink del cursor */
@keyframes blink-section-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.experience-logo.freelance img {
    /* Neutral (grey) variant for the freelance logo */
    /* Invert helps a dark logo read on dark cards */
    filter: invert(78%) grayscale(100%) contrast(1.1) brightness(1.05);
    opacity: 0.95;
}

/* Animación arcade */
@keyframes arcadeBlink {
  0%   { opacity: 1; }
  50%  { opacity: 0; }
  100% { opacity: 1; }
}

.cert-provider {
    color: #d0d0d0; /* más visible que text-muted */
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.cert-link {
    font-family: 'Courier New', monospace;
    color: var(--green-main);
    text-decoration: none;
    font-size: 0.85rem;
}

.cert-link:hover {
    text-decoration: underline;
}

/* ARCA-MCP: diagrama compacto, visual y legible */
.arca-flow {
    overflow: hidden;
    border: 1px solid rgba(51, 255, 51, 0.22);
    border-radius: 10px;
    background: #070a08;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(112px, 0.8fr) auto minmax(0, 1fr);
    gap: 0.65rem;
    align-items: center;
    padding: 1.35rem;
    min-height: 205px;
    background-image: radial-gradient(rgba(51, 255, 51, 0.08) 0.7px, transparent 0.7px);
    background-size: 13px 13px;
}

.arca-node {
    min-width: 0;
    padding: 0.75rem;
    border: 1px solid rgba(51, 255, 51, 0.35);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.62);
    color: #d7d7d7;
    font-family: 'Courier New', monospace;
    font-size: 0.66rem;
    line-height: 1.45;
}

.arca-node > div + div {
    margin-top: 0.45rem;
}

.arca-node i {
    width: 1rem;
    color: var(--green-main);
}

.arca-node-title,
.arca-node-core strong,
.arca-node-core span {
    display: block;
}

.arca-node-title {
    margin-bottom: 0.55rem;
    color: var(--green-main);
    font-weight: 700;
}

.arca-node-core {
    padding: 1rem 0.7rem;
    text-align: center;
    border-color: var(--green-soft);
}

.arca-node-core strong {
    margin-bottom: 0.4rem;
    color: var(--green-main);
    font-size: 0.84rem;
}

.arca-node-core span {
    color: var(--text-muted);
}

.arca-node-services div {
    padding-left: 0.55rem;
    position: relative;
}

.arca-node-services div::before {
    content: '·';
    position: absolute;
    left: 0;
    color: var(--green-main);
}

.arca-arrow {
    color: var(--green-main);
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
}

@media (max-width: 575.98px) {
    .arca-flow {
        grid-template-columns: 1fr;
        gap: 0.55rem;
        padding: 1rem;
        min-height: auto;
    }

    .arca-arrow {
        justify-self: center;
        transform: rotate(90deg);
    }

    .arca-node {
        font-size: 0.68rem;
    }
}


/* Mobile layout: keep the hero, navigation and project cards inside the viewport. */
@media (max-width: 767.98px) {
    #hero {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    #hero .container.px-5,
    section .container.px-5 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    #hero .row {
        --bs-gutter-x: 0;
        row-gap: 1.25rem;
    }

    .profile-img {
        width: min(220px, 70vw);
        height: auto;
    }

    .terminal-body {
        min-width: 0;
        overflow: hidden;
        padding: 1.25rem;
    }

    .terminal-body h1 {
        font-size: clamp(1.65rem, 8vw, 2rem);
        overflow-wrap: anywhere;
    }

    .terminal-body .lead {
        font-size: 1.15rem;
    }

    .social-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .social-links .btn {
        width: 100%;
        min-width: 0;
        margin: 0;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        white-space: normal;
    }

    section h2 {
        width: 100%;
        white-space: normal;
        animation: none;
    }

    #proyectos .card-body {
        padding: 1rem;
    }
}
