/* =========================================================================
   home-v3.css — Estrutura (mosaico/cinema), Níveis (cards/imersivo),
   Footer "Tinta Noturna". Builds on styles.css design tokens.
   ========================================================================= */

/* ── Shared section header (estrutura + niveis) ───────────────────────── */
.sec-head-v3 {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(28px, 5vw, 80px);
  align-items: end;
  margin-bottom: clamp(40px, 5vw, 64px);
}
@media (max-width: 880px) {
  .sec-head-v3 { grid-template-columns: 1fr; gap: 22px; align-items: start; }
}
.sec-head-v3 .display-lg { margin-top: 20px; }

/* =========================================================================
   ESTRUTURA — vídeo grande + mosaico de espaços
   ========================================================================= */
.estrutura { background: var(--bg); }

/* Cinematic video centerpiece */
.estr-video {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 21 / 9;
  background: var(--green-deep);
  isolation: isolate;
  cursor: pointer;
  box-shadow: 0 30px 80px -30px rgba(14, 32, 29, 0.45);
}
@media (max-width: 720px) { .estr-video { aspect-ratio: 4 / 3; } }
.estr-video .ph { position: absolute; inset: 0; border-radius: 0; }
.estr-video .ph::before {
  background-image: repeating-linear-gradient(135deg,
    rgba(255,255,255,0.05) 0 1px, transparent 1px 16px);
}
.estr-video-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8,30,28,0.10) 0%, transparent 30%),
    linear-gradient(0deg, rgba(8,30,28,0.78) 0%, rgba(8,30,28,0.10) 55%, transparent 100%);
}
.estr-video-content {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 18px;
  padding: clamp(24px, 4vw, 52px);
  pointer-events: none;
}
.estr-video-content .eyebrow { color: rgba(243,239,228,0.78); }
.estr-video-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.estr-video-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--cream);
  background: rgba(255,255,255,0.16);
  padding: 4px 10px;
  border-radius: 100px;
  backdrop-filter: blur(8px);
}
.estr-video-title {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--cream);
  font-size: clamp(26px, 3.6vw, 50px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  max-width: 20ch;
}
.estr-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  width: clamp(64px, 8vw, 104px);
  height: clamp(64px, 8vw, 104px);
  border-radius: 50%;
  border: none;
  background: var(--green-bright);
  color: var(--text-inverse);
  display: grid;
  place-items: center;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 18px 50px -10px rgba(5,196,100,0.6);
  transition: transform 0.3s var(--ease);
}
.estr-video-play::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1.5px solid rgba(5,196,100,0.5);
  animation: estrPulse 2.6s var(--ease) infinite;
}
@keyframes estrPulse {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.45); opacity: 0; }
}
.estr-video:hover .estr-video-play { transform: translate(-50%, -50%) scale(1.08); }

/* image-slot poster sits behind scrim */
.estr-video image-slot {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  z-index: 1;
}

/* ── Mosaico (bento) de espaços ──────────────────────────────────────── */
.estr-mosaic {
  margin-top: clamp(20px, 2.4vw, 30px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: clamp(150px, 15vw, 215px);
  gap: clamp(12px, 1.4vw, 18px);
}
.estr-tile {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: var(--green-paler);
  isolation: isolate;
}
.estr-tile image-slot {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}
.estr-tile-label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  padding: 16px 16px 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
  background: linear-gradient(0deg, rgba(8,30,28,0.72) 0%, rgba(8,30,28,0.08) 70%, transparent 100%);
}
.estr-tile-name {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--cream);
  font-size: clamp(15px, 1.3vw, 19px);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.estr-tile-num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(243,239,228,0.7);
  flex-shrink: 0;
}
/* Bento spans */
.estr-tile--feature { grid-column: span 2; grid-row: span 2; }
.estr-tile--wide { grid-column: span 2; }
@media (max-width: 880px) {
  .estr-mosaic { grid-template-columns: repeat(2, 1fr); }
  .estr-tile--feature { grid-column: span 2; grid-row: span 1; }
  .estr-tile--wide { grid-column: span 2; }
}
@media (max-width: 520px) {
  .estr-mosaic { grid-template-columns: 1fr; }
  .estr-tile, .estr-tile--feature, .estr-tile--wide { grid-column: span 1; }
}

/* ── Cinema variant: filmstrip horizontal ────────────────────────────── */
.estr-strip {
  margin-top: clamp(20px, 2.4vw, 30px);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 1fr);
  gap: clamp(12px, 1.4vw, 18px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  scrollbar-width: thin;
}
.estr-strip::-webkit-scrollbar { height: 6px; }
.estr-strip::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 100px; }
.estr-strip .estr-tile {
  aspect-ratio: 3 / 4;
  scroll-snap-align: start;
}

