:root {
  --bg: #f6f7f9;
  --bg-alt: #eef1f5;
  --surface: #ffffff;
  --ink: #0f1720;
  --ink-2: #3b4653;
  --muted: #677382;
  --line: #dde3ea;
  --accent: #0f766e;
  --accent-2: #14b8a6;
  --accent-ink: #ffffff;
  --shadow: 0 1px 2px rgba(15, 23, 32, .05), 0 8px 24px rgba(15, 23, 32, .06);
  --radius: 16px;
}
:root[data-theme="dark"] {
  --bg: #0b1016;
  --bg-alt: #0f161e;
  --surface: #131b24;
  --ink: #e8edf2;
  --ink-2: #b7c1cc;
  --muted: #8592a0;
  --line: #222d39;
  --accent: #2dd4bf;
  --accent-2: #5eead4;
  --accent-ink: #04201d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1016;
    --bg-alt: #0f161e;
    --surface: #131b24;
    --ink: #e8edf2;
    --ink-2: #b7c1cc;
    --muted: #8592a0;
    --line: #222d39;
    --accent: #2dd4bf;
    --accent-2: #5eead4;
    --accent-ink: #04201d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .82em; letter-spacing: 0; }
.muted { color: var(--muted); }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.fill { fill: currentColor; stroke: none; }

/* language switch */
html[data-lang="pt"] [data-l="en"],
html[data-lang="en"] [data-l="pt"] { display: none !important; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-in { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink);
  font-size: 13px; font-weight: 800; letter-spacing: .5px;
}
.links { display: flex; gap: 4px; margin-left: auto; }
.links a { text-decoration: none; color: var(--ink-2); font-size: 14.5px; font-weight: 500; padding: 8px 12px; border-radius: 8px; }
.links a:hover { color: var(--ink); background: var(--bg-alt); }
.tools { display: flex; gap: 8px; }
.chip-btn, .icon-btn {
  height: 36px; min-width: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; font: 600 13px Inter, sans-serif;
  display: inline-grid; place-items: center;
}
.chip-btn:hover, .icon-btn:hover { border-color: var(--accent); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}
@media (max-width: 760px) {
  .links { display: none; }
  .tools { margin-left: auto; }
  .brand-name { display: none; }
}

/* hero */
.hero { position: relative; padding: 72px 0 48px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 640px; height: 640px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent);
  pointer-events: none;
}
.hero-in { position: relative; display: grid; grid-template-columns: 1.25fr .75fr; gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; border-radius: 999px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .18); }
.hero h1 { font-size: clamp(42px, 7vw, 72px); font-weight: 800; margin-top: 20px; }
.role { margin-top: 10px; font-size: clamp(18px, 2.4vw, 22px); font-weight: 600; color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.role .mono { color: var(--accent); font-size: 15px; }
.lead { margin-top: 18px; font-size: 17.5px; color: var(--ink-2); max-width: 58ch; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 28px; }
.cta.center { justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  text-decoration: none; font-weight: 600; font-size: 15px; transition: transform .15s, border-color .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.icon-link { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); }
.icon-link:hover { color: var(--accent); border-color: var(--accent); }
.icon-link svg { width: 20px; height: 20px; }

.hero-photo { position: relative; justify-self: center; width: 100%; max-width: 340px; }
.photo-frame {
  aspect-ratio: 4 / 5; border-radius: 28px; overflow: hidden; box-shadow: var(--shadow);
  border: 1px solid var(--line); background: var(--surface);
  transform: rotate(1.5deg);
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }
.float {
  position: absolute; display: flex; flex-direction: column; padding: 10px 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 12.5px; color: var(--muted);
}
.float strong { font-size: 22px; color: var(--ink); line-height: 1.1; }
.f1 { left: -28px; bottom: 56px; }
.f2 { right: -20px; top: 28px; }
@media (max-width: 860px) {
  .hero { padding: 40px 0 32px; }
  .hero-in { grid-template-columns: 1fr; gap: 40px; }
  .hero-photo { max-width: 260px; order: -1; justify-self: start; }
  .f1 { left: auto; right: -12px; bottom: 24px; }
  .f2 { right: -12px; top: 18px; }
}

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 16px; }
.stat { background: var(--surface); padding: 22px 22px; }
.stat strong { display: block; font-size: 28px; font-weight: 800; letter-spacing: -.02em; color: var(--accent); }
.stat > span { font-size: 14px; color: var(--muted); }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* sections */
.section { padding: 96px 0; }
.section.alt { background: var(--bg-alt); }
.sec-head { margin-bottom: 40px; }
.kicker { font-family: "JetBrains Mono", monospace; color: var(--accent); font-size: 13px; margin-bottom: 8px; }
.sec-head h2 { font-size: clamp(30px, 4.5vw, 42px); font-weight: 800; }
.sec-sub { margin-top: 10px; color: var(--muted); max-width: 60ch; }
@media (max-width: 600px) { .section { padding: 64px 0; } }

