/* ═══════════════════════════════════════════════════════════
   BR Print Madeira — Design System
   Fonte de verdade: claude_md/brprint-brand-guidelines.md
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Cores primárias */
  --cyan:      #00B4D8;
  --magenta:   #E8006D;
  --magenta-text: #EA206F;  /* 4.65:1 — magenta legivel como texto sobre preto */
  --yellow:    #F5C400;
  --black:     #0A0A0A;
  --ink:       #111111;
  --white:     #FAFAFA;
  --off-white: #F2F0EB;

  /* Superfícies sobre fundo escuro */
  --surface-1: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border-1:  rgba(255, 255, 255, 0.07);
  --border-2:  rgba(255, 255, 255, 0.15);
  --text-mute: rgba(255, 255, 255, 0.55);
  --text-dim:  rgba(255, 255, 255, 0.48);   /* 4.9:1 sobre --black (WCAG AA) */

  /* Tipografia */
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur:      300ms;

  /* Breakpoints (referência) — 375 / 480 / 768 / 1024 / 1280 / 1536 */
}

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

* { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-overflow-scrolling: touch;
}

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }

ul { list-style: none; }

input, textarea, select, button { font-family: inherit; font-size: max(16px, 1rem); }

/* Evita zoom ao focar inputs em iOS */
input, textarea, select { font-size: max(16px, 1rem); }

/* ─── Tipografia ────────────────────────────────────────── */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.05;
}

.display {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(32px, 8vw, 72px);
  letter-spacing: clamp(-3px, -0.04em, -1px);
  line-height: 1.0;
}

.h1 { font-size: clamp(32px, 7vw, 52px); letter-spacing: clamp(-2px, -0.03em, -1px); }
.h2 { font-size: clamp(26px, 5vw, 48px); letter-spacing: clamp(-2px, -0.03em, -0.5px); }
.h3 { font-size: clamp(20px, 3.5vw, 32px); letter-spacing: -0.5px; }

.lead { font-size: clamp(16px, 2vw, 20px); color: var(--text-mute); }
.body-text { font-size: clamp(14px, 1.8vw, 17px); line-height: 1.75; }

.eyebrow {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(10px, 1.2vw, 12px);
  letter-spacing: clamp(2px, 0.3vw, 4px);
  text-transform: uppercase;
  color: var(--eyebrow-color, var(--text-dim));
  margin-bottom: 14px;
}

.text-cyan    { color: var(--cyan); }
.text-magenta { color: var(--magenta); }
.text-yellow  { color: var(--yellow); }

/* ─── Layout ────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 60px);
}
.container-narrow { max-width: 760px; }
.container-wide   { max-width: 1440px; }

.section { padding: clamp(64px, 10vw, 140px) 0; }

/* ─── Faixa CMYK (topo + rodapé obrigatório) ────────────── */
.cmyk-stripe {
  height: 4px;
  width: 100%;
  background: linear-gradient(90deg,
    var(--cyan)    0% 25%,
    var(--magenta) 25% 50%,
    var(--yellow)  50% 75%,
    var(--white)   75% 100%);
}
.cmyk-stripe--top { position: relative; z-index: 200; }

/* ─── Botões ────────────────────────────────────────────── */
.btn-primary,
.btn-ghost,
.btn-magenta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  padding: 14px 32px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity var(--dur), background var(--dur), border-color var(--dur), transform var(--dur);
  min-height: 44px;
}
.btn-primary { background: var(--white); color: var(--black); }
.btn-primary:hover { opacity: 0.88; }

.btn-magenta { background: var(--magenta); color: #fff; }
.btn-magenta:hover { opacity: 0.88; }

.btn-ghost {
  background: var(--surface-2);
  border-color: var(--border-2);
  color: #fff;
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.3); }

.link-arrow {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--yellow);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap var(--dur);
}
.link-arrow:hover { gap: 12px; }

/* ─── Navbar ────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-1);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}

/* Logo */
.logo { display: inline-flex; align-items: center; }
.logo-img {
  display: block;
  height: 30px;
  width: auto;
}
.footer-brand .logo-img { height: 40px; }

.nav-links { display: none; }
.nav-cta { display: none; }

