:root{
  --bg:#0B0B0D;
  --surface:#171213;
  --surface-2:#1D1719;
  --border:#332427;
  --text:#F2ECEC;
  --text-muted:#A79A9C;
  --red:#D62839;
  --red-dim:#7A1F2B;
  --red-bright:#FF4D5E;
  --font-display:'Space Grotesk', sans-serif;
  --font-body:'IBM Plex Sans', sans-serif;
  --font-mono:'IBM Plex Mono', monospace;
  --maxw:1080px;
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--font-body);
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
}
img,svg{max-width:100%;display:block;}
a{color:inherit;text-decoration:none;}
button{font:inherit;}

::selection{background:var(--red);color:#fff;}

/* ---------- header / editor tab bar ---------- */
header{
  position:sticky;
  top:0;
  z-index:40;
  background:rgba(11,11,13,0.92);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border);
}
.header-inner{
  max-width:var(--maxw);
  margin:0 auto;
  padding:14px 24px 0;
}
.brand-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding-bottom:12px;
}
.brand{
  font-family:var(--font-mono);
  font-size:1.15rem;
  font-weight:700;
  letter-spacing:0.03em;
  color:var(--text);
  white-space:nowrap;
}
.brand strong{color:var(--red);font-weight:700;}
.brand .cursor{
  display:inline-block;width:7px;height:1em;background:var(--red-bright);
  margin-left:2px;vertical-align:-2px;
  animation:blink 1.1s steps(1) infinite;
}
@keyframes blink{50%{opacity:0;}}

.contact-mini{
  display:flex;
  gap:14px;
}
.contact-mini a{
  color:var(--text-muted);
  width:20px;height:20px;
  transition:color .15s ease;
}
.contact-mini a:hover{color:var(--red);}

nav.tabs{
  display:flex;
  gap:2px;
  overflow-x:auto;
  scrollbar-width:none;
}
nav.tabs::-webkit-scrollbar{display:none;}
.tab-btn{
  position:relative;
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 18px;
  background:var(--surface);
  border:1px solid var(--border);
  border-bottom:none;
  border-radius:8px 8px 0 0;
  color:var(--text-muted);
  font-family:var(--font-mono);
  font-size:0.85rem;
  cursor:pointer;
  white-space:nowrap;
  flex-shrink:0;
}
.tab-btn .dot{
  width:6px;height:6px;border-radius:50%;
  background:var(--border);
  flex-shrink:0;
}
.tab-btn[aria-selected="true"]{
  background:var(--bg);
  color:var(--text);
  border-color:var(--border);
}
.tab-btn[aria-selected="true"] .dot{background:var(--red);}
.tab-btn:hover{color:var(--text);}
.tab-btn .ext{color:var(--red-dim);}

/* ---------- sections / panels ---------- */
main{max-width:var(--maxw);margin:0 auto;padding:0 24px;}
.panel{display:none;padding:56px 0 88px;}
.panel.active{display:block;}
.panel-head{margin-bottom:40px;}
.kicker{
  font-family:var(--font-mono);
  font-size:0.85rem;
  color:var(--red-dim);
  margin:0 0 10px;
}
h1,h2,h3{font-family:var(--font-display);font-weight:600;margin:0;letter-spacing:-0.01em;}
h2{font-size:clamp(1.6rem,3vw,2.1rem);margin-bottom:14px;}
p{color:var(--text-muted);max-width:62ch;}
.lede{font-size:1.05rem;color:var(--text);max-width:58ch;}

