/* =========================================================
   1. VARIÁVEIS — mexa aqui para mudar cores, fontes e tempos
   ========================================================= */
:root {
  --text:       #ececec;                 /* cor principal do texto */
  --text-dim:   rgba(236,236,236,.54);   /* texto secundário */
  --line:       rgba(255,255,255,.16);   /* linhas e bordas */
  --font-title: "Faustina", Georgia, serif;
  --font-body:  "Geist", system-ui, sans-serif;
  --ease:       cubic-bezier(.65, 0, .35, 1); /* curva da animação do nome (ease-in-out suave) */
  --ease-out:   cubic-bezier(.16, 1, .3, 1);  /* curva suave para o popup */
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { background: #0a0a0a; }

body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Trava a rolagem enquanto a intro está rodando */
body.intro { overflow: hidden; }

/* =========================================================
   2. FUNDO — troque background.jpg por um .gif/.webp/.mp4 depois
   ========================================================= */
#vanta-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #0a0a0a;
  overflow: hidden;
}

/* Camada 1: escurece e cria vinheta nas bordas */
#vanta-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,.25) 0%, rgba(0,0,0,.75) 100%),
    rgba(0,0,0,.2);
}

/* Camada 2: granulado (ruído em tons de cinza) */
#vanta-bg::after {
  content: "";
  position: absolute;
  inset: -50%;
  z-index: 2;
  pointer-events: none;
  opacity: .100;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='.33 .33 .33 0 0 .33 .33 .33 0 0 .33 .33 .33 0 0 0 0 0 0 1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) infinite;
}

@keyframes grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3%, 2%); }
  40%  { transform: translate(2%, -3%); }
  60%  { transform: translate(-2%, -1%); }
  80%  { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

/* =========================================================
   3. BARRA SUPERIOR (projeto à esquerda, idioma à direita)
   ========================================================= */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px clamp(20px, 3vw, 40px);
  font-size: .82rem;
}

/* ---- Link do projeto mais recente + bolinha ---- */
.project { position: relative; }

.project-link {
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(236,236,236,.5);
  padding-bottom: 3px;
  transition: border-color .25s ease;
}
.project-link:hover { border-color: var(--text); }

/* A bolinha • à esquerda do texto */
.project-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .25; } }

/* ---- Popup que aparece no hover (com animação smooth em cascata) ---- */
.popup {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 14px;
  width: min(330px, 86vw);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px) scale(.97);
  transform-origin: top left;
  filter: blur(4px);
  transition:
    opacity .38s var(--ease-out),
    transform .38s var(--ease-out),
    filter .38s var(--ease-out),
    visibility .38s;
}

.popup::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -16px;
  height: 16px;
}

