/* =========================================================
   Portfólio — Gabriel Portugal Castilho
   Paleta: escala do preto ao branco + laranjas da marca
   ========================================================= */

:root {
  /* Escala neutra (preto → branco) */
  --c-950: #0a0a0a;
  --c-900: #111111;
  --c-850: #141414;
  --c-800: #1c1c1c;
  --c-700: #262626;
  --c-600: #3a3a3a;
  --c-500: #6b6b6b;
  --c-400: #9a9a9a;
  --c-300: #c8c8c8;
  --c-200: #e2e2e2;
  --c-100: #efefef;
  --c-50: #f5f5f5;
  --white: #ffffff;

  /* Laranjas da marca */
  --orange: #ff9d00;
  --amber: #ffbf00;
  --orange-deep: #ff7a00;
  --gradient-brand: linear-gradient(
    135deg,
    var(--amber),
    var(--orange) 55%,
    var(--orange-deep)
  );

  /* Tipografia */
  --font-display: "Poppins", system-ui, sans-serif; /* títulos */
  --font-body: "Roboto", system-ui, sans-serif; /* textos corridos */
  --font-ui: "Poppins", system-ui, sans-serif; /* menu e botões */
  --font-mono:
    "Fira Code", ui-monospace, monospace; /* rótulos, tags, detalhes "de código" */

  /* Layout */
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 14px;
  --header-h: 76px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
  padding: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* Barra de rolagem oculta — a rolagem continua funcionando (mouse, toque, teclado) */
html,
body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

/* Texto só para leitores de tela */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--c-50);
  background: var(--c-950);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip; /* navegadores modernos: corta sem criar container de rolagem */
}

/* Cinza secundário nas seções escuras: #6b6b6b não passa no contraste WCAG AA sobre preto */
.section--dark,
.contact,
.loader {
  --c-500: #8a8a8a;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
ul,
ol {
  list-style: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
strong {
  font-weight: 700;
}
::selection {
  background: var(--orange);
  color: var(--c-950);
}

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 4px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--orange);
  color: var(--c-950);
  font-weight: 600;
  border-radius: 8px;
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
}
/* alvos de foco programático (seções/main com tabindex="-1") não precisam de contorno */
[tabindex="-1"]:focus {
  outline: none;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.accent {
  color: var(--orange);
}
.muted {
  color: var(--c-500);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-400);
}

/* ---------- Botões ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--c-950);
  background: var(--gradient-brand);
  border-radius: 999px;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}
/* hover: o botão cresce um pouco (sem trocar a cor de fundo) */
.btn:hover,
.btn:focus-visible {
  transform: scale(1.05);
}

.btn--ghost {
  color: var(--c-50);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--c-600);
}
.btn--ghost:hover,
.btn--ghost:focus-visible {
  box-shadow: inset 0 0 0 1px var(--orange);
}

@media (prefers-reduced-motion: reduce) {
  .btn:hover,
  .btn:focus-visible {
    transform: none;
  }
}

.btn--small {
  min-height: 42px;
  padding: 0 20px;
  font-size: 0.875rem;
}

/* ---------- Loader ---------- */
.loader {
  display: none;
}
html.js .loader {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 24px;
  background: var(--c-950);
}
.loader__mark {
  position: relative;
  width: 64px;
  height: 56px;
}
.loader__bar {
  position: absolute;
  left: 0;
  width: 58px;
  height: 12px;
  transform-origin: left center;
}
.loader__bar--1 {
  top: 34px;
  left: 18px;
  background: var(--orange);
  transform: rotate(-50deg) scaleX(0);
}
.loader__bar--2 {
  top: 40px;
  left: 0;
  background: var(--amber);
  transform: rotate(-50deg) scaleX(0);
}
.loader__count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--c-500);
  font-variant-numeric: tabular-nums;
}

