:root {
  --bg: #08090c;
  --bg-soft: #0e1016;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f2f3f5;
  --text-dim: #9aa0ab;
  --text-faint: #6b7280;
  /* verde de terminal; o -rgb existe para compor rgb(... / alpha) */
  --accent: #00ff41;
  --accent-rgb: 0 255 65;
  --accent-2: #22d3ee;
  --accent-2-rgb: 34 211 238;
  --radius: 18px;
  --radius-sm: 10px;
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --maxw: 1200px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* chuva de caracteres: vive atras de tudo e some antes de chegar aos cards,
   para nao competir com as capturas dos projetos */
#matrix {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.22;
  mask-image: linear-gradient(to bottom, #000 0%, rgb(0 0 0 / 0.45) 38%, transparent 68%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgb(0 0 0 / 0.45) 38%, transparent 68%);
}

.glow {
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 70vh;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(48% 55% at 20% 0%, rgb(var(--accent-2-rgb) / 0.16), transparent 70%),
    radial-gradient(42% 50% at 80% 10%, rgb(var(--accent-rgb) / 0.13), transparent 70%);
  filter: blur(6px);
}

main, .footer { position: relative; z-index: 1; }
.topbar { z-index: 10; }  /* acima dos cards */

/* ---------- topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 24px;
}

/* a barra e sticky: sem fundo proprio o conteudo passa por tras e fica ilegivel */
.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(8, 9, 12, 0.92), rgba(8, 9, 12, 0.72));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 1px solid var(--border-strong);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topnav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 999px;
  transition: color 0.18s ease, background 0.18s ease;
}

.topnav a:hover { color: var(--text); background: var(--surface); }

.ghost-btn {
  border: 1px solid var(--border-strong);
  color: var(--text) !important;
}

/* a consultoria nao e uma rede social: ganha destaque proprio */
.company-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgb(var(--accent-rgb) / 0.32);
  background: linear-gradient(140deg, rgb(var(--accent-rgb) / 0.12), rgb(var(--accent-2-rgb) / 0.07));
  color: var(--text) !important;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.company-btn:hover {
  border-color: var(--accent);
  background: linear-gradient(140deg, rgb(var(--accent-rgb) / 0.2), rgb(var(--accent-2-rgb) / 0.12));
}

.company-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / 0.18);
}

.ghost-btn:hover { border-color: var(--accent); }

.primary-btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  color: #08090c;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -12px rgb(var(--accent-rgb) / 0.6);
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 48px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px 24px 24px;
}

.hero-avatar {
  height: clamp(240px, 30vw, 420px);
  width: auto;
  justify-self: end;
  filter: drop-shadow(0 26px 44px rgba(0, 0, 0, 0.55));
}

.hero-stats {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px 56px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
  padding: 6px 14px 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / 0.15);
}

.hero-title {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.hero-title em {
  font-style: normal;
  background: linear-gradient(115deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin: 0;
  max-width: 52ch;
  color: var(--text-dim);
  font-size: clamp(1rem, 1.5vw, 1.15rem);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 28px 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  /* o conteudo vem do JSON: sem altura reservada, preencher empurra a pagina */
  min-height: 91px;
}

.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat span {
  color: var(--text-faint);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- works ---------- */

.works {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.works-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 32px;
}

.works-head h2,
.contact h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filters button {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
}

.filters button:hover { color: var(--text); border-color: var(--border-strong); }

.filters button[aria-selected="true"] {
  color: #08090c;
  background: var(--text);
  border-color: var(--text);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 26px;
  /* mesma razao: reserva a primeira dobra de cards */
  min-height: 70vh;
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: 0 24px 50px -30px rgba(0, 0, 0, 0.9);
}

/* browser mockup */
.shot {
  position: relative;
  border: 0;
  padding: 0;
  margin: 0;
  background: var(--bg-soft);
  cursor: zoom-in;
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
}

.chrome-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.chrome-bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border-strong);
}

.chrome-url {
  flex: 1;
  margin-left: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-faint);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shot-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.shot-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.card:hover .shot-frame img { transform: scale(1.035); }

/* pecas verticais (artes, mockups) aparecem inteiras em vez de cortadas */
.shot-frame.contain {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
}

.shot-frame.contain img {
  object-fit: contain;
  object-position: center;
}

.shot-count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(8, 9, 12, 0.78);
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 12px;
  padding: 22px;
}

