/* =========================================================
   Portfólio Nyxcode — largura total + animações
   (complementa o CSS original do tema Nyxcode)
   ========================================================= */

/* ---------- Largura total ---------- */
:root { --max-width: none; --gutter: clamp(20px, 5vw, 110px); }
.container { padding-left: var(--gutter); padding-right: var(--gutter); }
.section-intro { max-width: 780px; }
section { padding: clamp(72px, 9vw, 130px) 0; }
h2 { font-size: clamp(30px, 3.4vw, 54px); }

/* ---------- Camadas de fundo ---------- */
body { overflow-x: hidden; }
.sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.cursor-glow {
  position: fixed; left: 0; top: 0; width: 640px; height: 640px; margin: -320px 0 0 -320px; z-index: 0;
  pointer-events: none; border-radius: 50%; opacity: 0; transition: opacity .4s;
  background: radial-gradient(circle, rgba(139, 92, 246, .16) 0%, rgba(139, 92, 246, .06) 35%, transparent 65%);
  will-change: transform;
}
body.mouse-in .cursor-glow { opacity: 1; }
main, .site-footer { position: relative; z-index: 1; }

.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; transform-origin: 0 50%;
  transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--accent), var(--accent-light), var(--moon));
  box-shadow: 0 0 12px var(--accent);
}

/* ---------- Header ---------- */
.site-header { transition: background .3s, box-shadow .3s; }
.site-header.scrolled { background: #0b0b12e6; box-shadow: 0 10px 30px -18px #000; }
.brand { padding: 0 !important; background: none !important; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-text span:first-child { font-size: 17px; }
.logo-text span:last-child { font-family: var(--font-mono); font-size: 9.5px; font-weight: 400; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); }
.logo-mark { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.brand:hover .logo-mark { transform: rotate(-12deg) scale(1.08); }
.nav-links a { position: relative; }
.nav-links a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light)); transform: scaleX(0); transition: transform .3s;
}
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--text); }

/* ---------- Hero ---------- */
.hero { min-height: calc(100vh - 72px); min-height: calc(100svh - 72px); display: flex; align-items: center; padding-top: 48px; padding-bottom: 96px; }
.hero > .container { width: 100%; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 96px); }
.hero h1 { font-size: clamp(36px, 4.8vw, 86px); line-height: 1.06; letter-spacing: -.02em; }
.hero p { font-size: clamp(16px, 1.25vw, 21px); max-width: 700px; }
.hero p strong { color: var(--text); }
.hero .code-window { max-width: 600px; }
.hero .hero-orb { width: clamp(130px, 12vw, 210px); height: auto; aspect-ratio: 1; }
.caret { display: inline-block; margin-left: 4px; color: var(--accent-light); font-weight: 300; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-stats { display: flex; flex-wrap: wrap; gap: clamp(24px, 4vw, 64px); margin-top: 48px; }
.hero-stats strong {
  display: block; font-family: var(--font-display); font-size: clamp(30px, 3vw, 48px); line-height: 1;
  background: linear-gradient(100deg, var(--moon), var(--accent-light) 45%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-stats span { display: block; margin-top: 6px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint); }

/* Linhas de código "digitando" */
.code-line { height: 9px; border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--accent-light)); opacity: .85; width: var(--w); }
.code-anim .code-line { width: 0; animation: codigo 6s cubic-bezier(.6,.1,.3,1) infinite; }
.code-anim .code-line:nth-child(1) { animation-delay: .2s; }
.code-anim .code-line:nth-child(2) { animation-delay: .5s; }
.code-anim .code-line:nth-child(3) { animation-delay: .8s; }
.code-anim .code-line:nth-child(4) { animation-delay: 1.1s; }
.code-anim .code-line:nth-child(5) { animation-delay: 1.4s; }
.code-anim .code-line:nth-child(6) { animation-delay: 1.7s; }
@keyframes codigo { 0% { width: 0; } 18%, 78% { width: var(--w); } 92%, 100% { width: 0; } }
.code-window-body { gap: 14px; padding: 26px; }

/* Indicador de rolagem */
.scroll-hint { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid var(--border); border-radius: 14px; padding: 0 !important; z-index: 2; }
.scroll-hint span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--accent-light); animation: rolar 1.8s ease-in-out infinite; }
@keyframes rolar { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 80% { opacity: 0; transform: translateY(14px); } 100% { opacity: 0; } }

