@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url(/assets/fonts/archivo-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url(/assets/fonts/jetbrainsmono-latin.woff2) format('woff2');
}

:root {
  --bg: #0C0E0D;
  --bg2: #0F1211;
  --surface: rgba(20, 23, 22, 0.85);
  --line: #26302B;
  --line2: #3A4540;
  --text: #E8EAE6;
  --text2: #B9C0BB;
  --muted: #9AA39D;
  --accent: #F2B544;
  --accent-hi: #FFD27A;
  --ok: #7EE0A1;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --sans: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(rgba(232, 234, 230, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  line-height: 1.5;
  overflow-x: hidden;
}
a { color: var(--accent); }
a:hover { color: var(--accent-hi); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

.mono { font-family: var(--mono); }
.acc { color: var(--accent); }
.ok { color: var(--ok); }
.muted { color: var(--muted); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px); }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.print-only { display: none !important; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--accent); color: var(--bg); padding: 10px 16px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 16px; color: var(--bg); }

/* progress */
.prog { position: fixed; top: 0; left: 0; right: 0; height: 2px; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); z-index: 50; }

/* header */
.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding-top: 24px; padding-bottom: 24px; }
.brand { color: var(--text); text-decoration: none; font-size: 15px; font-weight: 500; }
.brand:hover { color: var(--text); }
.nav { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; }
.nav > a { color: var(--muted); text-decoration: none; font-size: 13px; padding: 10px 0; }
.nav > a:hover { color: var(--text); }
@media (max-width: 640px) { .nav > a { display: none; } }
.lang { display: flex; border: 1px solid var(--line2); }
.lang button { min-height: 40px; min-width: 46px; background: transparent; color: var(--text); border: 0; font-size: 12px; cursor: pointer; transition: background .2s, color .2s; }
.lang button:hover { color: var(--accent); }
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--bg); font-weight: 700; }

/* hero */
.hero { padding-top: clamp(56px, 10vw, 140px); padding-bottom: clamp(64px, 8vw, 120px); }
.prompt { margin: 0 0 28px; font-size: 15px; color: var(--muted); }
.type { display: inline-block; overflow: hidden; white-space: nowrap; width: 0; vertical-align: bottom; animation: typing 1.4s steps(16) .3s forwards; }
@keyframes typing { to { width: 16ch; } }
.cursor { display: inline-block; width: .6em; height: 1.1em; margin-left: 2px; background: var(--accent); vertical-align: -.2em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.name { margin: 0; font-size: clamp(58px, 13vw, 200px); line-height: .86; font-weight: 800; letter-spacing: -.03em; text-transform: uppercase; }
.name .r1, .name .r2 { display: block; white-space: nowrap; }
.ch { display: inline-block; font-stretch: 62%; opacity: 0; transform: translateY(.6em); animation: chIn 1.1s cubic-bezier(.2, .8, .2, 1) forwards; transition: font-stretch .5s cubic-bezier(.2, .8, .2, 1); }
@keyframes chIn { to { font-stretch: 100%; opacity: 1; transform: none; } }
@media (hover: hover) { .name:hover .ch { font-stretch: 118%; } }
.r1 .ch:nth-child(1) { animation-delay: .05s; } .r1 .ch:nth-child(2) { animation-delay: .1s; } .r1 .ch:nth-child(3) { animation-delay: .15s; }
.r1 .ch:nth-child(4) { animation-delay: .2s; } .r1 .ch:nth-child(5) { animation-delay: .25s; } .r1 .ch:nth-child(6) { animation-delay: .3s; }
.r2 .ch:nth-child(1) { animation-delay: .35s; } .r2 .ch:nth-child(2) { animation-delay: .4s; } .r2 .ch:nth-child(3) { animation-delay: .45s; }
.r2 .ch:nth-child(4) { animation-delay: .5s; } .r2 .ch:nth-child(5) { animation-delay: .55s; } .r2 .ch:nth-child(6) { animation-delay: .6s; }
.r2 .ch:nth-child(7) { animation-delay: .65s; } .r2 .ch:nth-child(8) { animation-delay: .7s; }
.hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 40px 48px; margin-top: 56px; align-items: end; }
.lead { margin: 0; font-size: clamp(19px, 2vw, 26px); line-height: 1.42; max-width: 34ch; }
.hero-side { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.status { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.75; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; }

.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px; font-size: 14px; font-weight: 600; text-decoration: none; border-radius: 2px; cursor: pointer; border: 1px solid transparent; transition: background .2s, color .2s, border-color .2s; }
.btn-p { background: var(--accent); color: var(--bg); }
.btn-p:hover { background: var(--accent-hi); color: var(--bg); }
.btn-s { background: transparent; border-color: var(--line2); color: var(--text); }
.btn-s:hover { border-color: var(--accent); color: var(--accent); }

