/* =====================================================================
   ECOS DE HUMANIDADE — Sistema de design
   Extensão digital de uma instalação que reage à presença, ao gesto
   e ao tempo. Paleta frio→quente, tipografia de alto contraste,
   movimento orgânico e contido.
   ===================================================================== */

/* ---------------------------------------------------------------------
   0 · Variáveis e fundações
   --------------------------------------------------------------------- */
:root {
  /* Paleta (afinada a partir do relatório) */
  --navy:        #1B2A4A;
  --navy-deep:   #10182B;
  --cold:        #0A0F1C;   /* azul-quase-preto do estado inicial */
  --gold:        #AF8C4F;
  --gold-bright: #C8A765;
  --cream:       #F6F4EE;
  --grey-light:  #ECEAE4;
  --ink:         #2B2B33;
  --ink-dark:    #E9E7E0;   /* corpo sobre escuro */
  --white:       #FFFFFF;
  --soft-red:    #C46A5A;

  /* Tons derivados */
  --muted:       rgba(233, 231, 224, 0.62);
  --faint:       rgba(233, 231, 224, 0.60);
  --hairline:    rgba(175, 140, 79, 0.22);
  --hairline-soft: rgba(233, 231, 224, 0.10);
  --surface:     rgba(255, 255, 255, 0.022);
  --surface-2:   rgba(255, 255, 255, 0.04);

  /* Temperatura de cor — recalculada por JS conforme o scroll.
     Valores por defeito: estado frio (topo). */
  --bg-top:    #0A0F1C;
  --bg-bottom: #10182B;
  --glow-color: rgba(27, 42, 74, 0.55);
  --glow-op:   0.5;
  --glow-x:    50%;
  --glow-y:    38%;
  --accent:    var(--gold);   /* acento "atual", aquece subtilmente */

  /* Tipografia */
  --serif: "Playfair Display", "Georgia", "Times New Roman", serif;
  --sans:  "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  /* Ritmo */
  --container: 1180px;
  --gutter: clamp(1.4rem, 5vw, 5rem);
  --section-pad: clamp(5.5rem, 13vh, 11rem);
  --radius: 4px;

  --ease: cubic-bezier(0.22, 0.7, 0.2, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);

  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sans);
  font-weight: 300;
  color: var(--ink-dark);
  background: var(--cold);
  line-height: 1.7;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Entrada suave da página */
body.is-loading { opacity: 0; }
body { opacity: 1; transition: opacity 0.9s var(--ease); }

img { max-width: 100%; height: auto; display: block; }
::selection { background: rgba(175, 140, 79, 0.32); color: var(--white); }

a { color: inherit; }

/* Foco visível e elegante para teclado */
:focus-visible {
  outline: 1px solid var(--gold-bright);
  outline-offset: 4px;
  border-radius: 2px;
}

.skip-link {
  position: fixed;
  top: -120px; left: 1rem;
  z-index: 200;
  background: var(--navy);
  color: var(--cream);
  padding: 0.7rem 1.1rem;
  font: 500 0.75rem/1 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--hairline);
  transition: top 0.3s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* Destino do skip link (foco programático, sem contorno visual) */
main:focus { outline: none; }

/* ---------------------------------------------------------------------
   1 · Camada de fundo (temperatura de cor)
   --------------------------------------------------------------------- */
.bg-field {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(178deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  transition: background 0.5s linear;
}
.bg-field__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(56vw 56vw at var(--glow-x) var(--glow-y),
              var(--glow-color), transparent 68%);
  opacity: var(--glow-op);
  transition: opacity 0.7s var(--ease-soft), background 0.5s linear;
  will-change: opacity;
}
/* Grão subtil para profundidade (sem peso de imagem) */
.bg-field__grain {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* Rasto do cursor (eco) */
.trail-canvas {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* Barra de progresso de leitura */
.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 90;
  background: rgba(255, 255, 255, 0.04);
}
.scroll-progress__bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  box-shadow: 0 0 12px rgba(175, 140, 79, 0.6);
  transform-origin: left;
}

/* ---------------------------------------------------------------------
   2 · Layout base de secção + cabeçalho replicado do PDF
   --------------------------------------------------------------------- */
.section {
  position: relative;
  padding: var(--section-pad) var(--gutter);
  z-index: 1;
}
.section-inner {
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
}

.eyebrow {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1.7rem;
}
.eyebrow--inline {
  margin: 3.6rem 0 1.4rem;
  color: var(--faint);
  font-size: 0.64rem;
  letter-spacing: 0.3em;
}