/* ---------- Entrada do topo ---------- */
.intro { opacity: 0; transform: translateY(34px); filter: blur(6px); animation: entrar .95s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: calc(var(--d, 0) * .13s + .15s); }
@keyframes entrar { to { opacity: 1; transform: none; filter: none; } }

/* ---------- Revelar ao rolar ---------- */
.reveal { opacity: 0; transform: translateY(46px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); transition-delay: var(--rd, 0s); }
.reveal.in { opacity: 1; transform: none; }
.eyebrow.reveal.in::before { animation: girar 1.2s cubic-bezier(.2,.7,.2,1); }
@keyframes girar { from { transform: rotate(-180deg) scale(0); } to { transform: none; } }

/* Cards do portfólio entram alternando os lados */
.nx-case { opacity: 0; transform: translateX(-70px); transition: opacity 1s cubic-bezier(.2,.7,.2,1), transform 1s cubic-bezier(.2,.7,.2,1), border-color .3s, box-shadow .3s; }
.nx-case:nth-child(even) { transform: translateX(70px); }
.nx-case.in { opacity: 1; transform: none; }
.nx-case.in.tilting { transition: transform .12s ease-out, border-color .3s, box-shadow .3s; }

/* ---------- Sobre ---------- */
.about-grid { grid-template-columns: 1.2fr 1fr; gap: clamp(40px, 6vw, 120px); align-items: center; }
.about-text p { font-size: clamp(15px, 1.1vw, 18.5px); color: var(--text-muted); margin-bottom: 16px; }
.about-text strong { color: var(--accent-light); }
#sobre .code-window { max-width: 560px; }
.term { margin: 0; min-height: 11em; font-family: var(--font-mono); font-size: clamp(12.5px, .95vw, 15px); line-height: 1.75; color: var(--text-muted); white-space: pre-wrap; }
.term .p { color: var(--accent-light); }
.term .c { display: inline-block; width: .6em; height: 1.1em; vertical-align: -2px; background: var(--accent-light); animation: blink 1s steps(1) infinite; }

/* ---------- Cards com efeito 3D e brilho ---------- */
.tilt, .tilt-soft { transform-style: preserve-3d; will-change: transform; }
.glow { background-image: radial-gradient(520px circle at var(--mx, 50%) var(--my, -20%), rgba(139, 92, 246, .16), transparent 45%); }
.service-card { transition: border-color .3s, transform .15s ease-out, box-shadow .3s; }
.service-card:hover { box-shadow: 0 24px 50px -24px rgba(139, 92, 246, .55); }
.service-card .service-icon { transition: transform .4s cubic-bezier(.2,.7,.2,1); }
.service-card:hover .service-icon { transform: translateZ(30px) rotate(-8deg) scale(1.1); }
.services-grid { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: clamp(16px, 1.6vw, 28px); }
.service-card { padding: clamp(24px, 2vw, 38px); }
.service-card h3 { font-size: clamp(17px, 1.3vw, 21px); }
.service-card p { font-size: clamp(14px, 1vw, 16px); }

/* ---------- Botões ---------- */
.btn { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent); transform: skewX(-20deg);
  animation: brilho 4.5s ease-in-out infinite;
}
@keyframes brilho { 0%, 60% { left: -60%; } 85%, 100% { left: 130%; } }
.magnetic { transition: transform .2s ease-out, box-shadow .15s, background .15s, border-color .15s; }

