/* =====================================================
   Elvis Segovia — Portfolio v2 (tech / terminal theme)
   ===================================================== */

:root {
    --bg:        #0b0f17;
    --bg-soft:   #0f1623;
    --panel:     rgba(20, 27, 41, 0.72);
    --panel-2:   rgba(28, 36, 54, 0.55);
    --border:    rgba(120, 200, 255, 0.14);
    --border-2:  rgba(120, 200, 255, 0.28);

    --text:      #e6edf3;
    --muted:     #8b97a8;
    --dim:       #5b6577;

    --accent:    #22d399;   /* terminal green */
    --accent-2:  #38bdf8;   /* sky cyan      */
    --accent-3:  #c084fc;   /* purple        */
    --warn:      #f59e0b;
    --pink:      #f472b6;

    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --radius:    14px;
    --radius-sm: 8px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::selection { background: rgba(34, 211, 153, 0.35); color: #fff; }

/* ---------- Background layers ---------- */
.bg-grid {
    position: fixed; inset: 0; z-index: -3;
    background-image:
        linear-gradient(rgba(120, 200, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(120, 200, 255, 0.045) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}
.bg-glow {
    position: fixed; inset: 0; z-index: -2;
    background:
        radial-gradient(600px circle at 15% 10%, rgba(34, 211, 153, 0.18), transparent 60%),
        radial-gradient(700px circle at 85% 30%, rgba(56, 189, 248, 0.15), transparent 60%),
        radial-gradient(500px circle at 50% 110%, rgba(192, 132, 252, 0.14), transparent 60%);
    pointer-events: none;
}
#matrix {
    position: fixed; inset: 0; z-index: -1;
    width: 100%; height: 100%;
    opacity: 0.18;
    pointer-events: none;
}

/* ---------- Top bar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 20px;
    background: rgba(11, 15, 23, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 13px;
}
.topbar-left { display: flex; align-items: center; gap: 8px; }
.topbar-title { color: var(--muted); margin-left: 8px; }
.topbar-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar-nav a {
    color: var(--muted);
    padding: 6px 12px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}
.topbar-nav a:hover { color: var(--accent); background: rgba(34, 211, 153, 0.08); }

.dot {
    width: 11px; height: 11px; border-radius: 50%;
    display: inline-block;
}
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }

/* ---------- Layout ---------- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 24px 40px;
}

/* ---------- Hero ---------- */
.hero {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 48px;
    align-items: center;
    min-height: 70vh;
}

.prompt {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 12px;
}
.prompt-user { color: var(--accent); }
.prompt-at, .prompt-colon, .prompt-sym { color: var(--dim); }
.prompt-host { color: var(--accent-2); }
.prompt-path { color: var(--accent-3); }
.prompt-cmd  { color: var(--text); margin-left: 6px; }

.hero-name {
    font-family: var(--font-mono);
    font-size: clamp(2.4rem, 5.2vw, 3.6rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 8px;
}
.caret {
    color: var(--accent);
    animation: blink 1.05s step-end infinite;
    margin-left: 4px;
}
@keyframes blink {
    50% { opacity: 0; }
}

.hero-role {
    font-family: var(--font-mono);
    font-size: clamp(1.05rem, 1.7vw, 1.3rem);
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 18px;
    min-height: 1.6em;
}
.role-caret {
    color: var(--accent);
    margin-left: 2px;
    animation: blink 1.05s step-end infinite;
}

.hero-blurb {
    color: var(--muted);
    font-size: 1.02rem;
    max-width: 56ch;
    margin-bottom: 22px;
}

.hero-meta {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-bottom: 26px;
}
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel-2);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 12px;
}
.badge i { color: var(--accent-2); font-size: 11px; }
.badge.status { color: var(--accent); border-color: rgba(34, 211, 153, 0.35); }
.pulse {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(34, 211, 153, 0.6);
    animation: pulse 1.8s infinite;
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(34, 211, 153, 0.55); }
    70%  { box-shadow: 0 0 0 8px rgba(34, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 211, 153, 0); }
}

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 18px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.15s ease, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.btn-primary {
    background: linear-gradient(135deg, rgba(34, 211, 153, 0.18), rgba(56, 189, 248, 0.18));
    color: var(--accent);
    border-color: rgba(34, 211, 153, 0.35);
}
.btn-primary:hover {
    background: linear-gradient(135deg, rgba(34, 211, 153, 0.3), rgba(56, 189, 248, 0.3));
    box-shadow: 0 0 24px rgba(34, 211, 153, 0.25);
    transform: translateY(-1px);
}
.btn-ghost {
    background: var(--panel-2);
    color: var(--text);
    border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--border-2); transform: translateY(-1px); }