/* timeline */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 188px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.timeline > li { display: grid; grid-template-columns: 170px 1fr; gap: 36px; padding: 0 0 36px; position: relative; }
.timeline > li::before {
  content: ""; position: absolute; left: 183px; top: 8px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.timeline > li:first-child::before { background: var(--accent); }
.t-when { font-size: 14px; color: var(--muted); padding-top: 2px; text-align: right; }
.t-body h3 { font-size: 19px; font-weight: 700; }
.at { color: var(--accent); font-weight: 700; white-space: nowrap; }
.at::before { content: "@ "; color: var(--muted); font-weight: 500; }
.t-body p, .t-body ul { margin-top: 8px; color: var(--ink-2); }
.t-body ul { padding-left: 18px; }
.t-body li { margin-bottom: 4px; }
@media (max-width: 760px) {
  .timeline::before { left: 5px; }
  .timeline > li { grid-template-columns: 1fr; gap: 4px; padding-left: 28px; }
  .timeline > li::before { left: 0; }
  .t-when { text-align: left; }
}

/* tags */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px !important; }
.tags span {
  font-family: "JetBrains Mono", monospace; font-size: 12px; padding: 3px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--ink-2);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
}
.tags.big span { font-size: 13px; padding: 5px 11px; }

/* featured projects */
.feature {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 36px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px; box-shadow: var(--shadow);
  margin-bottom: 28px;
}
.feature.reverse .shot, .feature.reverse .carousel { order: 2; }
.shot { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 10; background: var(--bg-alt); }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform .5s; }
.shot:hover img { transform: scale(1.03); }
.f-body { padding: 8px 8px 8px 0; }
.feature.reverse .f-body { padding: 8px 0 8px 8px; }
.badge { display: inline-block; font-size: 12.5px; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 4px 10px; border-radius: 999px; }
.f-body h3 { font-size: 30px; font-weight: 800; margin-top: 12px; }
.f-body > p:not(.badge):not(.tags) { margin-top: 10px; color: var(--ink-2); }
.points { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; }
.points li { position: relative; padding-left: 22px; color: var(--ink-2); font-size: 15px; }
.points li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
.more { display: inline-flex; align-items: center; gap: 4px; margin-top: 16px; color: var(--accent); font-weight: 600; text-decoration: none; font-size: 15px; }
.more:hover { text-decoration: underline; }
.more svg { width: 16px; height: 16px; }
@media (max-width: 860px) {
  .feature, .feature.reverse { grid-template-columns: 1fr; gap: 18px; padding: 16px; }
  .feature.reverse .shot, .feature.reverse .carousel { order: 0; }
  .f-body, .feature.reverse .f-body { padding: 0 4px 4px; }
  .f-body h3 { font-size: 26px; }
}

