:root {
    --bg: #08080f;
    --bg2: #0d0d1a;
    --bg3: #111120;
    --purple: #7c3aed;
    --purple-light: #a855f7;
    --blue: #3b82f6;
    --cyan: #06b6d4;
    --green: #10b981;
    --pink: #ec4899;
    --text: #e2e8f0;
    --muted: #64748b;
    --border: rgba(124, 58, 237, 0.18);
    --font-mono: 'JetBrains Mono', monospace;
    --font: 'Space Grotesk', sans-serif;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    overflow-x: hidden;
    cursor: none;
}

#cur {
    position: fixed; width: 10px; height: 10px;
    background: var(--purple-light); border-radius: 50%;
    pointer-events: none; z-index: 9999;
    transform: translate(-50%, -50%);
    mix-blend-mode: screen;
    transition: width .2s, height .2s, background .2s;
}
#cur-ring {
    position: fixed; width: 34px; height: 34px;
    border: 1.5px solid rgba(168,85,247,.45);
    border-radius: 50%; pointer-events: none; z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width .15s, height .15s, border-color .2s;
}
body:has(a:hover) #cur, body:has(.card:hover) #cur { width: 18px; height: 18px; background: var(--cyan); }
body:has(a:hover) #cur-ring, body:has(.card:hover) #cur-ring { width: 54px; height: 54px; border-color: rgba(6,182,212,.5); }

#cvs { position: fixed; inset: 0; z-index: 0; opacity: .55; pointer-events: none; }

.noise {
    position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px;
}

#loader {
    position: fixed; inset: 0; background: var(--bg);
    z-index: 1000; display: flex; align-items: center; justify-content: center;
    transition: opacity .6s .2s, visibility .6s .2s;
}
#loader.out { opacity: 0; visibility: hidden; }
.term {
    font-family: var(--font-mono); font-size: .85rem; color: var(--green);
    max-width: 480px; width: 100%; padding: 40px 30px;
    background: var(--bg2); border: 1px solid var(--border); border-radius: 12px;
}
.term-bar { display: flex; gap: 7px; margin-bottom: 22px; }
.term-dot { width: 11px; height: 11px; border-radius: 50%; }
.t-red { background: #ff5f57; } .t-yel { background: #ffbd2e; } .t-grn { background: #28c941; }
.t-line { margin-bottom: 5px; min-height: 1.2em; }
.t-prompt { color: var(--purple-light); margin-right: 8px; }
.t-cmd { color: var(--text); }
.t-out { color: var(--green); }
.t-dim { color: var(--muted); }
.t-hl { color: var(--cyan); }

nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    padding: 22px 64px;
    display: flex; align-items: center; justify-content: space-between;
    transition: background .3s, border-color .3s, backdrop-filter .3s;
    border-bottom: 1px solid transparent;
}
nav.scrolled {
    background: rgba(8,8,15,.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom-color: var(--border);
}
.nav-logo {
    font-family: var(--font-mono); font-size: .82rem; font-weight: 700;
    color: var(--text); text-decoration: none; letter-spacing: .03em;
    white-space: nowrap;
}
.nav-logo em { color: var(--purple-light); font-style: normal; }
.nav-links { list-style: none; display: flex; gap: 38px; }
.nav-links a {
    color: var(--muted); text-decoration: none; font-size: .88rem;
    font-weight: 500; letter-spacing: .04em;
    transition: color .25s; position: relative;
}
.nav-links a::after {
    content: ''; position: absolute; bottom: -3px; left: 0;
    width: 0; height: 1px; background: var(--purple-light);
    transition: width .3s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

section { position: relative; z-index: 2; }

.sec-label {
    font-family: var(--font-mono); font-size: .72rem;
    color: var(--purple-light); letter-spacing: .2em; text-transform: uppercase;
    margin-bottom: 10px;
    opacity: 0; transform: translateY(18px);
    transition: opacity .55s, transform .55s;
}
.sec-title {
    font-size: clamp(2rem, 4vw, 3rem); font-weight: 700;
    letter-spacing: -.03em; margin-bottom: 56px; line-height: 1.1;
    opacity: 0; transform: translateY(18px);
    transition: opacity .55s .1s, transform .55s .1s;
}
.sec-label.vis, .sec-title.vis { opacity: 1; transform: none; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: none; }
}

#hero {
    min-height: 100vh; display: flex; align-items: center;
    padding: 110px 64px 70px; position: relative;
}
.hero-wrap { max-width: 920px; }

