:root {
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.78);
    --panel-strong: rgba(2, 6, 23, 0.94);
    --text: #e5e7eb;
    --muted: #94a3b8;
    --green: #22c55e;
    --cyan: #22d3ee;
    --border: rgba(34, 197, 94, 0.24);
    --shadow: rgba(34, 197, 94, 0.18);
}

html { scroll-behavior: smooth; }
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Consolas, "Courier New", monospace;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    cursor: none;
}
body.recruiter-mode {
    --green: #38bdf8;
    --cyan: #a78bfa;
    --border: rgba(56, 189, 248, 0.28);
    --shadow: rgba(56, 189, 248, 0.18);
}

.matrix-bg { position: fixed; inset: 0; z-index: -4; background: radial-gradient(circle at 20% 10%, rgba(34,211,238,.16), transparent 28%), radial-gradient(circle at 80% 20%, rgba(34,197,94,.12), transparent 25%), linear-gradient(135deg,#020617,#030712,#00110a); }
.matrix-bg::before { content: "0101 CSS JAVA SQL LINUX HTML JS REACT ACCESS GRANTED 1010 \A HTML CSS JAVA SQL LINUX JS SYSTEM ONLINE 0101 1010 \A OUNETT EDWINOS TERMINAL PORTFOLIO BUILDING REAL PROJECTS"; white-space: pre-wrap; position: fixed; top: 22%; left: 0; right: 0; text-align: center; color: rgba(34,197,94,.10); font-size: clamp(14px,2vw,22px); line-height: 56px; word-spacing: 18px; letter-spacing: 2px; padding: 0 28px; animation: matrixWordsMove 12s ease-in-out infinite alternate; }
@keyframes matrixWordsMove { from { transform: translateY(-20px); } to { transform: translateY(20px); } }
body::before { content: ""; position: fixed; inset: 0; background-image: linear-gradient(rgba(34,197,94,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(34,197,94,.05) 1px, transparent 1px); background-size: 45px 45px; z-index: -5; pointer-events: none; mask-image: radial-gradient(circle at center, black 20%, transparent 80%); }
.scanlines { position: fixed; inset: 0; pointer-events: none; z-index: 9999; background: repeating-linear-gradient(to bottom, rgba(255,255,255,.025), rgba(255,255,255,.025) 1px, transparent 1px, transparent 5px); }
#matrix-canvas, #particles-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#matrix-canvas { z-index: -2; opacity: 0; transition: opacity .5s; }
#particles-canvas { z-index: -1; opacity: .45; }
body.hacker-mode #matrix-canvas { opacity: .68; }

.loader { position: fixed; inset: 0; background: #020617; z-index: 20000; display: grid; place-items: center; transition: opacity .8s ease, visibility .8s ease; }
.loader.hidden { opacity: 0; visibility: hidden; }
.loader-box { width: 90%; max-width: 440px; padding: 36px; border: 1px solid var(--green); border-radius: 22px; background: rgba(15,23,42,.86); box-shadow: 0 0 40px var(--shadow); text-align: center; }
.loader-box h2 { color: var(--green); letter-spacing: 4px; text-shadow: 0 0 15px var(--green); }
.loader-bar { height: 12px; border-radius: 999px; background: rgba(2,6,23,.9); border: 1px solid var(--border); overflow: hidden; }
.loader-progress { height: 100%; width: 0; background: linear-gradient(90deg,var(--green),var(--cyan)); animation: loadingBar 3s ease forwards; box-shadow: 0 0 18px var(--green); }
@keyframes loadingBar { to { width: 100%; } }

.navbar { position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 38px; background: rgba(2,6,23,.82); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); transition: .3s; }
.navbar.scrolled { background: rgba(2,6,23,.97); box-shadow: 0 0 28px var(--shadow); }
.logo { text-decoration: none; color: var(--green); font-size: 23px; font-weight: 800; letter-spacing: 2px; text-shadow: 0 0 15px var(--green); }
.logo span { color: var(--cyan); }
.nav-links { display: flex; list-style: none; gap: 18px; padding: 0; margin: 0; }
.nav-links a { color: var(--text); text-decoration: none; font-size: 14px; position: relative; transition: .25s; }
.nav-links a::after { content: ""; position: absolute; left: 0; bottom: -7px; width: 0; height: 2px; background: var(--green); box-shadow: 0 0 10px var(--green); transition: .25s; }
.nav-links a:hover, .nav-links a.active-link { color: var(--green); }
.nav-links a:hover::after, .nav-links a.active-link::after { width: 100%; }
.nav-actions { display: flex; gap: 10px; }
.mode-btn, .recruiter-btn, .menu-toggle { background: rgba(34,197,94,.08); color: var(--green); border: 1px solid var(--green); padding: 9px 13px; border-radius: 12px; font-family: inherit; cursor: pointer; transition: .25s; }
.mode-btn:hover, .recruiter-btn:hover, .menu-toggle:hover { background: var(--green); color: #020617; box-shadow: 0 0 22px var(--green); transform: translateY(-2px); }
.menu-toggle { display: none; }

section { scroll-margin-top: 96px; }
.hero { min-height: 92vh; display: grid; place-items: center; padding: 72px 40px 50px; }
.hero-grid { width: min(1160px,100%); display: grid; grid-template-columns: 1.25fr .75fr; gap: 34px; align-items: center; }
.system-text, .section-command { color: var(--green); letter-spacing: 2px; font-size: 14px; text-shadow: 0 0 12px var(--green); }
.eyebrow { color: var(--cyan); letter-spacing: 1px; margin-bottom: 16px; }
.hero h1 { font-size: clamp(42px,7vw,82px); line-height: .95; margin: 0 0 18px; letter-spacing: -3px; }
.hero h1 span { color: var(--green); text-shadow: 0 0 22px var(--green); }
.terminal-line { color: var(--cyan); font-size: 18px; }
.cursor { color: var(--green); animation: blink .8s infinite; }
@keyframes blink { 0%,50% { opacity: 1; } 51%,100% { opacity: 0; } }
.hero-description { max-width: 760px; color: #cbd5e1; font-size: 17px; line-height: 1.75; }
.hero-buttons, .contact-links, .project-links { display: flex; gap: 14px; flex-wrap: wrap; }
.btn, .contact-btn, .project-link, .mini-btn { position: relative; overflow: hidden; padding: 13px 22px; background: rgba(34,197,94,.12); color: var(--green); border: 1px solid var(--green); border-radius: 12px; cursor: pointer; text-decoration: none; font-weight: 700; font-family: inherit; transition: .25s; box-shadow: 0 0 18px var(--shadow); }
.btn:hover, .contact-btn:hover, .project-link:hover, .mini-btn:hover { transform: translateY(-4px); background: var(--green); color: #020617; box-shadow: 0 0 28px var(--green); }
.btn-secondary { color: var(--cyan); border-color: var(--cyan); background: rgba(34,211,238,.1); }
.btn-secondary:hover { background: var(--cyan); box-shadow: 0 0 28px var(--cyan); }
.btn-ghost { background: transparent; color: #e5e7eb; border-color: rgba(229,231,235,.25); }

.profile-console, .about-card, .project-card, .skill, .stat-card, .timeline-item, .lab-card, .terminal-window { background: var(--panel); border: 1px solid var(--border); box-shadow: 0 0 30px rgba(34,197,94,.08); backdrop-filter: blur(14px); position: relative; overflow: hidden; }
.profile-console { border-radius: 26px; padding: 20px; animation: floating 3.6s ease-in-out infinite; }
.console-top, .terminal-header { display: flex; align-items: center; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid rgba(34,197,94,.16); margin-bottom: 18px; }
.console-top span, .dot { width: 12px; height: 12px; border-radius: 50%; display: block; }
.console-top span:nth-child(1), .red { background: #ef4444; }
.console-top span:nth-child(2), .yellow { background: #facc15; }
.console-top span:nth-child(3), .green { background: #22c55e; }
.console-top p, .terminal-title { margin-left: auto; color: var(--muted); font-size: 13px; }
.hero-frame { width: 174px; height: 174px; margin: 26px auto; padding: 6px; border-radius: 50%; background: linear-gradient(135deg,var(--green),var(--cyan),transparent); box-shadow: 0 0 36px var(--shadow); }
.hero-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 4px solid #020617; display: block; }
.ascii-photo { position: relative; overflow: hidden; }
.ascii-overlay { position: absolute; inset: 6px; margin: 0; display: grid; place-items: center; color: rgba(34,197,94,.95); background: rgba(2,6,23,.72); font-size: 12px; line-height: 1.25; text-align: center; opacity: 0; transition: .35s; border-radius: 50%; }
.ascii-photo:hover .ascii-overlay { opacity: 1; }
.console-lines p { color: #cbd5e1; margin: 12px 0; }
.console-lines b { color: var(--green); }

.system-stats { width: min(1040px,90%); margin: -30px auto 80px; display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; }
.stat-card { border-radius: 18px; padding: 22px; text-align: center; transition: .25s; }
.stat-card:hover, .timeline-item:hover, .lab-card:hover { transform: translateY(-6px); border-color: var(--cyan); box-shadow: 0 0 30px rgba(34,211,238,.16); }
.stat-card span { display: block; color: var(--muted); font-size: 12px; letter-spacing: 2px; margin-bottom: 8px; }
.stat-card strong { color: var(--green); font-size: 18px; text-shadow: 0 0 12px var(--green); }

.about, .skills, .projects, .experience, .lab, .contact, .terminal-section { padding: 86px 40px; text-align: center; }
.about-card { max-width: 920px; margin: 0 auto; padding: 42px; border-radius: 24px; text-align: left; }
h2 { font-size: clamp(32px,4vw,48px); margin: 12px 0 18px; letter-spacing: -1px; }
.section-subtitle, .skills-text { color: var(--muted); max-width: 720px; margin: 0 auto 38px; line-height: 1.7; }
.about-card p { color: #cbd5e1; font-size: 17px; line-height: 1.8; }

.timeline { width: min(900px,100%); margin: 0 auto; display: grid; gap: 18px; }
.timeline-item { display: grid; grid-template-columns: 150px 1fr; gap: 24px; padding: 24px; border-radius: 20px; text-align: left; }
.timeline-date { color: var(--green); font-weight: 800; }
.timeline-item h3 { margin: 0 0 8px; color: var(--text); }
.timeline-item p { color: #cbd5e1; margin: 0; line-height: 1.7; }

.skills { max-width: 1080px; margin: 0 auto; }
.skills-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.skill { padding: 18px; border-radius: 18px; transition: .25s; }
.skill-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; color: var(--text); font-weight: 800; }
.skill-info span { display: flex; align-items: center; gap: 10px; }
.skill-info i { font-size: 25px; }
.skill-bar { width: 100%; height: 12px; background: rgba(2,6,23,.9); border-radius: 999px; border: 1px solid var(--border); overflow: hidden; }
.skill-progress { height: 100%; border-radius: 999px; background: linear-gradient(90deg,var(--green),var(--cyan)); box-shadow: 0 0 15px var(--green); animation: fillBar 1.8s ease; }
.html{width:75%}.css{width:70%}.js{width:55%}.java{width:85%}.linux{width:60%}.windows{width:95%}.sql{width:40%}.soporte{width:90%}
@keyframes fillBar { from { width: 0; } }

.projects-container { width: min(1180px,100%); margin: 0 auto; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px; }
.project-card { padding: 28px; border-radius: 24px; text-align: left; transition: .25s; min-height: 315px; }
.project-card.featured { grid-column: span 2; background: linear-gradient(135deg, rgba(34,197,94,.16), rgba(15,23,42,.82)); }
.project-card::before, .skill::after, .about-card::after, .project-card::after, .lab-card::after { content: ""; position: absolute; width: 260px; height: 260px; background: radial-gradient(circle, rgba(34,197,94,.14), transparent 70%); top: var(--y, 0); left: var(--x, 0); transform: translate(-50%,-50%); opacity: 0; transition: opacity .25s; pointer-events: none; }
.project-card:hover::after, .skill:hover::after, .about-card:hover::after, .lab-card:hover::after { opacity: 1; }
.project-card:hover { transform: translateY(-10px) scale(1.01); border-color: var(--cyan); box-shadow: 0 0 36px rgba(34,211,238,.16); }
.project-index { color: rgba(34,211,238,.75); font-weight: 900; letter-spacing: 2px; }
.project-icon { font-size: 40px; margin: 16px 0; }
.project-card h3 { color: var(--green); margin: 0 0 10px; font-size: 22px; }
.project-card p { color: #cbd5e1; line-height: 1.65; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.tags span { color: var(--cyan); border: 1px solid rgba(34,211,238,.35); border-radius: 999px; padding: 6px 10px; font-size: 12px; background: rgba(34,211,238,.07); }
.project-link { padding: 9px 13px; font-size: 13px; }

.lab-grid { width: min(1080px,100%); margin: 0 auto; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
.lab-card { border-radius: 22px; padding: 26px; text-align: left; }
.lab-card h3 { margin-top: 0; color: var(--green); }
.lab-card p { color: #cbd5e1; line-height: 1.65; }
.lab-card pre { color: var(--green); white-space: pre-wrap; min-height: 70px; }
.mini-btn { padding: 9px 12px; margin: 6px 6px 6px 0; font-size: 13px; }

.terminal-section { display: flex; justify-content: center; }
.terminal-window { width: min(900px,100%); border-radius: 22px; overflow: hidden; text-align: left; background: var(--panel-strong); }
.terminal-header { margin: 0; padding: 14px 18px; background: rgba(15,23,42,.94); }
.terminal-body { padding: 26px; min-height: 340px; max-height: 470px; overflow-y: auto; color: var(--green); font-size: 15px; line-height: 1.8; }
.terminal-input-line { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
#terminal-input { flex: 1; background: transparent; border: none; outline: none; color: var(--green); font-family: inherit; font-size: 15px; }
.terminal-output { white-space: pre-wrap; color: #cbd5e1; }
.terminal-command { color: var(--cyan); }

.contact { background: rgba(2,6,23,.88); border-top: 1px solid var(--border); }
.contact p { color: #cbd5e1; }
.contact-links { justify-content: center; }
.footer { background: #020617; color: #64748b; text-align: center; padding: 24px; border-top: 1px solid rgba(34,197,94,.15); }

.secret-dino { position: fixed; bottom: 30px; right: 30px; background: rgba(2,6,23,.96); border: 1px solid var(--green); color: var(--green); padding: 20px; border-radius: 18px; box-shadow: 0 0 30px var(--shadow); z-index: 10000; opacity: 0; transform: translateY(30px); pointer-events: none; transition: .35s; }
.secret-dino.active { opacity: 1; transform: translateY(0); }
.secret-dino pre { margin: 0; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); padding: 12px 18px; border: 1px solid var(--border); color: var(--green); background: rgba(2,6,23,.94); border-radius: 999px; box-shadow: 0 0 24px var(--shadow); z-index: 12000; opacity: 0; transition: .3s; }
.toast.active { opacity: 1; transform: translate(-50%, 0); }
.custom-cursor { position: fixed; width: 18px; height: 18px; border: 1px solid var(--green); border-radius: 50%; pointer-events: none; z-index: 30000; transform: translate(-50%,-50%); box-shadow: 0 0 15px var(--green); transition: width .18s, height .18s, background .18s; }
.custom-cursor.active { width: 34px; height: 34px; background: rgba(34,197,94,.12); }
.reveal { opacity: 0; transform: translateY(42px); transition: opacity .85s ease, transform .85s ease; }
.reveal.active { opacity: 1; transform: translateY(0); }
@keyframes floating { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
body.rebooting { animation: rebootFlash .6s ease; }
@keyframes rebootFlash { 0%{filter:brightness(1)} 40%{filter:brightness(2)} 100%{filter:brightness(1)} }
body.recruiter-mode .matrix-bg::before { content: "PROFESSIONAL MODE • EXPERIENCE • PROJECTS • SKILLS • CONTACT"; color: rgba(56,189,248,.13); }

@media (max-width: 980px) {
    body { cursor: auto; }
    .custom-cursor { display: none; }
    .navbar { align-items: flex-start; padding: 16px 20px; flex-wrap: wrap; }
    .menu-toggle { display: block; }
    .nav-links { display: none; width: 100%; flex-direction: column; padding: 12px 0; }
    .nav-links.open { display: flex; }
    .nav-actions { margin-left: auto; }
    .hero { padding: 54px 20px; }
    .hero-grid { grid-template-columns: 1fr; }
    .profile-console { max-width: 440px; margin: 0 auto; }
    .system-stats { grid-template-columns: repeat(2,1fr); margin-top: 20px; }
    .skills-grid, .projects-container, .lab-grid { grid-template-columns: 1fr; }
    .project-card.featured { grid-column: span 1; }
    .timeline-item { grid-template-columns: 1fr; }
    .about, .skills, .projects, .experience, .lab, .contact, .terminal-section { padding: 64px 20px; }
}
@media (max-width: 560px) {
    .hero h1 { letter-spacing: -1px; }
    .system-stats { grid-template-columns: 1fr; }
    .nav-actions { width: 100%; }
    .mode-btn, .recruiter-btn { flex: 1; }
    .hero-buttons, .contact-links { flex-direction: column; }
    .btn, .contact-btn { width: 100%; text-align: center; }
}