/* project grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 8px; }
.card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; transition: transform .2s, border-color .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow); }
.card h3 { font-size: 19px; font-weight: 700; margin-top: 16px; }
.card > p:not(.tags) { margin-top: 8px; color: var(--ink-2); font-size: 15px; }
.card .tags { margin-top: auto !important; padding-top: 14px; }
.card .more { margin-top: 12px; }
.card-top {
  height: 92px; border-radius: 12px; display: flex; align-items: flex-end; padding: 12px 14px; color: #fff; position: relative; overflow: hidden;
}
.card-top::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 85% 15%, rgba(255,255,255,.28), transparent 55%); }
.card-top .mono { position: relative; z-index: 1; font-size: 12.5px; background: rgba(0,0,0,.22); padding: 3px 8px; border-radius: 6px; }
.c-amber { background: linear-gradient(135deg, #b45309, #f59e0b); }
.c-green { background: linear-gradient(135deg, #065f46, #10b981); }
.c-violet { background: linear-gradient(135deg, #4c1d95, #8b5cf6); }
.c-blue { background: linear-gradient(135deg, #1e3a8a, #3b82f6); }
.c-rose { background: linear-gradient(135deg, #9f1239, #f43f5e); }
.card-img { display: block; height: 150px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-alt); }
.card-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }

/* carousel */
.carousel { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-alt); min-width: 0; }
.carousel-feat { border-radius: 14px; }
.track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; outline: none; }
.track::-webkit-scrollbar { display: none; }
.track:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.slide { flex: 0 0 100%; margin: 0; scroll-snap-align: start; aspect-ratio: 16 / 10; cursor: zoom-in; background: var(--bg-alt); }
.slide img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.slide.contain { background: #fff; }
.slide.contain img { object-fit: contain; }
.c-btn {
  position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.5); background: rgba(10, 16, 22, .62); color: #fff; cursor: pointer;
  display: grid; place-items: center; opacity: 0; transition: opacity .2s, background .2s; backdrop-filter: blur(6px);
}
.c-btn:hover { background: rgba(10, 16, 22, .85); }
.c-btn svg { width: 18px; height: 18px; }
.c-prev { left: 10px; }
.c-next { right: 10px; }
.carousel:hover .c-btn, .carousel:focus-within .c-btn { opacity: 1; }
.c-btn[disabled] { opacity: 0 !important; pointer-events: none; }
@media (hover: none) { .c-btn { opacity: 1; } }
.dots { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 6px; padding: 5px 8px; border-radius: 999px; background: rgba(10, 16, 22, .5); backdrop-filter: blur(6px); }
.dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 999px; background: rgba(255,255,255,.5); cursor: pointer; transition: width .2s, background .2s; }
.dots button[aria-current="true"] { width: 18px; background: #fff; }
.zoom-hint { position: absolute; right: 10px; top: 10px; font-size: 11.5px; color: #fff; background: rgba(10, 16, 22, .55); padding: 3px 8px; border-radius: 999px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.carousel:hover .zoom-hint { opacity: 1; }
.card .carousel { margin: -4px -4px 0; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(5, 8, 12, .92); display: none; align-items: center; justify-content: center; padding: 56px 64px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); background: #fff; }
.lb-cap { position: absolute; left: 0; right: 0; bottom: 16px; text-align: center; color: #d6dde5; font-size: 14px; padding: 0 16px; }
.lb-btn { position: absolute; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.08); color: #fff; cursor: pointer; display: grid; place-items: center; }
.lb-btn:hover { background: rgba(255,255,255,.18); }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) { .lightbox { padding: 64px 8px 56px; } .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; } .lb-cap { bottom: 64px; } }

/* stack */
.stack { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.stack-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.stack-col h3 { font-size: 16px; font-weight: 700; }
.edu { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.edu h3 { font-size: 16px; margin-bottom: 10px; color: var(--accent); }
.edu p { color: var(--ink-2); margin-bottom: 10px; }
.edu strong { color: var(--ink); font-weight: 600; }
@media (max-width: 760px) { .stack, .edu { grid-template-columns: 1fr; } }

/* contact */
.contact { text-align: center; background: var(--bg-alt); }
.contact-in { max-width: 720px; }
.contact h2 { font-size: clamp(32px, 5vw, 48px); font-weight: 800; }
.contact p { margin-top: 14px; color: var(--ink-2); font-size: 17px; }
.contact .btn.primary { word-break: break-all; }

.foot { border-top: 1px solid var(--line); padding: 24px 0; font-size: 14px; }
.foot-in { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card, .shot img { transition: none; }
}