/* ---------- Header ---------- */
.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 500;
  height: var(--header-h);
  transition:
    transform 0.5s var(--ease-out),
    background 0.4s,
    border-color 0.4s;
  border-bottom: 1px solid transparent;
}
/* Depois do hero o header vira uma cápsula flutuante de vidro escuro (em vez de uma faixa
   de ponta a ponta, que pesava sobre as seções brancas) */
.header__inner {
  border: 1px solid transparent;
  border-radius: 999px;
  transition:
    max-width 0.6s var(--ease-out),
    height 0.6s var(--ease-out),
    margin-top 0.6s var(--ease-out),
    padding 0.6s var(--ease-out),
    background-color 0.4s,
    border-color 0.4s,
    box-shadow 0.4s;
}
.header.is-scrolled .header__inner {
  max-width: min(1040px, calc(100% - 32px));
  height: 60px;
  margin-top: 10px;
  padding-inline: 26px 8px;
  background-color: rgba(12, 12, 12, 0.75); /* translúcido; o desfoque forte mantém o texto legível */
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow:
    0 12px 32px -12px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.header.is-scrolled .menu-toggle {
  width: 40px;
  height: 40px;
}
/* menu do celular aberto (tela cheia): a cápsula some para não ficar por cima dele */
.menu-open .header .header__inner {
  background-color: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.header.is-hidden {
  transform: translateY(-100%);
}

.header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}
.header__logo img {
  width: clamp(180px, 20vw, 236px);
  height: auto;
}

.nav {
  margin-left: auto;
}
.nav__list {
  display: flex;
  gap: 32px;
}
.nav__list a {
  position: relative;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--c-300);
  transition: color 0.3s;
}
.nav__list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease-out);
}
.nav__list a:hover,
.nav__list a.is-active {
  color: var(--c-50);
}
.nav__list a:hover::after,
.nav__list a.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.menu-toggle {
  display: none;
}

/* backdrop-filter/transform no header "prendem" o menu fixo dentro dele — desliga com o menu aberto */
.menu-open .header {
  transform: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: transparent;
  border-bottom-color: transparent;
}
.menu-open {
  overflow: hidden;
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: grid;
  align-content: center;
  padding: var(--gutter);
  background: var(--c-950);
}
.mobile-menu[hidden] {
  display: none;
}
.mobile-menu ul {
  display: grid;
  gap: 12px;
}
.mobile-menu a {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 12vw, 4rem);
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}
.mobile-menu a:hover {
  color: var(--orange);
}

@media (max-width: 860px) {
  .nav,
  .header__cta {
    display: none;
  }
  .menu-toggle {
    display: grid;
    gap: 6px;
    place-content: center;
    width: 44px;
    height: 44px;
    margin-left: auto;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px var(--c-600);
  }
  .menu-toggle span {
    width: 18px;
    height: 2px;
    background: var(--c-50);
    transition: transform 0.4s var(--ease-out);
  }
  .menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(4px) rotate(45deg);
  }
  .menu-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-4px) rotate(-45deg);
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: calc(var(--header-h) + 40px) 0 100px;
  overflow: hidden;
  background: var(--c-950);
}
/* Fundo animado (Lightfall, WebGL) — ver js/lightfall.js. Sem WebGL, fica o preto do .hero */
.hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.lightfall__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
}

.hero__title {
  position: relative;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 6.2vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--c-50);
}
.hero__stripes {
  position: absolute;
  top: -0.08em;
  left: -0.38em;
  z-index: -1;
  width: 0.95em;
}
.hero__stripes img {
  width: 100%;
  height: auto;
}
.hero__line {
  display: block;
  width: fit-content;
}

