/* ==========================================================================
   PROJETOS SF — catálogo das máquinas montadas.
   Identidade herdada do manual comercial: preto em camadas, vermelho de marca
   com parcimônia, cantos usinados (máx. 8px), sombra neutra vinda de cima.
   Tema escuro fixo: as fotos das máquinas foram feitas para fundo preto.
   ========================================================================== */

:root {
  color-scheme: dark;

  --red: #E5000C;
  --red-bright: #FF2030;
  --red-dark: #A80008;
  --red-text: #FF2030;

  --black: #070708;
  --bg: #0C0C0D;
  --surface-1: #111113;
  --surface-2: #191A1C;
  --surface-3: #222326;

  --text: #FFFFFF;
  --text-silver: #C8C8C8;
  --text-muted: #888890;
  --border: #2A2B2E;

  --wa: #25D366;

  --font-display: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  --font-label: 'Barlow Condensed', 'Segoe UI Condensed', system-ui, sans-serif;
  --font-body: 'Barlow', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  --fs-display: clamp(40px, 6.4vw, 88px);
  --fs-title: clamp(30px, 4.4vw, 54px);
  --fs-heading: clamp(24px, 3vw, 36px);
  --fs-body: clamp(16px, 1.1vw, 18px);
  --fs-caption: clamp(13px, .95vw, 15px);
  --fs-hud: 11px;

  --tracking-label: .14em;

  --r-2: 2px;
  --r-4: 4px;
  --r-8: 8px;
  --border-thin: 1px solid var(--border);

  --e1: 0 2px 8px rgba(0, 0, 0, .45);
  --e2: 0 6px 20px rgba(0, 0, 0, .55);
  --e3: 0 18px 48px rgba(0, 0, 0, .70);

  --glow-soft: 0 0 0 1px rgba(229, 0, 12, .28), 0 4px 18px rgba(229, 0, 12, .14);
  --glow-focus: 0 0 0 2px rgba(229, 0, 12, .55), 0 6px 24px rgba(229, 0, 12, .22);

  --ease: cubic-bezier(.16, 1, .3, 1);
  --t-fast: 120ms;
  --t-base: 180ms;
  --t-slow: 260ms;

  --nav-h: 64px;
  --maxw: 1320px;
  --gutter: clamp(18px, 4vw, 48px);

  --carbon: repeating-linear-gradient(135deg,
    rgba(255, 255, 255, .016) 0px, rgba(255, 255, 255, .016) 1px,
    transparent 1px, transparent 5px);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Trama de carbono + brilho de canto, fixos atrás de tudo. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--carbon);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  top: -10vh;
  right: -10vw;
  width: 60vw;
  height: 60vh;
  background: radial-gradient(circle at 70% 30%, rgba(229, 0, 12, .13), transparent 62%);
  pointer-events: none;
  z-index: 0;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.05;
  text-transform: uppercase;
  margin: 0;
}

:focus-visible {
  outline: none;
  box-shadow: var(--glow-focus);
  border-radius: var(--r-4);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

.sr-only, .skip-link {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip-link:focus {
  position: fixed;
  top: 12px; left: 12px;
  width: auto; height: auto;
  clip: auto;
  padding: 10px 16px;
  background: var(--red);
  color: #fff;
  z-index: 200;
  border-radius: var(--r-4);
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--gutter);
  position: relative;
  z-index: 1;
}

/* ---- Tipografia nomeada ------------------------------------------------- */
.t-display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-display);
  line-height: .95;
  text-transform: uppercase;
}
.t-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-title);
  line-height: 1;
  text-transform: uppercase;
}
.t-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-heading);
  text-transform: uppercase;
}
.t-label {
  font-family: var(--font-label);
  font-weight: 700;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}
.t-hud {
  font-family: var(--font-mono);
  font-size: var(--fs-hud);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---- Navbar ------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--nav-h);
  background: rgba(12, 12, 13, .82);
  backdrop-filter: blur(12px);
  border-bottom: var(--border-thin);
}
.nav-in {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-logo { display: flex; align-items: center; gap: 14px; line-height: 0; }
.nav-logo img { height: 26px; width: auto; }
.nav-logo span {
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-muted);
  padding-left: 14px;
  border-left: var(--border-thin);
  line-height: 1.2;
}
.nav-actions { display: flex; align-items: center; gap: 10px; }

