/* Complementos ao template — Matheus Santos */

.stacks-section {
  padding: 6rem 0 4rem;
  background: var(--bg-primary);
  position: relative;
}

.stacks-section .section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3rem;
}

/* Hint “clique para detalhes” */
.stacks-section {
  position: relative;
}

.stack-click-hint {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 132px;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease, transform 220ms ease;
}

.stack-click-hint--center {
  top: 50%;
  transform: translate(-50%, -50%);
}

.stack-click-hint.is-visible {
  opacity: 1;
}

.stack-click-hint.is-visible:not(.stack-click-hint--center) {
  transform: translateX(-50%) translateY(0);
}

.stack-click-hint.is-visible.stack-click-hint--center {
  transform: translate(-50%, -50%) translateY(0);
}

.stack-click-hint__bubble {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.72);
  border: 1px solid rgba(214, 255, 92, 0.18);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.55),
    0 0 50px rgba(214, 255, 92, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.stack-click-hint__icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(214, 255, 92, 0.14);
  color: rgba(214, 255, 92, 0.95);
  box-shadow: 0 0 22px rgba(214, 255, 92, 0.12);
}

.stack-click-hint__text {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.92);
}

@keyframes hintPulse {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes hintTap {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(-10deg) scale(1.08);
  }
}

.stack-click-hint.is-visible .stack-click-hint__bubble {
  animation: hintPulse 2.6s ease-in-out infinite;
}

.stack-click-hint.is-visible .stack-click-hint__icon {
  animation: hintTap 1.6s ease-in-out infinite;
}

@media (max-width: 991px) {
  .stack-click-hint {
    top: 116px;
  }
  .stack-click-hint--center {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stack-click-hint__bubble,
  .stack-click-hint__icon {
    animation: none !important;
  }
}

/* ===== Showcase surreal 3D (desktop) ===== */
.stacks-surreal {
  position: relative;
  max-width: 1100px;
  margin: 0 auto 2.25rem;
  height: 440px;
  border-radius: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.stacks-surreal__scene {
  position: absolute;
  inset: 0;
  perspective: 1200px;
  transform-style: preserve-3d;
}

.stacks-surreal__scene::before {
  content: "";
  position: absolute;
  inset: 0;
  /* Glow central (sem “caixa/retângulo” no fundo) */
  background: radial-gradient(520px 320px at 50% 52%, rgba(214, 255, 92, 0.16), rgba(214, 255, 92, 0) 70%);
  pointer-events: none;
}

.stacks-surreal__core {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transform: translateZ(0);
  pointer-events: none;
}

.core-orb {
  width: 150px;
  height: 150px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.25), rgba(214, 255, 92, 0.10) 35%, rgba(0, 0, 0, 0.0) 65%),
    radial-gradient(circle at 60% 60%, rgba(214, 255, 92, 0.18), transparent 60%);
  box-shadow:
    0 0 60px rgba(214, 255, 92, 0.18),
    0 0 120px rgba(214, 255, 92, 0.10);
  filter: saturate(1.05);
}

.core-ring {
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  border: 1px solid rgba(214, 255, 92, 0.10);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  transform-style: preserve-3d;
  opacity: 0.3;
}
.core-ring--1 { transform: rotateX(52deg) rotateZ(10deg); }
.core-ring--2 { transform: rotateX(62deg) rotateZ(-18deg) scale(0.9); opacity: 0.6; }
.core-ring--3 { transform: rotateX(44deg) rotateZ(28deg) scale(1.08); opacity: 0.42; }

.stacks-orbit {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.stacks-orbit__item {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-style: preserve-3d;
  transform: translate(-50%, -50%);
  will-change: transform, opacity, filter;
  cursor: pointer;
  user-select: none;
}

.orbit-chip {
  width: 280px;
  min-height: 84px;
  padding: 1.05rem 1.2rem;
  border-radius: 18px;
  background: rgba(10, 10, 10, 0.70);
  border: 0;
  box-shadow:
    0 18px 55px rgba(0, 0, 0, 0.60),
    0 0 60px rgba(214, 255, 92, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: translateZ(40px);
  transition: transform 250ms ease, border-color 250ms ease, box-shadow 250ms ease;
  user-select: none;
}

.stacks-orbit__item:active .orbit-chip {
  transform: translateZ(40px) scale(0.98);
}

.orbit-chip__icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent, rgba(214, 255, 92, 1)) 18%, rgba(0, 0, 0, 0.82));
  border: 0;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
  margin-right: 0.75rem;
  vertical-align: middle;
}