/* figures band */
.band { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg2); }
.band-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 32px; padding-top: 48px; padding-bottom: 48px; }
.fig-n { margin: 0; font-size: clamp(44px, 5vw, 68px); font-weight: 800; line-height: 1; letter-spacing: -.02em; font-stretch: 112%; }
.fig-t { margin: 10px 0 0; color: var(--text2); font-size: 15px; max-width: 24ch; }

/* sections */
.sec { padding-top: 112px; padding-bottom: 32px; }
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 44px; }
.sec-head h2 { margin: 0; font-size: clamp(36px, 5vw, 64px); font-weight: 800; letter-spacing: -.02em; text-transform: uppercase; line-height: 1; }
.sec-head p { margin: 0; font-size: 13px; }
.tag { margin: 0; color: var(--accent); font-size: 13px; font-weight: 500; }

.sig-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 16px; }
.sig { border: 1px solid var(--line); background: var(--surface); padding: 30px; display: flex; flex-direction: column; gap: 12px; transition: border-color .3s, transform .3s; }
.sig:hover { border-color: var(--accent); transform: translateY(-4px); }
.sig h3 { margin: 0; font-family: var(--sans); font-size: 26px; font-weight: 700; color: var(--text); }
.sig p { margin: 0; color: var(--text2); line-height: 1.6; }
.sig .tag, .sig .muted { color: var(--accent); }
.sig .muted { color: var(--muted); font-size: 13px; }

/* traceroute */
.trace-head { margin: 0 0 12px; font-size: 13px; }
.hops { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.hop { display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1.7fr) 128px; gap: 16px; padding: 22px 8px; align-items: baseline; font-size: 15px; border-top: 1px solid var(--line); transition: background .3s; }
.hop:hover { background: rgba(242, 181, 68, .06); }
.hopn { justify-self: start; padding: 2px 8px; color: var(--accent); transition: background .3s, color .3s; }
.hop:hover .hopn { background: var(--accent); color: var(--bg); }
.hop strong { font-weight: 700; }
.hop-r { color: var(--text2); }
.hop-r small { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; }
.hop-y { color: var(--muted); text-align: right; }
.hop-y.acc { color: var(--accent); }
@media (max-width: 760px) {
  .hop { grid-template-columns: 44px minmax(0, 1fr); gap: 4px 12px; }
  .hop strong, .hop-r, .hop-y { grid-column: 2; }
  .hop-y { text-align: left; order: -1; font-size: 13px; }
  .hopn { grid-row: 1 / span 3; }
}

/* agents */
.agents { background: var(--bg2); border-top: 1px solid var(--line); margin-top: 112px; padding-bottom: 112px; }
.intro { margin: 0 0 48px; max-width: 62ch; color: var(--text2); font-size: 19px; line-height: 1.55; }
.diagram { margin: 0 0 16px; padding: clamp(20px, 4vw, 40px); border: 1px solid var(--line); background: var(--bg); }
.diagram figcaption { margin-bottom: 28px; font-size: 13px; }
.ag-node { border: 1px solid var(--line2); background: var(--surface); padding: 12px 16px; font-size: 13px; line-height: 1.5; color: var(--text); transition: border-color .3s, color .3s; }
.ag-node:hover { border-color: var(--accent); }
.ag-human, .ag-orch { max-width: 300px; margin: 0 auto; }
.ag-human { display: flex; gap: 12px; align-items: center; border-color: var(--accent); }
.ag-orch { text-align: center; }
.ag-av { width: 36px; height: 36px; flex: none; display: grid; place-items: center; background: var(--accent); color: var(--bg); font-weight: 700; }
.ag-wire { position: relative; width: 2px; height: 44px; margin: 0 auto; background: var(--line2); }
.ag-wire::after { content: ''; position: absolute; left: -3px; top: 0; width: 8px; height: 8px; background: var(--accent); animation: pulse 1.8s ease-in infinite; }
@keyframes pulse { 0% { top: -4px; opacity: 0; } 20% { opacity: 1; } 100% { top: 40px; opacity: 0; } }
.ag-workers { list-style: none; margin: 0; padding: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 12px; border-top: 2px solid var(--line2); }
.ag-workers .ag-node { text-align: center; position: relative; }
.ag-workers .ag-node::before { content: ''; position: absolute; left: 50%; top: -26px; width: 2px; height: 24px; background: var(--line2); }
.lab-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.lab-grid .sig { font-size: 14px; }
.lab-grid .sig p { line-height: 1.75; }

/* marquee */
.marq-wrap { padding: 36px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; }
.marq { display: flex; gap: 40px; width: max-content; white-space: nowrap; font-size: clamp(18px, 2vw, 24px); color: var(--muted); animation: marq 45s linear infinite; }
.marq i { font-style: normal; color: var(--accent); }
@keyframes marq { to { transform: translateX(-50%); } }

/* credentials */
.cred-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 32px; font-size: 14px; }
.cred-grid h3 { margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.cred-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; color: var(--text2); line-height: 1.5; }
.cred-grid li::before { content: '> '; color: var(--muted); }

