@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Oswald:wght@500;700&display=swap');

/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
  --bg-color: #0a0a0a;
  --surface-color: #161616;
  --text-primary: #f5f5f5;
  --text-secondary: #a0a0a0;
  --accent-color: #e02424;
  --accent-hover: #b31616;
  --surface-hover: #1e1e1e;

  --font-body: 'Inter', sans-serif;
  --font-heading: 'Oswald', sans-serif;

  --gap-sm: 8px;
  --gap-md: 16px;
  --gap-lg: 32px;
  --gap-xl: 64px;

  /* Touch targets */
  --touch-min: 48px;
  --header-h: 64px;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent; /* Remove tap flash no iOS */
}

html {
  font-size: 15px; /* Base mobile */
  scroll-behavior: smooth;
  /* Previne bounce lateral no iOS */
  overscroll-behavior-x: none;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%; /* Previne zoom automático iOS */
  text-size-adjust: 100%;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============================================
   UTILITIES
   ============================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px; /* Mobile: paddding menor */
}

/* ============================================
   BUTTON - MOBILE FIRST (touch-optimized)
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  background-color: var(--accent-color);
  color: white;
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  border-radius: 6px;
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  cursor: pointer;
  border: none;
  text-transform: uppercase;
  min-height: var(--touch-min); /* Fitts' Law — mínimo 48px */
  width: 100%; /* Full width no mobile */
}

.btn:active {
  background-color: var(--accent-hover);
  transform: scale(0.98);
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
  padding-top: 64px;
  padding-bottom: 64px;
}

.section-title {
  font-size: 1.75rem;
  margin-bottom: 32px;
  text-align: center;
  color: white;
}

/* ============================================
   HEADER — MOBILE FIRST
   ============================================ */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-h);
  padding: 12px 0;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo img {
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--surface-color);
}

/* ─── Mobile Menu Trigger ─── */
.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-min);      /* 48px touch target */
  height: var(--touch-min);
  background: var(--surface-color);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 1001;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.mobile-menu-btn:active {
  background: var(--surface-hover);
}

/* ─── Nav Links: fullscreen overlay no mobile ─── */
.nav-links {
  position: fixed;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100vh;
  height: 100dvh; /* Dynamic viewport — 100dvh corrige barra do browser no mobile */
  background: rgba(10, 10, 10, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 0;
  z-index: 999;
  list-style: none;
  display: flex;
}

.nav-links.active {
  left: 0;
}

.nav-links li {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.nav-links.active li {
  opacity: 1;
  transform: translateX(0);
}

.nav-links.active li:nth-child(1) { transition-delay: 0.05s; }
.nav-links.active li:nth-child(2) { transition-delay: 0.10s; }
.nav-links.active li:nth-child(3) { transition-delay: 0.15s; }
.nav-links.active li:nth-child(4) { transition-delay: 0.20s; }
.nav-links.active li:nth-child(5) { transition-delay: 0.25s; }

.nav-links a {
  color: var(--text-primary);  /* Branco para contraste máximo no overlay escuro */
  text-decoration: none;
  font-size: 1.5rem;          /* Maior no mobile para legibilidade */
  font-weight: 500;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 16px 32px;         /* touch-target generoso */
  display: block;
  text-align: center;
  min-height: var(--touch-min);
  transition: color 0.2s ease;
}

.nav-links a:active {
  color: var(--accent-color);  /* Vermelho ao toque — feedback visual claro */
}

/* ============================================
   HERO — MOBILE FIRST
   ============================================ */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-align: center;
  padding-top: var(--header-h);
  /* background-attachment: fixed NÃO funciona em iOS Safari — removido */
  background-image: linear-gradient(rgba(10, 10, 10, 0.75), rgba(10, 10, 10, 0.92)), url('https://images.unsplash.com/photo-1598371839696-5e5bb00b059e?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=70');
  background-size: cover;
  background-position: center;
  /* Substituto ao fixed que funciona no iOS: */
  background-attachment: scroll;
}

.hero-content {
  max-width: 100%;
  z-index: 2;
  padding: 0 8px;
}

.hero h1 {
  font-size: 2.4rem;          /* Mobile first */
  margin-bottom: 16px;
  line-height: 1.1;
  text-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

.hero p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================
   PORTFOLIO — MOBILE FIRST
   ============================================ */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 colunas no mobile */
  gap: 10px;
}

.portfolio-item {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 6px;
  background: var(--surface-color);
  cursor: pointer;
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

/* Overlay com ícone ao toque — mobile UX */
.portfolio-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(224, 36, 36, 0);
  transition: background 0.3s ease;
}

.portfolio-item:active::after {
  background: rgba(224, 36, 36, 0.18);
}

/* ============================================
   ABOUT SECTION — MOBILE FIRST
   ============================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;  /* Stack no mobile */
  gap: 24px;
}

