/* pinata.bobagi.space · chrome nos tokens bobagi, festa nas cores de papel crepom */

:root {
  --bg: #0e0d0b;
  --text: #f5f1e6;
  --muted: #a39e92;
  --line: rgba(245, 241, 230, 0.14);
  --yellow: #ffd21a;
  --on-yellow: #15130b;
  --pink: #ff4f9a;
  --orange: #ff8b3d;
  --teal: #2ee6c8;
  --purple: #9d7bff;
  --pill-bg: rgba(14, 13, 11, 0.55);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", system-ui, sans-serif;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
  outline-offset: -3px;
}
#scene:focus-visible { outline: 2px solid var(--yellow); }
#scene[hidden] { display: none; }
#scene.dragging { cursor: grabbing; }

/* ---- overlay ---- */

.ui {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(0.8rem, 2.5vmin, 1.6rem);
  padding-bottom: max(clamp(0.8rem, 2.5vmin, 1.6rem), env(safe-area-inset-bottom));
  pointer-events: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  letter-spacing: 0.02em;
  pointer-events: auto;
  border-radius: 0.5rem;
}
.brand:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }
.badge {
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 0.45rem;
  background: var(--yellow);
  color: var(--on-yellow);
  font-family: "Archivo", system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
}
.brand-name { opacity: 0.9; }

.controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pill {
  margin: 0;
  padding: 0.42em 0.95em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--pill-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 0.85rem;
  color: var(--text);
  pointer-events: auto;
}

.counter {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.counter b {
  color: var(--yellow);
  font-weight: 600;
}
.dot-sep { margin: 0 0.55em; opacity: 0.55; }

.btn {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.btn:hover { background: var(--yellow); color: var(--on-yellow); border-color: var(--yellow); }
.btn:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }

/* ---- letreiro ---- */

.wordmark {
  margin: clamp(0.6rem, 3vmin, 1.8rem) 0 0;
  text-align: center;
  font-family: "Archivo", system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(3rem, 13vmin, 7rem);
  line-height: 0.95;
  letter-spacing: -0.015em;
  user-select: none;
}

.l {
  display: inline-block;
  text-shadow: 0.045em 0.055em 0 rgba(0, 0, 0, 0.4);
}
.c1 { color: var(--pink); }
.c2 { color: var(--orange); }
.c3 { color: var(--yellow); }
.c4 { color: var(--teal); }
.c5 { color: var(--purple); }

.d1 { transform: rotate(-5deg); }
.d2 { transform: rotate(3deg) translateY(-0.03em); }
.d3 { transform: rotate(-2deg); }
.d4 { transform: rotate(4deg) translateY(0.02em); }
.d5 { transform: rotate(-4deg); }
.d6 { transform: rotate(5deg) translateY(-0.02em); }

@keyframes drop-in {
  0% { opacity: 0; translate: 0 -0.7em; }
  60% { opacity: 1; translate: 0 0.06em; }
  100% { opacity: 1; translate: 0 0; }
}
.l {
  animation: drop-in 550ms cubic-bezier(0.2, 0.7, 0.3, 1.2) backwards;
}
.d1 { animation-delay: 40ms; }
.d2 { animation-delay: 120ms; }
.d3 { animation-delay: 200ms; }
.d4 { animation-delay: 280ms; }
.d5 { animation-delay: 360ms; }
.d6 { animation-delay: 440ms; }

.tagline {
  margin: 0.7rem 0 0;
  text-align: center;
  color: var(--text);
  opacity: 0.85;
  font-size: clamp(0.9rem, 2.2vmin, 1.05rem);
  text-shadow: 0 1px 3px rgba(14, 13, 11, 0.9), 0 0 14px rgba(14, 13, 11, 0.8);
}

/* ---- rodapé ---- */

.bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.hint {
  font-size: clamp(0.78rem, 2vmin, 0.9rem);
  color: var(--text);
  text-align: center;
}

.credit {
  margin: 0;
  font-size: 0.74rem;
  color: var(--muted);
  text-align: center;
  max-width: 60ch;
}

/* ---- fallback sem WebGL/JS ---- */

.fallback {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 1rem;
  text-align: center;
  background: var(--bg);
  padding: 2rem;
}
.fallback[hidden] { display: none; }
.fallback p { margin: 0; max-width: 44ch; }
.fallback-emoji { font-size: 4rem; }

@media (prefers-reduced-motion: reduce) {
  .l { animation: none; }
  .btn { transition: none; }
}

@media (max-width: 480px) {
  .brand-name { display: none; }
  .credit { display: none; }
}