.hero-badge {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 5px 16px;
    background: rgba(124,58,237,.08); border: 1px solid rgba(124,58,237,.28);
    border-radius: 100px; font-family: var(--font-mono);
    font-size: .72rem; color: var(--purple-light);
    margin-bottom: 32px;
    animation: fadeUp .6s ease both;
}
.badge-dot {
    width: 7px; height: 7px; background: var(--green);
    border-radius: 50%;
    animation: ping 2s infinite;
}
@keyframes ping {
    0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,.5); }
    50%      { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}

.hero-name {
    font-size: clamp(3.8rem, 9.5vw, 8rem);
    font-weight: 700; line-height: .95; letter-spacing: -.04em;
    margin-bottom: 14px;
    animation: fadeUp .6s .12s ease both;
}
.grad {
    background: linear-gradient(135deg, var(--purple-light), var(--cyan));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.hero-typed {
    font-family: var(--font-mono); font-size: 1.05rem; color: var(--muted);
    margin-bottom: 22px; min-height: 1.5em;
    animation: fadeUp .6s .28s ease both;
}
.hero-typed .tc { color: var(--cyan); }
.blink {
    display: inline-block; width: 2px; height: 1em; background: var(--cyan);
    margin-left: 2px; vertical-align: text-bottom; animation: bl 1s infinite;
}
@keyframes bl { 0%,100%{opacity:1} 50%{opacity:0} }

.hero-desc {
    font-size: 1.05rem; color: var(--muted); max-width: 560px;
    line-height: 1.75; margin-bottom: 44px;
    animation: fadeUp .6s .42s ease both;
}
.hero-desc strong { color: var(--text); font-weight: 600; }

.hero-cta {
    display: flex; gap: 14px; flex-wrap: wrap;
    animation: fadeUp .6s .56s ease both;
}
.btn-p {
    padding: 13px 30px;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    color: #fff; border: none; border-radius: 8px;
    font-family: var(--font); font-size: .92rem; font-weight: 600;
    cursor: none; text-decoration: none;
    display: inline-flex; align-items: center; gap: 8px;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 0 24px rgba(124,58,237,.3);
}
.btn-p:hover { transform: translateY(-3px); box-shadow: 0 0 44px rgba(124,58,237,.55); }

#about {
    padding: 130px 64px;
    max-width: 1240px; margin: 0 auto;
}
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: start; }
.about-text p {
    color: var(--muted); line-height: 1.8; font-size: .98rem; margin-bottom: 18px;
    opacity: 0; transform: translateY(18px);
    transition: opacity .55s, transform .55s;
}
.about-text p strong { color: var(--text); font-weight: 600; }
.about-text p.vis { opacity: 1; transform: none; }

.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat-card {
    padding: 28px 24px; background: var(--bg2);
    border: 1px solid var(--border); border-radius: 14px;
    position: relative; overflow: hidden;
    opacity: 0; transform: translateY(18px) scale(.97);
    transition: opacity .45s, transform .45s, border-color .3s, box-shadow .3s;
}
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--purple), var(--cyan));
}
.stat-card.vis { opacity: 1; transform: none; }
.stat-card:hover { border-color: rgba(124,58,237,.45); box-shadow: 0 8px 32px rgba(0,0,0,.4); }
.stat-n {
    font-size: 2.6rem; font-weight: 700; font-family: var(--font-mono); line-height: 1;
    background: linear-gradient(135deg, var(--purple-light), var(--cyan));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    margin-bottom: 5px;
}
.stat-l { font-size: .82rem; color: var(--muted); }

