/* =========================================================
   TOKENS
   ========================================================= */
:root {
  --bg: #0A0616;
  --surface: #150A2E;
  --surface-2: #1D0F3D;
  --border: rgba(245, 240, 250, 0.08);
  --border-strong: rgba(245, 240, 250, 0.16);
  --text: #F5F0FA;
  --muted: #9A8FB0;
  --amber: #F20789;
  --cyan: #5E07D9;
  --indigo: #2E038C;
  --rust: #8C2703;
  --tan: #BF8069;

  --font-display: "Anton", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --container: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: radial-gradient(ellipse 120% 80% at 50% -10%, #1D0B3D 0%, var(--bg) 55%);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  cursor: none;
}

@media (max-width: 900px), (hover: none) {
  body { cursor: auto; }
  .cursor { display: none !important; }
}

/* =========================================================
   CURSOR CUSTOMIZADO
   ========================================================= */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--cyan);
  pointer-events: none; /* crítico: sem isso, o cursor "rouba" hover/mousemove de tudo embaixo dele */
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, height 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  mix-blend-mode: difference;
}

.cursor.hover {
  width: 52px;
  height: 52px;
  background: rgba(94, 7, 217, 0.15);
  border-color: var(--amber);
}

.cursor.click {
  width: 16px;
  height: 16px;
}

/* =========================================================
   GRAIN (canvas animado, textura de filme)
   ========================================================= */
#grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
}

/* =========================================================
   MESH — manchas de gradiente que derivam
   ========================================================= */
.mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.mesh-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.16;
  will-change: transform;
}

.mesh-amber {
  width: 46vw;
  height: 46vw;
  background: var(--amber);
  top: -10%;
  left: -8%;
  animation: drift1 26s ease-in-out infinite alternate;
}

.mesh-cyan {
  width: 38vw;
  height: 38vw;
  background: var(--cyan);
  bottom: -12%;
  right: -6%;
  animation: drift2 32s ease-in-out infinite alternate;
}

@keyframes drift1 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(8vw, 10vh) scale(1.15); }
}

@keyframes drift2 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-6vw, -8vh) scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
  .mesh-blob { animation: none; }
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.mono { font-family: var(--font-mono); }

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1rem;
}

.section-heading {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
  line-height: 1.05;
}

.section-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 6rem 2rem;
}

@media (max-width: 640px) {
  .section-inner { padding: 4rem 1.25rem; }
}

/* =========================================================
   SIGNATURE ELEMENT — compositing / AR tracking grid
   ========================================================= */
.grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    linear-gradient(rgba(94, 7, 217, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 7, 217, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 0%, transparent 70%);
}

.scale-marker {
  position: absolute;
  right: 2.5rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-strong);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8rem 0;
}

.scale-marker span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--cyan);
  position: relative;
  left: -0.4rem;
  background: var(--bg);
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
}

@media (max-width: 900px) {
  .scale-marker { display: none; }
}

/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(11, 12, 14, 0.5);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.nav.scrolled {
  background: rgba(11, 12, 14, 0.82);
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 1.1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  gap: 2.25rem;
}

.nav-links a {
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  transition: color 0.2s ease;
}

.nav-links a:hover { color: var(--text); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
}

@media (max-width: 720px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1.5rem 2rem;
    gap: 1.25rem;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 8rem 2rem 4rem;
}

.hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
  padding-right: 4rem;
}

.hero-headline {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.5rem, 12vw, 9rem);
  line-height: 0.92;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  background: linear-gradient(180deg, #FFFFFF 0%, #F5C6E0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 28px rgba(242, 7, 137, 0.35));
}

.hero-inner .eyebrow,
.hero-headline,
.hero-sub,
.hero-ctas {
  opacity: 0;
  animation: heroIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-inner .eyebrow  { animation-delay: 0.1s; }
.hero-headline         { animation-delay: 0.22s; }
.hero-sub               { animation-delay: 0.4s; }
.hero-ctas               { animation-delay: 0.55s; }

@keyframes heroIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-inner .eyebrow, .hero-headline, .hero-sub, .hero-ctas {
    animation: none;
    opacity: 1;
  }
}

