/* ===================================================================
   Conceito Modular e Offsite — estilos globais
   Identidade preservada: escuro #0e0f13, vermelho #C1121F, fonte Outfit.
   =================================================================== */

:root {
  --cm-ink: #0e0f13;
  --cm-red: #C1121F;
  --cm-red-2: #ff6f63;
  --cm-red-dark: #9e0e18;
  --cm-light: #f5f6f8;
  --cm-green: #057a32;
  --cm-white: #ffffff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--cm-ink);
  color: var(--cm-ink);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: var(--cm-red); text-decoration: none; }
a:hover { color: var(--cm-red-dark); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--cm-red); outline-offset: 3px; }
::selection { background: var(--cm-red); color: #fff; }

/* ---- animações da identidade original ---- */
@keyframes cmRise  { from { transform: translateY(115%); } to { transform: translateY(0); } }
@keyframes cmFade  { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cmCue   { 0%,100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(9px); opacity: 1; } }
@keyframes cmMarq  { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes cmPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(5,122,50,.5); } 50% { box-shadow: 0 0 0 15px rgba(5,122,50,0); } }
@keyframes cmShine { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }

/* ===================================================================
   Seção de vídeo institucional
   =================================================================== */
.cm-video {
  position: relative;
  overflow: hidden;
  background: var(--cm-ink);
  padding: 130px 40px;
}
/* elementos abstratos / linhas arquitetónicas ao fundo */
.cm-video__grid {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, #000 30%, transparent 78%);
}
.cm-video__glow {
  position: absolute; z-index: 0; pointer-events: none;
  width: 60vw; height: 60vw; max-width: 820px; max-height: 820px;
  left: 50%; top: 42%; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(193,18,31,.28) 0%, rgba(193,18,31,0) 62%);
  filter: blur(20px);
}
.cm-video__inner {
  position: relative; z-index: 2;
  max-width: 1320px; margin: 0 auto;
}
.cm-video__head { max-width: 720px; margin: 0 auto 44px; text-align: center; }
.cm-video__eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .18em;
  text-transform: uppercase; margin-bottom: 20px;
}
.cm-video__eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--cm-red); display: inline-block; }
.cm-video__title {
  font-size: 46px; font-weight: 800; letter-spacing: -.025em; line-height: 1.05;
  margin: 0 0 18px; color: #fff; text-wrap: balance;
}
.cm-video__lead {
  font-size: 18.5px; line-height: 1.6; color: rgba(255,255,255,.72);
  margin: 0 auto 30px; max-width: 620px;
}
.cm-video__cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--cm-red); color: #fff; font-weight: 700; font-size: 17px;
  padding: 16px 28px; border-radius: 999px; min-height: 44px;
  box-shadow: 0 16px 40px -14px rgba(193,18,31,.85);
  transition: transform .3s cubic-bezier(.16,.8,.3,1), box-shadow .3s;
}
.cm-video__cta:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 20px 46px -14px rgba(193,18,31,.95); }
.cm-video__cta svg { transition: transform .3s; }
.cm-video__cta:hover svg { transform: translateX(4px); }