.card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.card-year {
  color: var(--text-faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.card-tagline {
  margin: -6px 0 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
}

.card p.desc {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
}

.tags span {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

.card-links {
  display: flex;
  gap: 14px;
  padding-top: 4px;
}

.card-links a {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.card-links a:hover { color: var(--accent); border-color: var(--accent); }

.empty {
  padding: 48px 0;
  text-align: center;
  color: var(--text-faint);
}

/* ---------- contact ---------- */

.contact {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 48px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 72px 24px 80px;
  border-top: 1px solid var(--border);
}

.contact-avatar {
  height: clamp(190px, 22vw, 290px);
  width: auto;
  filter: drop-shadow(0 22px 40px rgba(0, 0, 0, 0.5));
}

.contact-body { text-align: left; }

.contact-sub {
  margin: 12px 0 32px;
  max-width: 52ch;
  color: var(--text-dim);
}

.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 14px;
}

.contact-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "icon label"
    "icon value";
  align-items: center;
  gap: 2px 14px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.contact-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.contact-card svg {
  grid-area: icon;
  width: 26px;
  height: 26px;
  fill: var(--text-dim);
  transition: fill 0.18s ease;
}

.contact-card:hover svg { fill: var(--accent); }

.contact-label {
  grid-area: label;
  color: var(--text-faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.contact-value {
  grid-area: value;
  font-size: 14px;
  font-weight: 500;
  /* quebra so entre palavras: cortar um e-mail ao meio fica ilegivel */
  overflow-wrap: break-word;
}

/* o canal preferido ganha destaque */
.contact-card.is-primary {
  border-color: rgb(var(--accent-rgb) / 0.35);
  background: linear-gradient(140deg, rgb(var(--accent-rgb) / 0.12), rgb(var(--accent-2-rgb) / 0.06));
}

.contact-card.is-primary svg { fill: var(--accent); }
.contact-card.is-primary:hover { border-color: var(--accent); }

/* ---------- footer ---------- */

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  justify-content: space-between;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 24px 56px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 13px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 1px solid var(--border-strong);
}

.footer-brand div {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.footer-brand a {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: color 0.18s ease, border-color 0.18s ease;
}

.footer-brand a:hover { color: var(--accent); border-color: var(--accent); }

.footer-brand strong {
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
}

.footer-note { max-width: 40ch; text-align: right; text-wrap: balance; }

/* ---------- botao flutuante do whatsapp ---------- */

.zap {
  position: fixed;
  right: 24px;
  /* respeita a barra de gestos do iPhone */
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 40;              /* acima do conteudo, abaixo do lightbox (50) */
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 15px;
  border-radius: 999px;
  /* o verde do proprio WhatsApp: e o que as pessoas reconhecem de imediato */
  background: #25d366;
  color: #04240f;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 10px 30px -8px rgb(37 211 102 / 0.45), 0 2px 8px rgb(0 0 0 / 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.zap:hover,
.zap:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -10px rgb(37 211 102 / 0.6), 0 2px 8px rgb(0 0 0 / 0.3);
}

/* o rotulo fica recolhido: expandido, o botao cobria o filtro "Automação"
   e pedacos dos cards durante a rolagem */
.zap span {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.25s ease, opacity 0.2s ease, margin 0.25s ease;
}

.zap:hover span,
.zap:focus-visible span {
  max-width: 180px;
  opacity: 1;
  margin-left: 10px;
  margin-right: 4px;
}

.zap svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
  flex: none;
}

/* enquanto o lightbox esta aberto o botao so atrapalharia */
body:has(#lightbox:not([hidden])) .zap {
  opacity: 0;
  pointer-events: none;
}

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  background: rgba(4, 5, 7, 0.92);
  backdrop-filter: blur(10px);
  animation: fade 0.2s ease;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.lb-stage {
  margin: 0;
  max-width: min(1200px, 90vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lb-stage img {
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.lb-stage figcaption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-dim);
}

.lb-stage figcaption strong {
  color: var(--text);
  font-family: var(--font-display);
}

.lb-stage figcaption a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 0.18s ease;
}

.lb-stage figcaption a:hover { border-color: var(--accent); }

.lb-close,
.lb-nav {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.lb-close:hover,
.lb-nav:hover { background: var(--surface-hover); border-color: var(--border-strong); }

.lb-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 42px;
  height: 42px;
  font-size: 26px;
  line-height: 1;
}

.lb-nav {
  width: 46px;
  height: 46px;
  flex: none;
  font-size: 28px;
  line-height: 1;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  /* uma coluna: cada card e mais alto, entao a reserva cresce */
  .grid { grid-template-columns: 1fr; min-height: 100vh; }
}

@media (max-width: 860px) {
  .contact {
    grid-template-columns: 1fr;
    gap: 20px;
    justify-items: center;
  }
  .contact-body { text-align: center; }
  .contact-sub { margin-inline: auto; }
  .contact-avatar { height: min(200px, 42vw); }

  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }
  .hero-sub { margin-inline: auto; }
  .hero-avatar { justify-self: center; order: -1; height: min(240px, 44vw); }
  .eyebrow { margin-bottom: 16px; }
}

@media (max-width: 640px) {
  /* "Projetos" e "Contato" ficam: sem eles o menu do celular so tinha
     redes sociais, e nada levava ao conteudo do site */
  .topnav { gap: 4px; }
  .topnav a { padding: 7px 9px; font-size: 13px; }
  /* o GitHub sai: o botao flutuante e o B2SEC importam mais aqui */
  .topnav a[data-owner-github] { display: none; }
  .topbar { gap: 8px; padding: 14px 16px; }
  .brand { font-size: 15px; }

  .zap {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .zap span { display: none; }   /* sem hover no celular, o icone basta */
  .hero { padding: 40px 20px 16px; }
  .hero-stats { padding-bottom: 40px; }
  .stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    text-align: center;
    min-height: 111px;
  }
  .stat strong { font-size: 1.7rem; }
  .stat span { font-size: 10px; letter-spacing: 0.06em; }
  .footer { justify-content: center; text-align: center; }
  .footer-note { text-align: center; }
  .lb-nav { width: 38px; height: 38px; font-size: 22px; }
}

/* em telas bem estreitas o avatar ja identifica a marca */
@media (max-width: 430px) {
  .brand-name { display: none; }
}

/* telas muito estreitas: as redes sairam do topo para o menu caber.
   elas seguem acessiveis na secao de contato */
@media (max-width: 380px) {
  .topnav a[data-owner-linkedin] { display: none; }
  .topnav a { padding: 7px 8px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  #matrix { display: none; }
}
