*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0a;
  --bg-2: #0f0f0f;
  --card: #121212;
  --fg: #f2f2f2;
  --text: #b4b4b4;
  --muted: #7a7a7a;
  --line: #222;
  --accent: #ff3c00;
  --accent-2: #00e5ff;
  --display: 'Syne', system-ui, sans-serif;
  --mono: 'Space Mono', ui-monospace, monospace;
  --pad: clamp(1rem, 4vw, 3rem);
}

html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--display);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.7;
  overflow-x: hidden;
}
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
strong { color: var(--fg); font-weight: 700; }
ul, ol { list-style: none; }
::selection { background: var(--accent); color: #000; }

:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: var(--accent); color: #000; padding: .5rem 1rem;
  font-family: var(--mono); font-size: .8rem; text-decoration: none;
}
.skip:focus { top: 1rem; }

.wrap { max-width: 1160px; margin: 0 auto; padding-inline: var(--pad); }

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 10, 10, .82);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-in {
  max-width: 1160px; margin: 0 auto; padding: .9rem var(--pad);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.logo {
  font-family: var(--mono); font-weight: 700; font-size: .9rem; letter-spacing: 3px;
  color: var(--fg); text-decoration: none;
}
.logo span { color: var(--accent); }
.nav ul { display: flex; gap: 1.75rem; }
.nav nav a {
  font-family: var(--mono); font-size: .72rem; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); text-decoration: none; padding: .35rem 0; position: relative;
  transition: color .2s;
}
.nav nav a::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--accent); transition: width .25s;
}
.nav nav a:hover, .nav nav a.active { color: var(--fg); }
.nav nav a.active::after { width: 100%; }

.menu-btn {
  display: none; background: none; border: 1px solid var(--line); color: var(--fg);
  width: 44px; height: 44px; cursor: pointer; place-items: center;
}
.bars, .bars::before, .bars::after {
  display: block; width: 18px; height: 2px; background: currentColor; position: relative;
  transition: transform .2s, opacity .2s;
}
.bars::before, .bars::after { content: ''; position: absolute; left: 0; }
.bars::before { top: -6px; }
.bars::after { top: 6px; }
.menu-btn[aria-expanded="true"] .bars { background: transparent; }
.menu-btn[aria-expanded="true"] .bars::before { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 760px) {
  .menu-btn { display: grid; }
  .nav nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg); border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav nav.open { display: block; }
  .nav ul { flex-direction: column; gap: 0; padding: .5rem var(--pad) 1rem; }
  .nav nav a { display: block; padding: .9rem 0; font-size: .8rem; border-bottom: 1px solid var(--line); }
  .nav nav a::after { display: none; }
  .nav nav a.active { color: var(--accent); }
}

/* HERO */
.hero { padding-top: clamp(3.5rem, 10vw, 7rem); padding-bottom: clamp(3rem, 8vw, 5rem); }
.eyebrow {
  font-family: var(--mono); font-size: .72rem; letter-spacing: 3px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1.5rem;
}
.hero-name {
  font-family: var(--display); font-weight: 800; color: var(--fg);
  font-size: clamp(3rem, 11vw, 8.5rem); line-height: .92; letter-spacing: -.02em;
  text-transform: uppercase;
}
.hero-name span { display: block; }
.hero-name .accent { color: var(--accent); }
.hero-lead { max-width: 40rem; margin-top: 2rem; font-size: clamp(1rem, 2.2vw, 1.15rem); }
.cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2.25rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px;
  padding: .8rem 1.5rem; border: 1px solid #3a3a3a; color: var(--fg); text-decoration: none;
  font-family: var(--mono); font-size: .75rem; letter-spacing: 2px; text-transform: uppercase;
  transition: border-color .2s, background .2s, color .2s;
}
.btn:hover { border-color: var(--fg); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 700; }
.btn-primary:hover { background: #ff5a26; border-color: #ff5a26; }
.btn-ghost { border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--fg); border-color: transparent; }
.hero-links { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; margin-top: 2.5rem; }
.hero-links a {
  font-family: var(--mono); font-size: .75rem; color: var(--muted); text-decoration: none;
  transition: color .2s;
}
.hero-links a:hover { color: var(--accent-2); }

/* STRIP */
.strip { border-block: 1px solid var(--line); background: var(--bg-2); overflow: hidden; }
.strip-in {
  max-width: 1160px; margin: 0 auto; padding: 1rem var(--pad);
  display: flex; flex-wrap: wrap; gap: .4rem 1.5rem;
  font-family: var(--mono); font-size: .7rem; letter-spacing: 2px; text-transform: uppercase; color: var(--muted);
}
.strip-in span::before { content: '✦ '; color: var(--accent); }

/* SECTIONS */
.sec { padding-top: clamp(4.5rem, 10vw, 7.5rem); }
.sec-head { margin-bottom: 2.75rem; }
.sec-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.sec-tag {
  font-family: var(--mono); font-size: .72rem; letter-spacing: 3px; text-transform: uppercase;
  color: var(--accent); margin-bottom: .75rem;
}
.sec-title {
  font-family: var(--display); font-weight: 800; color: var(--fg);
  font-size: clamp(1.8rem, 4.5vw, 3rem); line-height: 1.1; letter-spacing: -.01em;
}
.more {
  font-family: var(--mono); font-size: .75rem; color: var(--accent-2); text-decoration: none;
  padding: .5rem 0;
}
.more:hover { text-decoration: underline; }