/* contact */
.contact { padding-top: 140px; padding-bottom: 40px; }
.contact > p { margin: 0 0 24px; font-size: 13px; }
.big { margin: 0 0 48px; font-size: clamp(56px, 10vw, 160px); line-height: .9; font-weight: 800; letter-spacing: -.03em; text-transform: uppercase; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin-top: 100px; padding-top: 24px; padding-bottom: 32px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--accent); }

/* scroll-driven reveals (progressive enhancement) */
@supports (animation-timeline: view()) {
  .rv { animation: rvIn linear both; animation-timeline: view(); animation-range: entry 0% cover 28%; }
  .prog { animation: grow linear both; animation-timeline: scroll(root); }
}
@keyframes rvIn { from { opacity: 0; transform: translateY(44px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes grow { to { transform: scaleX(1); } }
/* fallback via IntersectionObserver (js adds .io on <html>) */
.io .rv { opacity: 0; transform: translateY(44px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .2, 1); }
.io .rv.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ch, .type, .rv, .marq, .cursor, .prog, .ag-wire::after { animation: none !important; transition: none !important; }
  .ch, .rv, .io .rv { opacity: 1 !important; transform: none !important; filter: none !important; font-stretch: 100% !important; }
  .type { width: auto !important; }
}

/* print: the page becomes a clean two-page CV */
@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  :root { --text: #111; --text2: #222; --muted: #555; --accent: #8A5A00; --line: #CCC; --line2: #BBB; --surface: #FFF; --bg: #FFF; --bg2: #FFF; }
  html { color-scheme: light; }
  html, body { background: #FFF !important; color: #111; font-size: 10pt; }
  .ok { color: #1A7F45; }
  #credenciales { break-inside: avoid; }
  body { background-image: none; }
  .top, .prog, .skip, .no-print, .cursor, .prompt, .marq-wrap, .diagram, .contact .big, .contact > p, .lang { display: none !important; }
  .print-only { display: block !important; }
  .print-contact { margin: 6px 0 0; font-family: var(--mono); font-size: 9pt; color: #333; }
  * { animation: none !important; transition: none !important; }
  .ch, .rv, .io .rv { opacity: 1 !important; transform: none !important; filter: none !important; font-stretch: 100% !important; }
  .type { width: auto !important; }
  .wrap { max-width: none; padding: 0; }
  .hero { padding: 0 0 8mm; }
  .name { font-size: 30pt; line-height: 1; letter-spacing: 0; }
  .name .r1, .name .r2 { display: inline; }
  .name .r1::after { content: ' '; }
  .hero-grid { margin-top: 4mm; gap: 6mm; grid-template-columns: 1.4fr 1fr; }
  .lead { font-size: 11pt; max-width: none; }
  .status { font-size: 8.5pt; color: #333; }
  .band { border: 0; }
  .band-grid { padding: 0 0 4mm; gap: 4mm; grid-template-columns: repeat(4, 1fr); }
  .fig-n { font-size: 18pt; }
  .fig-t { font-size: 8.5pt; }
  .sec { padding-top: 6mm; padding-bottom: 0; }
  .sec-head { margin-bottom: 3mm; }
  .sec-head h2 { font-size: 14pt; }
  .sig-grid { grid-template-columns: repeat(2, 1fr); gap: 3mm; }
  .sig { padding: 3mm 4mm; gap: 1mm; break-inside: avoid; border-color: #CCC; }
  .sig h3 { font-size: 11pt; }
  .sig p { font-size: 9pt; line-height: 1.4; }
  .hop { padding: 1.8mm 0; font-size: 9pt; grid-template-columns: 8mm minmax(0, 1fr) minmax(0, 1.8fr) 24mm; break-inside: avoid; }
  .hop-r small { font-size: 8pt; margin-top: 1mm; }
  .trace-head { display: none; }
  .sec-head { break-after: avoid; }
  .agents { margin-top: 0; padding-bottom: 0; border: 0; }
  .agents .intro { font-size: 9.5pt; margin: 0 0 3mm; max-width: none; }
  .lab-grid { grid-template-columns: repeat(2, 1fr); gap: 3mm; }
  .lab-grid .sig { font-size: 8.5pt; padding: 2.5mm 4mm; }
  .lab-grid .sig p { line-height: 1.4; }
  .lab-grid .sig h3 { font-size: 10pt; }
  .cred-grid { gap: 4mm; font-size: 8.5pt; grid-template-columns: repeat(3, 1fr); }
  .cred-grid ul { gap: 1.5mm; }
  .contact { padding: 6mm 0 0; }
  .contact .ctas .btn { min-height: 0; padding: 0; border: 0; background: none; color: #111; font-size: 9pt; }
  .contact .ctas a[href^="https"]::after { content: ' (' attr(href) ')'; }
  .foot { margin-top: 6mm; padding: 3mm 0 0; font-size: 8pt; }
  a { color: inherit; text-decoration: none; }
}