/* ---------- DepthText (texto 3D do hero) — ver js/depth-text.js ---------- */
.depth-text {
  perspective: var(--depth-text-perspective);
  perspective-origin: 50% 48%;
  isolation: isolate;
}
.depth-text__stage {
  position: relative;
  display: inline-grid;
  place-items: center start;
  transform-style: preserve-3d;
  transform-origin: 50% 50%;
  will-change: transform;
}
.depth-text__layer,
.depth-text__face {
  grid-area: 1 / 1;
  display: inline-block;
  white-space: nowrap;
  user-select: none;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}
.depth-text__layer {
  pointer-events: none;
}
.depth-text__layer--back {
  text-shadow: var(--depth-text-shadow);
}
.depth-text__face {
  position: relative;
  z-index: 1;
  color: var(--depth-text-face-color);
  text-shadow: var(--depth-text-face-shadow);
  transform: translateZ(0.6px);
}
@media (prefers-reduced-motion: reduce) {
  .depth-text__stage {
    will-change: auto;
  }
}

.hero__location {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  color: var(--c-400);
}
.hero__location svg {
  color: var(--orange);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 44px;
}

.hero__media {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 440px;
}
.hero__media::before {
  content: "";
  position: absolute;
  inset: 12% -6% -4% 8%;
  background: var(--gradient-brand);
  filter: blur(70px);
  opacity: 0.28;
  z-index: 0;
}
.hero__photo-wrap {
  position: relative;
  z-index: 1;
}
.hero__photo {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.6));
}

@media (max-width: 860px) {
  .hero {
    padding-bottom: 80px;
  }
  .hero__inner {
    grid-template-columns: 1fr;
  }
  .hero__media {
    order: -1;
    justify-self: center;
    max-width: 300px;
  }
  .hero__stripes {
    left: -0.2em;
  }
  /* As linhas do título 3D não quebram: "Desenvolvedor" precisa caber na largura do celular */
  .hero__title {
    font-size: clamp(2.1rem, 10.5vw, 2.6rem);
  }
}

/* ---------- Stacks (carrossel 3D de ícones) ---------- */
/* .stack.circular-carousel: mais específico que o "height: 100%" do carrossel */
.stack,
.stack.circular-carousel {
  position: relative;
  z-index: 2;
  height: clamp(170px, 12.5vw, 240px);
  background: var(--c-850); /* mesma cor de fundo da Formação (.section--dark) */
}
/* Sem JS: os ícones ficam numa fileira simples */
.stack__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: 16px;
  height: 100%;
  padding: 0 var(--gutter);
}
.stack__list[hidden] {
  display: none;
}
.stack__item {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 96px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--c-400);
}
/* Ícone pintado com o gradiente da marca: o SVG vira só a "máscara".
   A imagem (mask-image) fica no style do HTML, assim o caminho é relativo à página. */
.stack__icon {
  display: block;
  width: 56px;
  aspect-ratio: 1;
  background: var(--gradient-brand);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* Cartão do carrossel: ícone com o gradiente laranja da marca e o nome logo abaixo */
.stack__card {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7%;
  container-type: inline-size; /* o nome escala com a largura do cartão (unidade cqw) */
  background: var(--c-800); /* um tom acima do fundo da seção, para o cartão se destacar */
  border: 1px solid var(--c-700);
  border-radius: var(--cc-radius);
}
.stack__card .stack__icon {
  width: 20cqw;
}
.stack__label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 8cqw;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--c-50);
}
.stack .circular-carousel__caption {
  color: var(--c-50);
}
.stack .circular-carousel__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  text-transform: uppercase;
}
.stack .circular-carousel__count {
  font-family: var(--font-mono);
}