/* ---------- Constelação de tecnologias ---------- */
.constellation-wrap { height: clamp(300px, 30vw, 460px); }
.constellation-lines polyline { stroke: var(--accent); stroke-width: .25px; opacity: .55; stroke-dasharray: 1200; stroke-dashoffset: 1200; transition: stroke-dashoffset 2.6s cubic-bezier(.6,.1,.3,1); }
.constellation-wrap.in .constellation-lines polyline { stroke-dashoffset: 0; }
.constellation-node { opacity: 0; transform: translate(-50%, -50%) scale(.3); transition: opacity .6s, transform .7s cubic-bezier(.3,1.6,.5,1); transition-delay: var(--nd, 0s); cursor: default; }
.constellation-wrap.in .constellation-node { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.constellation-node:hover .node-dot { transform: scale(1.8); box-shadow: 0 0 22px 6px #8b5cf6aa; }
.constellation-node:hover .node-label { color: var(--text); border-color: var(--accent); }
.node-dot { transition: transform .3s, box-shadow .3s; }
.node-label { transition: color .3s, border-color .3s; font-size: clamp(12px, .9vw, 14.5px); }

/* ---------- Contato / rodapé ---------- */
.contact-bar { padding: clamp(28px, 3vw, 56px); }
.contact-cta { max-width: 460px; }
.contact-form { display: grid; gap: 10px; }
.contact-form input, .contact-form textarea {
  font: 14px var(--font-body); color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 13px; resize: vertical; transition: border-color .2s, box-shadow .2s;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.to-top { color: var(--text-faint); font-size: 13.5px; transition: color .2s; }
.to-top:hover { color: var(--accent-light); }

/* ---------- Telas menores ---------- */
@media (max-width: 860px) {
  .hero { min-height: auto; padding-top: 40px; }
  .hero > .container, .about-grid { grid-template-columns: 1fr; }
  .scroll-hint, .cursor-glow { display: none; }
  .nx-case, .nx-case:nth-child(even) { transform: translateY(40px); }
}
@media (hover: none) { .cursor-glow { display: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .intro, .reveal, .nx-case, .constellation-node { opacity: 1 !important; transform: none !important; filter: none !important; animation: none !important; transition: none !important; }
  .code-anim .code-line { animation: none; width: var(--w); }
  .constellation-lines polyline { stroke-dashoffset: 0; transition: none; }
  .btn-primary::after, .caret, .scroll-hint span { animation: none; }
}

/* Ajustes da janela de código e da lua */
.code-window-bar span:nth-child(1) { background: #ff5f57; }
.code-window-bar span:nth-child(2) { background: #febc2e; }
.code-window-bar span:nth-child(3) { background: #28c840; }
.hero-visual .hero-orb { z-index: 2; }
.hero-visual .code-window { position: relative; z-index: 1; }
.typed { white-space: nowrap; }

/* Contato equilibrado */
.contact-bar { grid-template-columns: 1.2fr 1fr; gap: clamp(28px, 4vw, 80px); align-items: center; }
.contact-side { display: flex; flex-direction: column; gap: 22px; position: relative; z-index: 1; }
.contact-big { font-family: var(--font-display); font-weight: 600; font-size: clamp(28px, 3.2vw, 52px); line-height: 1.1; color: var(--text); letter-spacing: -.02em; }
.accent-text { background: linear-gradient(100deg, var(--moon), var(--accent-light) 40%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.contact-sub { color: var(--text-muted); font-size: clamp(15px, 1.1vw, 18px); max-width: 560px; }
.contact-bar .contact-cta { max-width: none; width: 100%; position: relative; z-index: 1; }
@media (max-width: 860px) { .contact-bar { grid-template-columns: 1fr; } }

/* Nada da animação de entrada pode criar rolagem lateral */

main { overflow-x: clip; }

/* Tablet: menu vira botão antes de apertar */
@media (max-width: 1000px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
}

/* Tecnologias em lista (telas onde a constelação não cabe) */
.tech-chips { display: none; flex-wrap: wrap; gap: 10px; }
.tech-chips span {
  font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px; display: inline-flex; align-items: center; gap: 8px;
  opacity: 0; transform: translateY(14px) scale(.9); transition: opacity .5s, transform .6s cubic-bezier(.3,1.6,.5,1); transition-delay: var(--nd, 0s);
}
.tech-chips span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--moon), var(--accent) 75%); box-shadow: 0 0 8px 1px #8b5cf68c; }
.tech-chips.in span { opacity: 1; transform: none; }
@media (max-width: 759px) {
  .constellation-wrap { display: none !important; }
  .tech-chips { display: flex; }
}

/* E-mail longo não estoura no celular */
.contact-bar-item strong { overflow-wrap: anywhere; }
.contact-bar-item > div:last-child { min-width: 0; }
@media (max-width: 480px) {
  .contact-bar { padding: 22px 18px; }
  .contact-bar-item strong { font-size: 13.5px; }
}
@media (prefers-reduced-motion: reduce) { .tech-chips span { opacity: 1 !important; transform: none !important; } }