/* ---- Botões ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: var(--r-4);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--t-base) var(--ease), border-color var(--t-base) var(--ease),
    box-shadow var(--t-base) var(--ease), transform var(--t-fast) var(--ease), color var(--t-base) var(--ease);
}
.btn-primary { background: var(--red); color: #fff; box-shadow: var(--e1); }
.btn-primary:hover { background: var(--red-bright); box-shadow: var(--e1), var(--glow-soft); transform: translateY(-2px); }
.btn-primary:active { background: var(--red-dark); transform: translateY(0); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-silver); }
.btn-ghost:hover { border-color: var(--red); color: var(--text); box-shadow: var(--glow-soft); transform: translateY(-2px); }
.btn-wa { background: var(--wa); color: #06301a; }
.btn-wa:hover { background: #2ee87a; transform: translateY(-2px); box-shadow: var(--e2); }
.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---- Hero --------------------------------------------------------------- */
.hero {
  position: relative;
  padding: clamp(36px, 5vw, 64px) 0 clamp(24px, 3vw, 40px);
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.hero-kicker::before {
  content: '';
  width: 28px;
  height: 3px;
  background: var(--red);
}
.hero-title { max-width: 24ch; }
.hero-title em {
  font-style: normal;
  color: var(--red-text);
}
.hero-sub {
  margin-top: 22px;
  max-width: 62ch;
  color: var(--text-silver);
  font-size: clamp(17px, 1.3vw, 20px);
  font-weight: 300;
}
/* ---- Barra de ferramentas (busca) --------------------------------------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 0 26px;
}
.search {
  position: relative;
  flex: 1 1 280px;
  max-width: 420px;
}
.search input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: var(--surface-1);
  border: var(--border-thin);
  border-radius: var(--r-4);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  transition: border-color var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}
.search input::placeholder { color: var(--text-muted); }
.search input:focus { outline: none; border-color: var(--red); box-shadow: var(--glow-soft); }
.search svg {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 17px; height: 17px;
  color: var(--text-muted);
  pointer-events: none;
}
.result-count { color: var(--text-muted); }

/* ---- Grid de gabinetes -------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: clamp(16px, 2vw, 26px);
  padding-bottom: clamp(48px, 7vw, 88px);
}

.case-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface-1);
  border: var(--border-thin);
  border-radius: var(--r-8);
  overflow: hidden;
  box-shadow: var(--e1);
  transition: border-color var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.case-card:hover,
.case-card:focus-within {
  border-color: var(--red);
  box-shadow: var(--e2), var(--glow-soft);
  transform: translateY(-3px);
}

.case-media {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--black);
  overflow: hidden;
}
.case-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease);
}
.case-slide.is-on { opacity: 1; }
.case-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease);
}
.case-card:hover .case-slide.is-on img { transform: scale(1.04); }
.case-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 7, 8, .05) 40%, rgba(7, 7, 8, .78) 100%);
  pointer-events: none;
}

.case-badge {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: var(--r-2);
  background: rgba(229, 0, 12, .92);
  color: #fff;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  box-shadow: var(--e1);
}
.case-badge--solo { background: rgba(25, 26, 28, .92); color: var(--text-silver); }

.case-dots {
  position: absolute;
  bottom: 12px; right: 12px;
  z-index: 2;
  display: flex;
  gap: 5px;
}
.case-dots i {
  width: 16px;
  height: 3px;
  background: rgba(255, 255, 255, .3);
  border-radius: 2px;
  transition: background var(--t-base) var(--ease);
}
.case-dots i.is-on { background: var(--red); }

.case-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.case-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(19px, 1.6vw, 23px);
  text-transform: uppercase;
  line-height: 1.1;
}
.case-variants {
  color: var(--text-muted);
  font-size: var(--fs-caption);
}
.case-variants b { color: var(--text-silver); font-weight: 500; }
.case-link { position: absolute; inset: 0; z-index: 3; }
.case-link:focus-visible { box-shadow: inset 0 0 0 2px var(--red); border-radius: var(--r-8); }

/* ---- Estado vazio ------------------------------------------------------- */
.empty {
  padding: clamp(40px, 8vw, 90px) 0;
  text-align: center;
  color: var(--text-muted);
}
.empty h2 { margin-bottom: 12px; color: var(--text); }

/* ---- Perfil do gabinete ------------------------------------------------- */
.crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 26px 0 0;
  color: var(--text-muted);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  transition: color var(--t-base) var(--ease);
}
.crumb:hover { color: var(--red-text); }
.crumb svg { width: 17px; height: 17px; flex: none; }