.project:hover .popup,
.project:focus-within .popup {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.popup-img {
  display: block;
  width: 100%;
  aspect-ratio: 1.85 / 1;          /* antes era 16 / 9 */
  object-fit: cover;
  object-position: center 0%;   /* topo do print */
  border: 1px solid var(--line);
  margin-bottom: 12px;
  transition: border-color .35s ease, transform .45s var(--ease-out);
}

.project:hover .popup-img,
.project:focus-within .popup-img {
  border-color: rgba(255, 255, 255, .32);
}

.popup-title,
.popup-meta {
  opacity: 0;
  transform: translateY(5px);
  transition: opacity .35s var(--ease-out), transform .35s var(--ease-out);
}
.popup-title { font-size: 13px; color: var(--text); transition-delay: .05s; }
.popup-meta  { font-size: 12.5px; color: var(--text-dim); transition-delay: .1s; }

.project:hover .popup-title,
.project:focus-within .popup-title,
.project:hover .popup-meta,
.project:focus-within .popup-meta {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Seletor de idioma PT | EN ---- */
.lang { display: flex; gap: 14px; }
.lang button {
  background: none;
  border: 0;
  padding: 0 0 3px;
  font: inherit;
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] { color: var(--text); border-color: var(--text); }

/* =========================================================
   4. CONTEÚDO PRINCIPAL (Layout estilo Pandora)
   ========================================================= */
main {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.spacer {
  height: 24px;
}

/* ---- Hero: Centro óptico limpo e contido ---- */
.hero {
  text-align: center;
  max-width: 640px;
  margin: auto 0;
  padding: 24px 0;
}

/* O NOME — escala elegante com bastante respiro ao redor */
#name {
  font-family: var(--font-title);
  font-weight: 500;
  font-size: clamp(2.1rem, 4.4vw, 3.35rem);
  line-height: 1.08;
  letter-spacing: -.015em;
  white-space: nowrap;
  width: fit-content;
  margin: 0 auto 16px;
  opacity: 0;
  transition: opacity .9s ease;
  will-change: transform;
}

/* Linha 1: Frase principal em serifada */
.hero-headline {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(1.12rem, 1.9vw, 1.38rem);
  color: var(--text);
  letter-spacing: -.005em;
  margin-bottom: 8px;
}

/* Linha 2: Subtítulo técnico menor em sans-serif */
.hero-sub {
  font-family: var(--font-body);
  font-size: .84rem;
  color: var(--text-dim);
  letter-spacing: .01em;
}

/* Botão / Link discreto central (estilo "Solicitar acesso") */
.hero-action {
  margin-top: 38px;
}

.hero-cta {
  display: inline-block;
  font-size: .8rem;
  color: var(--text-dim);
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, .28);
  letter-spacing: .02em;
  transition: color .25s ease, border-color .25s ease;
}
.hero-cta:hover {
  color: var(--text);
  border-color: var(--text);
}

/* ---- Rodapé de Logos ancorado na base ---- */
.clients {
  text-align: center;
  width: 100%;
}

.clients-caption {
  font-family: var(--font-title);
  font-style: italic;
  font-size: .86rem;
  color: rgba(236, 236, 236, .75);
  margin-bottom: 22px;
  letter-spacing: .01em;
}

.logos {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px clamp(28px, 5vw, 56px);
}

.logo {
  color: var(--text);
  opacity: .55;
  transition: opacity .25s ease;
  font-size: 1.56rem;
  line-height: 1;
  white-space: nowrap;
}
.logo:hover { opacity: 1; }

.logo img {
  height: 29px;          /* 20% maior que os 24px originais */
  width: auto;
  display: block;
  filter: brightness(0) invert(1) brightness(.925);
}

/* =========================================================
   5. REDES SOCIAIS (canto inferior direito, discretas)
   ========================================================= */
.socials {
  position: fixed;
  right: clamp(20px, 3vw, 40px);
  bottom: 28px;
  z-index: 20;
  display: flex;
  gap: 15px;
}
.socials a {
  color: rgba(236, 236, 236, .42);
  display: block;
  transition: color .2s;
}
.socials a:hover { color: var(--text); }
.socials svg { width: 16px; height: 16px; display: block; }

/* Em telas menores, dá espaço extra no fim para as logos não colidirem com as redes */
@media (max-width: 768px) {
  main { padding-bottom: 72px; }
  .socials {
    right: 0;
    left: 0;
    bottom: 20px;
    justify-content: center;
  }
}

/* =========================================================
   6. ESTADO DA INTRO
   ========================================================= */
.hide {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1.1s ease, transform 1.1s ease;
}
body.ready .hide { opacity: 1; transform: none; }

/* Atrasos escalonados */
.d1 { transition-delay: .7s;  }   /* barra superior */
.d2 { transition-delay: .95s; }   /* linha 1 e linha 2 */
.d3 { transition-delay: 1.12s; }  /* link de contato */
.d4 { transition-delay: 1.28s; }  /* logos e redes */

a:focus-visible, button:focus-visible { outline: 1px solid var(--text); outline-offset: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation: none !important;
  }
}