#skills {
    padding: 130px 64px;
    background: var(--bg2);
    border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.skills-inner { max-width: 1240px; margin: 0 auto; }
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 14px;
}
.sk {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 22px 14px;
    background: var(--bg3); border: 1px solid var(--border); border-radius: 12px;
    cursor: none;
    opacity: 0; transform: translateY(16px) scale(.95);
    transition: opacity .4s, transform .4s, border-color .3s, box-shadow .3s, background .3s;
}
.sk.vis { opacity: 1; transform: none; }
.sk:hover {
    border-color: var(--sk-color, var(--purple-light));
    box-shadow: 0 0 22px var(--sk-glow, rgba(124,58,237,.22));
    background: var(--bg2);
    transform: translateY(-5px) scale(1.04);
}
.sk-icon { font-size: 2rem; line-height: 1; }
.sk-icon.gh-light { color: var(--text); }
.sk-name { font-size: .75rem; font-family: var(--font-mono); color: var(--muted); text-align: center; transition: color .3s; }
.sk:hover .sk-name { color: var(--text); }

.skills-bars { margin-top: 64px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px 60px; }
.bar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.bar-name { font-size: .82rem; font-family: var(--font-mono); color: var(--muted); }
.bar-pct { font-size: .75rem; font-family: var(--font-mono); color: var(--purple-light); }
.bar-track { height: 4px; background: rgba(255,255,255,.06); border-radius: 4px; overflow: hidden; }
.bar-fill {
    height: 100%; border-radius: 4px; width: 0;
    background: linear-gradient(90deg, var(--purple), var(--cyan));
    transition: width 1.2s cubic-bezier(.4,0,.2,1);
}
.bar-item.vis .bar-fill { width: var(--pct); }

#projects { padding: 130px 64px; max-width: 1240px; margin: 0 auto; }
.proj-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }

.card {
    background: var(--bg2); border: 1px solid var(--border); border-radius: 16px;
    padding: 34px; position: relative; overflow: hidden; cursor: none;
    opacity: 0; transform: translateY(28px);
    transition: opacity .5s, transform .5s, border-color .3s, box-shadow .3s;
}
.card.vis { opacity: 1; transform: none; }
.card:hover { border-color: rgba(168,85,247,.4); box-shadow: 0 24px 64px rgba(0,0,0,.55), 0 0 40px rgba(124,58,237,.1); }
.card.feat { grid-column: span 2; }

.card::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(circle at var(--mx,50%) var(--my,50%), rgba(124,58,237,.09) 0%, transparent 55%);
    opacity: 0; transition: opacity .35s;
}
.card:hover::before { opacity: 1; }

.card-top-line {
    position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: var(--card-line, linear-gradient(90deg, var(--purple), var(--cyan), var(--pink)));
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.card-icon {
    width: 46px; height: 46px;
    background: rgba(124,58,237,.1); border: 1px solid rgba(124,58,237,.2);
    border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem;
}
.card-img-icon {
    width: 46px; height: 46px;
    border-radius: 11px; object-fit: cover;
    border: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}
.card-ext { display: flex; gap: 12px; }
.card-ext a {
    color: var(--muted); font-size: 1.05rem;
    display: flex; align-items: center; transition: color .2s, transform .2s;
    text-decoration: none;
}
.card-ext a:hover { color: var(--purple-light); transform: translateY(-2px); }
.card-title { font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: 8px; }
.card-desc { font-size: .88rem; color: var(--muted); line-height: 1.72; margin-bottom: 22px; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
    padding: 3px 11px;
    background: rgba(124,58,237,.07); border: 1px solid rgba(124,58,237,.2);
    border-radius: 100px; font-family: var(--font-mono); font-size: .7rem; color: var(--purple-light);
}

#merci {
    padding: 130px 64px;
    background: var(--bg); border-top: 1px solid var(--border);
    position: relative; z-index: 2;
}
.merci-inner { max-width: 640px; margin: 0 auto; text-align: center; }
.merci-label {
    font-family: var(--font-mono); font-size: .72rem; color: var(--purple-light);
    letter-spacing: .2em; text-transform: uppercase; margin-bottom: 20px; display: block;
}
.merci-h {
    font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700;
    letter-spacing: -.03em; line-height: 1.2; margin-bottom: 14px;
}
.merci-sub { color: var(--muted); font-size: .92rem; margin-bottom: 36px; }
.btn-close {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 14px 32px;
    background: transparent;
    border: 1px solid rgba(236,72,153,.35);
    border-radius: 8px; color: var(--text);
    font-family: var(--font); font-size: .95rem; font-weight: 600;
    cursor: none;
    transition: all .3s;
    position: relative; overflow: hidden;
}
.btn-close::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(236,72,153,.08), rgba(124,58,237,.08));
    opacity: 0; transition: opacity .3s;
}
.btn-close:hover { border-color: rgba(236,72,153,.7); box-shadow: 0 0 28px rgba(236,72,153,.25); transform: translateY(-2px); }
.btn-close:hover::before { opacity: 1; }