/* ---------- hero ---------- */
.hero{
  position:relative;
  min-height:calc(100vh - 108px);
  display:flex;
  align-items:center;
  padding:60px 0;
  overflow:hidden;
  isolation:isolate;
}
.code-rain{
  position:absolute;inset:0;
  display:flex;
  gap:28px;
  padding:0 4%;
  z-index:-3;
  opacity:0.55;
}
.code-col{
  flex:1;
  font-family:var(--font-mono);
  font-size:13px;
  line-height:1.7;
  white-space:pre;
  color:#4A5468;
  will-change:transform;
}
.code-col .kw{color:#8B2A38;}
.code-col .str{color:#7A6B6D;}
.code-col .cm{color:#5C3A3E;}
.code-col span.hi{color:#B5333F;}
.col-a{animation:scrollUp 46s linear infinite;}
.col-b{animation:scrollUp 61s linear infinite;}
.col-c{animation:scrollUp 38s linear infinite;}
.col-d{animation:scrollUp 54s linear infinite;}
@keyframes scrollUp{
  from{transform:translateY(0);}
  to{transform:translateY(-50%);}
}
.window-drift{
  position:absolute;inset:0;
  z-index:-2;
  pointer-events:none;
}
.drift-card{
  position:absolute;
  width:var(--w,210px);
  border:1.5px solid rgba(214,40,57,0.7);
  border-radius:10px;
  background:rgba(29,20,22,0.95);
  box-shadow:0 25px 70px rgba(0,0,0,0.55), 0 0 50px rgba(214,40,57,0.16);
  overflow:hidden;
  animation:drift var(--dur,30s) ease-in-out infinite;
  animation-delay:var(--delay,0s);
}
.drift-card .dc-bar{
  display:flex;align-items:center;gap:5px;
  padding:8px 10px;
  background:var(--surface-2);
  border-bottom:1px solid var(--border);
}
.drift-card .dc-bar i{width:6px;height:6px;border-radius:50%;background:var(--border);}
.drift-card .dc-label{
  font-family:var(--font-mono);
  font-size:0.62rem;
  color:var(--text-muted);
  margin-left:2px;
}
.drift-card .dc-body{padding:14px;}
.dc-row{height:8px;border-radius:3px;background:rgba(231,236,238,0.2);margin-bottom:8px;}
.dc-row.short{width:55%;}
.dc-row.accent{background:rgba(214,40,57,0.75);}
.dc-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:6px;}
.dc-grid span{aspect-ratio:1;border-radius:3px;background:rgba(231,236,238,0.18);display:block;}
.dc-grid span.on{background:rgba(214,40,57,0.85);}
.dc-chart{display:flex;align-items:flex-end;gap:4px;height:48px;}
.dc-chart b{flex:1;border-radius:2px 2px 0 0;background:rgba(214,40,57,0.75);display:block;}
.card-1{--w:260px;--dur:32s;top:10%;right:6%;}
.card-2{--w:210px;--dur:26s;--delay:-6s;top:52%;right:10%;}
.card-3{--w:210px;--dur:38s;--delay:-12s;top:30%;right:32%;}
.card-4{--w:190px;--dur:24s;--delay:-4s;top:60%;right:36%;}
@keyframes drift{
  0%{transform:translate(0,0) rotate(0deg);opacity:0.85;}
  50%{transform:translate(-16px,-24px) rotate(-1deg);opacity:1;}
  100%{transform:translate(0,0) rotate(0deg);opacity:0.85;}
}
.hero-scrim{
  position:absolute;inset:0;
  z-index:-1;
  background:
    radial-gradient(ellipse 55% 50% at 20% 45%, rgba(11,11,13,0.55), rgba(11,11,13,0.9) 70%, rgba(11,11,13,0.35) 100%),
    linear-gradient(180deg, rgba(11,11,13,0.3) 0%, rgba(11,11,13,0.45) 50%, rgba(11,11,13,0.8) 80%, var(--bg) 100%);
}
.hero-content{max-width:640px;}
.hero-content .kicker{color:var(--red);}
.hero-content h1{
  font-size:clamp(2.4rem,6vw,3.6rem);
  line-height:1.05;
  margin-bottom:18px;
  animation:rise .7s cubic-bezier(.2,.7,.3,1) both;
}
.hero-content .role{
  font-family:var(--font-mono);
  font-size:1.05rem;
  color:var(--text);
  margin-bottom:20px;
  animation:rise .7s .08s cubic-bezier(.2,.7,.3,1) both;
}
.hero-content p.lede{animation:rise .7s .16s cubic-bezier(.2,.7,.3,1) both;}
@keyframes rise{
  from{opacity:0;transform:translateY(14px);}
  to{opacity:1;transform:translateY(0);}
}
.hero-tags{
  display:flex;flex-wrap:wrap;gap:8px;
  margin:26px 0 32px;
  animation:rise .7s .22s cubic-bezier(.2,.7,.3,1) both;
}
.hero-tags span{
  font-family:var(--font-mono);
  font-size:0.78rem;
  padding:5px 10px;
  border:1px solid var(--border);
  border-radius:6px;
  color:var(--text-muted);
  background:rgba(255,255,255,0.02);
}
.hero-cta{
  display:flex;gap:14px;flex-wrap:wrap;
  animation:rise .7s .28s cubic-bezier(.2,.7,.3,1) both;
}
.btn{
  display:inline-flex;align-items:center;gap:8px;
  padding:12px 22px;
  border-radius:8px;
  font-weight:500;
  font-size:0.95rem;
  border:1px solid transparent;
  background:transparent;
  -webkit-appearance:none;
  appearance:none;
  cursor:pointer;
  transition:transform .12s ease, border-color .15s ease, background .15s ease;
}
.btn:active{transform:scale(0.98);}
.btn-primary{background:var(--red);color:#fff;}
.btn-primary:hover{background:var(--red-bright);}
.btn-ghost{border-color:var(--border);color:var(--text);}
.btn-ghost:hover{border-color:var(--red);}

@media (prefers-reduced-motion: reduce){
  .code-col,.drift-card,.hero-content *{animation:none !important;}
}
@media (max-width:720px){
  .code-rain{opacity:0.32;}
  .code-col:nth-child(3),.code-col:nth-child(4){display:none;}
  .window-drift{display:none;}
}

/* ---------- sobre ---------- */
.about-grid{
  display:grid;
  grid-template-columns:200px 1fr;
  gap:44px;
  align-items:start;
}
.term-card{
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface);
  overflow:hidden;
}
.term-card .term-bar{
  display:flex;gap:6px;
  padding:9px 12px;
  background:var(--surface-2);
  border-bottom:1px solid var(--border);
}
.term-bar i{width:9px;height:9px;border-radius:50%;background:var(--border);}
.term-card .term-body{
  padding:26px 14px;
  text-align:center;
  font-family:var(--font-display);
  font-size:2.4rem;
  font-weight:700;
  color:var(--red);
}
.term-card .term-caption{
  font-family:var(--font-mono);
  font-size:0.72rem;
  color:var(--text-muted);
  text-align:center;
  padding-bottom:16px;
}
.about-copy p{max-width:64ch;color:var(--text-muted);margin-bottom:16px;}
.about-copy p strong{color:var(--text);font-weight:600;}
.how-i-work{
  margin-top:28px;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:16px;
}
.how-item{
  border:1px solid var(--border);
  border-radius:10px;
  padding:16px 18px;
  background:var(--surface);
}
.how-item h3{font-size:0.95rem;margin-bottom:6px;}
.how-item p{font-size:0.87rem;margin:0;}
@media (max-width:720px){
  .about-grid{grid-template-columns:1fr;}
  .term-card{max-width:220px;}
  .how-i-work{grid-template-columns:1fr;}
}

/* ---------- serviços ---------- */
.services-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:20px;
}
.service-card{
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface);
  padding:26px 22px;
}
.service-card .icon{
  width:34px;height:34px;
  margin-bottom:18px;
  color:var(--red);
}
.service-card h3{font-size:1.08rem;margin-bottom:10px;}
.service-card p{font-size:0.92rem;margin:0;}
.service-card .stack{
  margin-top:16px;
  font-family:var(--font-mono);
  font-size:0.75rem;
  color:var(--red-dim);
}
@media (max-width:680px){.services-grid{grid-template-columns:1fr;}}

.process-head{margin-top:56px;margin-bottom:32px;}
.process-list{position:relative;padding-left:8px;}
.process-list::before{
  content:"";
  position:absolute;
  left:23px; top:6px; bottom:6px;
  width:1px;
  background:var(--border);
}
.process-step{
  position:relative;
  display:flex;
  gap:22px;
  padding:0 0 34px;
}
.process-step:last-child{padding-bottom:0;}
.process-step .num{
  position:relative;
  z-index:1;
  flex-shrink:0;
  width:46px;height:46px;
  border-radius:50%;
  border:1px solid var(--border);
  background:var(--surface);
  display:flex;align-items:center;justify-content:center;
  font-family:var(--font-mono);
  font-size:0.85rem;
  color:var(--red);
}
.process-step .step-body{padding-top:8px;}
.process-step h3{font-size:1.02rem;margin:0 0 6px;}
.process-step p{font-size:0.92rem;color:var(--text-muted);margin:0;max-width:56ch;}

/* ---------- portfólio ---------- */
.project{
  display:grid;
  grid-template-columns:1fr 1.5fr;
  gap:32px;
  padding:30px 0;
  border-top:1px solid var(--border);
  align-items:start;
}
.project:last-child{border-bottom:1px solid var(--border);}
.project-name{font-family:var(--font-display);font-size:1.3rem;margin-bottom:6px;}
.project-tag{
  display:inline-block;
  font-family:var(--font-mono);
  font-size:0.72rem;
  color:var(--red);
  border:1px solid rgba(214,40,57,0.4);
  border-radius:5px;
  padding:2px 8px;
  margin-bottom:14px;
}
.project-tag.wip{color:var(--text-muted);border-color:var(--border);border-style:dashed;}
.project-tag.testing{color:var(--red-dim);border-color:rgba(122,31,43,0.55);border-style:dashed;}
.project p{font-size:0.94rem;margin-bottom:14px;}
.project .stack-line{
  font-family:var(--font-mono);
  font-size:0.78rem;
  color:var(--text-muted);
}
.project .stack-line b{color:var(--red);font-weight:500;}
@media (max-width:720px){.project{grid-template-columns:1fr;}}

/* ---------- contato ---------- */
.contact-wrap{
  display:grid;
  grid-template-columns:1.1fr 1fr;
  gap:40px;
  align-items:start;
}
.contact-list{display:flex;flex-direction:column;gap:2px;}
.contact-row{
  display:flex;align-items:center;gap:14px;
  padding:16px 4px;
  border-bottom:1px solid var(--border);
  transition:padding-left .15s ease;
}
.contact-row:hover{padding-left:8px;}
.contact-row .ic{width:20px;height:20px;color:var(--red);flex-shrink:0;}
.contact-row .label{font-family:var(--font-mono);font-size:0.72rem;color:var(--text-muted);}
.contact-row .value{font-size:0.96rem;color:var(--text);}
.contact-cta{
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface);
  padding:28px 26px;
}
.contact-cta h3{font-size:1.15rem;margin-bottom:10px;}
.contact-cta p{font-size:0.92rem;margin-bottom:22px;}
@media (max-width:780px){.contact-wrap{grid-template-columns:1fr;}}

