/* ============================================================
   Hub de acesso JFX — tokens do FrotaJFX (Núcleo DJ, tema Preto)
   Efeitos no espírito do React Bits (AccordionGallery, StrokeText,
   ClickSpark) reescritos em CSS/JS puro, sem dependências.
   ============================================================ */
:root {
  --brand: #1b56ff;
  --brand-dark: #1142e0;
  --brand-lit: #3b74ff;
  --brand-soft: #93c5fd;
  --fluxo: #7c3aed;
  --fluxo-dark: #5b21b6;
  --fluxo-lit: #8b5cf6;
  --fluxo-soft: #c4b5fd;
  --hint: #a1a1aa;
  --bg: #000;
  --panel: #000;
  --ink: #fafafa;
  --muted: #a1a1aa;
  --soft: #d4d4d8;
  --line: #27272a;
  --radius: 16px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Hanken Grotesk', system-ui, sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(26px, 5vh, 64px) clamp(16px, 4vw, 52px);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: hidden;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--muted); }

/* ---- Fundo ---- */
#spark { position: fixed; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; z-index: 9; }

/* ---- Cabeçalho ---- */
.hero, .gallery, .hints, .foot { position: relative; z-index: 2; width: 100%; max-width: 1180px; }
.hero { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.brand { display: flex; align-items: center; gap: 13px; animation: up .5s var(--ease-out) both; }
.brand__mark {
  width: 46px; height: 46px;
  filter: drop-shadow(0 8px 20px rgba(27, 86, 255, .5));
  animation: float 6s ease-in-out infinite;
}
.brand__text { display: flex; flex-direction: column; gap: 5px; text-align: left; }
.brand__name { font-family: var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: -.02em; line-height: 1; }
.brand__sub { font-size: 13px; color: var(--muted); }

/* ---- Título traçado com preenchimento (StrokeText) ---- */
.stroke {
  margin: clamp(8px, 1.8vh, 20px) 0 0;
  display: flex; justify-content: center; align-items: baseline; flex-wrap: nowrap; gap: 0 .26em;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(30px, 5.6vw, 62px); line-height: 1.02; letter-spacing: -.03em;
  color: #f8fafc;
}
.stroke__word { position: relative; display: inline-block; white-space: nowrap; }
.stroke__line { -webkit-text-stroke: 1.4px #b8b8b8; color: transparent; }
.stroke__fill { position: absolute; left: 0; top: 0; color: #f8fafc; }
.stroke__left .stroke__fill { animation: fillToLeft .72s cubic-bezier(.4, 0, .2, 1) .4s both; }
.stroke__right .stroke__fill { animation: fillToRight .72s cubic-bezier(.4, 0, .2, 1) .4s both; }
.stroke__mid .stroke__fill { animation: fillOut .38s cubic-bezier(.4, 0, .2, 1) .06s both; }
.stroke__mid { animation: openMid .42s cubic-bezier(.2, .8, .3, 1.4) both; }
.stroke__left { animation: openLeft .75s var(--ease-out) .34s both; }
.stroke__right { animation: openRight .75s var(--ease-out) .34s both; }

.hero__sub {
  margin: 0; max-width: 48ch; font-size: clamp(14px, 1.5vw, 17px); line-height: 1.5;
  color: var(--muted); text-wrap: pretty; animation: up .6s var(--ease-out) .28s both;
}

/* ---- Acordeão de sistemas ---- */
.gallery {
  margin: clamp(22px, 4vh, 44px) 0 0;
  display: flex; flex-direction: row; gap: 12px; height: 500px;
  perspective: 1400px; perspective-origin: 50% 50%;
  animation: up .7s var(--ease-out) .38s both;
}
.panel {
  position: relative; flex: 1 1 0; min-width: 0; display: block; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel);
  box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .85);
  color: var(--ink); cursor: pointer; outline: none; outline-offset: 3px;
  transform-style: preserve-3d; transform-origin: center center;
  will-change: flex-grow, transform;
  transition: flex-grow .6s var(--ease-out), transform .6s var(--ease-out), border-color .3s ease, box-shadow .3s ease;
  -webkit-tap-highlight-color: transparent;
}
.panel--gestao:focus-visible { outline: 2px solid var(--brand-lit); }
.panel--fluxo:focus-visible { outline: 2px solid var(--fluxo-lit); }

.panel__media {
  position: absolute; inset: 0; will-change: filter, transform;
  transition: filter .6s var(--ease-out), transform .6s var(--ease-out);
}
.panel__wash { position: absolute; inset: 0; }
.panel__wash { background: #000; }
.panel__shot {
  position: absolute; right: -46px; bottom: 92px;
  width: min(62%, 470px); height: auto;
  border-radius: 12px; box-shadow: 0 26px 60px -20px rgba(0, 0, 0, .95);
  transform: perspective(1200px) rotateY(-13deg) rotateX(3deg);
}
.panel--gestao .panel__shot { border: 1px solid rgba(59, 116, 255, .35); }
.panel--fluxo .panel__shot { border: 1px solid rgba(139, 92, 246, .35); }
.panel__veil {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(100deg, #000 0%, rgba(0, 0, 0, .94) 40%, rgba(0, 0, 0, .45) 70%, rgba(0, 0, 0, .12) 100%);
}
.panel__scrim { position: absolute; inset: 0; }

.panel__badge {
  position: absolute; top: 16px; right: 16px; z-index: 3;
  padding: 5px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
  animation: pulse 2.6s ease-in-out infinite;
}
.panel__badge[hidden] { display: none; }
.panel--gestao .panel__badge { background: rgba(59, 116, 255, .16); border: 1px solid rgba(59, 116, 255, .45); color: #bfdbfe; }
.panel--fluxo .panel__badge { background: rgba(139, 92, 246, .18); border: 1px solid rgba(139, 92, 246, .45); color: #ddd6fe; }

.panel__content {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(20px, 2.6vw, 30px);
}
.panel__head { display: flex; align-items: center; gap: 12px; }
.panel__logo { width: 46px; height: 46px; flex: none; }
.panel--gestao .panel__logo { filter: drop-shadow(0 6px 16px rgba(27, 86, 255, .5)); }
.panel--fluxo .panel__logo { filter: drop-shadow(0 6px 16px rgba(124, 58, 237, .5)); }
.panel__strap { font-size: 13.5px; font-weight: 500; }
.panel--gestao .panel__strap { color: var(--brand-soft); }
.panel--fluxo .panel__strap { color: var(--fluxo-soft); }

.panel__caption { display: flex; align-items: flex-end; gap: 14px; }
.panel__bar { flex: none; width: 3px; height: 30px; border-radius: 3px; opacity: 0; transition: opacity .5s ease; }
.panel--gestao .panel__bar { background: var(--brand-lit); box-shadow: 0 0 14px rgba(59, 116, 255, .6); }
.panel--fluxo .panel__bar { background: var(--fluxo-lit); box-shadow: 0 0 14px rgba(139, 92, 246, .6); }
.panel__stack { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.panel__name {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(26px, 3vw, 38px); letter-spacing: -.02em; line-height: 1;
}
.panel__hint {
  display: block; overflow: hidden; max-height: 30px;
  font-size: 13px; white-space: nowrap; opacity: 1;
  transition: opacity .4s ease, max-height .5s var(--ease-out);
}
.panel__hint { color: var(--hint); }
.panel__details {
  display: flex; flex-direction: column; gap: 12px;
  overflow: hidden; max-height: 0;
  opacity: 0; transform: translateX(-14px);
  transition: opacity .55s ease .06s, transform .55s var(--ease-out) .06s, max-height .55s var(--ease-out);
}
.panel__desc { font-size: 15px; line-height: 1.5; color: var(--soft); max-width: 40ch; }
.panel__actions { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; }
.panel__cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 17px; border-radius: 10px; font-weight: 600; font-size: 14px;
}
.panel__cta svg { width: 16px; height: 16px; }
.panel__cta { color: #fff; }
.panel--gestao .panel__cta { background: linear-gradient(120deg, var(--brand), var(--brand-dark)); box-shadow: 0 6px 18px rgba(27, 86, 255, .4); }
.panel--fluxo .panel__cta { background: linear-gradient(120deg, var(--fluxo), var(--fluxo-dark)); box-shadow: 0 6px 18px rgba(124, 58, 237, .4); }
.panel__meta { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* ---- Rodapé ---- */
.hints { margin: clamp(20px, 3vh, 32px) 0 0; text-align: center; font-size: 13px; color: var(--muted); animation: up .6s var(--ease-out) .5s both; }
.foot {
  margin-top: auto; padding-top: clamp(22px, 4vh, 42px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 13px; color: var(--muted); animation: up .6s var(--ease-out) .58s both;
}
.foot a { color: var(--muted); border-bottom: 1px solid var(--line); }
.foot a:hover { color: var(--ink); border-color: #52525b; }

/* ---- Animações ---- */
@keyframes up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
@keyframes openMid { from { opacity: 0; transform: scale(.55); } to { opacity: 1; transform: none; } }
@keyframes openLeft { from { clip-path: inset(0 0 0 100%); transform: translateX(22px); } to { clip-path: inset(0 -4% 0 0); transform: none; } }
@keyframes openRight { from { clip-path: inset(0 100% 0 0); transform: translateX(-22px); } to { clip-path: inset(0 0 0 -4%); transform: none; } }
@keyframes fillOut { from { clip-path: inset(0 50% 0 50%); } to { clip-path: inset(0 -4% 0 -4%); } }
@keyframes fillToLeft { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 -4% 0 0); } }
@keyframes fillToRight { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 -4%); } }

@media (max-width: 700px) {
  .gallery { flex-direction: column; height: auto; perspective: none; }
  .panel { transform: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---- Tema branco: a PÁGINA clareia; os cartões continuam escuros (a mídia e o véu
   deles são pensados para fundo preto). Alternância pelo botão sol/lua (persistida). ---- */
.tema-toggle {
  position: fixed; top: 14px; right: 14px; z-index: 20;
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04);
  color: var(--muted); cursor: pointer; transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.tema-toggle:hover, .tema-toggle:focus-visible { color: var(--ink); border-color: #52525b; }
.tema-toggle .ico-lua { display: none; }
body.branco { background: #eef1f8; color: #14203a; }
body.branco .tema-toggle { background: #fff; border-color: #c9d3e8; color: #5a6a8c; }
body.branco .tema-toggle:hover, body.branco .tema-toggle:focus-visible { color: #14203a; border-color: #8fa2c9; }
body.branco .tema-toggle .ico-sol { display: none; }
body.branco .tema-toggle .ico-lua { display: block; }
body.branco a { color: #14203a; }
body.branco .brand__sub, body.branco .hero__sub, body.branco .hints, body.branco .foot, body.branco .panel__meta-fora { color: #5a6a8c; }
body.branco .stroke { color: #14203a; }
body.branco .stroke__line { -webkit-text-stroke-color: #9aa7c4; }
body.branco .stroke__fill { color: #14203a; }
body.branco .foot a { color: #5a6a8c; border-bottom-color: #c9d3e8; }
body.branco .foot a:hover { color: #14203a; border-color: #8fa2c9; }
body.branco .panel { box-shadow: 0 14px 34px -18px rgba(20, 32, 58, .35); }
