/* ------------------------------------------------------------------
   caiogoia — v2
   Flat ink background, hairline grid, serif display + Geist.
   ------------------------------------------------------------------ */
:root {
  --bg: #0e0e0d;
  --bg-2: #141413;
  --line: #242422;
  --line-2: #363632;
  --text: #ecebe6;
  --muted: #9a9993;
  --faint: #605f5a;
  --live: #8fcf9c;
  --warm: #c9a56c;

  --col: min(1180px, calc(100vw - 64px));
  --wide: min(1300px, calc(100vw - 32px));
  --pad: 32px;

  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
::selection { background: var(--text); color: var(--bg); }
:focus-visible { outline: 1px solid var(--text); outline-offset: 3px; }

/* the two vertical rails that frame the column */
body::before {
  content: ""; position: fixed; top: 0; bottom: 0; z-index: -1; pointer-events: none;
  left: calc(50% - var(--col) / 2); width: var(--col);
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
}

/* ---------- rows: full-bleed hairlines with crosshairs on the rails ---------- */
.row { position: relative; border-top: 1px solid var(--line); }
.row::before, .row::after {
  content: ""; position: absolute; top: -7px; width: 13px; height: 13px; pointer-events: none; z-index: 2;
  background:
    linear-gradient(var(--line-2), var(--line-2)) center / 1px 100% no-repeat,
    linear-gradient(var(--line-2), var(--line-2)) center / 100% 1px no-repeat;
}
.row::before { left: calc(50% - var(--col) / 2 - 6px); }
.row::after { left: calc(50% + var(--col) / 2 - 6px); }
.col { width: 100%; max-width: var(--col); margin: 0 auto; }

.label {
  font: 500 11px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint);
}
.dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--live);
  margin-right: 8px; vertical-align: 1px; animation: blink 2.4s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: .35; } }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 30; border-top: 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.top::before, .top::after { top: auto; bottom: -7px; }