/* ---------- CircularCarousel (port do React Bits) ---------- */
.circular-carousel {
  --cc-fade: #000000;
  --cc-radius: 12px;
  --cc-inner: 0.4;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  outline: none;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.circular-carousel[data-axis="x"] {
  touch-action: pan-x;
}
.circular-carousel[data-draggable] {
  cursor: grab;
}
.circular-carousel[data-dragging] {
  cursor: grabbing;
}
.circular-carousel:focus-visible {
  box-shadow: inset 0 0 0 2px var(--orange);
}
.circular-carousel__view {
  position: absolute;
  inset: 0;
}
.circular-carousel[data-shape="wheel"] .circular-carousel__view {
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}
.circular-carousel[data-shape="panorama"] .circular-carousel__view {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}
.circular-carousel__stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.45s ease;
}
.circular-carousel[data-ready] .circular-carousel__stage {
  opacity: 1;
}
.circular-carousel__camera,
.circular-carousel__ring,
.circular-carousel__card {
  width: 0;
  height: 0;
  transform-style: preserve-3d;
}
.circular-carousel__camera {
  position: relative;
}
.circular-carousel__ring,
.circular-carousel__card {
  position: absolute;
  left: 0;
  top: 0;
}
.circular-carousel__tile {
  position: absolute;
  outline: 1px solid transparent;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.circular-carousel__frame {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  overflow: hidden;
}
.circular-carousel__face {
  position: absolute;
  pointer-events: none;
}
.circular-carousel__shade,
.circular-carousel__inner {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.circular-carousel__shade {
  background: var(--cc-fade);
  opacity: var(--cc-depth, 0);
}
.circular-carousel__inner {
  background: #000;
  opacity: var(--cc-inner);
}
.circular-carousel__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  text-align: center;
  pointer-events: none;
  animation: circular-carousel-reveal 900ms ease both;
}
.circular-carousel__title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  animation: circular-carousel-title 520ms var(--ease-out);
}
.circular-carousel__count {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  opacity: 0.5;
}
.circular-carousel__live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
@keyframes circular-carousel-title {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes circular-carousel-reveal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .circular-carousel__stage {
    transition: none;
  }
  .circular-carousel__caption,
  .circular-carousel__title {
    animation: none;
  }
}

/* ---------- Seções com título gigante ---------- */
.section {
  position: relative;
  padding: clamp(120px, 14vw, 200px) 0 clamp(96px, 12vw, 160px);
}
.section--light {
  background: var(--white);
  color: var(--c-850);
}
.section--dark {
  background: var(--c-850);
  color: var(--c-300);
}

/* Troca preto ↔ branco ao rolar (estilo porsche.com) — classes postas por setupSectionTheme
   em js/main.js. Curva da Porsche, mais rápida (0.7s em vez de 1.2s) */
.section--light,
.section--dark,
.giant-title {
  transition:
    background-color 0.7s cubic-bezier(0.4, 0, 0.5, 1),
    color 0.7s cubic-bezier(0.4, 0, 0.5, 1);
}
body.zone-dark .section--light {
  background-color: var(--c-850);
}
body.zone-light .section--dark {
  background-color: var(--white);
}
/* Título gigante decorativo acompanha o fundo (tom sobre tom nos dois casos) */
body.zone-dark .section--light .giant-title {
  color: #1c1c1c;
}
body.zone-light .giant-title--dark {
  color: #e0e0e0;
}
@media (prefers-reduced-motion: reduce) {
  .section--light,
  .section--dark,
  .giant-title {
    transition-duration: 0.01s;
  }
}

.section__grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}

