:root {
  --side: 320px;
  --bg: #060d14;
  --ink: #edf2f6;
  --mute: #a3b3bf;
  --line: rgba(255, 255, 255, .13);
  --card: rgba(9, 19, 28, .78);
  --accent: #6cc4b4;
  --gold: #f0ae36;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; interpolate-size: allow-keywords; }
body {
  margin: 0;
  background: radial-gradient(120% 90% at 30% 0, #10283a 0, var(--bg) 60%) fixed var(--bg);
  color: var(--ink);
  font: 400 1rem/1.6 Inter, system-ui, sans-serif;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
html[lang="en"] body [lang="es"], html[lang="es"] body [lang="en"] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#bg { position: fixed; inset: 0; z-index: -1; }
#bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(6, 13, 20, .25), rgba(6, 13, 20, .55)); }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 20; background: var(--ink); color: var(--bg); padding: .5rem 1rem; }
.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.wide { width: min(1320px, 100% - 2.5rem); margin-inline: auto; }

.nav {
  position: fixed; z-index: 10; top: .9rem; left: 50%; translate: -50% 0;
  display: flex; align-items: center; gap: .15rem;
  max-width: calc(100% - 1.5rem); padding: .35rem .45rem;
  background: rgba(6, 13, 20, .72); backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: 999px;
  overflow-x: auto; scrollbar-width: none;
}
.nav a { padding: .4rem .8rem; border-radius: 999px; font-size: .875rem; font-weight: 500; text-decoration: none; white-space: nowrap; color: var(--mute); transition: color .2s, background .2s; }
.nav a:hover, .nav a[data-on] { color: var(--ink); background: rgba(255, 255, 255, .09); }
#lang-toggle { flex: none; position: sticky; right: 0; margin-left: .25rem; background: #0b1620; padding: .35rem .7rem; font: 600 .78rem Inter, sans-serif; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
#lang-toggle:hover { border-color: var(--accent); }

.hero {
  display: grid; grid-template-columns: var(--side) minmax(0, 1fr); gap: 2rem; align-items: center;
  padding-block: 7.5rem 3rem;
}
.portrait {
  justify-self: center; width: 220px; height: 220px; object-fit: cover; object-position: 50% 62%;
  border-radius: 50%; border: 2px solid rgba(108, 196, 180, .7);
  box-shadow: 0 0 0 8px rgba(108, 196, 180, .08), 0 20px 50px rgba(0, 0, 0, .45);
}
h1 { font-size: clamp(2.3rem, 5.2vw, 3.75rem); font-weight: 800; line-height: 1.05; letter-spacing: -.025em; }
.typed { min-height: 1.6em; margin-top: .6rem; font: 400 clamp(.86rem, 1.6vw, 1.06rem)/1.6 "JetBrains Mono", monospace; color: var(--accent); }
.typed i { display: inline-block; width: .55em; height: 1.05em; margin-left: .15em; vertical-align: -.15em; background: var(--accent); animation: blink 1.1s steps(2) infinite; }
.typed.static i { display: none; }
@keyframes blink { 50% { opacity: 0; } }
.bio { max-width: 68ch; margin-top: 1rem; color: #d3dde4; }
.js .hero > * { animation: rise .7s cubic-bezier(.2, .7, .2, 1) backwards; }
.js .hero-copy { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.acts { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.act {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 2.25rem; padding: .35rem .85rem;
  font-size: .875rem; font-weight: 500; text-decoration: none;
  border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .03);
  transition: border-color .2s, background .2s, transform .2s;
}
.act:hover { border-color: rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .08); transform: translateY(-1px); }
.act.solid { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 600; }
.act.solid:hover { background: #fff; }
.act img { width: 16px; height: 16px; }

.stars { display: inline-flex; align-items: center; gap: .25rem; font-size: .78rem; color: var(--gold); text-decoration: none; }
.stars svg { width: 13px; height: 13px; fill: currentColor; }
.stars b { font-weight: 600; }
.stars.inline { margin-left: .15rem; }
.forks { font-size: .78rem; color: var(--mute); }

.section { padding-block: 0 3rem; }
.layout { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); gap: 2rem; align-items: start; }
.side { align-self: stretch; }
.content { min-width: 0; }
.side-card { padding: 1.25rem; margin-bottom: 1rem; }
.side h2 { font-size: 1.15rem; letter-spacing: -.01em; margin-bottom: .9rem; }
#contact { position: sticky; top: 4.4rem; z-index: 2; background: rgba(9, 19, 28, .94); }
.side-rest > section { scroll-margin-top: 14.5rem; }
.contact-list { display: grid; gap: .65rem; margin-bottom: 1rem; font-size: .92rem; }
.contact-list li { display: flex; align-items: center; gap: .7rem; }
.contact-list svg, .contact-list img { flex: none; width: 20px; height: 15px; object-fit: cover; border-radius: 2px; }
.contact-list svg { height: 18px; color: var(--mute); }
.contact-list a { text-decoration: none; }
.contact-list a:hover { color: var(--accent); }
#contact .act { justify-content: center; width: 100%; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 1.25rem; }

.filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.25rem; }
.filters button { padding: .35rem .8rem; font: 500 .875rem Inter, sans-serif; color: var(--mute); background: rgba(9, 19, 28, .6); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; transition: color .2s, background .2s; }
.filters button:hover { color: var(--ink); }
.filters button[aria-pressed="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink); }

.panel { padding: 1.5rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1.25rem; }
.sec-head h2 { margin: 0; }
.stars.total { font-size: .9rem; }
.stars.total svg { width: 15px; height: 15px; align-self: center; }
.stars.total span { color: var(--mute); margin-left: .1rem; }

.card {
  --x: 50%; --y: 0;
  position: relative; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 1.5rem; padding-block: 1.5rem;
  border-top: 1px solid var(--line);
}
.card::before {
  content: ""; position: absolute; inset: 0 -1.5rem; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(420px circle at var(--x) var(--y), rgba(108, 196, 180, .08), transparent 70%);
}
.card:hover::before { opacity: 1; }
.card > * { position: relative; }
.card:last-of-type { padding-bottom: .25rem; }
#grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; }
#grid > * { grid-column: 1 / -1; }
#grid > .card.feature { grid-column: auto; grid-template-columns: minmax(0, 1fr); align-content: start; }
.card.feature::before { inset: 0; }
.card.feature .thumb { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.thumb video { display: block; width: 100%; height: 100%; object-fit: cover; background: #0e1621; }
.card.private { grid-template-columns: minmax(0, 1fr); padding-block: 1.1rem; }
.private-head { margin-top: 2rem; padding-bottom: .9rem; font-size: 1rem; font-weight: 600; color: var(--mute); }
.card-body { display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.card-head { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; }
.card-name { font-size: .82rem; font-weight: 600; color: var(--accent); }
.card h3 { font-size: 1.1rem; font-weight: 700; line-height: 1.3; }
.card p { font-size: .92rem; line-height: 1.55; color: #c6d2da; max-width: 75ch; }
.card .acts { margin-top: .15rem; }
.card .act { min-height: 2rem; font-size: .8rem; padding: .25rem .7rem; }
.thumb { display: block; width: 200px; height: 125px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .5s; }
.card:hover a.thumb img { transform: scale(1.04); }
.thumb.tile { display: flex; align-items: center; justify-content: center; gap: 1rem; background: rgba(255, 255, 255, .05); }
.thumb.tile img { width: 30px; height: 30px; object-fit: contain; }

.badges { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; }
.badge { padding: .1rem .55rem; font-size: .72rem; font-weight: 600; color: #cfdae1; border: 1px solid var(--line); border-radius: 999px; }
.badge.prod { color: #8fe3c9; border-color: rgba(108, 196, 180, .5); background: rgba(108, 196, 180, .1); }
.badge.dev { color: #f4c776; border-color: rgba(240, 174, 54, .45); }

.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chips li { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .5rem; font-size: .72rem; color: #c6d2da; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .03); }
.chips img { width: 13px; height: 13px; }
.chips.big { gap: .35rem; }
.chips.big li { padding: .2rem .55rem; font-size: .78rem; color: var(--ink); background: rgba(9, 19, 28, .72); transition: border-color .2s, transform .2s; }
.chips.big li:hover { border-color: rgba(255, 255, 255, .4); transform: translateY(-1px); }
.chips.big img { width: 15px; height: 15px; }

.more { display: block; margin: 1.25rem auto 0; padding: .45rem 1.1rem; font: 500 .9rem Inter, sans-serif; color: var(--ink); background: rgba(9, 19, 28, .8); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.more:hover { border-color: rgba(255, 255, 255, .4); }
.also { margin-top: 1.25rem; font-size: .875rem; color: var(--mute); }
.also a { margin-left: .6rem; color: var(--ink); text-underline-offset: 3px; }
#experience .also a { margin-left: 0; }

.stack-group + .stack-group { margin-top: 1rem; }
.stack-group h3 { font-size: .85rem; font-weight: 600; color: var(--mute); margin-bottom: .45rem; }
.anim .stack-group li { opacity: 0; }
.anim .stack-group.in li { animation: rise .4s ease-out backwards; animation-delay: calc(var(--i) * 28ms); opacity: 1; }

.job { background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: .6rem; }
.job summary { display: flex; gap: 1rem; align-items: center; padding: .85rem 1.15rem; cursor: pointer; list-style: none; }
.job summary::-webkit-details-marker { display: none; }
.job-title { flex: 1; min-width: 0; }
.job strong, .rows strong { display: block; font-weight: 600; }
.org { display: block; font-size: .875rem; color: var(--mute); }
.yr { display: inline-flex; align-items: center; gap: .6rem; flex: none; font-size: .85rem; color: var(--mute); }
.chev { width: 14px; height: 14px; transition: rotate .25s; }
.job[open] > summary .chev { rotate: 180deg; }
.job::details-content { height: 0; overflow: hidden; transition: height .28s ease, content-visibility .28s allow-discrete; }
.job[open]::details-content { height: auto; }
.job-body { padding: 0 1.15rem 1.1rem; }
.job-body > ul:not(.chips) { list-style: disc; padding-left: 1.1rem; margin-bottom: .8rem; font-size: .92rem; color: #c6d2da; }
.job-body > ul:not(.chips) li + li { margin-top: .2rem; }

.mini { flex: none; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); width: 68px; height: 46px; padding: .3rem; background: #fff; border-radius: 6px; }
.side .mini { width: 52px; height: 38px; padding: .25rem; }
.mini img { width: 100%; height: 100%; object-fit: contain; }
.rows li { display: flex; align-items: flex-start; gap: .75rem; padding-block: .7rem; font-size: .875rem; line-height: 1.4; }
.rows li:first-child { padding-top: 0; }
.rows li:last-child { padding-bottom: 0; }
.rows li + li { border-top: 1px solid var(--line); }
.rows .org { font-size: .8rem; margin-top: .15rem; }
.courses { display: grid; gap: .55rem; margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line); font-size: .85rem; line-height: 1.35; }
.courses .org { font-size: .76rem; }
.edu-title { flex: 1; min-width: 0; }

.pubs { display: grid; gap: 1rem; }
.pub { display: flex; align-items: center; gap: 1.25rem; text-decoration: none; }
.pub + .pub { padding-top: 1rem; border-top: 1px solid var(--line); }
.pub img { flex: none; width: 120px; height: 75px; object-fit: cover; border-radius: 6px; background: #fff; }
.pub strong { display: block; font-weight: 600; }
.pub:hover strong { text-decoration: underline; text-underline-offset: 3px; }

.langs { display: grid; gap: .8rem; font-size: .875rem; line-height: 1.4; }
.langs li { display: flex; align-items: flex-start; gap: .75rem; }
.langs img { flex: none; width: 32px; height: 24px; margin-top: .1rem; object-fit: cover; border-radius: 3px; }
.langs strong { display: block; font-weight: 600; }
.langs .org { font-size: .8rem; }

.socials { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 1.4rem; }
.socials a { display: block; color: var(--ink); line-height: 0; transition: color .2s, transform .2s; }
.socials a:hover { color: var(--accent); transform: translateY(-2px); }
.act img.flag { width: 20px; height: 15px; object-fit: cover; border-radius: 2px; }

.footer { padding-block: 1.5rem 2.5rem; font-size: .8rem; color: var(--mute); }

/* Consulting page */
.page-head { padding-block: 7rem 2rem; }
.lede { max-width: 62ch; margin-top: .75rem; font-size: 1.1rem; color: #d3dde4; }
.service { display: grid; grid-template-columns: 1fr 2fr; gap: 1.5rem; margin-bottom: 1rem; padding: 1.5rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.service h2 { font-size: 1.3rem; margin: 0; }
.service ul { list-style: disc; padding-left: 1.1rem; margin-top: .7rem; font-size: .95rem; color: #c6d2da; }
.proof { margin-top: .9rem; font-size: .9rem; color: var(--mute); }
.proof a { color: var(--ink); text-underline-offset: 3px; }
.advice { margin-block: 1.5rem 2rem; }
.advice a { margin-left: 0; }

@media (min-width: 1001px) {
  .narrow-only { display: none; }
}
@media (max-width: 1000px) {
  .hero { grid-template-columns: 220px minmax(0, 1fr); }
  .layout { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .side, .side-rest { display: contents; }
  #contact { position: static; order: 0; background: var(--card); }
  .content { order: 1; }
  .side-rest > section { order: 2; scroll-margin-top: 0; }
}
@media (max-width: 900px) {
  .service { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav { left: .75rem; right: .75rem; translate: none; }
  .nav a { padding: .35rem .6rem; font-size: .82rem; }
  .hero { grid-template-columns: 1fr; gap: 1.5rem; padding-block: 5.5rem 2rem; }
  .portrait { width: 136px; height: 136px; }
  .panel { padding: 1rem; }
  .card { grid-template-columns: 1fr; gap: .9rem; }
  .card::before { inset: 0 -1rem; }
  #grid > .card.feature { grid-column: 1 / -1; }
  .thumb { width: 100%; height: auto; aspect-ratio: 16 / 9; }
  .job summary { flex-wrap: wrap; padding-inline: .9rem; }
  .job summary .job-title { flex-basis: calc(100% - 68px - 1rem); }
  .job summary .yr { margin-left: calc(68px + 1rem); }
  .job-body { padding-inline: .9rem; }
  .pub img { width: 84px; height: 56px; }
  .socials { gap: .6rem; }
  .socials svg { width: 28px; height: 28px; }
  .section { padding-block: 0 2.25rem; }
  .also a { display: inline-block; margin: .2rem .6rem 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