/* Marca de secção: número serif dourado + linha fina + ponto */
.section-marker {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-bottom: 0.6rem;
}
.section-num {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 3.2vw, 2.7rem);
  color: var(--gold);
  line-height: 1;
  font-feature-settings: "lnum";
}
.section-marker .marker-line {
  flex: 0 0 auto;
  width: clamp(48px, 12vw, 150px);
  height: 1px;
  background: linear-gradient(90deg, var(--gold), rgba(175, 140, 79, 0.05));
}
.section-marker .marker-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px rgba(175, 140, 79, 0.45);
}
.section-marker--center { justify-content: center; }

.section-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.6rem, 7vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--cream);
  margin: 0.2rem 0 2.8rem;
}
.section-head--center { text-align: center; }

/* Texto corrido */
.prose p { margin: 0 0 1.4rem; color: var(--ink-dark); }
.prose p:last-child { margin-bottom: 0; }
.prose em { color: var(--gold-bright); font-style: italic; }
.measure { max-width: 64ch; }

.subhead {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.74rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 3.6rem 0 1.8rem;
}

/* ---------------------------------------------------------------------
   3 · Revelação ao scroll (entra desfocado/frio, ganha foco/calor)
   --------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  filter: blur(7px) saturate(0.45);
  transition:
    opacity 1.15s var(--ease),
    transform 1.15s var(--ease),
    filter 1.15s var(--ease);
}
.reveal.in-view {
  opacity: 1;
  transform: none;
  filter: blur(0) saturate(1);
}
.reveal-child {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
}
.in-view .reveal-child { opacity: 1; transform: none; }

/* ---------------------------------------------------------------------
   4 · HERO
   --------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 7rem var(--gutter) 5rem;
  overflow: hidden;
}
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
}
.hero__content {
  position: relative;
  z-index: 2;
  max-width: 980px;
}
.hero__eyebrow {
  font-weight: 500;
  font-size: clamp(0.66rem, 1.6vw, 0.78rem);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 2rem;
  opacity: 0;
  animation: rise 1.2s var(--ease) 0.3s forwards;
}
.hero__title {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(3.2rem, 15vw, 11rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
  color: var(--cream);
  margin: 0;
}
.hero__title-line { display: block; opacity: 0; transform: translateY(40px); }
.hero__title-line { animation: rise 1.4s var(--ease) 0.5s forwards; }
.hero__title-line--em {
  font-style: italic;
  font-weight: 500;
  color: var(--white);
  animation-delay: 0.72s;
  background: linear-gradient(96deg, var(--cream), var(--gold-bright) 70%, var(--soft-red));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero__subtitle {
  font-weight: 300;
  font-size: clamp(0.95rem, 2.2vw, 1.3rem);
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 2.2rem auto 0;
  line-height: 1.6;
  opacity: 0;
  animation: rise 1.4s var(--ease) 0.95s forwards;
}
.hero__meta {
  font-weight: 400;
  font-size: clamp(0.66rem, 1.5vw, 0.78rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 3.4rem 0 0;
  opacity: 0;
  animation: rise 1.4s var(--ease) 1.2s forwards;
}
.hero__scroll {
  position: absolute;
  bottom: 2.4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  color: var(--faint);
  opacity: 0;
  animation: rise 1.4s var(--ease) 1.5s forwards;
}
.hero__scroll-word {
  font-size: 0.62rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}
.hero__scroll-line {
  width: 1px; height: 56px;
  background: linear-gradient(180deg, var(--gold), transparent);
  position: relative;
  overflow: hidden;
}
.hero__scroll-line::after {
  content: "";
  position: absolute;
  top: -50%; left: 0;
  width: 100%; height: 50%;
  background: var(--gold-bright);
  animation: scrollPulse 2.2s var(--ease-soft) infinite;
}
@keyframes scrollPulse {
  0%   { transform: translateY(-100%); opacity: 0; }
  40%  { opacity: 1; }
  100% { transform: translateY(300%); opacity: 0; }
}
@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------------
   5 · EXCERTO
   --------------------------------------------------------------------- */