.giant-title {
  position: sticky;
  top: calc(var(--header-h) + 40px);
  display: grid;
  font-family: "Work Sans", var(--font-display);
  font-weight: 700;
  font-size: clamp(4.2rem, 9.5vw, 8.75rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  /* Só decoração: tom sobre tom, um pouco mais claro que o fundo da seção */
  color: #e0e0e0; /* fundo branco → cinza bem claro */
  user-select: none;
  pointer-events: none;
}
.giant-title--dark {
  color: #1c1c1c;
} /* fundo #141414 → preto um pouco mais claro */

.section__body {
  display: grid;
  gap: 56px;
}

.lead {
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.6;
  color: var(--c-600);
}
.lead strong {
  color: var(--c-850);
}
.lead--dark {
  color: var(--c-400);
}
.lead--dark strong {
  color: var(--c-50);
}

@media (max-width: 860px) {
  .section__grid {
    grid-template-columns: 1fr;
  }
  .giant-title {
    position: static;
    font-size: clamp(3.4rem, 19vw, 6rem);
  }
}

/* ---------- Projetos: pilha de prints (CardSwap) + detalhes ---------- */
.projects {
  display: grid;
  gap: 28px;
  margin-top: clamp(24px, 4vw, 56px); /* respiro extra entre a explicação e os projetos */
}

/* Pilha. O espaço de cima/direita é onde aparecem os cards de trás (js/card-swap.js:
   distX 44px e distY 40px por posição). O ::before reserva a altura do card da frente. */
.card-swap {
  --card-gap-x: 56px;
  --card-gap-y: 52px;
  position: relative;
  padding: var(--card-gap-y) var(--card-gap-x) 0 0;
  perspective: 900px;
  cursor: pointer;
  border-radius: var(--radius);
  -webkit-tap-highlight-color: transparent;
}
.card-swap::before {
  content: "";
  display: block;
  aspect-ratio: 2 / 1;
}
/* Arrastar (js/card-swap.js): mãozinha no card da frente; pan-y deixa a rolagem vertical
   do celular funcionando, e o arraste horizontal fica para a pilha */
.card-swap {
  touch-action: pan-y;
}
.card-swap__card.is-front {
  cursor: grab;
}
.card-swap.is-dragging,
.card-swap.is-dragging .card-swap__card {
  cursor: grabbing;
  user-select: none;
}
.card-swap:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 6px;
}
.card-swap__card {
  position: absolute;
  left: 0;
  bottom: 0;
  width: calc(100% - var(--card-gap-x));
  aspect-ratio: 2 / 1;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--c-100);
  border: 1px solid var(--c-200);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.35);
  backface-visibility: hidden;
  will-change: transform;
}
.card-swap__card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  pointer-events: none;
  user-select: none;
}
/* Cards de trás um pouco apagados, para dar profundidade */
.card-swap__card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--white);
  opacity: 0.45;
  transition: opacity 0.5s var(--ease-out);
  pointer-events: none;
}
.card-swap__card.is-front::after {
  opacity: 0;
}
.card-swap__card figcaption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--white);
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(8px);
  border-radius: 10px;
}
.card-swap__url {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--c-300);
  align-self: center;
}

/* Contador "01 / 02" no topo do bloco de projetos */
.projects__count {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--c-500);
  margin-bottom: -8px;
}
.projects__count [data-project-count] {
  color: var(--c-850);
  font-weight: 500;
}

/* Os detalhes (acima da pilha) dos dois projetos ocupam a MESMA célula: a altura é a do
   maior, então a pilha não pula ao trocar. Só o .is-active aparece (fade feito em js/main.js). */
.projects__details {
  display: grid;
  padding-right: 56px;
}
.project {
  grid-area: 1 / 1;
  position: relative;
  padding-left: 18px;
}
.project::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 3px;
  height: 22px;
  background: var(--orange);
}
html.js .project:not(.is-active) {
  opacity: 0;
  visibility: hidden;
}
.project__year {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--c-500);
  margin-bottom: 6px;
}
.project__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--c-850);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.project__text {
  font-size: 0.95rem;
  color: var(--c-500);
  margin-bottom: 16px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tags li {
  padding: 5px 11px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--c-700);
  background: var(--c-100);
  border-radius: 6px;
}

/* Sem JavaScript: prints um embaixo do outro e os dois projetos visíveis */
html:not(.js) .card-swap {
  display: grid;
  gap: 16px;
  padding: 0;
  cursor: default;
}
html:not(.js) .card-swap::before,
html:not(.js) .projects__count {
  display: none;
}
html:not(.js) .card-swap__card {
  position: relative;
  width: 100%;
}
html:not(.js) .card-swap__card::after {
  opacity: 0;
}
html:not(.js) .projects__details {
  gap: 40px;
}
html:not(.js) .project {
  grid-area: auto;
}

