:root {
  --paper: #ffffff;
  --ink: #0b1020;
  --ink-2: #444c61;
  --rule: #0b1020;
  --blue: #1b3dff;
  --blue-wash: #eef1ff;
  --orange: #ff5a1f;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(16px, 4vw, 40px);
  --f-sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "Azeret Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-stretch: 100%;
  caret-color: var(--blue);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--orange); color: var(--ink); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
a { color: inherit; text-underline-offset: 0.2em; }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
.wrap { width: min(1180px, 100% - 2 * var(--gutter)); margin-inline: auto; }

html { scrollbar-width: thin; scrollbar-color: var(--ink) var(--paper); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: var(--ink); border: 2px solid var(--paper); }

.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; z-index: 20; }
.skip:focus { top: 12px; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 10; background: var(--paper); border-bottom: 1px solid var(--rule); }
.top__in { width: min(1180px, 100% - 2 * var(--gutter)); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__mark { display: grid; place-items: center; width: 40px; height: 40px; background: var(--ink); color: #fff; font-weight: 800; font-stretch: 112%; letter-spacing: -0.02em; font-size: 0.95rem; }
.brand__name { font-weight: 700; font-stretch: 100%; letter-spacing: -0.01em; }
.nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 30px); font-size: 0.9375rem; font-weight: 500; font-stretch: 90%; }
.nav a { text-decoration: none; padding: 6px 0; background: linear-gradient(var(--ink), var(--ink)) left bottom / 0 2px no-repeat; transition: background-size 0.35s var(--ease); }
.nav a:hover { background-size: 100% 2px; }
.nav__cta { background: var(--blue) !important; color: #fff; padding: 8px 16px !important; font-weight: 600; }
.nav__cta:hover { background: var(--ink) !important; }

/* ---------- sheet (shared boleto grid) ---------- */
.sheet { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.sheet > * { background: var(--paper); }

/* ---------- hero ---------- */
.hero { padding-block: clamp(24px, 4vw, 48px) clamp(40px, 6vw, 80px); }
.hero__sheet { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.hero__main { padding: clamp(24px, 3.5vw, 48px); display: flex; flex-direction: column; justify-content: center; gap: 24px; }
h1 {
  font-size: clamp(2.25rem, 5vw, 4.25rem);
  font-weight: 800;
  font-stretch: 108%;
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.lead { max-width: 56ch; font-size: clamp(1.0625rem, 1.5vw, 1.25rem); color: var(--ink-2); line-height: 1.5; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; font: inherit; font-size: 1rem; font-weight: 600; font-stretch: 95%;
  text-decoration: none; border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: square; transition: transform 0.3s var(--ease); }
.btn:hover svg { transform: translate(2px, -2px); }
.btn--blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn--blue:hover { background: var(--ink); border-color: var(--ink); }
.btn--line:hover { background: var(--ink); color: #fff; }
.btn { cursor: pointer; }
.btn svg rect, .btn svg path { vector-effect: non-scaling-stroke; }
.btn.is-copied { background: var(--ink); border-color: var(--ink); color: #fff; }
.contact .btn.is-copied { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.btn:active { transform: translateY(1px); }

.fields { display: grid; gap: 1px; background: var(--rule); grid-template-rows: repeat(4, 1fr); }
.field { background: var(--paper); padding: 16px 20px 18px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 80px; }
.field dt { font-size: 0.75rem; font-weight: 600; font-stretch: 75%; text-transform: uppercase; letter-spacing: 0.09em; color: var(--ink-2); }
.field dd { font-weight: 600; font-stretch: 100%; font-size: 1.125rem; line-height: 1.25; letter-spacing: -0.01em; }

.barcell { grid-column: 1 / -1; padding: 18px 20px 14px; }
.bars { position: relative; height: 72px; display: flex; align-items: stretch; overflow: hidden; }
.bars i { display: block; background: var(--ink); height: 100%; flex: none; }
.bars-inner { display: flex; width: 100%; height: 100%; animation: reveal 1.5s var(--ease) 0.25s backwards; }
.beam { position: absolute; top: -4px; bottom: -4px; width: 3px; left: 100%; background: var(--orange); animation: scan 1.5s var(--ease) 0.25s backwards; z-index: 1; }
.digits { margin-top: 10px; font-family: var(--f-mono); font-size: clamp(0.6875rem, 1.35vw, 0.8125rem); letter-spacing: 0.14em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: clip; }
@keyframes reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes scan { from { left: 0; opacity: 1; } 92% { opacity: 1; } to { left: 100%; opacity: 0; } }

/* ---------- content blocks ---------- */
.block { border-top: 1px solid var(--rule); padding-block: clamp(40px, 6vw, 88px); }
.block__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); gap: clamp(24px, 5vw, 72px); align-items: start; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); font-weight: 800; font-stretch: 108%; line-height: 1; letter-spacing: -0.03em; text-wrap: balance; }
h3 { font-size: 1.1875rem; font-weight: 700; font-stretch: 100%; line-height: 1.25; letter-spacing: -0.015em; }

/* results: ledger with dot leaders */
.leaders li { display: flex; align-items: baseline; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.leaders li:first-child { padding-top: 0; }
.leaders__t { flex: 0 1 62%; font-size: 1.0625rem; line-height: 1.4; }
.leaders li::after { content: ""; order: 1; flex: 1 1 24px; min-width: 24px; border-bottom: 2px dotted var(--ink-2); transform: translateY(-5px); }
.leaders__v { order: 2; flex: none; font-family: var(--f-mono); font-weight: 500; font-size: clamp(1.1rem, 2.2vw, 1.5rem); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; text-align: right; }

/* projects & experience */
.ledger li { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) minmax(0, 11rem); gap: 20px; padding: 24px 12px 26px; margin-inline: -12px; border-bottom: 1px solid var(--rule); transition: background-color 0.3s var(--ease); }
.ledger li:first-child { padding-top: 0; }
.ledger li:hover { background: var(--blue-wash); }
.ledger li:first-child:hover { background: linear-gradient(var(--paper) 0, var(--paper) 0), var(--blue-wash); background: var(--blue-wash); }
.ledger--proj li { grid-template-columns: 4.5rem minmax(0, 1fr); }
.ledger__d { font-family: var(--f-mono); font-size: 0.875rem; font-weight: 500; padding-top: 4px; font-variant-numeric: tabular-nums; }
.ledger__b p { margin-top: 8px; color: var(--ink-2); max-width: 64ch; font-size: 1rem; }
.ledger__o { font-size: 0.8125rem; font-weight: 600; font-stretch: 80%; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); text-align: right; padding-top: 6px; }
.ledger em { font-style: normal; font-size: 0.6875rem; font-weight: 700; font-stretch: 80%; text-transform: uppercase; letter-spacing: 0.1em; background: var(--ink); color: #fff; padding: 3px 7px 2px; margin-left: 8px; vertical-align: 2px; white-space: nowrap; }

/* skills */
.skills > div { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.skills > div:first-child { padding-top: 0; }
.skills dt { font-size: 0.8125rem; font-weight: 700; font-stretch: 80%; text-transform: uppercase; letter-spacing: 0.09em; padding-top: 4px; }
.skills dd { color: var(--ink-2); max-width: 64ch; }
.edu { margin-top: 28px; color: var(--ink-2); max-width: 70ch; font-size: 0.9375rem; }
.edu strong { color: var(--ink); }

/* ---------- cut line + contact ---------- */
.cut { position: relative; height: 24px; border-top: 1.5px dashed var(--ink); margin-top: 0; background: var(--paper); }
.cut svg { position: absolute; top: -13px; left: var(--gutter); width: 26px; height: 26px; background: var(--paper); padding: 0 3px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; transform: rotate(0deg); }
.cut { height: 0; }
.contact { background: var(--blue); color: #fff; padding-block: clamp(56px, 9vw, 120px) clamp(32px, 4vw, 48px); }
.contact__in { display: flex; flex-direction: column; gap: 28px; align-items: flex-start; }
.contact h2 { font-size: clamp(2.5rem, 7vw, 6rem); font-stretch: 114%; line-height: 0.96; letter-spacing: -0.04em; max-width: 14ch; color: #fff; }
.contact p { max-width: 52ch; font-size: clamp(1.0625rem, 1.5vw, 1.25rem); color: #e4e9ff; }
.contact .btn { border-color: #fff; color: #fff; }
.contact .btn--white { background: #fff; color: var(--ink); }
.contact .btn--white:hover { background: var(--orange); border-color: var(--orange); }
.contact .btn--ghost:hover { background: #fff; color: var(--blue); }
.contact :focus-visible { outline-color: #fff; }
.contact ::selection { background: #fff; color: var(--blue); }
.contact__foot { margin-top: clamp(32px, 6vw, 72px); padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.45); width: 100%; font-family: var(--f-mono); font-size: 0.8125rem !important; letter-spacing: 0.04em; max-width: none !important; text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero__sheet { grid-template-columns: 1fr; }
  .fields { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
  .block__grid { grid-template-columns: 1fr; gap: 28px; }
  .nav a:not(.nav__cta) { display: none; }
  .ledger li { grid-template-columns: 4rem minmax(0, 1fr); }
  .ledger__o { grid-column: 2; text-align: left; padding-top: 0; }
}
@media (max-width: 560px) {
  .fields { grid-template-columns: 1fr; }
  .field { min-height: 0; }
  .leaders li { flex-wrap: wrap; row-gap: 6px; }
  .leaders__t { flex: 1 1 100%; }
  .leaders li::after { display: none; }
  .leaders__v { order: 0; text-align: left; color: var(--blue); }
  .ledger li { grid-template-columns: 1fr; gap: 6px; }
  .ledger__o { grid-column: 1; }
  .skills > div { grid-template-columns: 1fr; gap: 6px; }
  .btn { padding: 13px 18px; }
  .contact .btn { width: 100%; justify-content: space-between; }
  .digits { letter-spacing: 0.06em; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bars-inner, .beam { animation: none; }
  .beam { display: none; }
  * { transition-duration: 0.01ms !important; }
}