.section--excerto { padding-top: clamp(6rem, 16vh, 12rem); }
.excerto-quote {
  margin: 0 auto;
  max-width: 56ch;
  text-align: center;
  border: 0;
  padding: 0;
}
.excerto-quote p {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.25rem, 2.8vw, 1.9rem);
  line-height: 1.5;
  color: var(--cream);
  margin: 0 0 1.5rem;
}
.excerto-quote p:first-child::first-letter {
  color: var(--gold);
}
.credits {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1.6rem, 5vw, 4.5rem);
  margin: 4.5rem auto 0;
  max-width: 760px;
  border-top: 1px solid var(--hairline-soft);
  padding-top: 2.6rem;
}
.credits__item { text-align: center; }
.credits dt {
  font-size: 0.6rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.6rem;
}
.credits dd {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-dark);
  letter-spacing: 0.02em;
}

/* ---------------------------------------------------------------------
   6 · INTRODUÇÃO — pergunta + citação
   --------------------------------------------------------------------- */
.lead-question {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.5rem, 4vw, 2.7rem);
  line-height: 1.32;
  color: var(--white);
  max-width: 22ch;
  margin: 3.4rem 0 0;
  position: relative;
  padding-left: clamp(1.2rem, 3vw, 2.2rem);
  border-left: 2px solid var(--gold);
}
.pull-quote {
  margin: clamp(4rem, 9vw, 7rem) auto 0;
  max-width: 28ch;
  text-align: center;
  position: relative;
}
.pull-quote blockquote {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(1.6rem, 4.6vw, 3.2rem);
  line-height: 1.28;
  color: var(--cream);
}
.pull-quote::before,
.pull-quote::after {
  font-family: var(--serif);
  color: var(--gold);
  opacity: 0.6;
  font-size: clamp(3rem, 9vw, 6rem);
  line-height: 0;
  position: absolute;
}
.pull-quote::before { content: "\201C"; top: 0.4em; left: -0.1em; }
.pull-quote::after  { content: "\201D"; bottom: -0.1em; right: -0.05em; }
.pull-quote--final blockquote { color: var(--white); }

/* ---------------------------------------------------------------------
   7 · CONCEITO — três dimensões com micro-interações
   --------------------------------------------------------------------- */
.dimensions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  margin: 3rem 0 0;
}
.dim {
  position: relative;
  padding: 2.4rem 2rem 2.6rem;
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.6s var(--ease), background 0.6s var(--ease), transform 0.6s var(--ease);
  outline-offset: 4px;
}
.dim:hover, .dim:focus-visible {
  border-color: var(--hairline);
  background: var(--surface-2);
  transform: translateY(-4px);
}
.dim__fx {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  opacity: 0.9;
}
.dim__body { position: relative; z-index: 1; }
.dim__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.7rem;
  color: var(--cream);
  margin: 0 0 0.3rem;
}
.dim__lead {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--gold);
  margin: 0 0 1.2rem;
}
.dim p { font-size: 0.92rem; color: var(--muted); margin: 0; }
.note-echo { margin-top: clamp(2.6rem, 6vw, 4rem); color: var(--muted); }

/* ---------------------------------------------------------------------
   8 · ESTADO DA ARTE — galeria
   --------------------------------------------------------------------- */
.gallery {
  list-style: none;
  margin: 3rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
}
.art figure { margin: 0; height: 100%; }
.art__media {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--hairline-soft);
}
.art__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.85) brightness(0.86) contrast(1.02);
  transition: transform 1.1s var(--ease), filter 0.7s var(--ease);
}
.art__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 120%, rgba(175,140,79,0.32), transparent 60%);
  opacity: 0;
  transition: opacity 0.6s var(--ease);
  pointer-events: none;
}
.art:hover .art__media img { transform: scale(1.06); filter: saturate(1.05) brightness(1); }
.art:hover .art__media { border-color: var(--hairline); }
.art:hover .art__media::after { opacity: 1; }
.art figcaption { padding: 1.1rem 0.2rem 0; }
.art__index {
  font-family: var(--serif);
  font-size: 0.85rem;
  color: var(--gold);
  letter-spacing: 0.05em;
}
.art__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.18rem;
  color: var(--cream);
  margin: 0.2rem 0 0.5rem;
  line-height: 1.2;
}
.art__author { font-weight: 400; font-size: 0.82rem; color: var(--faint); font-style: italic; }
.art figcaption p { font-size: 0.82rem; color: var(--muted); margin: 0; line-height: 1.55; }
.closing-note { margin-top: clamp(2.8rem, 6vw, 4rem); }

/* ---------------------------------------------------------------------
   9 · PROPOSTA — pilares + ícones de linha
   --------------------------------------------------------------------- */
