/* ============================================================
   Simão Andrade — Glass Terminal Portfolio
   Palette: black / grey / white  +  single bash-green accent
   ============================================================ */

:root {
    --bg:          #08090b;
    --bg-2:        #0d0f12;
    --panel:       rgba(255, 255, 255, 0.035);
    --panel-2:     rgba(255, 255, 255, 0.06);
    --border:      rgba(255, 255, 255, 0.10);
    --border-soft: rgba(255, 255, 255, 0.06);
    --text:        #e9eaec;
    --muted:       #9598a0;
    --dim:         #5d6068;
    --white:       #ffffff;
    --green:       #56d364;
    --green-soft:  rgba(86, 211, 100, 0.10);

    --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    --sans: 'Inter', system-ui, -apple-system, sans-serif;

    --radius: 14px;
    --maxw: 1080px;
    --ease: cubic-bezier(.22, 1, .36, 1);
}

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

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(255, 255, 255, 0.85); color: #000; }
a { color: inherit; text-decoration: none; }

.prompt-symbol { color: var(--green); font-family: var(--mono); }
.dim { color: var(--dim); }
.cmd { color: var(--white); font-family: var(--mono); }
.cursor-blink { animation: blink 1.1s steps(1) infinite; color: var(--white); font-family: var(--mono); }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Animated background ---------- */
#bg-canvas {
    position: fixed; inset: 0; z-index: -3; width: 100%; height: 100%;
    background:
        radial-gradient(1100px 700px at 78% -10%, rgba(255,255,255,0.05), transparent 60%),
        radial-gradient(900px 600px at 10% 110%, rgba(255,255,255,0.04), transparent 60%),
        var(--bg);
}
.grid-overlay {
    position: fixed; inset: 0; z-index: -2; pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 40%, transparent 100%);
}
.scanlines {
    position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .35;
    background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.015) 0 1px, transparent 1px 3px);
}
.vignette { position: fixed; inset: 0; z-index: -1; pointer-events: none; box-shadow: inset 0 0 220px 40px rgba(0,0,0,0.85); }

/* ---------- Glass primitive ---------- */
.glass {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(14px) saturate(120%);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    box-shadow: 0 10px 40px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.05);
}

/* ============================================================
   NAVIGATION
   ============================================================ */
