/* Apple UI/UX Aesthetic */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
  --bg-color: #000000;
  --surface-1: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.1);
  --text-main: #f5f5f7;
  --text-muted: #86868b;
  --accent: #2997ff; /* Apple System Blue */
  --font-family: 'Montserrat', sans-serif;
  --radius-sm: 12px;
  --radius-md: 24px;
  --radius-lg: 32px;
  --transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); /* Spring-like Apple curve */
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-color);
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.47059;
  font-weight: 400;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ambient Backgrounds */
.ambient-bg {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.4;
  transition: top 3s cubic-bezier(0.2, 0.8, 0.2, 1), 
              left 3s cubic-bezier(0.2, 0.8, 0.2, 1), 
              right 3s cubic-bezier(0.2, 0.8, 0.2, 1), 
              bottom 3s cubic-bezier(0.2, 0.8, 0.2, 1), 
              background 3s ease, 
              width 3s ease, 
              height 3s ease, 
              transform 3s ease;
  pointer-events: none;
}

/* Base states (Hero / Inicio) */
.ambient-1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(41,151,255,0.4) 0%, rgba(0,0,0,0) 70%);
  animation: spin-slow 30s linear infinite;
}

.ambient-2 {
  bottom: -20%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(161,161,170,0.2) 0%, rgba(0,0,0,0) 70%);
  animation: spin-slow 45s linear infinite reverse;
}

@keyframes spin-slow {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Servicos State */
body.in-servicos .ambient-1 {
  top: 30%;
  left: 60%;
  background: radial-gradient(circle, rgba(41,151,255,0.35) 0%, rgba(0,0,0,0) 70%);
}
body.in-servicos .ambient-2 {
  bottom: 40%;
  right: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, rgba(0,0,0,0) 70%);
}

/* Portfolio State */
body.in-portfolio .ambient-1 {
  top: 60%;
  left: 10%;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, rgba(0,0,0,0) 70%);
}
body.in-portfolio .ambient-2 {
  bottom: 10%;
  right: -10%;
  background: radial-gradient(circle, rgba(41,151,255,0.4) 0%, rgba(0,0,0,0) 70%);
}

/* Sobre State */
body.in-sobre .ambient-1 {
  top: 80%;
  left: 50%;
  transform: translateX(-50%);
  width: 80vw;
  height: 80vw;
  background: radial-gradient(circle, rgba(41,151,255,0.2) 0%, rgba(0,0,0,0) 70%);
}
body.in-sobre .ambient-2 {
  bottom: -50%;
  right: 20%;
  background: radial-gradient(circle, rgba(161,161,170,0.2) 0%, rgba(0,0,0,0) 70%);
}

/* Layout */
.container {
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 2rem;
}

.max-w-3xl {
  max-width: 768px;
  margin: 0 auto;
}

.text-center {
  text-align: center;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: background-color 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 48px; /* Apple classic height */
}

.logo-text {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 400;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.nav-link:hover {
  opacity: 1;
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--text-main);
  color: var(--bg-color);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn-nav:hover {
  transform: scale(1.03);
  opacity: 0.9;
}

/* Buttons */
.btn-primary {
  display: inline-block;
  background: var(--text-main);
  color: var(--bg-color);
  font-size: 1.1rem;
  font-weight: 500;
  padding: 1rem 2rem;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn-primary:hover {
  transform: scale(1.02);
}

/* Sections */
section {
  padding: 8rem 0;
}

.section-header {
  margin-bottom: 4rem;
}

.section-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  color: var(--text-muted);
  font-weight: 400;
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 6rem;
}

.hero-title {
  font-size: clamp(3.5rem, 8vw, 6.5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.05em;
  margin-bottom: 1.5rem;
  background: linear-gradient(180deg, #fff 0%, #86868b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  color: var(--text-muted);
  font-weight: 400;
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.4;
}

.hero-actions {
  margin-bottom: 5rem;
}

/* Trusted By Marquee */
.trusted-by {
  margin-top: 6rem;
  width: 100%;
  text-align: center;
}

.trusted-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.logo-marquee {
  overflow: hidden;
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

.logo-track {
  display: flex;
  gap: 4rem;
  align-items: center;
  width: max-content;
  animation: scroll-logos 20s linear infinite;
}

.company-logo {
  font-family: var(--font-family);
  font-size: 1.5rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: -0.03em;
  transition: color 0.3s ease;
}

.company-logo:hover {
  color: rgba(255, 255, 255, 0.8);
}

@keyframes scroll-logos {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-50% - 2rem)); }
}

/* Bento Box Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.bento-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 320px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.bento-card:hover {
  background: var(--surface-2);
  transform: scale(1.01);
}

.bento-large {
  grid-column: span 2;
  min-height: 400px;
}

.bento-wide {
  grid-column: span 2;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 3rem;
  min-height: 250px;
}

.bento-content {
  position: relative;
  z-index: 2;
}

/* Mouse Spotlight Effect */
.bento-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(255, 255, 255, 0.08),
    transparent 40%
  );
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.bento-card:hover::before {
  opacity: 1;
}

.bento-card h3 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.bento-card p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 400px;
}

/* Bento Features & Tags */
.bento-features {
  list-style: none;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bento-features li {
  font-size: 0.95rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bento-features li::before {
  content: '✦';
  color: var(--accent);
  font-size: 0.85rem;
}

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

.metric-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-main);
  backdrop-filter: blur(10px);
}

/* Portfolio */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.portfolio-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow: hidden;
}

.portfolio-img {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: var(--radius-lg);
  background-size: cover;
  background-position: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  transition: transform 0.5s ease;
  animation: slow-pan 20s infinite alternate ease-in-out;
}

@keyframes slow-pan {
  0% { background-size: 100%; }
  100% { background-size: 115%; }
}

.portfolio-card:hover .portfolio-img {
  transform: scale(1.02);
}

.portfolio-info h4 {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.portfolio-info p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* About */
.about-text {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  line-height: 1.5;
  color: var(--text-muted);
  font-weight: 400;
}

/* Footer */
.site-footer {
  padding: 6rem 0 3rem;
  border-top: 1px solid var(--border);
}

.footer-cta {
  margin-bottom: 6rem;
}

.footer-cta h2 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 600;
  margin-bottom: 2rem;
  letter-spacing: -0.04em;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Animations */
.reveal-text {
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  transition: opacity 1.2s cubic-bezier(0.2, 0.8, 0.2, 1), transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.delay-1 { transition-delay: 100ms; }
.delay-2 { transition-delay: 200ms; }
.delay-3 { transition-delay: 300ms; }

/* Responsive */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .bento-grid { grid-template-columns: 1fr; }
  .bento-large, .bento-wide { grid-column: span 1; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
}
