:root {
  --navy: #0b0f19;
  --navy-alt: #0f1729;
  --navy-border: #1e2a42;
  --gold: #d4af37;
  --gold-soft: #e8cd7a;
  --silver: #f3f4f6;
  --text-muted: #9aa4b8;
  --radius: 8px;
  --max-width: 1140px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--navy);
  color: var(--silver);
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-weight: 700; line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 1em; color: var(--text-muted); }

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.narrow { max-width: 720px; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

.eyebrow {
  color: var(--gold);
  text-transform: uppercase;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  margin-bottom: .5em;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid transparent;
  transition: opacity .15s ease, border-color .15s ease;
}
.btn-primary {
  background: var(--gold);
  color: var(--navy);
}
.btn-primary:hover { opacity: .88; }
.btn-ghost {
  border-color: var(--navy-border);
  color: var(--silver);
}
.btn-ghost:hover { border-color: var(--gold); }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 15, 25, .85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--navy-border);
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
}
.nav-logo img { border-radius: 6px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: .92rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--gold); }
.nav-cta {
  background: var(--gold);
  color: var(--navy) !important;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-weight: 600;
}
.nav-cta:hover { opacity: .88; }
.nav-toggle { display: none; }

/* Intro */
#intro {
  height: 100vh;
  padding: 0 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  background: var(--navy);
  position: relative;
  z-index: 70;
}
.intro-visual {
  width: min(60vw, 460px);
  aspect-ratio: 1 / 1;
  position: relative;
}
#intro-canvas { width: 100%; height: 100%; display: none; }
#intro-canvas.active { display: block; }
#intro-fallback { width: 68%; margin: 0 auto; }
#intro-canvas.active + #intro-fallback { display: none; }
.intro-offer {
  color: var(--gold-soft);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-align: center;
}
.intro-hint {
  color: var(--text-muted);
  text-align: center;
  font-size: .82rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  animation: bob-y 2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  #intro { position: static; }
}

/* Hero */
.hero {
  position: relative;
  padding: 72px 0 96px;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 30%, rgba(212,175,55,.10), transparent 60%);
  pointer-events: none;
}
.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 48px;
  align-items: center;
  position: relative;
}
.eyebrow { display: block; }
.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -.02em;
}
.hero-sub {
  font-size: 1.05rem;
  max-width: 46ch;
}
.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.hero-visual {
  position: relative;
  aspect-ratio: 1 / 1;
  max-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#emblem-canvas {
  width: 100%;
  height: 100%;
  display: none;
}
#emblem-canvas.active { display: block; }
.emblem-fallback {
  width: 60%;
  max-width: 280px;
  margin: 0 auto;
}
#emblem-canvas.active + .emblem-fallback { display: none; }

.scroll-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 1.2rem;
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}

/* Sections */
.section { padding: 88px 0; }
.section-inner { width: 100%; }
.section-alt { background: var(--navy-alt); border-top: 1px solid var(--navy-border); border-bottom: 1px solid var(--navy-border); }

/* Scroll-snap "page journey" between sections — desktop only, mobile keeps normal scrolling */
@media (min-width: 861px) {
  html { scroll-snap-type: y proximity; }
  #intro, .hero, .section { scroll-snap-align: start; scroll-margin-top: 70px; }
}
@media (min-width: 861px) and (prefers-reduced-motion: reduce) {
  html { scroll-snap-type: none; }
}
.section h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: .6em; }
.lead { font-size: 1.05rem; }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; margin-top: 32px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 32px; }

.card {
  background: var(--navy-alt);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  padding: 28px;
}
.card h3 { color: var(--gold-soft); font-size: 1.1rem; }

/* Portfolio as a list — big names, hover reveals a preview near the cursor */
.portfolio-list { margin-top: 24px; }
.portfolio-row {
  position: relative;
  display: block;
  padding: 36px 0;
  border-top: 1px solid var(--navy-border);
  transition: padding-left .25s ease, color .25s ease;
}
.portfolio-list a:last-child { border-bottom: 1px solid var(--navy-border); }
.portfolio-row h3 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--silver);
  transition: color .25s ease;
}
.portfolio-row p {
  margin: 6px 0 0;
  font-size: .95rem;
}
.portfolio-row-arrow {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%) rotate(-45deg);
  font-size: 1.8rem;
  color: var(--gold);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
}
.portfolio-row:hover { padding-left: 20px; }
.portfolio-row:hover h3 { color: var(--gold-soft); }
.portfolio-row:hover .portfolio-row-arrow { opacity: 1; transform: translateY(-50%) rotate(0deg); }

.features { margin-top: 40px; }
.feature h3 { font-size: 1rem; color: var(--silver); }
.feature p { font-size: .92rem; }