/* ABOUT */
.about { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.about-text p + p { margin-top: 1.1rem; }
.facts { border: 1px solid var(--line); background: var(--card); }
.facts div { padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dt {
  font-family: var(--mono); font-size: .65rem; letter-spacing: 2px; text-transform: uppercase; color: var(--muted);
}
.facts dd { color: var(--fg); margin-top: .15rem; }

/* JOBS */
.jobs { border-top: 1px solid var(--line); }
.job {
  display: grid; grid-template-columns: 200px 1fr; gap: 1.5rem 2.5rem;
  padding: 2rem 0; border-bottom: 1px solid var(--line);
}
.job-when { font-family: var(--mono); font-size: .75rem; color: var(--fg); letter-spacing: 1px; }
.job-when span { display: block; color: var(--muted); margin-top: .25rem; }
.job h3 { font-size: 1.2rem; font-weight: 700; color: var(--fg); line-height: 1.35; }
.job h3 a, .job h3 .org {
  display: inline-block; margin-left: .35rem;
  font-family: var(--mono); font-size: .75rem; font-weight: 400; letter-spacing: 1px;
  color: var(--accent); text-decoration: none; vertical-align: middle;
}
.job h3 a:hover { text-decoration: underline; }
.job ul { margin-top: .9rem; }
.job li { position: relative; padding-left: 1.2rem; }
.job li + li { margin-top: .45rem; }
.job li::before { content: '—'; position: absolute; left: 0; color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1.1rem; }
.chips span {
  font-family: var(--mono); font-size: .65rem; letter-spacing: 1px; text-transform: uppercase;
  padding: .25rem .6rem; border: 1px solid var(--line); color: var(--muted);
}

/* PROJECTS */
.featured { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; margin-top: 1.25rem; }
.proj {
  background: var(--card); border: 1px solid var(--line);
  padding: 1.75rem; display: flex; flex-direction: column;
  transition: border-color .25s;
}
.proj:hover { border-color: #3a3a3a; }
.proj-big { padding: 0; }
.proj-img { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--line); background: #000; }
.proj-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.proj-img-top img { object-position: top; }
.proj:hover .proj-img img { transform: scale(1.03); }
.proj-body { padding: 1.75rem; display: flex; flex-direction: column; flex: 1; }
.proj-kicker {
  font-family: var(--mono); font-size: .65rem; letter-spacing: 2px; text-transform: uppercase; color: var(--accent);
}
.proj h3 { font-size: 1.35rem; font-weight: 700; color: var(--fg); margin: .5rem 0 .75rem; line-height: 1.25; }
.proj p { font-size: .95rem; }
.proj .chips { margin-top: auto; padding-top: 1.25rem; }
.proj-links { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 1.25rem; }
.proj-links a {
  font-family: var(--mono); font-size: .75rem; color: var(--fg); text-decoration: none;
  border-bottom: 1px solid var(--accent); padding: .3rem 0;
}
.proj-links a:hover { color: var(--accent); }

/* SKILLS */
.skills {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.skill { padding: 1.5rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.skill h3 {
  font-family: var(--mono); font-size: .7rem; font-weight: 400; letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent); margin-bottom: .5rem;
}
.skill p { color: var(--fg); font-size: .95rem; }
.certs { margin-top: 3.5rem; }
.certs-title { font-size: 1.2rem; font-weight: 700; color: var(--fg); margin-bottom: 1rem; }
.certs li {
  display: flex; justify-content: space-between; gap: .25rem 1.5rem; flex-wrap: wrap;
  padding: .8rem 0; border-bottom: 1px solid var(--line);
}
.certs li span { color: var(--fg); }
.certs li em { font-style: normal; font-family: var(--mono); font-size: .72rem; color: var(--muted); align-self: center; }

/* CONTACT */
.contact { padding-bottom: clamp(4.5rem, 10vw, 7rem); }
.contact-title {
  font-family: var(--display); font-weight: 800; color: var(--fg);
  font-size: clamp(2.4rem, 8vw, 5.5rem); line-height: 1; letter-spacing: -.02em;
}
.contact-lead { margin-top: 1.25rem; max-width: 36rem; }
.contact-mail {
  display: inline-block; margin-top: 2rem;
  font-size: clamp(1.1rem, 4vw, 2rem); font-weight: 700; color: var(--accent); text-decoration: none;
  border-bottom: 2px solid currentColor; word-break: break-all;
}
.contact-mail:hover { color: #ff5a26; }
.contact-list { display: flex; flex-wrap: wrap; gap: .75rem 2rem; margin-top: 2rem; }
.contact-list a {
  font-family: var(--mono); font-size: .8rem; color: var(--fg); text-decoration: none;
  padding: .3rem 0; border-bottom: 1px solid #3a3a3a;
}
.contact-list a:hover { border-color: var(--accent-2); color: var(--accent-2); }

/* FOOTER */
.foot { border-top: 1px solid var(--line); }
.foot-in {
  max-width: 1160px; margin: 0 auto; padding: 1.5rem var(--pad);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-family: var(--mono); font-size: .7rem; color: var(--muted);
}
.foot a { text-decoration: none; }
.foot a:hover { color: var(--fg); }

/* REVEAL (so com JS e sem reduced motion) */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
  .js .reveal.in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* RESPONSIVE */
@media (max-width: 960px) {
  .skills { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .about, .featured, .grid { grid-template-columns: 1fr; }
  .job { grid-template-columns: 1fr; gap: .75rem; }
}
@media (max-width: 520px) {
  .skills { grid-template-columns: 1fr; }
  .cta .btn { flex: 1 1 100%; }
  .proj, .proj-body { padding: 1.35rem; }
  .proj-big { padding: 0; }
}