/* palco 3D + moldura do vídeo */
.cm-video__stage { perspective: 1400px; max-width: 1180px; margin: 0 auto; }
/* variante retrato 9:16 (vídeo vertical, formato reel) */
.cm-video__stage--portrait { max-width: 392px; }
.cm-video__stage--portrait .cm-video__frame { aspect-ratio: 9 / 16; }
.cm-video__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  background: #05060a;
  box-shadow: 0 60px 120px -40px rgba(0,0,0,.85),
              0 0 0 1px rgba(255,255,255,.03) inset,
              0 0 60px -18px rgba(193,18,31,.45);
  transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.16,.8,.3,1);
  will-change: transform;
}
.cm-video__frame::after { /* brilho translúcido superior */
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,0) 26%);
  mix-blend-mode: screen;
}
.cm-video__media {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.cm-video__sound {
  position: absolute; right: 16px; bottom: 16px; z-index: 4;
  width: 46px; height: 46px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(14,15,19,.6); color: #fff;
  border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  cursor: pointer; transition: background .25s, transform .25s;
}
.cm-video__sound:hover { background: rgba(193,18,31,.85); transform: scale(1.06); }
.cm-video__sound .cm-ico-on { display: none; }
.cm-video__sound[aria-pressed="true"] .cm-ico-on  { display: block; }
.cm-video__sound[aria-pressed="true"] .cm-ico-off { display: none; }

/* entrada cinematográfica do vídeo (revelada via .is-in) */
.cm-video__stage .cm-video__frame {
  opacity: 0;
  transform: translateY(80px) scale(.88);
  filter: blur(14px);
  border-radius: 40px;
  clip-path: inset(6% 4% round 40px);
}
.cm-video__stage.is-in .cm-video__frame {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  border-radius: 22px;
  clip-path: inset(0% 0% round 22px);
  transition: opacity 1.2s cubic-bezier(.16,.8,.3,1),
              transform 1.2s cubic-bezier(.16,.8,.3,1),
              filter 1.2s cubic-bezier(.16,.8,.3,1),
              clip-path 1.3s cubic-bezier(.16,.8,.3,1),
              border-radius 1.2s cubic-bezier(.16,.8,.3,1);
}

/* ===================================================================
   Seção Instagram (preview + página dedicada)
   =================================================================== */
.cm-ig { background: var(--cm-light); padding: 110px 40px; }
.cm-ig--page { padding-top: 150px; }
.cm-ig__inner { max-width: 1280px; margin: 0 auto; }
.cm-ig__head {
  display: flex; flex-wrap: wrap; align-items: flex-end;
  justify-content: space-between; gap: 24px; margin-bottom: 46px;
}
.cm-ig__eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--cm-red); font-weight: 700; font-size: 13px; letter-spacing: .18em;
  text-transform: uppercase; margin-bottom: 16px;
}
.cm-ig__eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--cm-red); display: inline-block; }
.cm-ig__title { font-size: 42px; font-weight: 800; letter-spacing: -.02em; line-height: 1.06; margin: 0 0 14px; color: var(--cm-ink); }
.cm-ig__lead { font-size: 17.5px; color: #3f424a; line-height: 1.6; margin: 0; max-width: 520px; }
.cm-ig__follow {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--cm-ink); color: #fff; font-weight: 700; font-size: 16px;
  padding: 14px 22px; border-radius: 999px; min-height: 44px; white-space: nowrap;
  transition: transform .3s, background .3s;
}
.cm-ig__follow:hover { color: #fff; transform: translateY(-2px); background: var(--cm-red); }

.cm-ig__grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(6, 1fr);
}
/* variante da home: 6 cards em 3×2 (desktop), nativa ao restante do site */
.cm-ig__grid--feed { grid-template-columns: repeat(3, 1fr); }
/* seção escondida por completo em erro/vazio (sem card quebrado) */
.cm-ig[hidden] { display: none !important; }
.cm-ig__card {
  position: relative; display: block;
  aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden;
  background: #dfe1e6;
  box-shadow: 0 18px 40px -26px rgba(14,15,19,.5);
  opacity: 0; transform: translateY(30px);
}
.cm-ig__card.is-in { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s cubic-bezier(.16,.8,.3,1); }
.cm-ig__card img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.16,.8,.3,1); }
.cm-ig__card:hover img { transform: scale(1.08); }
.cm-ig__overlay {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 10px;
  color: #fff; padding: 14px;
  background: linear-gradient(180deg, rgba(14,15,19,0) 30%, rgba(14,15,19,.30) 55%, rgba(14,15,19,.82) 100%);
  opacity: 0; transition: opacity .35s ease;
}
.cm-ig__card:hover .cm-ig__overlay, .cm-ig__card:focus-visible .cm-ig__overlay { opacity: 1; }
.cm-ig__meta { display: flex; align-items: center; gap: 16px; font-weight: 700; font-size: 14px; }
.cm-ig__meta span { display: inline-flex; align-items: center; gap: 6px; }
.cm-ig__cap {
  font-weight: 500; font-size: 13.5px; line-height: 1.4; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cm-ig__badge { /* selo tipo de mídia (vídeo/carrossel) */
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 30px; height: 30px; border-radius: 8px;
  display: none; align-items: center; justify-content: center;
  background: rgba(14,15,19,.55); color: #fff; backdrop-filter: blur(4px);
}
.cm-ig__card[data-type="VIDEO"] .cm-ig__badge,
.cm-ig__card[data-type="CAROUSEL_ALBUM"] .cm-ig__badge { display: flex; }

/* estados da página dedicada */
.cm-ig__more { text-align: center; margin-top: 44px; }
.cm-ig__loadmore {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--cm-ink); color: #fff; font-weight: 700; font-size: 16px;
  padding: 15px 30px; border-radius: 999px; min-height: 44px; border: none; cursor: pointer;
  transition: transform .3s, background .3s;
}
.cm-ig__loadmore:hover:not(:disabled) { transform: translateY(-2px); background: var(--cm-red); }
.cm-ig__loadmore:disabled { opacity: .5; cursor: default; }
.cm-ig__status { text-align: center; color: #5a5d65; font-size: 15px; margin-top: 26px; min-height: 22px; }
.cm-ig__skeleton { background: linear-gradient(100deg, #e2e4e8 30%, #eef0f3 50%, #e2e4e8 70%); background-size: 220% 100%; animation: cmShine 1.4s linear infinite; }

/* ===================================================================
   Responsividade
   =================================================================== */
@media (max-width: 1024px) {
  .cm-ig__grid { grid-template-columns: repeat(4, 1fr); }
  .cm-ig__grid--feed { grid-template-columns: repeat(2, 1fr); } /* tablet 2×3 */
  .cm-video { padding: 96px 30px; }
  .cm-video__title { font-size: 38px; }
}
@media (max-width: 860px) {
  .px-nav-links { display: none !important; }
  .px-h1  { font-size: 12vw !important; }
  .px-row { grid-template-columns: 1fr !important; gap: 0 !important; }
  .px-row-img { order: -1 !important; height: 64vw !important; }
  .px-ghost { font-size: 120px !important; }
  .px-stats { grid-template-columns: 1fr 1fr !important; }
  .px-steps { grid-template-columns: 1fr !important; }
  .px-pad  { padding-left: 22px !important; padding-right: 22px !important; }
  .px-big  { font-size: 34px !important; }
  .px-huge { font-size: 44px !important; }
}
@media (max-width: 640px) {
  .cm-ig { padding: 80px 18px; }
  .cm-ig__grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .cm-ig__card { border-radius: 12px; }
  /* mobile: carrossel horizontal com scroll-snap (só a variante da home) */
  .cm-ig__grid--feed {
    display: flex; grid-template-columns: none;
    overflow-x: auto; scroll-snap-type: x mandatory;
    gap: 12px; padding-bottom: 6px;
    margin: 0 -18px; padding-left: 18px; padding-right: 18px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .cm-ig__grid--feed::-webkit-scrollbar { display: none; }
  .cm-ig__grid--feed .cm-ig__card {
    flex: 0 0 76%; scroll-snap-align: start; margin: 0;
  }
  .cm-ig__grid--feed .cm-ig__overlay { opacity: 1; } /* sem hover no touch */
  .cm-ig__head { margin-bottom: 32px; }
  .cm-ig__title { font-size: 30px; }
  .cm-video { padding: 72px 16px; }
  .cm-video__title { font-size: 30px; }
  .cm-video__lead { font-size: 16px; }
  .cm-video__frame { border-radius: 16px; }
  .cm-video__stage .cm-video__frame { border-radius: 22px; clip-path: inset(4% 3% round 22px); transform: translateY(40px) scale(.94); filter: blur(8px); }
  .cm-video__stage.is-in .cm-video__frame { border-radius: 16px; clip-path: inset(0% 0% round 16px); }
}

/* ===================================================================
   Preferência de redução de movimento — desliga parallax/tilt/zoom/blur
   =================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .cm-video__stage .cm-video__frame { opacity: 1; transform: none; filter: none; clip-path: none; border-radius: 22px; }
  .cm-ig__card { opacity: 1; transform: none; }
  .cm-ig__card:hover img { transform: none; }
}