@media (max-width: 560px) {
  .card-swap {
    --card-gap-x: 32px;
    --card-gap-y: 30px;
  }
  .projects__details {
    padding-right: 0;
  }
  .card-swap__url {
    display: none;
  }
  .card-swap__card figcaption {
    left: 8px;
    right: auto;
    bottom: 8px;
    padding: 6px 10px;
    font-size: 0.75rem;
    border-radius: 8px;
  }
}

/* ---------- Formação ---------- */
.degrees {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}
.degree {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 24px 24px 22px;
  background: var(--c-950);
  border: 1px solid var(--c-700);
  border-radius: var(--radius);
  transition: border-color 0.4s; /* transform fica só com o GSAP (transição CSS deixava a animação travada) */
}
.degree::before {
  /* detalhe laranja colado do lado de fora da borda esquerda, alinhado ao título (como no Figma).
     right: 100% encosta na caixa de padding; +1px pula a borda de 1px do card */
  content: "";
  position: absolute;
  right: calc(100% + 1px);
  top: 44px;
  width: 5px;
  height: 20px;
  border-radius: 0;
  background: var(--orange);
}
.degree:hover {
  border-color: rgba(255, 157, 0, 0.5);
}
.degree__kind,
.degree__school {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-500);
}
.degree__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--c-50);
  margin-bottom: 18px;
}

.extras {
  display: grid;
  gap: 40px;
}
.extra__heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-400);
}
.extra__list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--c-700);
  color: var(--c-50);
}

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

/* ---------- Contato ---------- */
.contact {
  position: relative;
  padding: clamp(120px, 14vw, 180px) 0 0;
  background: var(--c-950);
  color: var(--c-400);
  /* sem overflow: hidden — as listras ficam metade na Formação e metade aqui */
}
.contact__stripes {
  position: absolute;
  top: 0;
  left: var(--gutter);
  z-index: 3;
  width: clamp(64px, 7vw, 96px);
  height: auto;
  translate: 0 -50%; /* centraliza na divisa entre as duas seções */
}

/* Laser (LaserFlow, WebGL) atrás do conteúdo — ver js/laser-flow.js e setupContactLaser em main.js */
.contact__laser {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  transition: opacity 0.5s ease;
}
.contact__laser.is-hidden {
  opacity: 0; /* some ao rolar para cima (setupContactLaser em js/main.js) */
}
.laser-flow__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.contact__grid,
.contact .footer {
  position: relative;
  z-index: 1;
}

.contact__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}
.contact__text {
  display: grid;
  gap: 18px;
  max-width: 620px;
}
.contact__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 5.5vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--c-50);
  margin-bottom: 8px;
}

.contact__links {
  margin-top: 28px;
  border-top: 1px solid var(--c-800);
}
.contact__links li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--c-800);
}
.contact__link {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 20px 0;
}
.contact__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-500);
}
.contact__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.1rem, 2.4vw, 1.75rem);
  color: var(--c-50);
  overflow-wrap: anywhere;
  transition:
    color 0.3s,
    transform 0.5s var(--ease-out);
}
.contact__link:hover .contact__value {
  color: var(--orange);
  transform: translateX(10px);
}

.copy-btn {
  flex-shrink: 0;
  min-height: 44px; /* área de toque mínima recomendada */
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--c-300);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--c-700);
  transition:
    color 0.3s,
    box-shadow 0.3s;
}
.copy-btn:hover {
  color: var(--orange);
  box-shadow: inset 0 0 0 1px var(--orange);
}