.orbit-chip__icon i {
  color: color-mix(in srgb, var(--accent, rgba(214, 255, 92, 1)) 85%, white);
  font-size: 1.05rem;
}

.orbit-chip__name {
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  vertical-align: middle;
  font-size: 1.02rem;
}

.orbit-chip__desc {
  display: none;
}

/* Melhora legibilidade (nome central) no carrossel */
.orbit-chip {
  text-align: left;
}
.orbit-chip__name {
  display: inline-block;
  margin-top: 0.1rem;
}

.stacks-orbit__item:hover .orbit-chip {
  border-color: color-mix(in srgb, var(--accent, rgba(214, 255, 92, 1)) 55%, rgba(255, 255, 255, 0.25));
  box-shadow:
    0 18px 55px rgba(0, 0, 0, 0.65),
    0 0 50px color-mix(in srgb, var(--accent, rgba(214, 255, 92, 1)) 22%, transparent);
  transform: translateZ(70px) scale(1.03);
}

/* Desktop: usa o surreal e esconde o grid */
@media (min-width: 992px) {
  .stacks-section .stacks-grid { display: none !important; }
  .stacks-section .stacks-surreal { display: block !important; }
}

/* Mobile/tablet: mantém o grid (surreal some) */
@media (max-width: 991px) {
  .stacks-section .stacks-surreal { display: none !important; }
  .stacks-section .stacks-grid { display: grid !important; }
}

@media (prefers-reduced-motion: reduce) {
  .stacks-surreal {
    display: none;
  }
  .stacks-grid {
    display: grid;
  }
}

.stacks-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
  perspective: 1000px;
}

@media (max-width: 992px) {
  .stacks-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .stacks-grid {
    grid-template-columns: 1fr;
  }
}

.stack-pill {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color-light);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  text-align: left;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
  transform-style: preserve-3d;
  will-change: transform;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}

.stack-pill::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(500px 220px at var(--mx, 50%) var(--my, 50%), rgba(214, 255, 92, 0.16), transparent 55%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 55%);
  transition: opacity 200ms ease;
}

.stack-pill::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(214, 255, 92, 0.08) inset;
  opacity: 0.8;
}