.pillars {
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
}
.pillar {
  padding: 2.2rem 1.6rem;
  border-top: 1px solid var(--hairline);
  transition: transform 0.5s var(--ease);
}
.pillar:hover { transform: translateY(-5px); }
.pillar__icon {
  display: block;
  width: 46px; height: 46px;
  margin-bottom: 1.4rem;
  color: var(--gold);
}
.pillar__icon svg { width: 100%; height: 100%; }
.pillar__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--cream);
  margin: 0 0 0.7rem;
}
.pillar p { font-size: 0.88rem; color: var(--muted); margin: 0; }

/* Traço animado dos ícones de linha */
.icon-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: var(--len, 400);
  stroke-dashoffset: var(--len, 400);
  transition: stroke-dashoffset 1.6s var(--ease);
}
.in-view .pillar .icon-line { stroke-dashoffset: 0; }

/* ---------------------------------------------------------------------
   10 · INSTALAÇÃO — texto + planta SVG
   --------------------------------------------------------------------- */
.install-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  margin-top: 1rem;
}
.room { margin: 0; }
.room__cap {
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.2rem;
}
.room__svg {
  width: 100%;
  height: auto;
  font-family: var(--sans);
}
.room__floor {
  fill: rgba(255, 255, 255, 0.012);
  stroke: var(--hairline-soft);
  stroke-width: 1;
}
.room__wall { fill: var(--gold); opacity: 0.5; }
.room__box { fill: none; stroke: var(--faint); stroke-width: 1.2; }
.room__box--accent { stroke: var(--gold); }
.room__dot { fill: none; stroke: var(--faint); stroke-width: 1.2; }
.room__zone {
  fill: rgba(175, 140, 79, 0.05);
  stroke: var(--hairline);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}
.room__person { fill: var(--gold); }
.room__cam { fill: none; stroke: var(--faint); stroke-width: 1.2; }
.room__door { fill: none; stroke: var(--gold); stroke-width: 1.4; }
.room__label {
  fill: var(--muted);
  font-size: 9px;
  letter-spacing: 0.04em;
}
.room__label--zone { fill: var(--gold); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; }
/* Destaque interativo ao passar */
.room__node { cursor: default; transition: opacity 0.4s var(--ease); }
.room__svg:hover .room__node { opacity: 0.4; }
.room__svg .room__node:hover { opacity: 1; }
.room__node:hover .room__box,
.room__node:hover .room__dot,
.room__node:hover .room__cam { stroke: var(--gold-bright); }
.room__node:hover .room__label { fill: var(--cream); }
.room__node:hover .room__zone { stroke: var(--gold); fill: rgba(175,140,79,0.1); }
/* Legenda alternativa para mobile (rótulos do SVG ficam pequenos demais) */
.room__legend { display: none; list-style: none; margin: 1.4rem 0 0; padding: 0; }
.room__legend li { position: relative; padding-left: 0.95rem; font-size: 0.8rem; color: var(--muted); }
.room__legend li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }

/* ---------------------------------------------------------------------
   11 · EXPERIÊNCIA — jornada com linha que flui
   --------------------------------------------------------------------- */
.journey {
  position: relative;
  list-style: none;
  margin: 3rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.4rem, 4vw, 3rem);
}
.journey__flow {
  position: absolute;
  top: 22px; left: 6%; right: 6%;
  height: 1px;
  background: var(--hairline-soft);
  overflow: hidden;
}
.journey__flow::after {
  content: "";
  position: absolute;
  top: 0; left: -30%;
  width: 30%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
  animation: flowLine 4.5s linear infinite;
}
@keyframes flowLine { to { left: 110%; } }
.journey__step { position: relative; padding-top: 3.6rem; }
.journey__num {
  position: absolute;
  top: 0; left: 0;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: var(--bg-bottom);
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--gold);
}
.journey__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.6rem;
  color: var(--cream);
  margin: 0 0 0.3rem;
}
.journey__lead { font-size: 0.82rem; color: var(--gold); margin: 0 0 1rem; letter-spacing: 0.03em; }
.journey__step p:last-child { font-size: 0.9rem; color: var(--muted); margin: 0; }

/* ---------------------------------------------------------------------
   12 · TECNOLOGIA — etapas numeradas
   --------------------------------------------------------------------- */
