:root {
  --text: #e6edf8;
  --text-muted: #9ab1ca;
  --accent: #22d3ee;
  --radius: 18px;
  --shadow: 0 12px 26px rgba(10, 15, 27, 0.45);
}

* { box-sizing: border-box; }
html, body { margin:0; padding:0; scroll-behavior: smooth; font-family: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif; color: var(--text); background: radial-gradient(circle at 20% 20%, #172a42 0%, #0a0f1b 50%, #090d16 100%); }
a { color: var(--accent); text-decoration: none; }
button, .btn { font-family: inherit; }

.topbar { position: sticky; top:0; z-index: 50; display: flex; align-items:center; justify-content: space-between; padding: 14px 24px; background: rgba(8, 13, 23, 0.73); backdrop-filter: blur(13px); border-bottom: 1px solid rgba(255,255,255,0.08); }
.logo { font-size: 1.2rem; font-weight: 800; letter-spacing: 0.02em; color: #fff; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 16px; }
.top-actions { display: flex; align-items: center; gap: 8px; }

.nav a { color: var(--text); font-weight: 500; font-size: 0.95rem; padding: 8px 12px; border-radius: 10px; transition: all .25s ease; }
.nav a:hover, .nav a:focus { background: rgba(59,130,246,.17); color: #fff; }
.btn-menu { display:none; border:none; background: transparent; color: var(--text); font-size: 1.5rem; cursor: pointer; }

.hero { min-height: calc(100vh - 78px); display:grid; grid-template-columns: 1fr 1fr; align-items:center; gap: 32px; padding: 80px 6vw 60px; }
.hero-content { max-width: 520px; }
.subtitulo { color: var(--accent); text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 14px; font-weight: 600; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin: 0 0 12px; white-space: nowrap; }
.hero h2 { font-size: clamp(1.1rem, 2.2vw, 1.8rem); margin: 0 0 20px; color: #bfcde6; line-height: 1.35; }
.hero p { color: var(--text-muted); line-height:1.7; margin-bottom: 20px; }
.btn-group { display:flex; gap: .75rem; flex-wrap: wrap; }
.btn { padding: 12px 20px; border-radius: 12px; font-weight: 600; border: 1px solid transparent; cursor:pointer; transition: all .25s ease; }
.btn-primary { background: linear-gradient(130deg, #3b82f6, #22d3ee); color:#fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(34,211,238,0.35); }
.btn-outline { color: #d7e5ff; border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.03); }
.btn-outline:hover { background: rgba(255,255,255,0.08); }

.hero-visual { position: relative; min-height: 320px; display:flex; align-items:center; justify-content:center; }
.glow { position:absolute; inset: 10px; background: radial-gradient(circle, rgba(34,211,238,.55), transparent 42%); filter: blur(32px); z-index: 1; }
.codeblock { position: relative; z-index:2; width: 100%; max-width:420px; background: rgba(9, 15, 29, 0.68); border: 1px solid rgba(99,146,224,.35); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); color:#cdf6ff; font-family:'Fira Code', monospace; font-size:0.9rem; overflow:auto; }
.codeblock pre { margin:0; }

.section { padding: 80px 6vw; }
.section.bg-secondary { background: rgba(15, 23, 42, 0.5); }
.container { max-width: 1100px; margin: 0 auto; }
.section h3 { font-size: 2rem; margin-bottom: 10px; letter-spacing:.01em; }
.subtitle { color: var(--text-muted); margin-bottom: 26px; }
.cards-grid { display:grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 16px; }
.card { background: rgba(13,18,33,.75); border:1px solid rgba(255,255,255,.08); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card h4 { margin-top:0; }

.skills-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: 10px; }
.skill { border: 1px solid rgba(34, 211, 238, 0.35); background: rgba(34, 211, 238, 0.08); color: #d2f7ff; border-radius: 999px; padding: 10px 15px; text-align: center; font-weight: 600; }

.timeline { position: relative; margin-top: 16px; padding-left: 20px; }
.timeline::before { content: ""; position:absolute; top:0; left:13px; width: 2px; height: 100%; background: linear-gradient(180deg, rgba(58, 139, 248, 0.85), rgba(34,211,238,0.4)); }
.timeline-item { position: relative; margin-bottom: 22px; }
.timeline-marker { position:absolute; left:-4px; top: 0; width: 14px; height: 14px; background: var(--accent); border:2px solid #10273f; border-radius: 50%; }
.timeline-content { margin-left: 14px; background: rgba(9, 15, 29, 0.6); border:1px solid rgba(255,255,255,.08); border-radius:14px; padding: 16px; box-shadow: var(--shadow); }
.timeline-content h4 { margin-top:0; }
.timeline-content small { color: var(--text-muted); }

.experience-grid { display:grid; grid-template-columns: repeat(auto-fit,minmax(250px,1fr)); gap:16px; }
.experience-card { background: rgba(13, 18, 35, .78); border:1px solid rgba(255,255,255,.08); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.experience-card h4 { margin-top:0; }

.projects-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 14px; }
.project-card { background: rgba(12, 16, 29, .87); border: 1px solid rgba(255,255,255,.1); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); transition: transform .3s ease, border-color .3s ease; }
.project-card:hover { transform: translateY(-6px); border-color: rgba(34,211,238,0.6); }
.project-card h4 { margin: 0 0 8px; }
.project-card p { color: var(--text-muted); margin: 0 0 10px; }
.project-card a { color: var(--accent); font-weight: 600; }

.stack-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 12px; }
.stack-card { background: rgba(12, 16, 29, .87); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: space-between; }
.stack-card span { font-weight: 700; color: var(--accent); }
.stack-card small { color: var(--text-muted); }

.dashboard-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin: 20px 0 8px; }
.dashboard-card { background: rgba(15, 20, 37, 0.75); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.dashboard-card h4 { margin: 0 0 10px; }
.big-text { font-size: 2rem; font-weight: 700; margin: 0 0 6px; }

.chart-card { background: rgba(12, 16, 29, 0.78); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); margin-top: 6px; }
.chart-card h4 { margin: 0 0 6px; font-size: 1rem; text-align: center; }
.chart-card canvas { display: block; margin: 0 auto; }

.experience-card ul { margin:8px 0 0; padding-left: 20px; color: var(--text-muted); }

.contact-grid { display:grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 14px; }
.contact-card { background: rgba(12, 16, 29, .85); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius); padding: 16px; }
.contact-card h4 { margin-top:0; }
.social-links { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.social-link { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(34,211,238,0.2); color: #d8f5ff; border: 1px solid rgba(34,211,238,0.35); transition: all .25s ease; }
.social-link:hover { transform: translateY(-2px); background: linear-gradient(135deg, rgba(34,211,238,0.45), rgba(59,130,246,0.35)); color: #fff; }
.text-muted { color: var(--text-muted); margin-top: 8px; font-size: 0.9rem; }


footer { text-align:center; padding: 22px 12px; color: var(--text-muted); border-top: 1px solid rgba(255,255,255,.08); background: rgba(7, 11, 19, 0.75); }

.animate-up, .animate-left, .animate-right, .animate-bottom { opacity:0; transform: translateY(30px); animation: appearUp .75s forwards ease-out; }
.animate-left { transform: translateX(-32px); animation-name: appearLeft; }
.animate-right { transform: translateX(32px); animation-name: appearRight; }
.animate-bottom { transform: translateY(24px); animation-name: appearUp; }
.delay-1 { animation-delay: .16s; }
.delay-2 { animation-delay: .28s; }
.delay-3 { animation-delay: .4s; }

@keyframes appearUp { to { opacity:1; transform: translate(0); } }
@keyframes appearLeft { to { opacity:1; transform: translate(0); } }
@keyframes appearRight { to { opacity:1; transform: translate(0); } }

@keyframes float { 0% { transform: translateY(0) rotate(0.1deg); } 50% { transform: translateY(-8px) rotate(0.2deg); } 100% { transform: translateY(0) rotate(0.1deg); }}
.animate-float { animation: float 5s ease-in-out infinite; }

@media (max-width: 984px) {
  .hero { grid-template-columns: 1fr; padding: 60px 5vw 40px; }
  .hero-visual { display:none; }
  .nav { gap: 10px; }
}

@media (max-width: 780px) {
  .topbar { padding: 10px 16px; }
  .nav { display: none; position: fixed; top: 64px; right: 14px; background: rgba(8,13,23,.95); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; flex-direction: column; width: 210px; padding: 10px; }
  .nav.show { display:flex; }
  .btn-menu { display: block; }
  .nav a { margin: 4px 0; }
}

@media (max-width: 500px) {
  .section { padding: 48px 4vw; }
}

body.light-mode {
  --bg: #f5f7fd;
  --surface: #ffffff;
  --surface-alt: #eef1f7;
  --text: #1f2937;
  --text-muted: #4b5563;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #0ea5e9;
  --danger: #ef4444;
  background: #f5f7fd;
  color: #1f2937;
}

body.light-mode .topbar { background: rgba(255,255,255,0.98); border-bottom-color: rgba(60, 99, 164, 0.14); }
body.light-mode a { color: #0ea5e9; }
body.light-mode footer { background: #f1f5f9; border-top-color: rgba(0, 0, 0, 0.1); }
body.light-mode .chart-card { background: #ffffff; border-color: rgba(0, 0, 0, 0.1); }
body.light-mode .logo { color: #1f2937; }
body.light-mode .logo span { color: var(--accent); }
body.light-mode .nav a { color: #1f2937; }
body.light-mode .nav a:hover { background: rgba(37, 99, 235,0.12); }

body.light-mode .card,
body.light-mode .project-card,
body.light-mode .experience-card,
body.light-mode .dashboard-card,
body.light-mode .stack-card,
body.light-mode .contact-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .skill {
  background: rgba(14, 165, 233, 0.1);
  border-color: rgba(14, 165, 233, 0.4);
  color: #0369a1;
}

body.light-mode .hero-visual { display: none; }
body.light-mode .codeblock { background: #f1f5f9; border-color: rgba(0,0,0,0.1); }

body.light-mode .timeline-content {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .timeline::before {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.85), rgba(14, 165, 233, 0.4));
}

@media print {
  body, .topbar, footer, .btn, .btn-menu, .top-actions { color: #000 !important; background: #fff !important; box-shadow: none !important; }
  .nav, .btn-group, .contact-grid, .projects-grid, .skills-grid, .experience-grid { page-break-inside: avoid; }
  .hero { min-height: auto; }
  .animate-up, .animate-left, .animate-right, .animate-bottom { opacity: 1 !important; transform: none !important; animation: none !important; }
}