.top-inner { display: grid; grid-template-columns: 1fr 64px 1fr; height: 60px; }
.top-nav { display: flex; align-items: center; gap: 26px; padding-left: 24px; }
.top-nav a { font-size: 14px; color: var(--muted); transition: color .15s; }
.top-nav a:hover { color: var(--text); }
.mark {
  display: grid; place-items: center;
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  font: italic 400 34px/1 var(--serif); color: var(--text);
}
.mark span { transform: translateY(-3px); transition: transform .3s; }
.mark:hover span { transform: translateY(-3px) rotate(-8deg); }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding-right: 16px; }
.lang {
  display: flex; gap: 0; padding: 6px 4px; background: none; border: 0; cursor: pointer;
  font: 500 11.5px var(--mono); letter-spacing: .12em; color: var(--faint);
}
.lang span { padding: 0 4px; transition: color .15s; }
.lang span + span { border-left: 1px solid var(--line-2); }
.lang:hover span { color: var(--muted); }
html[lang="en"] .lang [data-l="en"], html[lang="pt-BR"] .lang [data-l="pt"] { color: var(--text); }
.btn-cv {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 11.5px var(--mono); letter-spacing: .12em; text-transform: uppercase;
  padding: 8px 12px; background: var(--text); color: var(--bg); border-radius: 2px;
  transition: background .15s;
}
.btn-cv:hover { background: #fff; }
.btn-cv .ar { transition: transform .2s; }
.btn-cv:hover .ar { transform: translateY(2px); }

/* ---------- profile ---------- */
.profile { display: grid; grid-template-columns: 172px 1fr 212px; }
.cell { padding: 28px var(--pad); }
.cell + .cell { border-left: 1px solid var(--line); }
.avatar { padding: 26px; display: grid; place-items: center; }
.avatar img {
  width: 118px; height: 118px; object-fit: cover; border-radius: 2px;
  filter: grayscale(1) contrast(1.04) brightness(.95);
  transition: filter .5s ease;
}
.avatar:hover img { filter: none; }
.id { display: flex; flex-direction: column; justify-content: center; }
h1 { font: 400 64px/1 var(--serif); letter-spacing: -.01em; }
.kicker {
  margin-top: 14px; font: 500 11.5px/1.5 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.id-links { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 18px; }
.id-links a {
  font: 500 12px var(--mono); letter-spacing: .08em; color: var(--muted);
  border-bottom: 1px solid transparent; transition: color .15s, border-color .15s;
}
.id-links a:hover { color: var(--text); border-color: var(--line-2); }
.meta { display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.meta dt { font: 500 10.5px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.meta dd { margin-top: 3px; font: 400 13px var(--mono); color: var(--text); }

/* ---------- bio ---------- */
.bio { padding: 34px var(--pad) 36px; display: grid; gap: 16px; }
.lead { font-size: 21px; line-height: 1.6; color: var(--muted); max-width: 52ch; }
.lead b {
  font-weight: 500; color: var(--text);
  text-decoration: underline; text-decoration-color: var(--line-2);
  text-decoration-thickness: 1px; text-underline-offset: 5px;
}
.bio p:not(.lead) { color: var(--faint); max-width: 70ch; font-size: 15.5px; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 6px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat b { font: 400 34px/1.05 var(--sans); letter-spacing: -.035em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13.5px; line-height: 1.45; color: var(--muted); }

/* ---------- hatch separators ---------- */
.hatch {
  height: 30px;
  background: repeating-linear-gradient(-45deg, var(--line) 0 1px, transparent 1px 7px);
}

/* ---------- section heads ---------- */
.head { display: flex; align-items: baseline; justify-content: space-between; padding: 26px var(--pad) 20px; }
h2 { font: 400 42px/1.05 var(--serif); letter-spacing: -.01em; }
.subhead { display: flex; align-items: center; justify-content: space-between; padding: 13px var(--pad); }
.subhead .link { transition: color .15s; }
.subhead .link:hover { color: var(--text); }

/* ---------- selected work ---------- */
.wide { width: 100%; max-width: var(--wide); margin: 0 auto; }
.work {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line);
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
}
.piece { position: relative; display: flex; flex-direction: column; background: var(--bg); transition: background .25s; }
/* crop marks that close in on the piece */
.piece::after {
  content: ""; position: absolute; inset: 12px; pointer-events: none; z-index: 1;
  --m: var(--text);
  background:
    linear-gradient(var(--m), var(--m)) top left / 16px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) top left / 1px 16px no-repeat,
    linear-gradient(var(--m), var(--m)) top right / 16px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) top right / 1px 16px no-repeat,
    linear-gradient(var(--m), var(--m)) bottom left / 16px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) bottom left / 1px 16px no-repeat,
    linear-gradient(var(--m), var(--m)) bottom right / 16px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) bottom right / 1px 16px no-repeat;
  opacity: 0; transform: scale(1.025);
  transition: opacity .3s ease, transform .45s cubic-bezier(.2, .7, .2, 1);
}
.piece:hover::after { opacity: 1; transform: none; }
.piece h3 { transition: transform .35s cubic-bezier(.2, .7, .2, 1); }
.piece h3::after {
  content: "↗"; display: inline-block; margin-left: 10px; font: 400 18px var(--mono); vertical-align: 4px;
  opacity: 0; transform: translate(-6px, 4px); transition: opacity .25s, transform .35s cubic-bezier(.2, .7, .2, 1);
}
.piece:hover h3::after { opacity: .7; transform: none; }