.stages {
  list-style: none;
  margin: 3rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.4rem;
}
.stage {
  position: relative;
  padding: 2.4rem 2.2rem 2.4rem 2.4rem;
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.5s var(--ease), background 0.5s var(--ease);
}
.stage:hover { border-color: var(--hairline); background: var(--surface-2); }
.stage__num {
  font-family: var(--serif);
  font-size: 2.4rem;
  color: var(--gold);
  opacity: 0.7;
  line-height: 1;
}
.stage__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.45rem;
  color: var(--cream);
  margin: 0.6rem 0 0.3rem;
}
.stage__lead { font-size: 0.8rem; color: var(--gold); margin: 0 0 1rem; }
.stage p:last-child { font-size: 0.9rem; color: var(--muted); margin: 0; }

/* ---------------------------------------------------------------------
   13 · TABELAS (Hardware / Orçamento)
   --------------------------------------------------------------------- */
.spec-table {
  margin: 2.6rem 0 0;
  border-top: 1px solid var(--hairline);
}
.spec-table__head,
.spec-table__row {
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) 1.6fr;
  gap: clamp(1rem, 4vw, 3rem);
  align-items: baseline;
}
.spec-table__head {
  padding: 1rem 0;
  border-bottom: 1px solid var(--hairline);
}
.spec-table__head span {
  font-size: 0.62rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
}
.spec-table__row {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--hairline-soft);
  transition: background 0.4s var(--ease), padding-left 0.4s var(--ease);
}
.spec-table__row:hover {
  background: linear-gradient(90deg, rgba(175,140,79,0.06), transparent);
  padding-left: 0.6rem;
}
.spec-table__k {
  font-family: var(--serif);
  font-size: 1.12rem;
  color: var(--cream);
}
.spec-table__k em { color: var(--gold); font-size: 0.8rem; font-style: italic; }
.spec-table__row span:last-child { color: var(--muted); font-size: 0.92rem; }
.spec-table--budget .spec-table__v {
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--ink-dark);
  text-align: right;
}
.spec-table--budget .spec-table__head span:last-child,
.spec-table--budget .spec-table__row span:last-child { text-align: right; }

.budget-total {
  margin-top: 1.6rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.8rem clamp(1.4rem, 4vw, 2.4rem);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  background: linear-gradient(100deg, rgba(175,140,79,0.10), rgba(196,106,90,0.06));
}
.budget-total__label {
  font-size: 0.7rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
}
.budget-total__value {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  color: var(--white);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------
   14 · SOFTWARE — bibliotecas
   --------------------------------------------------------------------- */
.libs {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--hairline-soft);
}
.libs li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1.2rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--hairline-soft);
}
.libs__name {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--cream);
  min-width: 200px;
}
.libs__desc { color: var(--muted); font-size: 0.9rem; }

/* ---------------------------------------------------------------------
   15 · FLUXO — diagrama com pulso + terminal
   --------------------------------------------------------------------- */
.flow {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 1.6rem 0 0;
  flex-wrap: nowrap;
  --flow-kicker: 1.5rem;       /* altura reservada para a etiqueta de cada coluna */
}
.flow__col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.flow__kicker {
  height: var(--flow-kicker);
  display: flex;
  align-items: flex-start;
  font-size: 0.56rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}
/* O(s) nó(s) centram-se verticalmente abaixo da etiqueta, pondo todas as
   colunas — e os conectores — no mesmo eixo horizontal. */