.nav-links a, .nav-drawer a { transition: color var(--dur); }
.nav-links a { color: var(--text-mute); font-size: 14px; }
.nav-links a:hover, .nav-links a.active { color: #fff; }

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 10px;
}
.hamburger span {
  width: 22px; height: 2px;
  background: #fff; border-radius: 2px;
  transition: transform var(--dur), opacity var(--dur);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Drawer mobile */
.nav-drawer {
  position: fixed; top: 0; right: 0;
  width: min(320px, 85vw); height: 100vh;
  background: var(--ink);
  border-left: 1px solid rgba(255,255,255,0.08);
  padding: 88px 32px 40px;
  transform: translateX(100%);
  transition: transform 0.35s var(--ease-out);
  z-index: 110;
  display: flex; flex-direction: column; gap: 4px;
}
.nav-drawer.open { transform: translateX(0); }
.nav-drawer a {
  font-family: var(--font-display);
  font-weight: 700; font-size: 22px;
  color: var(--text-mute);
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav-drawer a:hover, .nav-drawer a.active { color: #fff; }
.nav-drawer .drawer-cta {
  margin-top: auto; background: var(--magenta); color: #fff;
  padding: 16px; border-radius: 10px; text-align: center;
  border: none; font-size: 15px;
}
.nav-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur);
  z-index: 105;
}
.nav-overlay.open { opacity: 1; pointer-events: all; }

@media (min-width: 768px) {
  .nav-inner { padding: 16px 32px; }
  .nav-links { display: flex; gap: 22px; }
  .nav-cta { display: inline-flex; }
  .hamburger { display: none; }
}
@media (min-width: 1024px) {
  .nav-inner { padding: 16px 48px; }
  .nav-links { gap: 28px; }
}

/* ─── Footer ────────────────────────────────────────────── */
.footer { padding: clamp(48px, 7vw, 80px) 0 0; border-top: 1px solid var(--border-1); }
.footer-inner {
  display: grid; grid-template-columns: 1fr; gap: 32px;
  text-align: center;
}
.footer-col h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: 13px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 14px;
}
.footer-col a, .footer-col p {
  display: block; color: var(--text-mute); font-size: 14px;
  padding: 5px 0; transition: color var(--dur);
}
.footer-col a:hover { color: #fff; }
.footer-brand .logo { justify-content: center; margin-bottom: 14px; }
.footer-socials { display: flex; gap: 10px; justify-content: center; }
.footer-socials a {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-1); border: 1px solid var(--border-1);
  color: var(--text-mute); transition: all var(--dur);
}
.footer-socials a:hover { color: #fff; border-color: var(--border-2); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 40px; padding: 22px 0;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
  font-size: 12px; color: rgba(255,255,255,0.48);
}

@media (min-width: 600px) {
  .footer-inner { grid-template-columns: 1fr 1fr; text-align: left; }
  .footer-brand .logo { justify-content: flex-start; }
  .footer-socials { justify-content: flex-start; }
}
@media (min-width: 1024px) {
  .footer-inner { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

/* ─── Reveal on scroll (homepage / fallback sem GSAP) ───── */
/* Só esconde se houver JS para voltar a mostrar (o <html class="js"> é posto
   no <head>). Sem isto, se o main.js falhar a página fica invisível. */
.js [data-animate] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.js [data-animate].in { opacity: 1; transform: none; }

/* Primeiro ecrã: a entrada é feita em CSS e arranca com a página, sem esperar
   pelo IntersectionObserver. Enquanto dependia do JS, o "render delay" valia
   86-95% do LCP (a /servicos chegava aos 8,4s). */
.js .page-head [data-animate],
.js .hero-inner [data-animate],
.js .portfolio-grid > .portfolio-item:nth-child(-n+4) {
  animation: reveal-up 0.6s var(--ease-out) both;
  transition: none;
}
.js .page-head [data-animate]:nth-child(2),
.js .hero-inner [data-animate]:nth-child(2) { animation-delay: 0.08s; }
.js .page-head [data-animate]:nth-child(3),
.js .hero-inner [data-animate]:nth-child(3) { animation-delay: 0.16s; }
.js .hero-inner [data-animate]:nth-child(4) { animation-delay: 0.24s; }
.js .hero-inner [data-animate]:nth-child(5) { animation-delay: 0.32s; }
.js .portfolio-grid > .portfolio-item:nth-child(2) { animation-delay: 0.06s; }
.js .portfolio-grid > .portfolio-item:nth-child(3) { animation-delay: 0.12s; }
.js .portfolio-grid > .portfolio-item:nth-child(4) { animation-delay: 0.18s; }

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

/* ─── Acessibilidade — movimento reduzido ───────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-animate] { opacity: 1; transform: none; animation: none; }
}

/* ═══════════════════════════════════════════════════════════
   Componentes partilhados (usados em várias páginas)
   ═══════════════════════════════════════════════════════════ */

/* ─── Barra de valor ────────────────────────────────────── */
.value-bar {
  border-top: 1px solid var(--border-1);
  border-bottom: 1px solid var(--border-1);
  background: var(--ink);
  padding: clamp(28px, 5vw, 44px) 0;
}
.value-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(18px, 3vw, 28px);
}
.value-item { display: flex; align-items: flex-start; gap: 13px; }
.value-item i { font-size: 26px; line-height: 1.1; flex-shrink: 0; color: var(--cyan); }
.value-item:nth-child(2) i { color: var(--yellow); }
.value-item:nth-child(3) i { color: var(--magenta); }
.value-item:nth-child(4) i { color: var(--cyan); }
.value-item strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(14px, 1.8vw, 16px);
}
.value-item span {
  display: block;
  font-size: clamp(12px, 1.4vw, 13px);
  color: var(--text-mute);
  margin-top: 3px;
  line-height: 1.5;
}
@media (min-width: 600px)  { .value-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .value-grid { grid-template-columns: repeat(4, 1fr); } }

/* ─── WhatsApp flutuante ────────────────────────────────── */
.wa-float {
  position: fixed;
  z-index: 150;
  right: clamp(16px, 3vw, 28px);
  bottom: clamp(16px, 3vw, 28px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 56px;
  height: 56px;
  padding: 0;
  background: var(--magenta);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  transition: transform var(--dur), box-shadow var(--dur), opacity var(--dur);
}
.wa-float i { font-size: 26px; line-height: 1; }
.wa-float span { display: none; }
.wa-float:hover { transform: translateY(-3px); box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5); }
@media (min-width: 768px) {
  .wa-float { width: auto; height: auto; padding: 14px 22px; }
  .wa-float span { display: inline; }
}