#outro {
    position: fixed; inset: 0; z-index: 2000;
    background: #000;
    display: none;
    align-items: center; justify-content: center;
}
#outro.active { display: flex; }
#outro-screen {
    display: flex; align-items: center; justify-content: center;
    position: absolute; inset: 0;
    transition: transform .5s cubic-bezier(.25,0,.75,1), filter .4s, opacity .25s .38s;
    transform-origin: center;
}
#outro-screen.squish {
    transform: scaleY(0.003);
    filter: brightness(4) blur(1px);
    opacity: 0;
}
#reopen-wrap {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
    opacity: 0; pointer-events: none;
    transition: opacity 1s;
}
#reopen-wrap.show { opacity: 1; pointer-events: all; }
.reopen-cursor {
    font-family: var(--font-mono); font-size: 1.1rem; color: var(--green);
    animation: bl 1s infinite; height: 1.5em;
}
.reopen-msg {
    font-family: var(--font-mono); font-size: .9rem; color: var(--muted);
    letter-spacing: .12em; margin-bottom: 12px;
}
#reopen-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 13px 28px;
    background: transparent;
    border: 1px solid rgba(168,85,247,.45); border-radius: 8px;
    color: var(--text); font-family: var(--font); font-size: .92rem; font-weight: 600;
    cursor: none;
    transition: all .3s;
    box-shadow: 0 0 20px rgba(124,58,237,.15);
}
#reopen-btn:hover {
    border-color: var(--purple-light);
    box-shadow: 0 0 40px rgba(168,85,247,.4);
    transform: translateY(-2px);
}

footer {
    position: relative; z-index: 2;
    padding: 32px 64px; background: var(--bg); border-top: 1px solid var(--border);
    display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
    font-family: var(--font-mono); font-size: .76rem; color: var(--muted);
}
.footer-credit { display: flex; align-items: center; gap: 7px; font-size: .82rem; }
.footer-credit em { color: var(--purple-light); font-style: normal; }
.heart-svg { color: #e25555; flex-shrink: 0; animation: hb 1.4s ease-in-out infinite; }
@keyframes hb {
    0%,100% { transform: scale(1);    color: #e25555; }
    14%      { transform: scale(1.38); color: #ff2222; filter: drop-shadow(0 0 6px #ff2222); }
    28%      { transform: scale(1);    color: #e25555; }
    42%      { transform: scale(1.2);  color: #ff3333; filter: drop-shadow(0 0 4px #ff3333); }
    70%      { transform: scale(1);    color: #e25555; }
}
.footer-copy { font-size: .72rem; color: var(--muted); }

@media (max-width: 900px) {
    nav { padding: 14px 20px; gap: 16px; }
    .nav-logo { font-size: .72rem; }
    .nav-links { display: none; }
    #hero { padding: 100px 24px 70px; }
    #about, #skills, #projects, #merci { padding: 90px 24px; }
    .about-grid { grid-template-columns: 1fr; gap: 44px; }
    .proj-grid { grid-template-columns: 1fr; }
    .card.feat { grid-column: span 1; }
    .skills-bars { grid-template-columns: 1fr; }
    footer { padding: 22px 24px; }
}

@media (max-width: 480px) {
    .term { padding: 28px 18px; font-size: .78rem; }
    .hero-name { font-size: clamp(2.6rem, 13vw, 3.8rem); }
    .about-stats { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card { padding: 20px 16px; }
    .stat-n { font-size: 2rem; }
    .skills-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 10px; }
    .sk { padding: 16px 8px; }
    .sk-icon { font-size: 1.7rem; }
    .card { padding: 24px 18px; }
    .card-title { font-size: 1.1rem; }
    .merci-inner { padding: 0 4px; }
}

@media (hover: none) {
    #cur, #cur-ring { display: none; }
    body { cursor: auto; }
    .btn-p, .btn-close, #reopen-btn, .sk, .card, .nav-toggle { cursor: pointer; }
}