.flow__col > .flow__node,
.flow__col > .flow__stack { margin-top: auto; margin-bottom: auto; }
.flow__stack { display: flex; flex-direction: column; gap: 0.6rem; }
.flow__node {
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.85rem 0.9rem;
  font-size: 0.8rem;
  color: var(--ink-dark);
  line-height: 1.35;
  transition: border-color 0.4s var(--ease);
}
.flow__node--origin, .flow__node--soft {
  border-color: var(--hairline);
  background: var(--surface-2);
}
.flow__node-title { display: block; font-family: var(--serif); font-size: 1rem; color: var(--cream); }
.flow__node-sub { display: block; font-size: 0.72rem; color: var(--faint); margin-top: 0.2rem; }
/* Conector com pulso de luz a viajar */
.flow__link {
  flex: 0 0 clamp(20px, 3vw, 52px);
  position: relative;
  align-self: center;
  /* desce o conector metade da etiqueta, alinhando-o ao centro dos nós */
  margin: var(--flow-kicker) -1px 0;
  height: 1px;
  background: var(--hairline-soft);
  overflow: visible;
}
.flow__pulse {
  position: absolute;
  top: 50%; left: 0;
  width: 7px; height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 10px 2px rgba(200, 167, 101, 0.8);
  opacity: 0;
}
.in-view .flow__pulse { animation: pulseTravel 2.8s var(--ease-soft) infinite; }
/* Cascata previsível, dirigida a cada conector (independente da ordem dos divs) */
.in-view .flow__link:nth-of-type(1) .flow__pulse { animation-delay: 0s; }
.in-view .flow__link:nth-of-type(2) .flow__pulse { animation-delay: 0.18s; }
.in-view .flow__link:nth-of-type(3) .flow__pulse { animation-delay: 0.36s; }
.in-view .flow__link:nth-of-type(4) .flow__pulse { animation-delay: 0.54s; }
@keyframes pulseTravel {
  0%   { left: -4px; opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { left: calc(100% + 4px); opacity: 0; }
}

/* Bloco terminal */
.terminal {
  margin: 1.4rem 0 0;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: rgba(6, 10, 20, 0.6);
  overflow: hidden;
  backdrop-filter: blur(2px);
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid var(--hairline-soft);
  background: rgba(255, 255, 255, 0.015);
}
.terminal__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(175, 140, 79, 0.7);
}
.terminal__name {
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  color: var(--faint);
  text-transform: uppercase;
}
.terminal__code {
  margin: 0;
  padding: 1.6rem clamp(1.1rem, 3vw, 2rem);
  overflow-x: auto;
  font-family: "SFMono-Regular", "JetBrains Mono", "Consolas", ui-monospace, monospace;
  font-size: clamp(0.72rem, 1.5vw, 0.84rem);
  line-height: 1.85;
  color: rgba(233, 231, 224, 0.78);
  tab-size: 4;
}
.terminal__code .ln {
  display: block;
  opacity: 0;
  transform: translateX(-6px);
}
.terminal.in-code .ln {
  animation: lnReveal 0.5s var(--ease) forwards;
}
@keyframes lnReveal { to { opacity: 1; transform: none; } }
.terminal__code b { color: var(--gold-bright); font-weight: 600; }   /* palavras-chave */
.terminal__code s { color: var(--soft-red); text-decoration: none; font-weight: 500; } /* estados */

/* ---------------------------------------------------------------------
   16 · COMPONENTES — colunas + escala cromática
   --------------------------------------------------------------------- */
.components {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  margin-top: 1rem;
}
.component .subhead { margin-top: 0; }
.chroma { margin: clamp(3.4rem, 7vw, 5.5rem) 0 0; }
.chroma__cap {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.66rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}
.chroma__pole { color: var(--muted); }
.chroma__pole--warm { color: var(--soft-red); }
.chroma__arrow { flex: 1; height: 1px; background: linear-gradient(90deg, var(--faint), var(--soft-red)); }
.chroma__bar {
  height: 18px;
  border-radius: 20px;
  background: linear-gradient(90deg,
    #1B2A4A 0%, #2b3550 18%, #4a4a52 36%, #16161c 52%,
    #AF8C4F 74%, #F6F4EE 88%, #C46A5A 100%);
  box-shadow: 0 0 30px rgba(175, 140, 79, 0.18);
}
.chroma__ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 0.7rem;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--faint);
  flex-wrap: wrap;
  gap: 0.4rem;
}
.chroma__note { margin-top: 1.8rem; }

/* ---------------------------------------------------------------------
   17 · PÚBLICO-ALVO — etiquetas
   --------------------------------------------------------------------- */
.tags {
  list-style: none;
  margin: 2.2rem 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}
.tags li {
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--hairline);
  border-radius: 40px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink-dark);
  transition: background 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.tags li:hover { background: var(--gold); color: var(--navy-deep); border-color: var(--gold); }

/* ---------------------------------------------------------------------
   18 · PLANEAMENTO — timeline
   --------------------------------------------------------------------- */
.timeline {
  list-style: none;
  margin: 2.6rem 0 0;
  padding: 0;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 1px;
  background: linear-gradient(180deg, var(--gold), var(--hairline-soft));
}
.timeline__item {
  position: relative;
  padding: 0 0 2.4rem 2.8rem;
}
.timeline__item::before {
  content: "";
  position: absolute;
  left: 1px; top: 6px;
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: var(--bg-bottom);
}
.timeline__item:hover::before { background: var(--gold); box-shadow: 0 0 12px rgba(175,140,79,0.7); }
.timeline__phase {
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}
.timeline__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--cream);
  margin: 0.3rem 0 0.5rem;
}
.timeline__item p { margin: 0; font-size: 0.9rem; color: var(--muted); max-width: 60ch; }