.stack-pill:hover {
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  transform: translateY(-6px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}

.stack-pill:hover::before {
  opacity: 1;
}

.stack-pill .stack-icon,
.stack-pill h4,
.stack-pill p {
  transform: translateZ(18px);
  user-select: none;
}

.stack-pill .stack-icon {
  transform: translateZ(24px);
}

/* Mobile/touch: mantém premium sem tilt */
@media (hover: none), (pointer: coarse) {
  .stack-pill {
    transform: none !important;
  }
  .stack-pill:hover {
    transform: translateY(-4px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stack-pill,
  .stack-pill::before {
    transition: none !important;
  }
  .stack-pill:hover {
    transform: none !important;
  }
}

/* ===== Modal de stacks ===== */
.stack-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.stack-modal.is-open {
  display: block;
}

.stack-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.stack-modal__dialog {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.stack-modal__card {
  width: min(720px, 92vw);
  border-radius: 18px;
  background:
    radial-gradient(800px 420px at 20% 10%, rgba(214, 255, 92, 0.14), transparent 55%),
    radial-gradient(700px 380px at 90% 20%, rgba(255, 255, 255, 0.06), transparent 55%),
    linear-gradient(180deg, rgba(14, 14, 14, 0.92), rgba(0, 0, 0, 0.92));
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(214, 255, 92, 0.16) inset;
  border: 1px solid rgba(214, 255, 92, 0.18);
  overflow: hidden;
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  animation: stackModalIn 240ms ease forwards;
}

@keyframes stackModalIn {
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.stack-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.25rem 0.75rem;
}

.stack-modal__titleWrap {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.stack-modal__icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(214, 255, 92, 0.14);
  box-shadow: 0 0 40px rgba(214, 255, 92, 0.08);
}

.stack-modal__icon i {
  color: rgba(214, 255, 92, 0.95);
  font-size: 1.2rem;
}

.stack-modal__title {
  margin: 0;
  font-size: 1.35rem;
  color: var(--text-primary);
}

.stack-modal__subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.stack-modal__close {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.stack-modal__close:focus-visible {
  outline: 2px solid rgba(214, 255, 92, 0.6);
  outline-offset: 2px;
}

.stack-modal__body {
  padding: 0.25rem 1.25rem 1.25rem;
  color: var(--text-secondary);
  line-height: 1.65;
  font-size: 0.98rem;
}

.stack-modal__list {
  margin: 0.9rem 0 0;
  padding-left: 1.1rem;
}

.stack-modal__list li {
  margin: 0.35rem 0;
}
.stack-pill h4 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.stack-pill p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.stack-pill .stack-icon {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

/* Última linha incompleta: centraliza item único (4 col) */
.stacks-grid .stack-pill:last-child:nth-child(4n + 1) {
  grid-column: 1 / -1;
  max-width: calc((100% - 3 * 1.25rem) / 4);
  justify-self: center;
}

@media (max-width: 992px) {
  .stacks-grid .stack-pill:last-child:nth-child(4n + 1) {
    max-width: none;
    grid-column: auto;
    justify-self: stretch;
  }
  .stacks-grid .stack-pill:last-child:nth-child(2n + 1) {
    grid-column: 1 / -1;
    max-width: calc((100% - 1 * 1.25rem) / 2);
    justify-self: center;
  }
}

@media (max-width: 520px) {
  .stacks-grid .stack-pill:last-child:nth-child(2n + 1) {
    grid-column: auto;
    max-width: none;
    justify-self: stretch;
  }
}

.sobre-matheus,
.formacao-matheus {
  padding: 5rem 0;
  background: var(--bg-primary);
  position: relative;
}

.sobre-grid,
.formacao-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .sobre-grid,
  .formacao-grid {
    grid-template-columns: 1fr;
  }
}

.sobre-photo-wrap {
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--border-color-light);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.sobre-photo-wrap img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

/* Moldura do certificado — uma borda só (externa) + sombra limpa */
.formacao-cert-wrap {
  position: relative;
  overflow: visible;
  isolation: isolate;
  border-radius: 18px;
  border: 1px solid rgba(214, 255, 92, 0.22);
  padding: 14px;
  margin-top: 18px;
  background: linear-gradient(145deg, rgba(18, 18, 18, 1), rgba(8, 8, 8, 1));
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.72),
    0 12px 30px rgba(0, 0, 0, 0.45);
  transform: translateZ(0);
  transition: transform 420ms ease, box-shadow 420ms ease, border-color 420ms ease;
}

.cert-ribbon {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  color: #0a0a0a;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: linear-gradient(135deg, rgba(214, 255, 92, 1), rgba(214, 255, 92, 0.72));
  border: 0;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
}

.cert-ribbon__icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  color: rgba(10, 10, 10, 0.92);
}

.cert-inner {
  /* Mantém o HTML, mas “some” da árvore de layout pra não criar 2ª moldura visual */
  display: contents;
}

.cert-document {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #0a0a0a;
  border: 0;
  box-shadow: none;
}

.cert-document img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
  transform: scale(1);
  transition: transform 420ms ease, filter 420ms ease;
  will-change: transform;
}

.cert-seal {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: rgba(10, 10, 10, 0.92);
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.55), rgba(214, 255, 92, 0.95));
  border: 0;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cert-seal i {
  font-size: 1.25rem;
}

.formacao-cert-wrap:hover {
  transform: translateY(-6px);
  border-color: rgba(214, 255, 92, 0.32);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.78),
    0 16px 34px rgba(0, 0, 0, 0.48);
}

.formacao-cert-wrap:hover .cert-document img {
  transform: scale(1.02);
  filter: contrast(1.02) saturate(1.02);
}