/* =========================================================================
   NÍVEIS V3 — cards com foto / imersivo
   ========================================================================= */
.niveis-v3 { background: #f1f1f1; }

/* ── Cards variant ───────────────────────────────────────────────────── */
.nv3-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(18px, 1.8vw, 26px);
  perspective: 1800px;
}
/* 1ª linha: 2 cards maiores */
.nv3-grid > .nv3-card:nth-child(1),
.nv3-grid > .nv3-card:nth-child(2) { grid-column: span 3; }
@media (min-width: 921px) {
  .nv3-grid > .nv3-card:nth-child(1),
  .nv3-grid > .nv3-card:nth-child(2) { min-height: 520px; }
  .nv3-grid > .nv3-card:nth-child(1) .nv3-photo,
  .nv3-grid > .nv3-card:nth-child(2) .nv3-photo { height: 420px; }
  .nv3-grid > .nv3-card:nth-child(1) .nv3-photo img,
  .nv3-grid > .nv3-card:nth-child(2) .nv3-photo img {
    height: 150%;
    bottom: auto;
  }
}
/* 2ª linha: 3 cards */
.nv3-grid > .nv3-card:nth-child(3),
.nv3-grid > .nv3-card:nth-child(4),
.nv3-grid > .nv3-card:nth-child(5) { grid-column: span 2; }

.nv3-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform;
  box-shadow: 0 2px 8px -4px rgba(14,32,29,0.12);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.4s var(--ease);
}
.nv3-card:hover {
  box-shadow: 0 30px 70px -30px rgba(9,114,116,0.45), 0 10px 26px -16px rgba(14,84,79,0.3);
  border-color: transparent;
}
/* Borda com brilho gradiente */
.nv3-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  pointer-events: none;
  z-index: 4;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--green-bright) 70%, transparent),
    transparent 35%, transparent 65%,
    color-mix(in srgb, var(--green-teal) 60%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}
.nv3-card:hover::after { opacity: 0.9; }

.nv3-photo {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--green-deep);
  transform: translateZ(0.01px);
}
/* fotos maiores (1ª linha) em paisagem */
.nv3-grid > .nv3-card:nth-child(1) .nv3-photo,
.nv3-grid > .nv3-card:nth-child(2) .nv3-photo { aspect-ratio: 16 / 10; }

.nv3-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}
.nv3-card:hover .nv3-photo img { transform: scale(1.06); }
.nv3-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(0deg, rgba(8,30,28,0.6) 0%, transparent 42%),
    linear-gradient(90deg, rgba(14,84,79,0.3) 0%, transparent 55%);
}

/* Grid drift overlay */
.nv3-fx-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: soft-light;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(255,255,255,0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.5) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask: radial-gradient(120% 100% at 28% 0%, #000 0%, transparent 72%);
          mask: radial-gradient(120% 100% at 28% 0%, #000 0%, transparent 72%);
  animation: nv3GridDrift 26s linear infinite;
}
@keyframes nv3GridDrift { to { background-position: 40px 80px; } }

/* Glow ball flutuante */
.nv3-fx-glow {
  position: absolute;
  z-index: 1;
  width: 58%;
  aspect-ratio: 1;
  left: -10%;
  top: -16%;
  pointer-events: none;
  background: radial-gradient(circle, var(--green-bright) 0%, transparent 65%);
  opacity: 0.26;
  filter: blur(8px);
  mix-blend-mode: screen;
  animation: nv3GlowFloat 9s ease-in-out infinite alternate;
}
@keyframes nv3GlowFloat { to { transform: translate(24%, 20%) scale(1.18); } }

/* Linha de scan — corre no hover */
.nv3-fx-scan {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.nv3-card:hover .nv3-fx-scan { opacity: 1; }
.nv3-fx-scan::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 38%;
  top: -45%;
  background: linear-gradient(180deg, transparent, rgba(5,196,100,0.18), transparent);
}
.nv3-card:hover .nv3-fx-scan::before { animation: nv3Scan 2.4s cubic-bezier(.7,0,.3,1) infinite; }
@keyframes nv3Scan { 0% { top: -45%; } 60%, 100% { top: 115%; } }

/* Cantos */
.nv3-fx-corner {
  position: absolute;
  z-index: 2;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255,255,255,0.55);
  pointer-events: none;
  opacity: 0.55;
  transition: opacity 0.4s var(--ease);
}
.nv3-card:hover .nv3-fx-corner { opacity: 0.95; }
.nv3-fx-corner.tl { top: 14px; left: 14px; border-right: 0; border-bottom: 0; }
.nv3-fx-corner.br { bottom: 14px; right: 14px; border-left: 0; border-top: 0; }
.nv3-num {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--cream);
  background: rgba(8,30,28,0.4);
  backdrop-filter: blur(6px);
  padding: 4px 9px;
  border-radius: 100px;
}
.nv3-age {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green-bright);
}
.nv3-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 22px 24px;
  flex: 1;
}
.nv3-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(20px, 1.7vw, 24px);
  letter-spacing: -0.015em;
  color: var(--fg);
  line-height: 1.05;
}
.nv3-desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.nv3-link {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-deep);
  transition: gap 0.3s var(--ease), color 0.2s;
}
.nv3-card:hover .nv3-link { gap: 14px; color: var(--green-teal); }