/* ---------------------------------------------------------------------
   19 · DESAFIOS
   --------------------------------------------------------------------- */
.challenges { list-style: none; margin: 2.4rem 0 0; padding: 0; }
.challenge {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1.2rem, 4vw, 2.6rem);
  align-items: start;
  padding: 1.8rem 0;
  border-top: 1px solid var(--hairline-soft);
}
.challenge:first-child { border-top: 0; }
.challenge__num {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: var(--gold);
  opacity: 0.65;
  line-height: 1;
}
.challenge p { margin: 0; color: var(--ink-dark); max-width: 70ch; }

/* ---------------------------------------------------------------------
   20 · CONCLUSÃO / REFERÊNCIAS
   --------------------------------------------------------------------- */
.section--conclusao { padding-bottom: clamp(6rem, 14vh, 11rem); }
.refs { list-style: none; margin: 1rem 0 0; padding: 0; }
.refs li {
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--hairline-soft);
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}
.refs__author { color: var(--cream); }
.refs cite { color: var(--gold-bright); font-style: italic; }

/* ---------------------------------------------------------------------
   21 · Navegação (índice)
   --------------------------------------------------------------------- */
.index-nav {
  position: fixed;
  right: clamp(0.8rem, 2vw, 1.8rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 80;
}
.index-nav__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.index-nav a {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem;
  text-decoration: none;
  padding: 0.32rem 0;
  color: var(--muted);
  transition: color 0.4s var(--ease);
}
.index-nav__n {
  font-family: var(--serif);
  font-size: 0.62rem;
  width: 1.4em;
  text-align: right;
  opacity: 0.85;
  transition: opacity 0.4s var(--ease);
}
.index-nav__t {
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(8px);
  transition: max-width 0.5s var(--ease), opacity 0.4s var(--ease), transform 0.5s var(--ease);
}
.index-nav a::after {
  content: "";
  width: 18px; height: 1px;
  background: currentColor;
  opacity: 0.4;
  transition: width 0.4s var(--ease), opacity 0.4s var(--ease);
}
.index-nav a:hover,
.index-nav a:focus-visible { color: var(--cream); }
.index-nav a:hover .index-nav__t,
.index-nav a:focus-visible .index-nav__t { max-width: 180px; opacity: 1; transform: none; }
.index-nav li.active a { color: var(--gold); }
.index-nav li.active a::after { width: 30px; opacity: 1; background: var(--gold); box-shadow: 0 0 8px rgba(175,140,79,0.7); }
.index-nav li.active .index-nav__n { opacity: 1; }

/* Botão de menu (ecrãs pequenos) */
.nav-toggle {
  position: fixed;
  top: 1.1rem; right: 1.1rem;
  z-index: 95;
  width: 44px; height: 44px;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: rgba(10, 15, 28, 0.6);
  border: 1px solid var(--hairline);
  border-radius: 50%;
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px; height: 1.5px;
  background: var(--gold);
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
}
body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------------------------------------------------------------------
   22 · Toggle de áudio
   --------------------------------------------------------------------- */
.audio-toggle {
  position: fixed;
  left: clamp(1rem, 2.5vw, 1.8rem);
  bottom: clamp(1rem, 2.5vw, 1.8rem);
  z-index: 85;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 1.1rem 0.6rem 0.9rem;
  background: rgba(10, 15, 28, 0.55);
  border: 1px solid var(--hairline);
  border-radius: 40px;
  color: var(--muted);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.audio-toggle:hover { color: var(--cream); border-color: var(--gold); }
.audio-toggle__label {
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.audio-toggle__icon {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.audio-bar {
  width: 2px;
  height: 4px;
  background: var(--gold);
  border-radius: 2px;
  transition: height 0.2s var(--ease);
}
.audio-toggle[aria-pressed="true"] { color: var(--gold); border-color: var(--gold); background: rgba(175,140,79,0.08); }
.audio-toggle[aria-pressed="true"] .audio-bar { animation: eq 1s var(--ease-soft) infinite; }
.audio-toggle[aria-pressed="true"] .audio-bar:nth-child(1) { animation-delay: 0s; }
.audio-toggle[aria-pressed="true"] .audio-bar:nth-child(2) { animation-delay: 0.18s; }
.audio-toggle[aria-pressed="true"] .audio-bar:nth-child(3) { animation-delay: 0.36s; }
.audio-toggle[aria-pressed="true"] .audio-bar:nth-child(4) { animation-delay: 0.12s; }
@keyframes eq {
  0%, 100% { height: 4px; }
  50% { height: 13px; }
}

/* ---------------------------------------------------------------------
   23 · Rodapé
   --------------------------------------------------------------------- */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: clamp(4rem, 9vh, 7rem) var(--gutter) clamp(3rem, 6vh, 5rem);
  border-top: 1px solid var(--hairline-soft);
}
.site-footer__mark {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  letter-spacing: 0.04em;
  color: var(--cream);
  margin: 0 0 1rem;
}
.site-footer__meta {
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 2rem;
}
.site-footer__top {
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 0.3rem;
  transition: color 0.4s var(--ease);
}
.site-footer__top:hover { color: var(--cream); }

/* ---------------------------------------------------------------------
   24 · Responsivo
   --------------------------------------------------------------------- */
/* Índice fixo → menu sobreposto e scrollável, antes de o rail colidir com o
   conteúdo centrado (container 1180px + goteira do rail). */
@media (max-width: 1200px) {
  .index-nav {
    position: fixed;
    inset: 0;
    transform: none;
    background: rgba(8, 12, 22, 0.97);
    backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: clamp(4.5rem, 12vh, 7rem) clamp(1.5rem, 8vw, 5rem) 3rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s var(--ease);
  }
  body.nav-open .index-nav { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  /* margin:auto centra quando cabe e permite scroll quando não cabe */
  .index-nav__list { gap: 0.15rem; width: 100%; max-width: 440px; margin: auto; }
  .index-nav a { justify-content: flex-start; padding: 0.55rem 0; }
  .index-nav a::after { display: none; }
  .index-nav__t { max-width: none; opacity: 1; transform: none; font-size: 1rem; }
  .index-nav__n { font-size: 0.85rem; width: 2.2em; text-align: left; opacity: 0.85; }
  .nav-toggle { display: flex; }
}

@media (max-width: 1080px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .pillars { grid-template-columns: repeat(2, 1fr); }
}

/* Diagrama de fluxo passa a vertical mais cedo, evitando colunas apertadas */
@media (max-width: 1000px) {
  .flow { flex-direction: column; align-items: stretch; }
  .flow__link {
    width: 1px;
    height: clamp(18px, 5vw, 30px);
    align-self: center;
    margin: 0;
    background: var(--hairline-soft);
  }
  .in-view .flow__link .flow__pulse { animation-name: pulseTravelV; }
  @keyframes pulseTravelV {
    0%   { top: -4px; left: 50%; margin-left: -3.5px; opacity: 0; }
    15%  { opacity: 1; }
    85%  { opacity: 1; }
    100% { top: calc(100% + 4px); left: 50%; margin-left: -3.5px; opacity: 0; }
  }
}

@media (max-width: 860px) {
  .dimensions { grid-template-columns: 1fr; }
  .stages { grid-template-columns: 1fr; }
  .components { grid-template-columns: 1fr; }
  .install-grid { grid-template-columns: 1fr; }
  .journey { grid-template-columns: 1fr; gap: 0; }
  .journey__flow { display: none; }
  .journey__step { padding-left: 3.6rem; padding-bottom: 1rem; padding-top: 0.4rem; }
  .journey__num { top: 0.4rem; }
}
@media (max-width: 560px) {
  .gallery { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: 1fr; }
  .credits { gap: 1.6rem; }
  .spec-table__head, .spec-table__row { grid-template-columns: 1fr; gap: 0.3rem; }
  .spec-table--budget .spec-table__v,
  .spec-table--budget .spec-table__head span:last-child { text-align: left; }
  .budget-total { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .audio-toggle__label { display: none; }
  .audio-toggle { padding: 0.6rem; border-radius: 50%; }
  /* Rótulos do SVG ficam ilegíveis a esta escala: usar legenda HTML */
  .room__label { display: none; }
  .room__legend { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 1rem; }
}

/* ---------------------------------------------------------------------
   25 · Movimento reduzido — desliga partículas/rastos pesados,
        mantém conteúdo legível e estático.
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal, .reveal-child { opacity: 1 !important; transform: none !important; filter: none !important; }
  .hero__canvas, .trail-canvas { display: none !important; }
  .hero__title-line, .hero__eyebrow, .hero__subtitle, .hero__meta, .hero__scroll { opacity: 1 !important; transform: none !important; }
  .terminal__code .ln { opacity: 1 !important; transform: none !important; }
  .bg-field__glow { transition: none; }
}