/* charts redraw themselves on hover */
.cover rect.c-base, .cover rect.c-hi { transform-box: fill-box; transform-origin: 50% 100%; }
.piece:hover .cover rect.c-base, .piece:hover .cover rect.c-hi { animation: grow .7s cubic-bezier(.2, .7, .2, 1) both; }
.piece:hover .cover g rect:nth-child(2) { animation-delay: .04s; }
.piece:hover .cover g rect:nth-child(3) { animation-delay: .08s; }
.piece:hover .cover g rect:nth-child(4) { animation-delay: .12s; }
.piece:hover .cover g rect:nth-child(5) { animation-delay: .16s; }
.piece:hover .cover g rect:nth-child(6) { animation-delay: .2s; }
.piece:hover .cover g rect:nth-child(7) { animation-delay: .24s; }
.piece:hover .cover g rect:nth-child(8) { animation-delay: .28s; }
.piece:hover .cover g rect:nth-child(9) { animation-delay: .32s; }
.piece:hover .cover g rect:nth-child(10) { animation-delay: .36s; }
.piece:hover .cover .c-key rect { animation: none; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.piece:hover .cover .c-v, .piece:hover .cover .c-note { animation: fade .5s .35s both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.c-ln-a, .c-ln-b { stroke-dasharray: 520; stroke-dashoffset: 0; }
.piece:hover .c-ln-a, .piece:hover .c-ln-b { animation: draw 1.1s cubic-bezier(.3, .6, .2, 1) both; }
.piece:hover .c-ln-b { animation-delay: .1s; }
.piece:hover .c-ln-c { animation: fade .8s .3s both; }
@keyframes draw { from { stroke-dashoffset: 520; } to { stroke-dashoffset: 0; } }
.piece:hover { background: var(--bg-2); }
.cover { aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--line); background: #121211; }
.cover svg { width: 100%; height: 100%; display: block; }
.cover-shot img {
  width: 100%; height: 100%; object-fit: cover; object-position: top left;
  filter: grayscale(1) brightness(.82) contrast(1.05); transition: filter .5s ease, transform .8s ease;
}
.piece:hover .cover-shot img { filter: none; transform: scale(1.015); }
.piece-body { flex: 1; padding: 22px 28px 24px; display: flex; flex-direction: column; gap: 14px; }
.piece-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
h3 { font: 400 28px/1.15 var(--serif); letter-spacing: -.005em; }
.tag {
  flex: none; display: inline-flex; align-items: center;
  font: 500 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  padding: 4px 8px; border: 1px solid var(--line-2); border-radius: 2px;
}
.tag .dot { width: 5px; height: 5px; margin-right: 7px; vertical-align: 0; }
.tag-live { color: var(--live); border-color: color-mix(in srgb, var(--live) 35%, transparent); }
.tag-wip { color: var(--warm); border-color: color-mix(in srgb, var(--warm) 35%, transparent); }
.piece-body > p { font-size: 15px; color: var(--muted); }
.piece-body > .stack { font-size: 12px; color: var(--faint); }
.result { display: grid; gap: 4px; padding-left: 14px; border-left: 1px solid var(--line-2); }
.piece-body > .result { color: var(--text); }
.stack { font: 400 12px/1.6 var(--mono); color: var(--faint); letter-spacing: .02em; }
.piece-links { display: flex; border-top: 1px solid var(--line); }
.piece-links a {
  flex: 1; display: flex; justify-content: space-between; padding: 14px 28px;
  font: 500 11.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  transition: color .15s, background .15s;
}
.piece-links a + a { border-left: 1px solid var(--line); }
.piece-links a:hover { color: var(--text); background: #191918; }

/* chart covers: ink on ink, one light series */
.c-t { font: 400 12px var(--mono); fill: var(--faint); letter-spacing: .02em; }
.c-l { font: 400 11px var(--mono); fill: var(--faint); }
.c-v { font: 400 11px var(--mono); fill: var(--muted); }
.c-v-hi { fill: var(--text); }
.c-note { font: italic 400 22px var(--serif); fill: var(--text); }
.c-axis { stroke: var(--line-2); stroke-width: 1; }
.c-dash { stroke-dasharray: 2 5; }
.c-base { fill: #2c2c29; }
.c-hi { fill: var(--text); }
.c-chance { stroke: var(--muted); stroke-dasharray: 3 4; stroke-width: 1; }
.c-ln { fill: none; stroke-width: 2; stroke-linecap: round; }
.c-ln-a { stroke: var(--text); }
.c-ln-b { stroke: #66655f; }
.c-ln-c { stroke: var(--muted); stroke-dasharray: 1 6; }
.c-pt { fill: var(--bg); stroke: var(--text); stroke-width: 1.5; }
.c-key text { font: 400 11px var(--mono); fill: var(--muted); }
.c-k-a { fill: var(--text); } .c-k-b { fill: #66655f; } .c-k-c { fill: var(--muted); }

/* ---------- repo list ---------- */
.repo {
  display: grid; grid-template-columns: 230px 1fr auto 64px 14px; align-items: baseline; gap: 20px;
  padding: 13px var(--pad); transition: background .15s;
}
.repo + .repo { border-top: 1px solid var(--line); }
a.repo:hover { background: var(--bg-2); }
.repo-name { font: 500 13px var(--mono); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repo-desc { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repo-desc.none { color: var(--faint); }
.repo-lang, .repo-year { font: 400 11px var(--mono); letter-spacing: .06em; color: var(--faint); white-space: nowrap; }
.repo-year { text-align: right; }
.repo .ar { color: var(--faint); transition: color .15s, transform .15s; }
a.repo:hover .ar { color: var(--text); transform: translate(2px, -2px); }
.repo.is-loading { display: block; }
.repo.is-loading span { display: block; height: 10px; width: 46%; background: var(--line); animation: blink 1.4s infinite; }
.repo-error { padding: 16px var(--pad); color: var(--muted); font-size: 14px; }
.repo-error a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; }

/* ---------- path ---------- */
.org { padding: 26px var(--pad) 30px; }
.org-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.org-head h3 { font: 600 17px/1.3 var(--sans); letter-spacing: -.005em; }
.org-sub { margin-top: 3px; font-size: 14px; color: var(--faint); }
.roles { margin-top: 22px; }
.role { position: relative; margin-left: 4px; padding: 0 0 26px 28px; border-left: 1px solid var(--line); }
.role:last-child { padding-bottom: 0; border-left-color: transparent; }
.role::before {
  content: ""; position: absolute; left: -4px; top: 7px; width: 7px; height: 7px;
  background: var(--bg); border: 1px solid var(--line-2);
}
.role.is-current::before { background: var(--text); border-color: var(--text); }
.role h4 { font: 500 16px/1.4 var(--sans); }
.role-meta { margin-top: 3px; }
.role ul { margin-top: 12px; display: grid; gap: 8px; max-width: 86ch; }
.role li { position: relative; padding-left: 18px; font-size: 15px; color: var(--muted); }
.role li::before { content: "–"; position: absolute; left: 0; color: var(--faint); }
.role-text { margin-top: 10px; font-size: 15px; color: var(--muted); max-width: 64ch; }
.role .stack { margin-top: 12px; }

/* ---------- skills ---------- */
.skill { display: grid; grid-template-columns: 210px 1fr; gap: 20px; align-items: baseline; padding: 16px var(--pad); }
.skill + .skill { border-top: 1px solid var(--line); }
.skill p { font-size: 15px; color: var(--text); }

/* ---------- contact ---------- */
.mail {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 34px var(--pad); transition: background .2s;
}
.mail:hover { background: var(--bg-2); }
.mail-addr { display: block; font: 400 clamp(30px, 5vw, 50px)/1.05 var(--serif); letter-spacing: -.01em; word-break: break-word; }
.mail-sub { display: block; margin-top: 10px; font-size: 14px; color: var(--muted); }
.mail-to { font: 500 14px var(--mono); color: var(--text); border-bottom: 1px solid var(--line-2); }
.mail .ar { font-size: 26px; color: var(--faint); transition: color .2s, transform .2s; }
.mail:hover .ar { color: var(--text); transform: translate(3px, -3px); }
.links { display: grid; grid-template-columns: repeat(4, 1fr); }
.links a {
  display: flex; justify-content: space-between; padding: 15px 20px;
  font: 500 11.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  transition: color .15s, background .15s;
}
.links a + a { border-left: 1px solid var(--line); }
.links a:hover { color: var(--text); background: var(--bg-2); }
.links .ar { transition: transform .15s; }
.links a:hover .ar { transform: translate(2px, -2px); }

/* ---------- footer ---------- */
footer.row { border-bottom: 1px solid var(--line); margin-bottom: 72px; }
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding: 18px var(--pad);
  font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint);
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  :root { --pad: 20px; }
  body::before, .row::before, .row::after { display: none; }
  .top-inner { grid-template-columns: 60px 1fr; }
  .top-nav { display: none; }
  .mark { border-left: 0; }
  .work { grid-template-columns: 1fr; }
  .profile { grid-template-columns: 132px 1fr; }
  .avatar { padding: 20px; }
  .avatar img { width: 92px; height: 92px; }
  .id { padding-left: 20px; }
  .meta {
    grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 14px 36px;
    border-left: 0 !important; border-top: 1px solid var(--line); padding-top: 18px; padding-bottom: 18px;
  }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .repo { grid-template-columns: 1fr auto 14px; grid-template-areas: "name year ar" "desc desc desc"; row-gap: 2px; }
  .repo-name { grid-area: name; } .repo-year { grid-area: year; } .repo .ar { grid-area: ar; }
  .repo-desc { grid-area: desc; white-space: normal; }
  .repo-lang { display: none; }
  .skill { grid-template-columns: 1fr; gap: 6px; }
  .links { grid-template-columns: 1fr 1fr; }
  .links a:nth-child(3) { border-left: 0; }
  .links a:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (max-width: 540px) {
  h1 { font-size: 46px; }
  h2 { font-size: 34px; }
  .profile { grid-template-columns: 1fr; }
  .avatar { justify-items: start; padding: 22px var(--pad) 0; }
  .avatar img { width: 76px; height: 76px; }
  .cell + .cell.id { border-left: 0; }
  .id { padding: 18px var(--pad) 24px; }
  .lead { font-size: 18px; }
  .stat b { font-size: 28px; }
  .piece-body { padding: 20px var(--pad) 22px; }
  .piece-links a { padding: 14px var(--pad); }
  .piece-title { flex-direction: column; gap: 8px; }
  .top-actions { gap: 8px; padding-right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
