/* Estúdio NEWNEO — Crie seu Personagem
   Identidade: fundo #0D0A12, superfícies #171120, bordas #392C49,
   texto #FBF7FF, secundário #CEC3D8, lilás #D3A9FF,
   botão #CDA1FA com texto #170725, neon #AE67FC. */

:root {
  --bg: #0d0a12;
  --surface: #171120;
  --surface-2: #1d1428;
  --border: #392c49;
  --text: #fbf7ff;
  --muted: #cec3d8;
  --lilac: #d3a9ff;
  --btn: #cda1fa;
  --btn-text: #170725;
  --neon: #ae67fc;
  --radius: 16px;
  --max: 1180px;
}

* { box-sizing: border-box; }

/* Regra global: o atributo hidden SEMPRE esconde, mesmo com display próprio.
   (Sem isso, .modal { display:flex } anulava o hidden e o modal nunca sumia.) */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Arco neon fino no topo, só nos cantos — nunca uma moldura completa */
.arc {
  position: fixed;
  top: -140px;
  left: 50%;
  width: 900px;
  height: 220px;
  transform: translateX(-50%);
  border: 2px solid var(--neon);
  border-radius: 50%;
  opacity: .45;
  filter: blur(1px);
  box-shadow: 0 0 32px rgba(174, 103, 252, .45), inset 0 0 24px rgba(174, 103, 252, .25);
  pointer-events: none;
  z-index: 0;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 12px; letter-spacing: -.01em; }
h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 14px; }
a { color: var(--lilac); }
.muted { color: var(--muted); }
.lead { color: var(--muted); font-size: 1.08rem; max-width: 640px; }
.eyebrow { color: var(--lilac); font-weight: 700; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 8px; }

section { padding: 72px 0; }
.section-head { margin-bottom: 32px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 10, 18, .92);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.logo-frame {
  width: 42px; height: 42px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border); background: var(--surface);
  flex: none; display: block;
}
.logo-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.brand-name { font-weight: 800; font-size: 1.15rem; letter-spacing: .06em; }
.brand-name span { color: var(--lilac); }
.main-nav { display: flex; gap: 4px; margin-left: auto; }
.main-nav a {
  color: var(--muted); text-decoration: none; font-weight: 600;
  padding: 8px 12px; border-radius: 8px;
}
.main-nav a:hover { color: var(--text); background: var(--surface); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: .95rem;
  padding: 12px 20px; border-radius: 12px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform .12s ease, background .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--btn); color: var(--btn-text); }