/* Imagem do estúdio DEPOIS do texto no mobile (mais natural) */
.about-image {
  order: -1;              /* Imagem antes no mobile */
  border-radius: 8px;
  overflow: hidden;
  max-width: 260px;
  margin: 0 auto;
}

.about-image img {
  width: 100%;
  height: auto;
  display: block;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-size: 1rem;
  line-height: 1.7;
}

.features {
  display: grid;
  grid-template-columns: 1fr;  /* 1 coluna no mobile */
  gap: 12px;
  margin-top: 20px;
}

.feature-item {
  background: var(--surface-color);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.feature-item h4 {
  font-size: 1rem;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.feature-item p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* ============================================
   TESTIMONIALS — MOBILE FIRST
   ============================================ */
.testimonials {
  background: var(--surface-color);
}

.testimonials-grid {
  display: grid;
  grid-template-columns: 1fr;  /* 1 coluna no mobile */
  gap: 16px;
}

.testimonial-card {
  background: var(--bg-color);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.stars {
  color: #fbbf24;
  margin-bottom: 12px;
  font-size: 1rem;
}

.testimonial-text {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.65;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.testimonial-author img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.author-info h4 {
  font-size: 0.9rem;
  margin: 0;
}

.author-info p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
  font-family: var(--font-body);
  text-transform: none;
}

/* ============================================
   FOOTER — MOBILE FIRST
   ============================================ */
footer {
  background: linear-gradient(to top, rgba(0,0,0,1), rgba(10,10,10,1));
  padding: 48px 0 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  /* Espaço extra no mobile para o botão flutuante não cobrir conteúdo */
  padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px) + 72px);
}

.footer-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 40px;
}

.footer-top h2 {
  font-size: 1.75rem;
  margin-bottom: 12px;
}

.footer-top p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 1rem;
}

.footer-info {
  display: grid;
  grid-template-columns: 1fr;  /* Coluna única no mobile */
  gap: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 24px;
}

.info-block {
  margin-bottom: 8px;
}

.info-block h4 {
  margin-bottom: 10px;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.info-block p,
.info-block a {
  color: var(--text-secondary);
  text-decoration: none;
  margin-bottom: 6px;
  display: block;
  font-size: 0.9rem;
  line-height: 1.6;
}

.info-block a {
  /* Touch target mínimo para links de contato */
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
}

.info-block a:active {
  color: var(--text-primary);
}

.social-links {
  display: flex;
  gap: 12px;
}

/* Ícones sociais com touch target mínimo */
.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-min);
  height: var(--touch-min);
  font-size: 1.25rem;
  background: var(--surface-color);
  border-radius: 50%;
  color: var(--text-primary);
  transition: background 0.2s ease, transform 0.2s ease;
  min-height: unset; /* Reset do estilo de info-block a */
}

.social-links a:active {
  transform: scale(0.92);
  background: var(--accent-color);
}

.copyright {
  text-align: center;
  color: var(--text-secondary);
  margin-top: 40px;
  font-size: 0.8rem;
}

/* ============================================
   FLOATING WHATSAPP BUTTON
   Sempre visível na zona do polegar (bottom-right)
   ============================================ */
.whatsapp-float {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  right: 20px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #25d366;
  color: white;
  text-decoration: none;
  padding: 12px 18px;
  border-radius: 50px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-height: var(--touch-min);
  /* Anima entrada */
  animation: floatIn 0.6s 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.whatsapp-float i {
  font-size: 1.3rem;
}

.whatsapp-float:active {
  transform: scale(0.95);
  box-shadow: 0 2px 10px rgba(37, 211, 102, 0.3);
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Pulsa suavemente para chamar atenção */
@keyframes pulse-green {
  0%, 100% { box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4); }
  50%       { box-shadow: 0 4px 28px rgba(37, 211, 102, 0.65); }
}

.whatsapp-float {
  animation: floatIn 0.6s 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) both,
             pulse-green 2.5s 2s ease-in-out infinite;
}