/* 1ª linha (cards maiores): título/texto/respiro maiores */
.nv3-grid > .nv3-card:nth-child(1) .nv3-body,
.nv3-grid > .nv3-card:nth-child(2) .nv3-body { padding: 26px 28px 28px; }
.nv3-grid > .nv3-card:nth-child(1) .nv3-title,
.nv3-grid > .nv3-card:nth-child(2) .nv3-title { font-size: clamp(24px, 2.2vw, 30px); }
.nv3-grid > .nv3-card:nth-child(1) .nv3-desc,
.nv3-grid > .nv3-card:nth-child(2) .nv3-desc { font-size: 15px; -webkit-line-clamp: 3; }

/* Responsivo */
@media (max-width: 920px) {
  .nv3-grid { grid-template-columns: 1fr 1fr; perspective: none; }
  .nv3-grid > .nv3-card:nth-child(n) { grid-column: auto; }
  .nv3-grid > .nv3-card:nth-child(1) .nv3-photo,
  .nv3-grid > .nv3-card:nth-child(2) .nv3-photo { aspect-ratio: 4 / 5; }
  .nv3-grid > .nv3-card:nth-child(5) { grid-column: 1 / -1; }
  .nv3-grid > .nv3-card:nth-child(5) .nv3-photo { aspect-ratio: 16 / 9; }
  .nv3-card { transform: none !important; }
}
@media (max-width: 560px) {
  .nv3-grid { grid-template-columns: 1fr; }
  .nv3-grid > .nv3-card:nth-child(5) { grid-column: auto; }
  .nv3-grid > .nv3-card:nth-child(5) .nv3-photo { aspect-ratio: 4 / 5; }
}
@media (prefers-reduced-motion: reduce) {
  .nv3-fx-grid, .nv3-fx-glow, .nv3-fx-scan::before { animation: none !important; }
}

/* ── Imersivo variant: scroll-snap portrait com overlay ──────────────── */
.nv3-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(270px, 1fr);
  gap: clamp(14px, 1.5vw, 20px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 10px;
  scrollbar-width: thin;
}
.nv3-strip::-webkit-scrollbar { height: 6px; }
.nv3-strip::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 100px; }
.nv3-imm {
  position: relative;
  aspect-ratio: 3 / 4.2;
  border-radius: 18px;
  overflow: hidden;
  scroll-snap-align: start;
  isolation: isolate;
  background: var(--green-deep);
}
.nv3-imm img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}
.nv3-imm:hover img { transform: scale(1.05); }
.nv3-imm::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(7,26,23,0.92) 0%, rgba(7,26,23,0.25) 48%, rgba(7,26,23,0.05) 100%);
}
.nv3-imm-body {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: 24px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nv3-imm-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--green-bright);
}
.nv3-imm-age {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(243,239,228,0.7);
}
.nv3-imm-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(22px, 2vw, 28px);
  letter-spacing: -0.018em;
  color: var(--cream);
  line-height: 1.02;
}
.nv3-imm-desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(243,239,228,0.78);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.5s var(--ease), opacity 0.4s var(--ease), margin 0.4s var(--ease);
}
.nv3-imm:hover .nv3-imm-desc { max-height: 140px; opacity: 1; margin-top: 2px; }
.nv3-imm-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream);
  transition: gap 0.3s var(--ease);
}
.nv3-imm:hover .nv3-imm-link { gap: 14px; }

.nv3-foot {
  margin-top: clamp(32px, 4vw, 48px);
  display: flex;
  justify-content: center;
}