.btn-primary:hover { background: #d8b6fb; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--lilac); color: var(--lilac); }
.btn-small { padding: 9px 14px; font-size: .88rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero { padding: 84px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: stretch; }
.hero-copy { display: flex; flex-direction: column; justify-content: center; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--lilac); font-weight: 700; font-size: .85rem;
  padding: 7px 14px; border-radius: 999px; margin-bottom: 20px;
  align-self: flex-start;
}
.hero h1 { font-size: clamp(2.9rem, 7vw, 4.6rem); font-weight: 800; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; color: var(--lilac); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 18px; }
.hero-actions .btn { border-radius: 999px; padding: 14px 26px; }
.hero-note { color: var(--muted); font-size: .88rem; margin: 0; }
/* Painel alto do mascote — assinatura visual do hero */
.hero-mascot {
  margin: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px; overflow: hidden; position: relative;
  display: flex; flex-direction: column;
  box-shadow: 0 0 0 1px rgba(174, 103, 252, .15), 0 24px 48px rgba(0, 0, 0, .45);
}
.hero-mascot::before {
  content: ""; position: absolute; top: 0; left: 24px; right: 24px; height: 2px;
  background: var(--neon); box-shadow: 0 0 18px var(--neon); z-index: 1;
}
.hero-mascot img { width: 100%; height: 100%; min-height: 380px; object-fit: cover; object-position: center top; display: block; flex: 1; }
.hero-mascot figcaption {
  padding: 16px 20px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; background: var(--surface);
}
.hero-mascot figcaption strong { font-size: 1rem; }
.hero-mascot figcaption span { color: var(--muted); font-size: .88rem; }
/* Faixa de números com divisórias, não cartões */
.stats-strip {
  display: flex; margin-top: 44px; padding: 20px 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.stat { flex: 1; padding: 0 24px; border-left: 1px solid var(--border); }
.stat:first-child { border-left: none; padding-left: 0; }
.stat strong { display: block; font-size: 1.7rem; font-weight: 800; color: var(--lilac); }
.stat span { color: var(--muted); font-size: .85rem; }

.hero-examples { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 28px; }
.example-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .15s ease, border-color .15s ease;
}
.example-card:hover { transform: translateY(-4px); border-color: var(--lilac); }
.example-visual {
  height: 190px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  font-size: 3rem;
}
.example-visual span:last-child { font-size: .8rem; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.example-card h3 { padding: 14px 16px 2px; }
.example-card p { padding: 0 16px 16px; color: var(--muted); font-size: .9rem; margin: 0; }

/* ---------- Estúdio ---------- */
.studio-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
/* Painel de saída: superfície mais escura + acento lilás à esquerda */
.panel-sticky { position: sticky; top: 92px; background: #120b1c; border-left: 3px solid var(--lilac); }
/* Seletor de modo: controle segmentado em pílula, largura total */
.mode-row {
  display: flex; gap: 4px; margin-bottom: 20px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px;
}
.mode-row .mode-btn { flex: 1; border: none; border-radius: 999px; white-space: nowrap; }
.mode-row .mode-btn:hover { color: var(--text); }
.mode-row .mode-btn.active { background: var(--btn); color: var(--btn-text); }
.mode-btn, .char-btn, .chip {
  font: inherit; font-weight: 700; font-size: .9rem;
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 9px 16px; cursor: pointer;
}
.mode-btn.active, .char-btn.active, .chip.active {
  background: var(--btn); color: var(--btn-text); border-color: var(--btn);
}
.mode-btn:hover, .char-btn:hover, .chip:hover { border-color: var(--lilac); color: var(--text); }
.mode-btn.active:hover, .char-btn.active:hover, .chip.active:hover { color: var(--btn-text); }
.char-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.step { border-top: 1px solid var(--border); padding-top: 20px; margin-top: 20px; }
.step h3 { display: flex; align-items: center; gap: 10px; }
.step-num {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--neon); color: var(--btn-text);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.05rem; font-weight: 800;
  box-shadow: 0 0 0 3px var(--surface), 0 0 16px rgba(174, 103, 252, .5);
}
.step p { color: var(--muted); font-size: .95rem; }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 6px; }
.field .hint { color: var(--muted); font-size: .85rem; font-weight: 400; }
input[type="text"], textarea, select {
  width: 100%; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 12px;
}
input[type="text"]:focus, textarea:focus, select:focus {
  outline: 2px solid var(--neon); outline-offset: 1px; border-color: var(--neon);
}
textarea { resize: vertical; min-height: 84px; }
select { cursor: pointer; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--neon); flex: none; }

details.advanced { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 16px; }
details.advanced summary { font-weight: 700; cursor: pointer; font-size: 1rem; }
details.advanced summary:hover { color: var(--lilac); }

.studio-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

.output-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.output-head h3 { margin: 0; }
.mode-badge {
  background: var(--neon); color: var(--btn-text);
  font-size: .8rem; font-weight: 800; padding: 5px 10px; border-radius: 999px;
}
.dirty-note { color: var(--lilac); font-size: .85rem; font-weight: 700; margin: 0 0 10px; }
.prompt-box {
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px; white-space: pre-wrap; word-break: break-word;
  font-size: .95rem; line-height: 1.7; min-height: 260px; margin: 0 0 16px;
}
.output-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.tool-links { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px; }
.tool-links p { color: var(--muted); font-size: .9rem; margin-bottom: 10px; }
.tool-links a { display: inline-block; margin: 0 14px 6px 0; font-weight: 700; }