.contact-form-wrap{
  margin-top:40px;
  padding-top:36px;
  border-top:1px solid var(--border);
}
.contact-form-wrap h3{font-size:1.05rem;margin-bottom:4px;}
.contact-form-wrap .lede-sm{font-size:0.9rem;color:var(--text-muted);margin:0 0 22px;}
.contact-form{max-width:560px;}
.contact-form .form-row{display:grid;grid-template-columns:1fr 1fr;gap:16px;}
.contact-form label{
  display:block;
  font-family:var(--font-mono);
  font-size:0.75rem;
  color:var(--text-muted);
  margin-bottom:16px;
}
.contact-form input,
.contact-form textarea{
  display:block;
  width:100%;
  margin-top:6px;
  padding:10px 12px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:8px;
  color:var(--text);
  font-family:var(--font-body);
  font-size:0.92rem;
  resize:vertical;
}
.contact-form input:focus,
.contact-form textarea:focus{outline:none;border-color:var(--red);}
.form-status{
  min-height:1.2em;
  font-family:var(--font-mono);
  font-size:0.8rem;
  color:var(--text-muted);
  margin-top:14px;
}
.form-status.ok{color:#5CD68A;}
.form-status.err{color:var(--red-bright);}
@media (max-width:520px){.contact-form .form-row{grid-template-columns:1fr;}}

.game-wrap{
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface);
  padding:16px;
}
#game-canvas{
  width:100%;
  height:auto;
  display:block;
  border-radius:8px;
  background:var(--bg);
  touch-action:manipulation;
  cursor:pointer;
}
.game-hud{
  display:flex;
  justify-content:space-between;
  margin-top:10px;
  font-family:var(--font-mono);
  font-size:0.8rem;
  color:var(--text-muted);
}