/* ============================================
   ANIMATIONS
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   SAFE AREA — iPhone notch / home indicator
   ============================================ */
@supports (padding: env(safe-area-inset-bottom)) {
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .nav-links {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ============================================
   TABLET — 640px+
   ============================================ */
@media (min-width: 640px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .portfolio-item {
    aspect-ratio: 4 / 5;
  }

  .features {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .testimonials-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-info {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   TABLET GRANDE — 768px+
   ============================================ */
@media (min-width: 768px) {
  html {
    font-size: 16px;
  }

  :root {
    --header-h: 72px;
  }

  .container {
    padding: 0 24px;
  }

  .section {
    padding-top: 80px;
    padding-bottom: 80px;
  }

  .section-title {
    font-size: 2rem;
    margin-bottom: 40px;
  }

  /* Esconde botão flutuante no desktop/tablet grande — 
     hero btn e footer btn são visíveis */
  .whatsapp-float .whatsapp-float-label {
    display: inline;
  }

  /* Hero desktop */
  .hero h1 {
    font-size: 3rem;
  }

  .hero p {
    font-size: 1.15rem;
  }

  .btn {
    width: auto;       /* Auto-width no tablet+ */
    padding: 16px 32px;
    font-size: 1.05rem;
  }

  /* Nav vira horizontal no tablet */
  .mobile-menu-btn {
    display: none;
  }

  .nav-links {
    position: static;
    height: auto;
    width: auto;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    flex-direction: row;
    justify-content: flex-end;
    transition: none;
    gap: 24px;
    opacity: 1;
    transform: none;
    list-style: none;
  }

  .nav-links li {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .nav-links a {
    font-size: 0.9rem;
    padding: 8px 4px;
    min-height: unset;
    text-align: left;
    display: inline;
    transition: color 0.2s ease;
  }

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

  /* About grid 2 colunas */
  .about-grid {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
  }

  .about-image {
    order: 0;       /* Volta para o lado direito */
    max-width: 100%;
  }

  /* Portfolio 3 colunas */
  .portfolio-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .portfolio-item:hover img {
    transform: scale(1.05);
  }

  /* Footer 3 colunas */
  .footer-info {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }

  /* Remove extra padding do footer (botão float some no desktop) */
  footer {
    padding-bottom: 40px;
  }

  /* Testimonials 3 colunas */
  .testimonials-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }

  .footer-top h2 {
    font-size: 2.5rem;
  }

  .social-links a:hover {
    transform: scale(1.1);
    background: var(--surface-hover);
  }
}

/* ============================================
   DESKTOP — 1024px+
   ============================================ */
@media (min-width: 1024px) {
  .section {
    padding-top: 96px;
    padding-bottom: 96px;
  }

  .section-title {
    font-size: 2.5rem;
    margin-bottom: 48px;
  }

  .hero h1 {
    font-size: 4rem;
  }

  .hero p {
    font-size: 1.25rem;
  }

  .about-grid {
    gap: 64px;
  }

  /* Ocultar botão flutuante no desktop — CTAs embutidos são suficientes */
  .whatsapp-float {
    display: none;
  }

  .btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(224, 36, 36, 0.2);
  }

  /* Apenas links diretos de texto (endereço, telefone) — NÃO afeta .social-links a */
  .info-block > a,
  .info-block p ~ a {
    min-height: unset;
    display: block;
  }

  /* Garante que os círculos sociais permanecem perfeitos no desktop */
  .social-links a {
    display: flex;
    width: var(--touch-min);
    height: var(--touch-min);
    min-height: unset;
  }

  .info-block a:hover {
    color: var(--text-primary);
  }
}

/* ============================================
   LARGE DESKTOP — 1200px+
   ============================================ */
@media (min-width: 1200px) {
  .hero h1 {
    font-size: 4.5rem;
  }

  .footer-top h2 {
    font-size: 3rem;
  }
}

/* ============================================
   REDUCED MOTION — Acessibilidade
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .whatsapp-float {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