/* ---------- Biblioteca ---------- */
.library-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.library-toolbar input[type="text"] { flex: 1; min-width: 220px; }
.library-toolbar select { width: auto; min-width: 200px; }
.cat-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-chip {
  font: inherit; font-weight: 700; font-size: .88rem;
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 14px; cursor: pointer;
}
.filter-chip.active { background: var(--btn); color: var(--btn-text); border-color: var(--btn); }
.styles-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.style-card, .insp-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.style-card:hover, .insp-card:hover {
  transform: translateY(-4px); border-color: var(--lilac);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .45);
}
.style-visual, .insp-visual {
  min-height: 170px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  padding: 18px; text-align: center; position: relative;
}
.style-glyph, .insp-glyph { font-size: 2.8rem; }
.style-visual-name { font-weight: 800; font-size: 1.05rem; }
/* Número grande do card — marca visual da biblioteca */
.style-index {
  position: absolute; top: 10px; right: 14px;
  font-size: 2rem; font-weight: 800; line-height: 1;
  color: var(--lilac); opacity: .45; letter-spacing: -.02em;
}
.style-body, .insp-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.style-body h3, .insp-body h3 { margin: 0; }
.style-body p, .insp-body p { color: var(--muted); font-size: .92rem; margin: 0; flex: 1; }
.style-body .btn, .insp-body .btn { margin-top: 8px; align-self: flex-start; }
/* Categoria como pílula, não só texto */
.tag {
  color: var(--lilac); font-size: .78rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  display: inline-block; align-self: flex-start;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 3px 10px; background: var(--bg);
}
.center { text-align: center; margin-top: 28px; }

/* ---------- Inspiração ---------- */
.insp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.insp-visual { min-height: 150px; }

/* ---------- Como usar ---------- */
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.step-card .step-num { width: 36px; height: 36px; font-size: 1rem; margin-bottom: 14px; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 780px; }
.faq-item { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin-bottom: 10px; overflow: hidden; }
.faq-q {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: none; border: none; color: var(--text); font: inherit;
  font-weight: 700; font-size: 1rem; text-align: left;
  padding: 18px 20px; cursor: pointer;
}
.faq-q:hover { color: var(--lilac); }
.faq-q .faq-icon { color: var(--lilac); font-size: 1.3rem; flex: none; }
.faq-a { padding: 0 20px 18px; color: var(--muted); display: none; }
.faq-item.open .faq-a { display: block; }
.faq-item.open .faq-icon { transform: rotate(45deg); }

/* ---------- Sobre / rodapé ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 40px; align-items: center; }
.mascot-frame {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; max-width: 380px;
}
.mascot-frame img { width: 100%; height: auto; display: block; }
.site-footer { border-top: 1px solid var(--border); padding: 36px 0; color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-inner .brand-name { font-size: 1rem; }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 3, 8, .8);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 60px 20px;
}
.modal-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  max-width: 640px; width: 100%; max-height: 80vh; overflow: auto;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.modal-head h3 { margin: 0; }
.saved-row {
  border-top: 1px solid var(--border); padding: 14px 0;
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
}
.saved-row p { color: var(--muted); font-size: .88rem; margin: 4px 0 0; }
.saved-actions { display: flex; gap: 8px; flex: none; }

/* ---------- Responsivo ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .studio-layout { grid-template-columns: 1fr; }
  .panel-sticky { position: static; }
  .styles-grid { grid-template-columns: repeat(2, 1fr); }
  .insp-grid, .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  section { padding: 48px 0; }
  .main-nav { display: none; }
  .header-inner { gap: 12px; }
  .hero { padding: 56px 0 40px; }
  .hero-mascot img { min-height: 260px; }
  .stats-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 0; }
  .stat { border-left: none; padding: 0 12px 0 0; }
  .stat:nth-child(even) { border-left: 1px solid var(--border); padding-left: 16px; }
  .mode-row .mode-btn { font-size: .82rem; padding: 9px 6px; }
  .hero-examples { grid-template-columns: 1fr; }
  .example-visual { height: 150px; }
  .styles-grid, .insp-grid, .steps-grid { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  .btn { width: 100%; }
  .hero-actions .btn, .studio-actions .btn, .output-actions .btn { width: 100%; }
  .mode-row, .char-row { gap: 6px; }
}