.skin-row{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:16px;
}
.skin-dot{
  width:26px;height:26px;
  border-radius:50%;
  background:var(--dot);
  border:2px solid var(--border);
  padding:0;
  cursor:pointer;
}
.skin-dot.active{border-color:#fff;box-shadow:0 0 0 2px var(--dot);}
.skin-dot.locked{opacity:0.25;filter:grayscale(1);cursor:not-allowed;}
.skin-hint{
  font-family:var(--font-mono);
  font-size:0.72rem;
  color:var(--text-muted);
  margin-left:4px;
}

.game-actions{margin-top:16px;display:flex;align-items:center;gap:14px;}
.game-actions .form-status{margin-top:0;}

footer{
  border-top:1px solid var(--border);
  padding:26px 24px;
}
.footer-inner{
  max-width:var(--maxw);
  margin:0 auto;
  display:flex;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:10px;
  font-family:var(--font-mono);
  font-size:0.78rem;
  color:var(--text-muted);
}

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

/* ---------- placas nfc ---------- */
.nfc{max-width:980px;}
.nfc h2{font-size:clamp(1.6rem,3.4vw,2.3rem);line-height:1.15;letter-spacing:-0.02em;margin:0 0 18px;}
.nfc p{max-width:58ch;margin:0 0 14px;line-height:1.7;}
.nfc img{width:100%;height:auto;display:block;border-radius:6px;}
.nfc-row{display:grid;gap:48px;align-items:center;padding:60px 0;border-top:1px solid var(--border);}
.nfc-row:first-child{border-top:0;padding-top:8px;}
.nfc-row.a{grid-template-columns:1fr 1.1fr;}
.nfc-row.b{grid-template-columns:1fr 1fr;}
.nfc-row.c{grid-template-columns:.8fr 1fr;}
.nfc dl{margin:20px 0 0;max-width:540px;}
.nfc dl div{display:flex;gap:18px;padding:12px 0;border-bottom:1px solid var(--border);}
.nfc dt{width:150px;flex:none;color:var(--text);font-weight:600;}
.nfc dd{margin:0;color:var(--text-muted);}
.nfc .btn{margin-top:10px;}
.nfc-teaser{display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap;margin-top:32px;padding:4px 0 4px 18px;border-left:3px solid var(--red);}
.nfc-teaser h3{font-size:1.05rem;margin:0 0 4px;}
.nfc-teaser p{margin:0;font-size:0.92rem;}
@media (max-width:780px){
  .nfc-row.a,.nfc-row.b,.nfc-row.c{grid-template-columns:1fr;gap:28px;padding:44px 0;}
  .nfc dl div{flex-direction:column;gap:2px;}
  .nfc dt{width:auto;}
}