.contact__media {
  position: relative;
}
.contact__photo-wrap {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 640px;
  overflow: hidden;
  clip-path: polygon(14% 0, 100% 0, 86% 100%, 0 100%);
}
.contact__photo-wrap img {
  width: 100%;
  height: 118%;
  object-fit: cover;
  object-position: center 15%;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: clamp(80px, 10vw, 140px);
  padding-block: 32px;
  border-top: 1px solid var(--c-800);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--c-500);
}
.footer__top {
  display: inline-block;
  color: var(--c-300);
  transition: color 0.3s;
}
.footer__top:hover {
  color: var(--orange);
}

@media (max-width: 860px) {
  .contact__grid {
    grid-template-columns: 1fr;
  }
  .contact__media {
    max-width: 380px;
  }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 700;
  padding: 12px 20px;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-950);
  background: var(--gradient-brand);
  border-radius: 999px;
  width: max-content;
  max-width: calc(100vw - 32px);
  text-align: center;
  /* escondido de verdade: antes uma "pontinha" laranja vazava no rodapé da tela */
  opacity: 0;
  transform: translate(-50%, calc(100% + 40px));
  transition:
    transform 0.5s var(--ease-out),
    opacity 0.3s;
  pointer-events: none;
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Acessibilidade: menos movimento ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* SplitText (mask: lines) corta descendentes como o "g" — dá folga embaixo de cada linha sem mudar o espaçamento */
.splitline-mask {
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}

/* Link "Ver site" nos cards de projeto */
.project__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--c-850);
  border-bottom: 1px solid var(--orange);
  padding-bottom: 2px;
  transition:
    color 0.3s,
    gap 0.3s var(--ease-out);
}
.project__link:hover {
  color: #b35c00;
  gap: 10px;
}

/* =========================================================
   Animações extras (branch develop)
   ========================================================= */

/* Botões magnéticos: usam a propriedade "translate" (separada do transform),
   assim o scale do :hover continua funcionando junto */
.is-magnetic {
  translate: calc(var(--mx, 0) * 1px) calc(var(--my, 0) * 1px);
}

/* =========================================================
   Responsivo — celular
   ========================================================= */

/* Nada pode empurrar a largura da página (animações que vêm de lado, faixa girada).
   Sem isso o celular "abre" a página mais larga que a tela e o botão do menu fica fora da vista.
   overflow-x: clip não cria container de rolagem, então o título "sticky" continua funcionando. */
main {
  overflow-x: clip;
}
@supports not (overflow: clip) {
  main {
    overflow-x: hidden;
  }
}

@media (max-width: 860px) {
  /* Hero: foto menor para título e botões caberem na primeira tela */
  .hero {
    padding: calc(var(--header-h) + 16px) 0 72px;
  }
  .hero__inner {
    gap: 28px;
  }
  .hero__media {
    max-width: min(240px, 26svh);
  }
  .hero__location {
    margin-top: 20px;
  }
  .hero__actions {
    margin-top: 28px;
  }
  /* Seções: menos respiro em cima */
  .section {
    padding: 88px 0 80px;
  }
  .section__body {
    gap: 40px;
  }

  /* Título gigante numa linha só ("EXPERIÊNCIA"), em vez de 3 blocos ocupando a tela */
  .giant-title {
    display: flex;
    flex-wrap: wrap;
    font-size: 11vw;
    line-height: 1;
    letter-spacing: 0;
  }

  /* Contato */
  .contact {
    padding-top: 96px;
  }
  .contact__media {
    max-width: 340px;
    width: 100%;
    margin-inline: auto;
  }
}

@media (max-width: 560px) {
  .hero__actions .btn {
    flex: 1 1 auto;
    padding: 0 18px;
  }

  /* E-mail com a largura toda: o botão Copiar sobe para a linha do rótulo */
  .contact__links li {
    display: block;
  }
  .copy-btn {
    position: absolute;
    top: 12px;
    right: 0;
    min-height: 36px;
    padding: 6px 14px;
  }
  .contact__value {
    font-size: 1.1rem;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