@media (max-width: 768px) {
  .formacao-cert-wrap {
    padding: 12px;
    margin-top: 16px;
  }
  .cert-ribbon {
    top: -12px;
    padding: 0.5rem 0.85rem;
    font-size: 0.68rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .formacao-cert-wrap,
  .cert-document img {
    transition: none !important;
  }
  .formacao-cert-wrap:hover {
    transform: none !important;
  }
  .formacao-cert-wrap:hover .cert-document img {
    transform: none !important;
  }
}

/* Snake border (efeito “correndo” na borda) — foto do Sobre
   Implementação compatível: o wrapper ganha padding e o “anel” gira atrás da imagem. */
.sobre-photo-wrap {
  padding: 6px;
  border: 0;
}

.sobre-photo-wrap img {
  position: relative;
  z-index: 2;
  border-radius: calc(16px - 6px);
  transform: scale(1);
  transition: transform 450ms ease;
  will-change: transform;
}

.sobre-photo-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: conic-gradient(
    from 0deg,
    rgba(214, 255, 92, 0) 0%,
    rgba(214, 255, 92, 0) 12%,
    rgba(214, 255, 92, 0.95) 18%,
    rgba(214, 255, 92, 0) 26%,
    rgba(214, 255, 92, 0) 100%
  );
  animation: snakeBorderSpin 6.8s linear infinite;
  filter: drop-shadow(0 0 12px rgba(214, 255, 92, 0.25));
  pointer-events: none;
  z-index: 1;
}

.sobre-photo-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(214, 255, 92, 0.18) inset;
  pointer-events: none;
  z-index: 3;
}

@keyframes snakeBorderSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sobre-photo-wrap::before {
    animation: none !important;
  }
  .sobre-photo-wrap img {
    transition: none !important;
  }
}

.sobre-photo-wrap:hover img {
  transform: scale(1.04);
}

/* Sobre (mobile): botões lado a lado */
@media (max-width: 520px) {
  .sobre-actions {
    flex-wrap: nowrap !important;
    gap: 0.6rem !important;
  }
  .sobre-actions > a {
    flex: 1 1 0;
    justify-content: center;
    text-align: center;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    white-space: nowrap;
  }
}

.sobre-text h2,
.formacao-text h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin: 0 0 1rem;
  color: var(--text-primary);
}

.sobre-text p,
.formacao-text p,
.formacao-text li {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.95rem;
}

.formacao-text ul {
  padding-left: 1.1rem;
  margin: 1rem 0 0;
}

.formacao-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-color-light);
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.hero-title .title-line,
.hero-title .title-highlight {
  display: block;
}

/* Garante laptop estático se style.css antigo ainda tiver keyframes */
.laptop {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

/* style.css antigo: .screen-content global 400px — corrige altura no celular do hero */
.phone-mockup .phone-screen > .screen-content {
  height: calc(100% - 60px) !important;
}

.laptop-screen .screen-content.screen-content--laptop {
  height: 400px !important;
}

@media (max-width: 768px) {
  .laptop-screen .screen-content.screen-content--laptop {
    height: 300px !important;
  }
}

/* Hero (desktop): centraliza SaaS / APIs / Stack */
@media (min-width: 992px) {
  /* stats agora são full-width abaixo do grid */
  .hero .hero-stats--full {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    margin-top: 2.25rem;
    text-align: center;
  }
  .hero .hero-stats--full .stat-item {
    justify-content: center;
    text-align: center;
  }
  .hero .hero-stats--full .stat-content {
    text-align: center;
  }
}

/* Hero — cards flutuantes (SPA / API / SQL / IA): flutuação bem suave em loop */
@keyframes heroMetricBounce {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -7px, 0);
  }
}

/* Desktop e mobile: cards visíveis flutuam (no mobile o style.css esconde 2 e 3) */
.hero .floating-metrics .metric-card {
  animation: heroMetricBounce 5.5s ease-in-out infinite;
  will-change: transform;
}
.hero .floating-metrics .metric-card.metric-1 {
  animation-delay: 0s;
}
.hero .floating-metrics .metric-card.metric-2 {
  animation-delay: 0.6s;
}
.hero .floating-metrics .metric-card.metric-3 {
  animation-delay: 1.2s;
}
.hero .floating-metrics .metric-card.metric-4 {
  animation-delay: 1.8s;
}

@media (prefers-reduced-motion: reduce) {
  .hero .floating-metrics .metric-card {
    animation: none !important;
  }
}
