/* ==========================================================================
   RESIDÊNCIA CARDOSO — DESIGN SYSTEM EDITORIAL MINIMALISTA
   Arquitetura de Alto Padrão | Estrutura & Tipografia Editorial
   ========================================================================== */

/* --- Variáveis & Paleta Neutra --- */
:root {
  --bg-primary: #0d0f11;
  --bg-secondary: #14171a;
  
  --text-primary: #ffffff;
  --text-secondary: #e8edf2;
  --text-muted: #b8c2cc;
  --accent-refined: #f5ebe0;
  
  --font-editorial: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --header-height: 90px;
  --content-max-width: 620px;
  --gutter-desktop: 7vw;
  --gutter-mobile: 1.5rem;
  
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  overscroll-behavior-y: none;
}

body {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--bg-primary);
  line-height: 1.7;
  overscroll-behavior: none;
  overscroll-behavior-y: none;
}

/* --- Camada 1 & 2: Container Único de Vídeo Contínuo e Overlay Escuro --- */
.canvas-video-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1; /* Camada 1 (base fixa) */
  pointer-events: none;
  background-color: var(--bg-primary);
  overflow: hidden;
}

/* Camada 1: Vídeo de Fundo */
.bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  pointer-events: none;
}

/* Camada 2: Overlay Escuro com Vinheta Protetora no Topo e Base */
.video-overlay-tint {
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(to bottom, rgba(13, 15, 17, 0.75) 0%, transparent 18%, transparent 82%, rgba(13, 15, 17, 0.75) 100%),
    radial-gradient(circle at 50% 35%, rgba(13, 15, 17, 0.42) 0%, rgba(10, 11, 13, 0.85) 100%);
  z-index: 2;
}

/* --- Camada 4: Cabeçalho Fixo Minimalista --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 100; /* Camada 4 */
  display: flex;
  align-items: center;
  pointer-events: none; /* Deixa cliques passarem exceto nos itens interativos */
  transition: background-color var(--transition-smooth), border-color var(--transition-smooth);
}

.header-inner {
  width: 100%;
  max-width: 1720px;
  margin: 0 auto;
  padding: 0 var(--gutter-desktop);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: auto;
}

.brand-logo {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  color: var(--text-primary);
  letter-spacing: 0.35em;
  transition: opacity var(--transition-smooth);
}

.brand-logo:hover {
  opacity: 0.75;
}

.brand-title {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.brand-sub {
  font-size: 0.62rem;
  letter-spacing: 0.52em;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-top: 1px;
}

.header-nav {
  display: flex;
  align-items: center;
}

.nav-chapters {
  display: flex;
  list-style: none;
  gap: 2.5rem;
}

.nav-chapters a {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-secondary);
  transition: color var(--transition-smooth), opacity var(--transition-smooth);
}

.nav-chapters .chapter-num {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.nav-chapters a:hover,
.nav-chapters a.is-active {
  color: var(--text-primary);
}

.nav-chapters a.is-active .chapter-num {
  color: var(--accent-refined);
}

.header-actions {
  display: flex;
  align-items: center;
}

.header-status {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 300;
}

/* --- Camada 3: Fluxo Editorial e Seções Principais (4 Seções Exatas) --- */
.editorial-flow {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  z-index: 10; /* Camada 3 */
}

.scene-section {
  position: relative;
  width: 100%;
  min-height: 140vh;
  min-height: 140dvh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-height) + 2rem) var(--gutter-desktop) 4rem;
  /* Sem fundos próprios para preservar o vídeo contínuo */
  background: transparent;
}

.scene-content {
  will-change: opacity, transform;
}

/* --- Hierarquia Editorial e Tipografia --- */
.editorial-tagline {
  margin-bottom: 1.5rem;
}

.section-indicator {
  display: inline-block;
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent-refined);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.editorial-title {
  font-family: var(--font-editorial);
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: 2rem;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.7);
}