.profile-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0 26px;
}
.profile-head h1 { max-width: 18ch; }
.profile-meta { margin-top: 12px; color: var(--text-muted); }
.profile-meta b { color: var(--red-text); font-family: var(--font-mono); font-size: 14px; }

/* Carrossel: cada slide é uma máquina montada naquele gabinete. */
.carousel { position: relative; }
.stage {
  position: relative;
  background: var(--black);
  border: var(--border-thin);
  border-radius: var(--r-8);
  overflow: hidden;
  box-shadow: var(--e2);
}
.stage-viewport {
  position: relative;
  height: min(72vh, 720px);
  min-height: 340px;
}
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-slow) var(--ease);
}
.slide.is-on { opacity: 1; visibility: visible; }
/* Fundo desfocado da própria foto: resolve retrato e paisagem na mesma caixa
   sem cortar a máquina nem deixar tarja preta chapada. */
.slide-bg {
  position: absolute;
  inset: -8%;
  background-size: cover;
  background-position: center;
  filter: blur(38px) brightness(.34) saturate(.9);
  transform: scale(1.06);
}
.slide-photo {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-in;
}
.slide-tag {
  position: absolute;
  top: 16px; left: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  background: rgba(7, 7, 8, .74);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .12);
  border-left: 3px solid var(--red);
  border-radius: 0 var(--r-4) var(--r-4) 0;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}
.slide-count {
  position: absolute;
  right: 16px; bottom: 16px;
  z-index: 3;
  padding: 6px 10px;
  border-radius: var(--r-2);
  background: rgba(7, 7, 8, .7);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--text-silver);
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  background: rgba(7, 7, 8, .62);
  backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  transition: background var(--t-base) var(--ease), border-color var(--t-base) var(--ease), transform var(--t-fast) var(--ease);
}
.nav-arrow:hover { background: var(--red); border-color: var(--red); }
.nav-arrow[disabled] { opacity: .3; pointer-events: none; }
.nav-arrow--prev { left: 14px; }
.nav-arrow--next { right: 14px; }
.nav-arrow svg { width: 20px; height: 20px; }

/* Trilha de variações abaixo do palco. */
.variants {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding-bottom: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
  scroll-snap-type: x mandatory;
}
.variant {
  flex: 0 0 auto;
  width: 132px;
  border: var(--border-thin);
  border-radius: var(--r-4);
  background: var(--surface-1);
  overflow: hidden;
  cursor: pointer;
  scroll-snap-align: start;
  transition: border-color var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease), transform var(--t-fast) var(--ease);
}
.variant:hover { transform: translateY(-2px); border-color: var(--red); }
.variant.is-on { border-color: var(--red); box-shadow: var(--glow-soft); }
.variant img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--black);
}
.variant span {
  display: block;
  padding: 8px 10px;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-silver);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.variant.is-on span { color: var(--text); }

/* Galeria extra da máquina em foco (quando tem mais de uma foto). */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.gallery button {
  padding: 0;
  border: var(--border-thin);
  border-radius: var(--r-4);
  background: var(--black);
  overflow: hidden;
  cursor: zoom-in;
  transition: border-color var(--t-base) var(--ease), transform var(--t-fast) var(--ease);
}
.gallery button:hover { border-color: var(--red); transform: translateY(-2px); }
.gallery img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }

/* ---- Selo de variações sobre a foto grande ------------------------------ */
/* Repete dentro do gabinete o que o card da home já anuncia: quantas máquinas
   diferentes saíram da bancada neste mesmo case. */
.stage-badge {
  position: absolute;
  /* Canto direito: o esquerdo é do .slide-tag, que diz qual variação está em
     foco. Os dois no mesmo canto se sobrepõem. */
  top: 16px; right: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: var(--r-2);
  background: rgba(229, 0, 12, .92);
  color: #fff;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  box-shadow: var(--e1);
  pointer-events: none;
}
.stage-badge--solo { background: rgba(7, 7, 8, .78); color: var(--text-silver); backdrop-filter: blur(8px); }

/* ---- Faixa de CTA ------------------------------------------------------- */
.cta-band {
  position: relative;
  margin: clamp(40px, 6vw, 72px) 0 clamp(32px, 5vw, 56px);
  padding: clamp(28px, 4vw, 44px);
  background: var(--surface-1);
  border: var(--border-thin);
  border-radius: var(--r-8);
  box-shadow: var(--e1);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.cta-band::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px; right: -1px;
  height: 3px;
  background: var(--red);
  border-radius: var(--r-8) var(--r-8) 0 0;
}
.cta-copy { max-width: 56ch; }
.cta-copy h2 { margin-bottom: 10px; }
.cta-copy p { margin: 0; color: var(--text-silver); }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---- Benefícios --------------------------------------------------------- */
.benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 14px;
  padding-bottom: clamp(40px, 6vw, 72px);
}
.benefit {
  padding: 20px;
  background: var(--surface-1);
  border: var(--border-thin);
  border-left: 3px solid var(--red);
  border-radius: 0 var(--r-8) var(--r-8) 0;
}
.benefit h3 {
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: var(--tracking-label);
  margin-bottom: 6px;
}
.benefit p { margin: 0; color: var(--text-muted); font-size: var(--fs-caption); }

/* ---- Outros gabinetes --------------------------------------------------- */
.section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: clamp(32px, 5vw, 56px) 0 20px;
}
.section-head h2 { white-space: nowrap; }
.section-head::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---- Rodapé ------------------------------------------------------------- */
.footer {
  border-top: var(--border-thin);
  padding: 32px 0 44px;
  color: var(--text-muted);
  font-size: var(--fs-caption);
}
.footer-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer a:hover { color: var(--red-text); }

/* ---- Lightbox ----------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  place-items: center;
  padding: clamp(16px, 4vw, 48px);
  background: rgba(7, 7, 8, .93);
  backdrop-filter: blur(6px);
}
.lightbox.is-open { display: grid; }
.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  border-radius: var(--r-4);
  box-shadow: var(--e3);
}
.lightbox-close {
  position: absolute;
  top: 18px; right: 18px;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
  background: rgba(25, 26, 28, .8);
  cursor: pointer;
}
.lightbox-close:hover { background: var(--red); border-color: var(--red); }
.lightbox-close svg { width: 20px; height: 20px; }

/* ---- Carregando --------------------------------------------------------- */
.loading {
  display: grid;
  place-items: center;
  min-height: 60vh;
  gap: 16px;
  color: var(--text-muted);
}
.loading i {
  width: 30px; height: 30px;
  border: 2px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Entrada suave dos cards -------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: rise var(--t-slow) var(--ease) forwards;
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---- Responsivo --------------------------------------------------------- */
.cta-short { display: none; }

@media (max-width: 700px) {
  .nav-logo span { display: none; }
  .nav-logo img { height: 22px; }
  .cta-long { display: none; }
  .cta-short { display: inline; }
  .stage-viewport { height: min(58vh, 460px); }
  .nav-arrow { width: 40px; height: 40px; }
  .nav-arrow--prev { left: 8px; }
  .nav-arrow--next { right: 8px; }
  .cta-actions { width: 100%; }
  .cta-actions .btn { flex: 1 1 100%; }
}