.hero-sub {
  max-width: 32rem;
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--amber);
  color: #FFFFFF;
  box-shadow: 0 0 24px rgba(242, 7, 137, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 0 32px rgba(242, 7, 137, 0.55);
}

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
}

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

/* =========================================================
   ABOUT
   ========================================================= */
.about {
  border-top: 1px solid var(--border);
  background: rgba(21, 23, 26, 0.55);
  backdrop-filter: blur(24px);
  position: relative;
  z-index: 2;
}

.about-text {
  display: grid;
  gap: 1.4rem;
  max-width: 46rem;
  color: var(--muted);
  font-size: 1.02rem;
}

.about-text p:first-child {
  color: var(--text);
  font-size: 1.15rem;
}

/* =========================================================
   PROJECTS
   ========================================================= */
.projects {
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 2;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  perspective: 1200px;
}

.project-card {
  --mx: 50%;
  --my: 50%;
  background: rgba(28, 31, 35, 0.5);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out,
              border-color 0.3s ease,
              box-shadow 0.35s ease;
  will-change: transform;
}

.project-card:hover {
  border-color: rgba(94, 7, 217, 0.4);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}

/* spotlight que segue o cursor dentro do card */
.project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(380px circle at var(--mx) var(--my),
              rgba(94, 7, 217, 0.22), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.project-card:hover::after {
  opacity: 1;
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--amber));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.project-card:hover::before {
  transform: scaleX(1);
}

.project-card > * {
  position: relative;
  z-index: 1;
  transform: translateZ(20px);
}

.project-media {
  margin: -2.25rem -2.25rem 1.25rem -2.25rem;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 16 / 10;
  position: relative;
}

.project-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(10, 6, 22, 0.85) 100%);
  pointer-events: none;
}

.project-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-category {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
}

.project-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.4rem;
  text-transform: uppercase;
  line-height: 1.15;
}

.project-description {
  color: var(--muted);
  font-size: 0.92rem;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  padding: 0.25rem 0.55rem;
  border-radius: 2px;
}

/* =========================================================
   STACK
   ========================================================= */
.stack {
  border-top: 1px solid var(--border);
  background: rgba(21, 23, 26, 0.55);
  backdrop-filter: blur(24px);
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem;
}

.stack-group-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1.1rem;
}

.stack-badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.stack-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(28, 31, 35, 0.5);
  font-size: 0.85rem;
  color: var(--text);
  cursor: default;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.25s ease,
              background 0.25s ease,
              color 0.25s ease;
}

.stack-badge:hover {
  transform: scale(1.08) translateY(-2px);
  border-color: var(--cyan);
  background: rgba(94, 7, 217, 0.1);
  color: var(--cyan);
}

/* =========================================================
   SERVICES
   ========================================================= */
.services {
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 2;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.service-card {
  border: 1px solid var(--border-strong);
  background: rgba(28, 31, 35, 0.4);
  backdrop-filter: blur(12px);
  padding: 2rem;
  border-radius: 6px;
  transition: border-color 0.3s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.service-card:hover {
  border-color: var(--amber);
  transform: translateY(-4px);
}

.service-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.15rem;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.service-description {
  color: var(--muted);
  font-size: 0.92rem;
}

/* =========================================================
   CONTACT
   ========================================================= */
.contact {
  border-top: 1px solid var(--border);
  background: rgba(21, 23, 26, 0.55);
  backdrop-filter: blur(24px);
  position: relative;
  z-index: 2;
}

.contact .section-heading {
  max-width: 40rem;
}

.contact-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 3rem;
}

.contact-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-value {
  font-size: 1.2rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.contact-item:hover .contact-value {
  color: var(--cyan);
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  position: relative;
  z-index: 2;
}

/* =========================================================
   SCROLL REVEAL
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