.italic-serif {
  font-style: italic;
  font-weight: 300;
  color: var(--accent-refined);
}

.editorial-lead {
  font-family: var(--font-sans);
  font-size: clamp(1rem, 1.25vw, 1.2rem);
  font-weight: 300;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.editorial-body {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

/* Blocos de Detalhes e Especificações Estruturais */
.architecture-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.detail-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.detail-label {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-refined);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.detail-desc {
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.5;
  color: var(--text-secondary);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

/* --- Alinhamento das 4 Seções --- */

/* 1. SEÇÃO ABERTURA: Centralizada */
.scene-abertura {
  justify-content: center;
  text-align: center;
}

.content-center {
  max-width: 860px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
}

.hero-heading {
  font-size: clamp(3rem, 6.5vw, 5.8rem);
  margin-bottom: 1.8rem;
}

.scene-abertura .editorial-lead {
  max-width: 620px;
  margin-bottom: 3.5rem;
}

.meta-spec-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  margin-bottom: 4rem;
  padding: 1.5rem 0;
}

.spec-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: center;
}

.spec-value {
  font-family: var(--font-editorial);
  font-size: clamp(1.6rem, 2.2vw, 2.4rem);
  font-weight: 400;
  color: var(--text-primary);
}

.spec-caption {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-muted);
}

.spec-divider {
  width: 1px;
  height: 36px;
  background-color: rgba(255, 255, 255, 0.1);
}

.scroll-cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
}

.scroll-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
}

.scroll-arrow {
  font-size: 1rem;
  animation: floatArrow 2.4s ease-in-out infinite;
}

@keyframes floatArrow {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(6px); opacity: 0.9; }
}

/* 2. SEÇÃO ENTRADA E ARQUITETURA: Alinhada à Esquerda */
.scene-arquitetura {
  justify-content: flex-start;
}

/* 3. SEÇÃO LIVING PRINCIPAL: Alinhada à Direita */
.scene-living {
  justify-content: flex-end;
}

/* 4. SEÇÃO ÁREA EXTERNA E PISCINA: Alinhada à Esquerda */
.scene-externa {
  justify-content: flex-start;
}

/* Conteúdo Alinhado à Esquerda */
.content-left {
  max-width: var(--content-max-width);
  width: 100%;
  text-align: left;
  z-index: 2;
}

/* Conteúdo Alinhado à Direita */
.content-right {
  max-width: var(--content-max-width);
  width: 100%;
  text-align: left;
  margin-left: auto;
  z-index: 2;
}

/* Área Livre Espacial Preservada para o Vídeo */
.empty-spatial-zone {
  flex: 1;
  min-width: 0;
  pointer-events: none;
}

/* --- Responsividade Editorial --- */
@media (max-width: 1024px) {
  :root {
    --gutter-desktop: 5vw;
    --content-max-width: 520px;
  }
  
  .nav-chapters {
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 75px;
    --gutter-desktop: var(--gutter-mobile);
  }

  .site-header {
    background: rgba(13, 15, 17, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .nav-chapters {
    display: none; /* Mantém cabeçalho ultra limpo no mobile */
  }

  .header-status {
    font-size: 0.65rem;
  }

  .scene-section {
    padding: calc(var(--header-height) + 2rem) var(--gutter-mobile) 3.5rem;
    min-height: 140dvh;
    justify-content: flex-start;
  }

  .content-left,
  .content-right,
  .content-center {
    max-width: 100%;
    margin: 0;
    text-align: left;
  }

  .scene-abertura {
    text-align: left;
    align-items: flex-start;
  }

  .content-center {
    align-items: flex-start;
  }

  .meta-spec-grid {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
    width: 100%;
  }

  .spec-item {
    text-align: left;
  }

  .spec-divider {
    display: none;
  }

  .scroll-cue {
    align-self: flex-start;
    align-items: flex-start;
  }

  .empty-spatial-zone {
    display: none;
  }

  .architecture-specs {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}
