/* ==========================================================================
   Comunidades Alternativas — folha de estilo
   Paleta:
     fundo    #060b0f  (azul-marinho cósmico, toque de verde-petróleo)
     texto    #f0e9d8  (creme)
     verde    #9ad6af   dourado #e4c87e
     azul     #9ab8e8   violeta #cfa8dc
   ========================================================================== */

:root {
  --bg: #060b0f;
  --ink: #f0e9d8;
  --ink-soft: #c9c4b2;
  --sage: #93a795;
  --green: #9ad6af;
  --gold: #e4c87e;
  --blue: #9ab8e8;
  --violet: #cfa8dc;

  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-body: "Alegreya Sans", "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  overflow: hidden;
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   Camadas de fundo
   -------------------------------------------------------------------------- */

#constellation {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Névoa suave: um alento verde no centro, calor dourado discreto embaixo */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 46%, rgba(38, 66, 48, 0.35), transparent 70%),
    radial-gradient(ellipse 45% 30% at 50% 100%, rgba(84, 68, 34, 0.12), transparent 70%),
    radial-gradient(ellipse 40% 35% at 12% 8%, rgba(30, 46, 58, 0.18), transparent 70%);
}

/* Granulação orgânica bem leve (feTurbulence em data-URI) */
.grain {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Conteúdo central
   -------------------------------------------------------------------------- */

.center {
  position: relative;
  z-index: 3;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  pointer-events: none;
}

h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  line-height: 1.08;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-shadow: 0 0 40px rgba(154, 214, 175, 0.18);
}

h1 br { display: none; }

.ornament {
  width: 120px;
  height: 24px;
  margin: 1.1rem 0 1.3rem;
  overflow: visible;
}

.ornament line {
  stroke: rgba(240, 233, 216, 0.22);
  stroke-width: 1;
}

.ornament .sprout {
  fill: none;
  stroke: var(--green);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.8;
}

.lead {
  max-width: 34ch;
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  line-height: 1.65;
  color: var(--ink-soft);
}

.status {
  margin-top: 2.1rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.38em;
  text-indent: 0.38em; /* compensa o letter-spacing final para centrar */
  text-transform: uppercase;
  color: var(--sage);
}

/* --------------------------------------------------------------------------
   Frase inferior
   -------------------------------------------------------------------------- */

.quote {
  position: fixed;
  left: 0;
  right: 0;
  bottom: clamp(0.9rem, 3vh, 2rem);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  pointer-events: none;
}

.quote .seed {
  width: 30px;
  height: 30px;
  opacity: 0.5;
}

.quote .seed circle {
  fill: none;
  stroke: var(--gold);
  stroke-width: 0.8;
  stroke-opacity: 0.55;
}

.quote blockquote p {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1rem, 2.6vw, 1.25rem);
  color: rgba(240, 233, 216, 0.78);
  padding: 0 1.5rem;
}

/* --------------------------------------------------------------------------
   Palavras da constelação
   -------------------------------------------------------------------------- */

/* Sem JavaScript: as palavras aparecem como uma linha discreta de temas
   sob o conteúdo, ainda legíveis e indexáveis. */
.words {
  list-style: none;
  position: fixed;
  left: 50%;
  bottom: 5.5rem;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.1rem;
  max-width: min(90vw, 46rem);
  font-size: 0.78rem;
  color: var(--sage);
}

/* Com JavaScript: cada palavra vira um rótulo ancorado a um nó da rede. */
.js .words {
  display: contents; /* os <li> passam a se posicionar sozinhos */
}

.js .words li {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 2;
  max-width: 8.5em;
  text-align: center;
  font-size: clamp(0.68rem, 1.6vw, 0.82rem);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.03em;
  white-space: normal;
  opacity: 0;
  transition: opacity 1.6s ease;
  will-change: transform;
  pointer-events: none;
  text-shadow: 0 1px 8px rgba(4, 8, 6, 0.9);
}

.js .words li.placed { opacity: 1; }

.words li[data-tone="green"]  { color: #c3e3cd; }
.words li[data-tone="gold"]   { color: #e8d5a4; }
.words li[data-tone="blue"]   { color: #c0d2ee; }
.words li[data-tone="violet"] { color: #ddc4e4; }

/* --------------------------------------------------------------------------
   Entrada suave do conteúdo
   -------------------------------------------------------------------------- */

.center > *,
.quote > * {
  animation: settle 2.2s ease both;
}

.center .lead    { animation-delay: 0.25s; }
.center .status  { animation-delay: 0.5s; }
.quote > *       { animation-delay: 0.7s; }

@keyframes settle {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Ajustes por tamanho de tela
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
  h1 br { display: block; } /* título em duas linhas, como na referência */

  .lead {
    max-width: 26ch;
    font-size: 0.95rem;
  }

  .status {
    margin-top: 1.6rem;
    font-size: 0.68rem;
  }

  .quote .seed { width: 24px; height: 24px; }
}

/* Telas ultraestreitas: encolhe um pouco tudo para abrir espaço */
@media (max-width: 360px) {
  h1 { font-size: 2rem; }

  .lead {
    max-width: 24ch;
    font-size: 0.88rem;
  }

  .status {
    font-size: 0.62rem;
    letter-spacing: 0.3em;
  }

  .js .words li { font-size: 0.62rem; }
}

/* Telas muito baixas (celular deitado): prioriza o conteúdo central */
@media (max-height: 460px) {
  .words { display: none; }
  .js .words { display: none; }
  .quote .seed { display: none; }
}

/* --------------------------------------------------------------------------
   Movimento reduzido
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .center > *,
  .quote > * {
    animation: none;
  }

  .js .words li {
    transition: none;
  }
}