/* Hero card / code window */
.hero-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow:
        0 30px 60px -25px rgba(0, 0, 0, 0.6),
        0 0 60px -20px rgba(56, 189, 248, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow: hidden;
}
.hero-card-bar {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: rgba(11, 15, 23, 0.55);
}
.file-tab {
    margin-left: 10px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--muted);
}
.hero-code {
    padding: 18px 20px;
    font-family: var(--font-mono);
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--text);
    overflow-x: auto;
}
.tk-c { color: var(--dim); font-style: italic; }
.tk-k { color: var(--accent-3); }
.tk-v { color: var(--accent-2); }
.tk-p { color: #e0a458; }
.tk-s { color: var(--accent); }
.tk-n { color: var(--pink); }

/* ---------- Sections ---------- */
.section {
    padding: 64px 0 8px;
    scroll-margin-top: 80px;
}
.section-title {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 28px;
    letter-spacing: -0.01em;
}
.section-title .hash { color: var(--accent); margin-right: 6px; }

/* ---------- About ---------- */
.about-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 36px;
    align-items: start;
}
.about-photo {
    position: relative;
    width: 200px; height: 200px;
}
.about-photo img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border-2);
    filter: saturate(1.05);
}
.about-photo-frame {
    position: absolute; inset: -8px;
    border-radius: calc(var(--radius) + 8px);
    border: 1px dashed rgba(34, 211, 153, 0.4);
    pointer-events: none;
    animation: rotate-frame 14s linear infinite;
}
@keyframes rotate-frame {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.about-body p { color: var(--muted); margin-bottom: 14px; }
.about-body strong { color: var(--text); }
.about-list {
    list-style: none;
    margin-top: 16px;
    font-family: var(--font-mono);
    font-size: 13.5px;
    color: var(--muted);
}
.about-list li { padding: 5px 0; }
.kbd {
    color: var(--accent);
    margin-right: 8px;
    font-weight: 700;
}

/* ---------- Stack / Skills ---------- */
.stack-group { margin-bottom: 26px; }
.stack-label {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--dim);
    margin-bottom: 12px;
    letter-spacing: 0.02em;
}
.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 10px;
}
.chip {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 13.5px;
    color: var(--text);
    transition: transform 0.18s ease, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.chip:hover {
    transform: translateY(-2px);
    border-color: var(--border-2);
    background: rgba(34, 211, 153, 0.05);
    box-shadow: 0 6px 20px -10px rgba(34, 211, 153, 0.4);
}
.chip i {
    font-size: 22px;
    color: var(--accent-2);
    transition: color 0.2s;
}
.chip:hover i { color: var(--accent); }

/* ---------- Connect ---------- */
.connect-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.connect-cmd {
    font-family: var(--font-mono);
    font-size: 13.5px;
    color: var(--muted);
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px dashed var(--border);
}
.connect-cmd .tk-c { color: var(--accent); margin-right: 6px; font-style: normal; }

.connect-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.link {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: transform 0.18s ease, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.link:hover {
    transform: translateY(-2px);
    border-color: var(--border-2);
    box-shadow: 0 8px 24px -12px rgba(56, 189, 248, 0.4);
}
.link i {
    font-size: 22px;
    color: var(--accent-2);
    width: 28px; text-align: center;
}
.link:hover i { color: var(--accent); }
.link-title {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}
.link-sub {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
}

/* ---------- Footer ---------- */
.footer {
    max-width: 1100px;
    margin: 40px auto 0;
    padding: 28px 24px 36px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--muted);
}
.footer-line { padding: 4px 0; }
.footer .sep { margin: 0 8px; color: var(--dim); }
.footer .tk-c { color: var(--dim); font-style: normal; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 32px;
        min-height: auto;
        padding-top: 30px;
    }
    .about-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .about-photo {
        width: 160px; height: 160px;
        margin: 0 auto;
    }
    .topbar-nav a { padding: 6px 8px; }
}

@media (max-width: 560px) {
    .container { padding: 40px 16px 24px; }
    .topbar-title { display: none; }
    .hero-name { font-size: 2.2rem; }
    .hero-cta { flex-direction: column; align-items: stretch; }
    .btn { justify-content: center; }
    .hero-code { font-size: 12.5px; padding: 14px; }
    .topbar { padding: 8px 14px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .caret, .role-caret, .pulse, .about-photo-frame { animation: none; }
    #matrix { display: none; }
}
