/* Estilo limpio, blanco + verde, sombras negras sólidas, tipografía geométrica */
:root {
  --bg: #ffffff; --bg-alt: #f4f7f6; --card: #ffffff; --text: #0b0b0b; --muted: #6b6f72;
  --border: #e4e8e6; --primary: #0b0b0b; --green: #20dd9b; --ink: #0b0b0b; --radius: 6px;
  --font: "Outfit", system-ui, sans-serif; --body: "Karla", system-ui, sans-serif;
}
[data-theme="dark"] {
  --bg: #0d1110; --bg-alt: #131918; --card: #151b1a; --text: #f1f5f3; --muted: #9aa5a1;
  --border: #25302d; --primary: #f1f5f3; --ink: #20dd9b;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { font-family: var(--body); font-size: 16px; background: var(--bg); color: var(--text); line-height: 1.7; transition: background .3s, color .3s; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
h1, h2, h3, h4, .logo, .btn { font-family: var(--font); }
.container { width: min(1120px, 92%); margin-inline: auto; }

/* Header */
.header { position: fixed; inset: 0 0 auto 0; z-index: 50; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); }
.header.scrolled { border-bottom: 1px solid var(--border); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { font-weight: 700; font-size: 1.2rem; display: flex; align-items: center; gap: 10px; }
.logo::before { content: ""; width: 30px; height: 30px; border-radius: 50%; background: var(--green); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.logo span { color: var(--muted); font-weight: 400; }
.nav-links { display: flex; gap: 32px; }
.nav-links a { font-size: .9rem; color: var(--muted); font-weight: 500; position: relative; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); margin-right: 8px; vertical-align: middle; }
.nav-actions { display: flex; gap: 8px; }
.icon-btn { background: var(--card); border: 1.5px solid var(--ink); border-radius: 50%; width: 38px; height: 38px; cursor: pointer; color: var(--text); }
.menu-btn { display: none; }

/* Botones */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 26px; font-weight: 600; font-size: .95rem; cursor: pointer; border: 2px solid var(--ink); border-radius: 3px; transition: transform .15s, box-shadow .15s; }
.btn-primary { background: var(--ink); color: var(--bg); box-shadow: 5px 5px 0 var(--green); }
[data-theme="dark"] .btn-primary { color: #0b0b0b; box-shadow: 5px 5px 0 #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: transparent; padding-inline: 8px; }
.btn-ghost::after { content: "↓"; }
.btn:hover { transform: translate(-2px, -2px); }
.btn-primary:hover { box-shadow: 7px 7px 0 var(--green); }

/* Hero */
.hero { min-height: 100vh; display: flex; align-items: center; padding: 120px 0 80px; }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.badge { display: inline-block; padding: 6px 14px; border: 1.5px solid var(--ink); font-family: var(--font); font-weight: 500; font-size: .85rem; margin-bottom: 24px; position: relative; background: var(--bg); }
.badge::before, .badge::after { content: ""; position: absolute; width: 9px; height: 9px; background: var(--green); border: 1.5px solid var(--ink); top: -5px; left: -5px; }
.badge::after { top: auto; left: auto; right: -5px; bottom: -5px; }
h1 { font-size: clamp(2.6rem, 6.5vw, 4.6rem); line-height: 1.15; font-weight: 600; letter-spacing: -.02em; }
.gradient { background: linear-gradient(transparent 62%, var(--green) 62%, var(--green) 92%, transparent 92%); }
.role { font-size: clamp(1.3rem, 3vw, 2rem); font-weight: 500; margin: 8px 0 18px; color: var(--text); }
.cursor { color: var(--green); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.lead { color: var(--muted); max-width: 470px; font-size: 1.05rem; }
.hero-buttons { display: flex; gap: 22px; margin: 32px 0; align-items: center; flex-wrap: wrap; }
.socials { display: flex; gap: 12px; align-items: center; }
.socials::before { content: "Encuéntrame en:"; font-family: var(--font); font-weight: 600; font-size: .9rem; margin-right: 8px; }
.socials a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 1.5px solid var(--border); transition: all .2s; }
.socials svg { width: 17px; height: 17px; fill: currentColor; }
.socials a:hover { background: var(--green); border-color: var(--ink); color: #0b0b0b; transform: translateY(-3px); }

.hero-card { position: relative; padding: 0 30px 40px 0; }
.hero-card::before { content: ""; position: absolute; width: 85%; height: 60px; background: var(--green); border-radius: 40px; right: -30px; bottom: 20px; transform: rotate(-24deg); z-index: 0; }
.hero-card::after { content: ""; position: absolute; width: 60%; height: 40px; background: var(--green); border-radius: 40px; left: -10px; bottom: 0; transform: rotate(-24deg); z-index: 0; }
.code-window { position: relative; z-index: 1; background: #1a1d1c; color: #e8f3ee; border: 2px solid var(--ink); box-shadow: 14px 14px 0 var(--ink); padding: 22px 26px; font-family: "Consolas", monospace; font-size: .92rem; animation: float 6s ease-in-out infinite; }
[data-theme="dark"] .code-window { box-shadow: 14px 14px 0 #000; border-color: var(--green); }
@keyframes float { 50% { transform: translateY(-8px); } }
.dots { display: flex; gap: 6px; margin-bottom: 14px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff6b6b; }
.dots i:nth-child(2) { background: #ffd166; } .dots i:nth-child(3) { background: var(--green); }
pre { overflow-x: auto; }
.c { color: #7d8b86; } .k { color: var(--green); } .s { color: #ffd166; }

/* Banda tipo marquesina */
.marquee { background: #0b0b0b; color: #fff; padding: 30px 0; transform: skewY(-1.5deg); margin: 20px 0 60px; border-top: 6px solid var(--green); border-bottom: 6px solid var(--green); overflow: hidden; }
.marquee-track { display: flex; gap: 48px; width: max-content; animation: scroll 28s linear infinite; font-family: var(--font); font-size: 1.7rem; font-weight: 500; white-space: nowrap; align-items: center; }
.marquee-track b { color: var(--green); font-size: 1.6rem; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* Secciones */
.section { padding: 80px 0; }
.section.alt { background: var(--bg-alt); }
.section-title { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; display: inline-block; }
.section-title::after { content: ""; display: block; height: 10px; margin-top: -12px; background: var(--green); position: relative; z-index: -1; width: 80%; }
.section-sub { color: var(--muted); margin: 14px 0 40px; max-width: 560px; }
.about { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; margin-top: 36px; align-items: center; }
.about-text p { color: var(--muted); margin-bottom: 16px; }
.about-text strong { color: var(--text); }
.facts { display: grid; gap: 8px; margin-top: 8px; font-weight: 500; }
.stats { display: grid; gap: 18px; }
.stat { background: var(--card); border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--green); padding: 16px 22px; display: flex; align-items: baseline; gap: 14px; }
.stat b { font-family: var(--font); font-size: 2.2rem; font-weight: 600; }
.stat span { color: var(--muted); }

.tech-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; margin-top: 36px; }
.tech-card, .project, .service { background: var(--card); border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); transition: transform .2s, box-shadow .2s; }
[data-theme="dark"] .tech-card, [data-theme="dark"] .project, [data-theme="dark"] .service { border-color: var(--border); box-shadow: 6px 6px 0 var(--green); }
.tech-card:hover, .project:hover, .service:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--green); }
.tech-card { padding: 26px; }
.tech-card h3 { font-weight: 600; margin-bottom: 16px; font-size: 1.2rem; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span { font-size: .8rem; padding: 3px 12px; border-radius: 999px; border: 1.5px solid var(--border); font-weight: 500; transition: all .2s; }
.tags span:hover { background: var(--green); border-color: var(--ink); color: #0b0b0b; }

.filters { display: flex; gap: 12px; margin: 30px 0; flex-wrap: wrap; }
.filter { padding: 8px 22px; border-radius: 999px; border: 2px solid var(--ink); background: var(--card); color: var(--text); cursor: pointer; font-family: var(--font); font-weight: 500; }
[data-theme="dark"] .filter { border-color: var(--border); }
.filter.active, .filter:hover { background: var(--green); color: #0b0b0b; border-color: var(--ink); }
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 28px; }
.project.hide { display: none; }
.project-img { height: 130px; display: grid; place-items: center; font-size: 3rem; border-bottom: 2px solid var(--ink); }
.p1 { background: var(--green); } .p2 { background: #ffd166; } .p3 { background: #8fd3ff; } .p4 { background: #ff9fb2; }
.project-body { padding: 20px; }
.project-body h3 { font-weight: 600; margin-bottom: 6px; }
.project-body p { color: var(--muted); font-size: .92rem; margin-bottom: 12px; }
.links { display: flex; gap: 18px; margin-top: 16px; font-family: var(--font); font-weight: 600; font-size: .9rem; }
.links a { border-bottom: 2px solid var(--green); }
.links a::after { content: " ↗"; }
.subhead { text-align: left; margin: 70px 0 24px; font-size: 1.6rem; font-weight: 600; }
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; }
.service { padding: 24px; }
.service span { font-size: 1.8rem; }
.service h4 { margin: 8px 0 4px; font-weight: 600; font-size: 1.15rem; }
.service p { color: var(--muted); font-size: .92rem; }

.timeline { max-width: 640px; margin: 40px 0 0; border-left: 2px solid var(--ink); padding-left: 30px; }
[data-theme="dark"] .timeline { border-color: var(--green); }
.t-item { position: relative; margin-bottom: 28px; }
.t-item i { position: absolute; left: -41px; top: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--green); border: 2px solid var(--ink); }
.t-item h4 { font-weight: 600; font-size: 1.2rem; }
.t-item p { color: var(--muted); }

.contact { max-width: 680px; margin-inline: auto; }
.contact .section-title, .contact .section-sub { display: block; text-align: center; margin-inline: auto; }
.contact .section-title { width: fit-content; }
.form .btn { justify-self: center; }
.form { display: grid; gap: 18px; }
.field label { display: block; font-family: var(--font); font-weight: 500; font-size: .9rem; margin-bottom: 6px; }
.field input, .field textarea { width: 100%; padding: 12px 14px; border: 2px solid var(--ink); border-radius: 3px; background: var(--card); color: var(--text); font-family: var(--body); font-size: 1rem; }
[data-theme="dark"] .field input, [data-theme="dark"] .field textarea { border-color: var(--border); }
.field input:focus, .field textarea:focus { outline: none; box-shadow: 4px 4px 0 var(--green); }
.field.error input, .field.error textarea { border-color: #e5484d; }
.field small { color: #e5484d; font-size: .82rem; }
.form .btn { justify-self: center; }
.form-status { color: #0e9c6b; font-weight: 600; }

.footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); font-size: .9rem; }
.footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s, transform .7s; }
.reveal.visible { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .hero-inner, .about { grid-template-columns: 1fr; }
  .hero-card { max-width: 420px; }
  .menu-btn { display: block; }
  .socials::before { width: 100%; margin: 0 0 4px; }
  .socials { flex-wrap: wrap; }
  .nav-links { position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--border); max-height: 0; overflow: hidden; transition: max-height .3s; }
  .nav-links.open { max-height: 300px; }
  .nav-links a { display: block; padding: 14px 4%; }
  .marquee-track { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
