/* Página "em breve" do Sentinela — A Vigília. Cores e fontes da maquete (PALETA.md, FONTES.md). */

@font-face { font-family: "Montserrat"; font-weight: 300; font-style: normal; font-display: swap; src: url("/fontes/montserrat-300.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 300; font-style: italic; font-display: swap; src: url("/fontes/montserrat-300-italico.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 400; font-display: swap; src: url("/fontes/dm-sans-400.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 500; font-display: swap; src: url("/fontes/dm-sans-500.woff2") format("woff2"); }

@property --raio { syntax: "<percentage>"; inherits: false; initial-value: 0%; }

:root {
  --noite: #00040F;
  --fundo: #040E1B;
  --ouro-claro: #FAE7B3;
  --ouro: #E6B55D;
  --ouro-escuro: #A36D34;
  --texto: #EFF2F6;
  --texto-suave: #CED1D5;
  --degrade: linear-gradient(135deg, #FAE7B3 0%, #E6B55D 45%, #A36D34 100%);
  --lanterna: clamp(150px, 30vmin, 280px);
}

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

html, body { height: 100%; }

body {
  background:
    radial-gradient(ellipse 70% 55% at 50% 38%, #0A1422 0%, transparent 70%),
    var(--noite);
  color: var(--texto);
  font-family: "DM Sans", system-ui, sans-serif;
  overflow: hidden;
  cursor: crosshair;
  -webkit-font-smoothing: antialiased;
  touch-action: pinch-zoom; /* um dedo move a luz; dois dedos ainda ampliam */
  overscroll-behavior: none;
}

/* Grão de filme e vinheta: dão profundidade ao escuro. */
body::before {
  content: "";
  position: fixed; inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='.5'/%3E%3C/svg%3E");
  opacity: .07;
  pointer-events: none;
  z-index: 5;
  animation: grao 1.2s steps(6) infinite;
}
body::after {
  content: "";
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at 50% 45%, transparent 45%, rgba(0, 2, 11, .85) 100%);
  pointer-events: none;
  z-index: 4;
}
@keyframes grao {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

.poeira { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }

/* A lanterna: um brilho morno que segue o cursor e uma máscara que revela as palavras. */
.luz, .escondidas { --lx: 50vw; --ly: 40vh; }
.luz {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(circle var(--lanterna) at var(--lx) var(--ly), rgba(250, 210, 130, .16), rgba(230, 181, 93, .06) 40%, rgba(163, 109, 52, .02) 70%, transparent 100%);
  mix-blend-mode: screen;
  opacity: 0;
  animation: surgir 2s ease 5.5s forwards;
}
.escondidas {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  -webkit-mask-image: radial-gradient(circle var(--lanterna) at var(--lx) var(--ly), #000 0%, rgba(0, 0, 0, .55) 45%, transparent 100%);
          mask-image: radial-gradient(circle var(--lanterna) at var(--lx) var(--ly), #000 0%, rgba(0, 0, 0, .55) 45%, transparent 100%);
}
.escondidas span {
  position: absolute; left: var(--x); top: var(--y);
  transform: translate(-50%, -50%);
  font-family: "Montserrat", sans-serif; font-weight: 300; font-style: italic;
  font-size: clamp(15px, 2.4vmin, 24px);
  letter-spacing: .08em;
  color: var(--ouro-claro);
  text-shadow: 0 0 18px rgba(230, 181, 93, .55);
  white-space: nowrap;
}
/* Onde fica cada palavra escondida (a CSP não aceita estilo dentro do HTML). */
.escondidas span:nth-child(1) { --x: 12%; --y: 18%; }
.escondidas span:nth-child(2) { --x: 78%; --y: 14%; }
.escondidas span:nth-child(3) { --x: 86%; --y: 46%; }
.escondidas span:nth-child(4) { --x: 8%; --y: 52%; }
.escondidas span:nth-child(5) { --x: 20%; --y: 84%; }
.escondidas span:nth-child(6) { --x: 72%; --y: 80%; }
.escondidas span:nth-child(7) { --x: 46%; --y: 8%; }
.escondidas span:nth-child(8) { --x: 60%; --y: 92%; }
.escondidas span:nth-child(9) { --x: 30%; --y: 34%; }
.escondidas span:nth-child(10) { --x: 68%; --y: 30%; }
.escondidas span:nth-child(11) { --x: 90%; --y: 66%; }
.escondidas span:nth-child(12) { --x: 6%; --y: 70%; }
.escondidas .pequena {
  font-family: "DM Sans", sans-serif; font-style: normal; font-weight: 500;
  font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--ouro);
}

main {
  position: relative; z-index: 3;
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(14px, 2.6vmin, 26px);
  padding: 24px 16px 72px;
  text-align: center;
  pointer-events: none;
}

/* O emblema: primeiro os olhos, depois o escudo nasce do olhar. */
.emblema {
  position: relative;
  width: clamp(170px, 32vmin, 300px);
  aspect-ratio: 548 / 600;
  pointer-events: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.emblema-halo {
  position: absolute; inset: -35%;
  background: radial-gradient(circle closest-side at 50% 45%, rgba(230, 181, 93, .22), rgba(163, 109, 52, .08) 55%, transparent 100%);
  opacity: 0;
  animation: surgir 3s ease 2.6s forwards, respirar 6s ease-in-out 5.6s infinite;
}
.emblema-imagem {
  position: absolute; inset: 0; width: 100%; height: 100%;
  user-select: none;
  -webkit-mask-image: radial-gradient(circle at 50% 37%, #000 var(--raio), transparent calc(var(--raio) + 18%));
          mask-image: radial-gradient(circle at 50% 37%, #000 var(--raio), transparent calc(var(--raio) + 18%));
  animation: nascer 2.6s cubic-bezier(.6, 0, .2, 1) 2.4s forwards;
}
@keyframes nascer { to { --raio: 110%; } }

.emblema-brilho {
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 246, 214, .75) 48%, rgba(255, 255, 255, .95) 50%, rgba(255, 246, 214, .75) 52%, transparent 65%);
  background-size: 300% 100%;
  background-position: 150% 0;
  -webkit-mask: url("/logo.webp") center / 100% 100% no-repeat;
          mask: url("/logo.webp") center / 100% 100% no-repeat;
  mix-blend-mode: soft-light;
  animation: varrer 7s ease-in-out 4.8s infinite;
}
@keyframes varrer {
  0% { background-position: 150% 0; }
  22%, 100% { background-position: -50% 0; }
}

.olho {
  position: absolute; top: 37.2%;
  width: 15%; height: 6%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, #FFF6D6 0%, #FAE7B3 25%, rgba(230, 181, 93, .55) 55%, transparent 75%);
  filter: blur(1.5px);
  transform: translate(-50%, -50%) scaleY(.15);
  opacity: 0;
  animation: acender 1.4s cubic-bezier(.3, 0, .2, 1) 1s forwards, pulsar 4.5s ease-in-out 5s infinite;
  mix-blend-mode: screen;
}
.olho-esquerdo { left: 44%; }
.olho-direito { left: 57.5%; }
@keyframes acender {
  0% { opacity: 0; transform: translate(-50%, -50%) scaleY(.15); }
  55% { opacity: 1; transform: translate(-50%, -50%) scaleY(.15) scaleX(1.4); }
  100% { opacity: .9; transform: translate(-50%, -50%) scaleY(1); }
}
@keyframes pulsar {
  0%, 100% { opacity: .9; box-shadow: 0 0 14px 4px rgba(250, 231, 179, .35); }
  50% { opacity: .55; box-shadow: 0 0 6px 1px rgba(250, 231, 179, .15); }
}
/* Ao tocar no emblema, o olhar se acende por um instante. */
.emblema.alerta .olho { animation: clarao .9s ease-out; }
.emblema.alerta .emblema-halo { animation: clarao-halo .9s ease-out; opacity: 1; }
@keyframes clarao {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 10px 2px rgba(250, 231, 179, .4); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1.5, 1.3); box-shadow: 0 0 60px 22px rgba(250, 231, 179, .55); }
  100% { opacity: .9; transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 14px 4px rgba(250, 231, 179, .35); }
}
@keyframes clarao-halo { 30% { transform: scale(1.12); filter: brightness(1.8); } }

/* A marca: letra por letra, saindo da névoa. */
.marca {
  font-family: "Montserrat", sans-serif; font-weight: 300;
  font-size: clamp(22px, 4.6vmin, 40px);
  letter-spacing: .42em;
  margin-right: -.42em; /* compensa o espaço depois da última letra */
  line-height: 1;
}
.marca span {
  display: inline-block;
  background: var(--degrade);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  opacity: 0;
  filter: blur(8px);
  transform: translateY(6px);
  animation: letra 1.1s ease forwards;
}
.marca span:nth-child(1) { animation-delay: 4.6s; }
.marca span:nth-child(2) { animation-delay: 4.72s; }
.marca span:nth-child(3) { animation-delay: 4.84s; }
.marca span:nth-child(4) { animation-delay: 4.96s; }
.marca span:nth-child(5) { animation-delay: 5.08s; }
.marca span:nth-child(6) { animation-delay: 5.2s; }
.marca span:nth-child(7) { animation-delay: 5.32s; }
.marca span:nth-child(8) { animation-delay: 5.44s; }
.marca span:nth-child(9) { animation-delay: 5.56s; }
@keyframes letra { to { opacity: 1; filter: blur(0); transform: none; } }

/* A frase que se escreve e se apaga. */
.frase {
  min-height: 1.6em;
  font-family: "Montserrat", sans-serif; font-weight: 300; font-style: italic;
  font-size: clamp(15px, 2.3vmin, 20px);
  color: var(--texto-suave);
  letter-spacing: .02em;
}
.cursor {
  display: inline-block;
  width: 1px; height: 1.05em;
  margin-left: 3px;
  vertical-align: -.15em;
  background: var(--ouro);
  opacity: 0;
  animation: piscar 1s steps(1) infinite;
}
.frase.ativa .cursor { opacity: 1; }
@keyframes piscar { 50% { visibility: hidden; } }

/* A pista: só a referência. Quem quiser saber, procura. */
.pista {
  margin-top: clamp(4px, 2vmin, 18px);
  font-weight: 500; font-size: 11px;
  letter-spacing: .38em; margin-right: -.38em;
  text-transform: uppercase;
  color: var(--ouro);
  opacity: 0;
  pointer-events: auto;
  cursor: help;
  animation: surgir-pista 3s ease 11s forwards;
  transition: text-shadow .6s ease, color .6s ease;
}
.pista:hover { color: var(--ouro-claro); text-shadow: 0 0 16px rgba(230, 181, 93, .8); }
@keyframes surgir-pista { to { opacity: .85; } }

footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 0 16px max(18px, env(safe-area-inset-bottom));
  pointer-events: none;
}
.dica {
  font-size: 10px; font-weight: 500;
  letter-spacing: .32em; margin-right: -.32em;
  text-transform: uppercase;
  color: var(--ouro);
  opacity: 0;
  animation: surgir-dica 2s ease 7.5s forwards;
  transition: opacity 1.2s ease;
}
@keyframes surgir-dica { to { opacity: .8; } }
.dica-toque { display: none; }
@media (hover: none) {
  .dica-mouse { display: none; }
  .dica-toque { display: inline; }
}
body.mexeu .dica { opacity: 0 !important; animation: none; }
.rodape {
  font-size: 11px;
  letter-spacing: .14em;
  color: rgba(206, 209, 213, .72);
  opacity: 0;
  animation: surgir 2s ease 6s forwards;
}

@keyframes surgir { to { opacity: 1; } }
@keyframes respirar { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.06); opacity: .75; } }

.apenas-leitor {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Quem pediu menos movimento vê tudo pronto, sem animação. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-delay: 0s !important;
    animation-iteration-count: 1 !important; transition-duration: .01ms !important;
  }
  .emblema-brilho { display: none; }
}

@media (max-height: 520px) {
  .emblema { width: clamp(120px, 30vmin, 200px); }
  .pista { display: none; }
}