.process {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.process li { position: relative; }
.step-num {
  display: block;
  font-size: .85rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 10px;
  letter-spacing: .08em;
}
.process h3 { font-size: 1rem; }
.process p { font-size: .9rem; }

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 48px;
  margin-top: 32px;
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.contact-form label { font-size: .85rem; color: var(--text-muted); margin-top: 10px; }
.contact-form input,
.contact-form textarea {
  background: var(--navy-alt);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  color: var(--silver);
  padding: 11px 14px;
  font-family: inherit;
  font-size: .95rem;
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--gold);
}
.contact-form button { margin-top: 16px; align-self: flex-start; cursor: pointer; }
.form-status { font-size: .88rem; min-height: 1.2em; }
.form-status.ok { color: #7fd99a; }
.form-status.err { color: #e08383; }

.contact-direct h3 { font-size: 1rem; color: var(--gold-soft); }
.contact-direct p { font-size: .95rem; }
.socials { color: var(--text-muted); font-size: .85rem; }

/* Interactivity */
#cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 420px; height: 420px;
  margin-left: -210px; margin-top: -210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,175,55,.10), transparent 70%);
  pointer-events: none;
  z-index: 40;
  opacity: 0;
  transition: opacity .3s ease;
  will-change: transform;
}
#cursor-glow.active { opacity: 1; }

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1);
}
.reveal.in-view { opacity: 1; transform: none; }

.tilt { transition: transform .15s ease, box-shadow .15s ease; will-change: transform; }

/* Baralho de cartas: os cartões entram empilhados e depois espalham-se pela grelha.
   Deslocamentos (--dx/--dy) medidos em script.js; regras depois de .tilt para o
   shorthand de transition dele não as apagar. */
.deck.armed > * {
  position: relative;
  opacity: 0;
  transform: translate(var(--dx, 0), var(--dy, 0)) rotate(var(--rot, 0deg)) scale(.97);
  transition: none;
}
.deck.armed.stacked > * {
  opacity: 1;
  transition: opacity .45s ease, transform .8s cubic-bezier(.16,1,.3,1);
}
.deck.armed.dealt > * {
  transform: none;
  transition-delay: var(--delay, 0ms);
}

.nav-links a.active:not(.nav-cta) { color: var(--gold); }

.typewriter::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--gold);
  margin-left: 2px;
  vertical-align: -2px;
  animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.hero-text > * {
  opacity: 0;
  animation: hero-in .7s cubic-bezier(.16,1,.3,1) forwards;
}
.hero-text > *:nth-child(1) { animation-delay: .05s; }
.hero-text > *:nth-child(2) { animation-delay: .15s; }
.hero-text > *:nth-child(3) { animation-delay: .28s; }
.hero-text > *:nth-child(4) { animation-delay: .4s; }
@keyframes hero-in {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-text > * { opacity: 1; animation: none; }
  .tilt { transition: none; }
  #cursor-glow { display: none; }
}
@media (hover: none) and (pointer: coarse) {
  #cursor-glow { display: none; }
}

/* Dot navigation (page progress) */
.dot-nav {
  position: fixed;
  right: 26px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 45;
}
.dot-nav a {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--text-muted);
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.dot-nav a:hover { transform: scale(1.3); border-color: var(--gold); }
.dot-nav a.active { background: var(--gold); border-color: var(--gold); transform: scale(1.2); }
.dot-nav a::after {
  content: attr(data-label);
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: .78rem;
  color: var(--silver);
  background: var(--navy-alt);
  border: 1px solid var(--navy-border);
  padding: 4px 10px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.dot-nav a:hover::after { opacity: 1; }
@media (max-width: 1023px) { .dot-nav { display: none; } }

/* Cursor-follow label (portfolio hover) */
#hover-label {
  position: fixed;
  top: 0; left: 0;
  width: 220px;
  height: 150px;
  margin: -75px 0 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  transform: translate(-2000px, -2000px);
  background: linear-gradient(135deg, #131b2e, #0b0f19);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: .8rem;
  pointer-events: none;
  z-index: 55;
  opacity: 0;
  overflow: hidden;
  transition: opacity .2s ease;
  will-change: transform;
}
#hover-label.active { opacity: 1; }
#hover-label img { width: 100%; height: 100%; object-fit: cover; }
@media (hover: none) { #hover-label { display: none; } }

/* Marquee ticker — the animation runs continuously (infinite) regardless of position */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--navy-border);
  border-bottom: 1px solid var(--navy-border);
  background: var(--navy-alt);
  padding: 16px 0;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 26s linear infinite;
  white-space: nowrap;
}
.marquee-track span {
  margin-right: 8px;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-muted);
}
.marquee-track span:nth-child(even) { color: var(--gold); font-weight: 400; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}
/* Spinning CTA badge */
.spin-badge {
  position: fixed;
  left: 26px;
  bottom: 26px;
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--navy-alt);
  border: 1px solid var(--navy-border);
  z-index: 45;
  transition: transform .2s ease;
}
.spin-badge:hover { transform: scale(1.08); }
.spin-badge svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: var(--gold-soft);
  animation: spin-badge 14s linear infinite;
}
.spin-badge-arrow {
  display: inline-block;
  font-size: 1.4rem;
  color: var(--gold);
  transition: transform .3s ease;
}
@keyframes spin-badge { to { transform: rotate(360deg); } }
@media (max-width: 1023px) { .spin-badge { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .spin-badge svg { animation: none; }
}

/* Footer */
.footer {
  border-top: 1px solid var(--navy-border);
  padding: 28px 0;
}
.footer-inner {
  font-size: .85rem;
  color: var(--text-muted);
}

/* AI chat widget */
.ai-chat-toggle {
  position: fixed;
  right: 26px;
  bottom: 26px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--gold-soft), var(--gold));
  border: none;
  cursor: pointer;
  z-index: 100;
  padding: 0;
  box-shadow: 0 8px 24px rgba(212,175,55,.35);
  animation: ai-chat-float 3.5s ease-in-out infinite;
  transition: transform .2s ease, box-shadow .2s ease;
}
.ai-chat-toggle:hover { transform: scale(1.08); box-shadow: 0 10px 28px rgba(212,175,55,.5); }
.ai-chat-toggle img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
@keyframes ai-chat-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.ai-chat-tooltip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: var(--navy-alt);
  border: 1px solid var(--navy-border);
  color: var(--gold-soft);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: .8rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.ai-chat-toggle:hover .ai-chat-tooltip { opacity: 1; transform: translateY(-50%) translateX(0); }