header { position: sticky; top: 0; z-index: 100; }
.nav {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0.55rem 1.4rem 0.55rem 1.2rem;
    margin: 0.7rem auto 0; max-width: calc(var(--maxw) + 80px); width: calc(100% - 2rem);
    background: rgba(10, 11, 13, 0.55);
    border: 1px solid var(--border-soft); border-radius: 12px;
    backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    transition: padding .3s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
    position: relative;
}
.nav::after {
    content: ''; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(86,211,100,0.5), transparent);
    background-size: 200% 100%; opacity: 0; transition: opacity .35s var(--ease);
    animation: sheen 6s linear infinite;
}
.nav.scrolled { padding-top: .4rem; padding-bottom: .4rem; background: rgba(8,9,11,0.82); border-color: var(--border); box-shadow: 0 12px 40px rgba(0,0,0,0.65); }
.nav.scrolled::after { opacity: 1; }
@keyframes sheen { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.nav-left { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.nav-brand { font-family: var(--mono); font-weight: 700; font-size: 1.02rem; display: flex; align-items: center; gap: .15rem; white-space: nowrap; }
.nav-brand .brand-text { color: var(--white); }
.nav-path { color: var(--green); font-weight: 500; }

.nav-menu { display: flex; align-items: center; gap: 1.2rem; }
.nav-links { display: flex; list-style: none; gap: .45rem; flex-wrap: wrap; }
/* Claude-Code style command fields: each item is a `> item` prompt field */
.nav-links a {
    font-family: var(--mono); font-size: .82rem; color: var(--muted);
    position: relative; display: inline-flex; align-items: center;
    padding: .34rem .7rem .34rem 1.5rem;
    border: 1px solid var(--border-soft); border-radius: 9px; background: rgba(255,255,255,0.015);
    transition: color .22s var(--ease), background .22s var(--ease), border-color .22s var(--ease);
}
.nav-links a::before {
    content: '>'; position: absolute; left: .62rem; top: 50%; transform: translateY(-50%);
    color: var(--dim); font-weight: 700; transition: color .22s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--white); border-color: rgba(86,211,100,0.40); background: var(--green-soft); }
.nav-links a:hover::before, .nav-links a.active::before { color: var(--green); }
.nav-links a.active { box-shadow: inset 0 0 0 1px rgba(86,211,100,0.18); }
.nav-links a.nav-back { color: var(--green); border-color: rgba(86,211,100,0.30); }
.nav-links a.nav-back::before { content: '..'; left: .5rem; color: var(--green); letter-spacing: -1px; }
.nav-links a.nav-back { padding-left: 1.7rem; }

.nav-actions { display: flex; align-items: center; gap: .8rem; }
.btn-cv { font-family: var(--mono); font-size: .8rem; color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: .35rem .7rem; transition: all .25s var(--ease); }
.btn-cv:hover { background: var(--white); color: #000; border-color: var(--white); }
.lang-toggle { font-family: var(--mono); font-size: .8rem; cursor: pointer; background: transparent; border: 1px solid var(--border); border-radius: 8px; padding: .35rem .55rem; color: var(--dim); display: flex; gap: .25rem; transition: border-color .25s; }
.lang-toggle:hover { border-color: var(--white); }
.lang-opt.active { color: var(--white); }
.lang-sep { color: var(--dim); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 4px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); transition: all .3s var(--ease); display: block; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   VIEWS / LAYOUT
   ============================================================ */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 1.4rem; }
.view[hidden] { display: none; }
.view { animation: view-in .5s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.section { padding: 4.5rem 0 1rem; }
.section-head { display: flex; align-items: baseline; gap: .9rem; margin-bottom: 2.2rem; }
.section-index { font-family: var(--mono); font-size: .8rem; color: var(--dim); border: 1px solid var(--border-soft); border-radius: 6px; padding: .15rem .45rem; }
.section-title { font-family: var(--mono); font-size: clamp(1.25rem, 3.5vw, 1.85rem); font-weight: 500; color: var(--muted); word-break: break-word; }

/* ============================================================
   HERO + DIRECTORY LISTING (home)
   ============================================================ */
.hero { min-height: calc(100vh - 120px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.4rem; padding: 2rem 0; }
.terminal {
    width: min(720px, 100%); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
    background: rgba(10, 12, 15, 0.72); backdrop-filter: blur(18px) saturate(130%); -webkit-backdrop-filter: blur(18px) saturate(130%);
    box-shadow: 0 30px 80px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.06);
    animation: rise .9s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }
.terminal-bar { display: flex; align-items: center; gap: .8rem; padding: .6rem .9rem; background: rgba(255,255,255,0.04); border-bottom: 1px solid var(--border-soft); }
.terminal-dots { display: flex; gap: .45rem; flex-shrink: 0; }
.terminal-dots span { width: 11px; height: 11px; border-radius: 50%; }
.terminal-dots span:nth-child(1) { background: #6b6e74; }
.terminal-dots span:nth-child(2) { background: #85888e; }
.terminal-dots span:nth-child(3) { background: #a0a3a9; }
.terminal-title { font-family: var(--mono); font-size: .8rem; color: var(--dim); }
.terminal-body { font-family: var(--mono); font-size: clamp(.82rem, 2.4vw, 1rem); padding: 1.4rem 1.4rem; min-height: 270px; line-height: 1.9; }
.term-line { white-space: pre-wrap; word-break: break-word; }
.term-user { color: var(--green); }
.term-prompt { color: var(--muted); }
.term-cmd { color: var(--white); }
.term-accent { color: var(--white); font-weight: 700; }
.term-muted { color: var(--dim); }
.term-cursor { display: inline-block; width: .55ch; height: 1.05em; background: var(--white); transform: translateY(2px); animation: blink 1s steps(1) infinite; }

.dir-listing { width: min(720px, 100%); display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.dir-card { padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .35rem; transition: transform .3s var(--ease), border-color .3s var(--ease), background .3s; }
.dir-card:hover { transform: translateY(-4px); border-color: rgba(86,211,100,0.35); background: var(--panel-2); }
.dir-icon { color: var(--green); font-size: .8rem; }
.dir-name { font-family: var(--mono); font-weight: 700; color: var(--white); font-size: 1rem; }
.dir-desc { font-size: .82rem; color: var(--muted); }

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.6rem; align-items: start; }
.about-text { padding: 1.8rem; }
.about-text p { color: var(--text); margin-bottom: 1.6rem; }
.about-facts { list-style: none; font-family: var(--mono); font-size: .86rem; display: grid; gap: .55rem; }
.about-facts li { display: flex; gap: .8rem; flex-wrap: wrap; }
.fact-key { color: var(--dim); min-width: 92px; }
.fact-key::after { content: ':'; }
.fact-val { color: var(--text); }
.about-photo { position: relative; overflow: hidden; padding: 0; aspect-ratio: 1 / 1; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(100%) contrast(1.05); transition: filter .5s var(--ease); }
.about-photo:hover img { filter: grayscale(0%) contrast(1); }
.photo-scan { position: absolute; left: 0; right: 0; top: 0; height: 38%; background: linear-gradient(to bottom, rgba(255,255,255,0.12), transparent); animation: scan 3.6s linear infinite; pointer-events: none; }
@keyframes scan { 0% { transform: translateY(-40%); } 100% { transform: translateY(280%); } }

/* ============================================================
   GIT-GRAPH TIMELINE (experience + education)
   ============================================================ */
.git-graph { --rail: 36px; position: relative; }
.git-commit { display: grid; grid-template-columns: var(--rail) 1fr; align-items: stretch; }
/* the rail + connecting branch line */
.git-rail { position: relative; }
.git-rail::before {
    content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; transform: translateX(-1px);
    background: linear-gradient(to bottom, var(--border), rgba(86,211,100,0.25));
}
.git-commit:first-child .git-rail::before { top: 22px; }
.git-commit:last-child .git-rail::before { bottom: calc(100% - 22px); }
.git-dot {
    position: absolute; left: 50%; top: 22px; transform: translate(-50%, -50%);
    width: 14px; height: 14px; border-radius: 50%; z-index: 2;
    background: var(--bg-2); border: 2px solid var(--muted); display: grid; place-items: center;
}
.git-commit.current .git-dot { border-color: var(--green); background: var(--green); box-shadow: 0 0 0 0 rgba(86,211,100,0.5); animation: pulse 1.9s infinite; }
.git-commit.done .git-dot { width: 16px; height: 16px; border-color: var(--green); background: rgba(86,211,100,0.12); }
.git-commit.done .git-dot::after { content: ''; width: 3px; height: 6px; border: solid var(--green); border-width: 0 1.5px 1.5px 0; transform: translateY(-1px) rotate(45deg); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(86,211,100,.5); } 70% { box-shadow: 0 0 0 10px rgba(86,211,100,0); } 100% { box-shadow: 0 0 0 0 rgba(86,211,100,0); } }

.git-card { padding: 1.1rem 1.25rem; margin: 0 0 1.3rem 0; transition: transform .3s var(--ease), border-color .3s var(--ease), background .3s; }
.git-card:hover { transform: translateX(3px); border-color: var(--border); background: var(--panel-2); }
.git-commit.featured .git-card { border-color: rgba(86,211,100,0.28); background: linear-gradient(120deg, rgba(86,211,100,0.05), var(--panel) 45%); box-shadow: 0 10px 40px rgba(0,0,0,0.45), inset 2px 0 0 var(--green); }

.git-head { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; font-family: var(--mono); font-size: .72rem; margin-bottom: .7rem; }
.git-hash { color: var(--dim); }
.git-ref { display: inline-flex; align-items: center; gap: .3rem; border-radius: 20px; padding: .08rem .5rem; border: 1px solid var(--border-soft); color: var(--muted); }
.git-ref.ref-head { color: var(--green); border-color: rgba(86,211,100,0.30); background: var(--green-soft); }
.git-ref.ref-tag { color: var(--text); }
.git-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); animation: blink 1.3s steps(1) infinite; }
.git-date { margin-left: auto; color: var(--dim); white-space: nowrap; }

.git-body { display: flex; align-items: center; gap: .9rem; margin-bottom: .55rem; }
.git-logo { width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; overflow: hidden; background: #f4f4f5; border: 1px solid var(--border-soft); font-family: var(--mono); font-weight: 700; font-size: 1rem; color: #18181b; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.git-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; filter: grayscale(100%); transition: filter .4s var(--ease); }
.git-card:hover .git-logo img { filter: grayscale(0%); }
.git-headings { display: flex; flex-direction: column; min-width: 0; }
.git-role { font-weight: 600; font-size: 1.0rem; color: var(--white); }
.git-company { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.git-desc { color: var(--muted); font-size: .9rem; }

.git-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; }
.tag { font-family: var(--mono); font-size: .72rem; color: var(--muted); background: rgba(255,255,255,0.04); border: 1px solid var(--border-soft); border-radius: 6px; padding: .15rem .5rem; }

/* ============================================================
   SKILLS — claude-skill-file window with tabs
   ============================================================ */
.skill-window { overflow: hidden; }
.skill-window .terminal-bar { flex-wrap: wrap; row-gap: .4rem; }
.skill-tabs { display: flex; gap: .3rem; flex-wrap: wrap; overflow-x: auto; }
.skill-tab {
    font-family: var(--mono); font-size: .76rem; color: var(--muted); cursor: pointer;
    background: rgba(255,255,255,0.02); border: 1px solid var(--border-soft); border-bottom: none;
    border-radius: 7px 7px 0 0; padding: .3rem .65rem; white-space: nowrap;
    transition: color .2s, background .2s;
}
.skill-tab:hover { color: var(--text); }
.skill-tab.active { color: var(--white); background: rgba(86,211,100,0.08); border-color: rgba(86,211,100,0.30); }
.skill-content { font-family: var(--mono); font-size: .86rem; padding: 1.3rem 1.4rem; line-height: 1.9; min-height: 220px; white-space: pre-wrap; word-break: break-word; }
.md-fence { color: var(--dim); }
.md-key { color: var(--green); }
.md-val { color: var(--text); }
.md-h { color: var(--white); font-weight: 700; }
.md-li { color: var(--muted); transition: color .15s; }
.md-li b { color: var(--green); font-weight: 700; }
.md-li:hover { color: var(--text); }

/* ============================================================
   PROJECTS
   ============================================================ */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.1rem; }
.project-card { padding: 1.3rem; display: flex; flex-direction: column; gap: .7rem; transition: transform .3s var(--ease), border-color .3s var(--ease), background .3s; }
.project-card:hover { transform: translateY(-4px); border-color: var(--border); background: var(--panel-2); }
.project-top { display: flex; align-items: center; justify-content: space-between; }
.project-icon { font-family: var(--mono); color: var(--dim); font-size: .85rem; }
.project-link { font-family: var(--mono); font-size: .78rem; color: var(--muted); transition: color .2s; }
.project-card:hover .project-link { color: var(--green); }
.project-title { font-weight: 600; color: var(--white); font-size: 1.02rem; }
.project-desc { color: var(--muted); font-size: .88rem; flex: 1; }
.project-tags { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ============================================================
   RESEARCH (empty state)
   ============================================================ */
.empty-state { padding: 1.6rem 1.5rem; }
.empty-pre { font-family: var(--mono); font-size: .9rem; color: var(--muted); white-space: pre-wrap; line-height: 1.9; margin: 0; }
.empty-pre .term-user { color: var(--green); }
.empty-pre .hl { color: var(--white); }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-wrap { display: grid; grid-template-columns: 1fr 1.2fr; gap: 1.6rem; align-items: start; }
.contact-info { padding: 1.8rem; }
.contact-info p { color: var(--muted); margin-bottom: 1.5rem; }
.socials { display: flex; flex-direction: column; gap: .7rem; }
.social-row { display: flex; align-items: center; gap: .8rem; font-family: var(--mono); font-size: .85rem; color: var(--text); padding: .55rem .7rem; border: 1px solid var(--border-soft); border-radius: 9px; transition: all .25s var(--ease); min-width: 0; }
.social-row:hover { background: var(--panel-2); border-color: rgba(86,211,100,0.30); transform: translateX(4px); }
.social-row .s-key { color: var(--dim); min-width: 78px; flex-shrink: 0; }
.social-row .s-val { color: var(--white); overflow-wrap: anywhere; word-break: break-word; }

.contact-form { padding: 1.8rem; display: flex; flex-direction: column; gap: .5rem; }
.contact-form label { font-family: var(--mono); font-size: .82rem; color: var(--muted); margin-top: .5rem; }
.contact-form input, .contact-form textarea { font-family: var(--mono); font-size: .9rem; color: var(--text); background: rgba(0,0,0,0.35); border: 1px solid var(--border-soft); border-radius: 8px; padding: .65rem .8rem; outline: none; resize: none; transition: border-color .25s, box-shadow .25s; width: 100%; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.contact-form input::placeholder, .contact-form textarea::placeholder { color: var(--dim); }
.btn-submit { margin-top: 1.1rem; font-family: var(--mono); font-size: .9rem; cursor: pointer; background: var(--white); color: #000; border: 0; border-radius: 8px; padding: .75rem 1rem; font-weight: 600; transition: transform .2s var(--ease), box-shadow .2s; }
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(255,255,255,0.12); }
.btn-submit:active { transform: translateY(0); }

/* ============================================================
   FOOTER
   ============================================================ */
footer { text-align: center; padding: 2.5rem 1rem 3rem; margin-top: 4rem; font-family: var(--mono); font-size: .82rem; color: var(--dim); border-top: 1px solid var(--border-soft); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
    .about-grid, .contact-wrap { grid-template-columns: 1fr; }
    .about-photo { max-width: 320px; margin: 0 auto; }
}

@media (max-width: 760px) {
    .nav-toggle { display: flex; }
    .nav-menu {
        position: absolute; top: calc(100% + 8px); left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 1rem;
        background: rgba(10, 11, 13, 0.97); border: 1px solid var(--border-soft); border-radius: 12px;
        padding: 1.3rem 1.5rem;
        transform: translateY(-12px); opacity: 0; pointer-events: none;
        transition: opacity .3s var(--ease), transform .3s var(--ease);
    }
    .nav-menu.open { transform: none; opacity: 1; pointer-events: auto; }
    .nav-links { flex-direction: column; gap: .55rem; }
    .nav-links a { width: 100%; }
    .nav-actions { justify-content: space-between; }
    .section { padding: 3.5rem 0 1rem; }
    .dir-listing { grid-template-columns: 1fr; }
    /* perf: drop blur on mobile (expensive), keep solid glass */
    .glass, .nav, .terminal {
        backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
        background: rgba(14, 16, 19, 0.92);
    }
    .nav { background: rgba(10, 11, 13, 0.95); }
}

@media (max-width: 560px) {
    .git-graph { --rail: 26px; }
    .git-card { padding: .95rem 1rem; }
    .git-date { margin-left: 0; width: 100%; }
    .git-body { gap: .7rem; }
    .git-logo { width: 38px; height: 38px; }
    .contact-form, .contact-info, .about-text { padding: 1.3rem; }
}

@media (max-width: 480px) {
    .nav { padding: .5rem .9rem; }
    .terminal-body { padding: 1.2rem 1rem; min-height: 250px; }
    main { padding: 0 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    * , *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