@media (hover: none) { .ai-chat-tooltip { display: none; } }

.ai-chat-panel {
  position: fixed;
  right: 26px;
  bottom: 128px;
  width: 340px;
  max-height: 460px;
  display: flex;
  flex-direction: column;
  background: var(--navy);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0,0,0,.4);
  z-index: 101;
  overflow: hidden;
}
.ai-chat-panel[hidden] { display: none; }
.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--navy-border);
  font-size: .85rem;
}
.ai-chat-status { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }
.ai-chat-status .dot {
  width: 7px; height: 7px; border-radius: 50%; background: #4ade80;
}
.ai-chat-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 4px;
}
.ai-chat-close:hover { color: var(--gold); }
.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-chat-bubble {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: .88rem;
  line-height: 1.5;
  margin: 0;
}
.ai-chat-bubble.bot { background: var(--navy-alt); border: 1px solid var(--navy-border); align-self: flex-start; }
.ai-chat-bubble.user { background: var(--gold); color: var(--navy); align-self: flex-end; }
.ai-chat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: none;
  border: 1px solid var(--navy-border);
  color: var(--gold-soft);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .78rem;
  cursor: pointer;
  transition: border-color .2s ease;
}
.chip:hover { border-color: var(--gold); }
.ai-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--navy-border);
}
.ai-chat-form input {
  flex: 1;
  background: var(--navy-alt);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--silver);
  font-family: inherit;
  font-size: .85rem;
}
.ai-chat-form input:focus { outline: none; border-color: var(--gold); }
.ai-chat-form button {
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: var(--radius);
  width: 36px;
  cursor: pointer;
  font-size: 1rem;
}
@media (prefers-reduced-motion: reduce) {
  .ai-chat-toggle { animation: none; }
}

/* Responsive */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-actions { justify-content: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-visual { max-height: 280px; order: -1; }
  .grid-3, .grid-2, .process { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .ai-chat-panel { right: 12px; left: 12px; width: auto; bottom: 118px; }
  .ai-chat-toggle { right: 16px; bottom: 16px; }

  .nav-links {
    position: fixed;
    top: 65px;
    left: 0;
    right: 0;
    background: var(--navy);
    border-bottom: 1px solid var(--navy-border);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 24px;
    gap: 18px;
    transform: translateY(-150%);
    transition: transform .2s ease;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
  }
  .nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--silver);
  }
}

/* Barra de cookies — só aparece quando o analytics.js tem um GA_ID definido.
   Os botões são <button>, por isso precisam da fonte e do cursor que o .btn
   (pensado para <a>) não traz. */
.cookie-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 90;
  width: min(640px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 18px 22px;
  background: var(--navy-alt);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
}
.cookie-bar p {
  margin: 0;
  flex: 1 1 260px;
  color: var(--text-muted);
  font-size: .9rem;
  line-height: 1.5;
}
.cookie-bar-actions { display: flex; gap: 10px; }
.cookie-bar .btn-ghost { background: transparent; }
.cookie-bar .btn {
  font-family: inherit;
  cursor: pointer;
  padding: 10px 20px;
}
@media (max-width: 620px) {
  .cookie-bar { bottom: 134px; }
  .cookie-bar-actions { width: 100%; }
  .cookie-bar .btn { flex: 1; }
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-inner a { color: var(--text-muted); }
.footer-inner a:hover { color: var(--gold); }
.cookie-bar p a { color: var(--gold); text-decoration: underline; }
