:root {
  --bg: #0a0b14; --surface: #11131f; --surface-2: #171a28; --surface-3: #1f2335;
  --border: #2a2f45; --text: #eef1f8; --text-muted: #aab2c8; --text-dim: #6b7290;
  --accent: #8fe8ff; --accent-2: #a9a0ff; --accent-3: #ff5dc4;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-serif: "Instrument Serif", Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); min-height: 100vh; }

.ps-shell { max-width: 1280px; margin: 0 auto; padding: 28px 32px 80px; display: flex; flex-direction: column; gap: 22px; }

.ps-head { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.ps-mark { font-family: var(--font-serif); font-style: italic; font-size: 24px; color: var(--text); }
.ps-sub { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); margin-top: 2px; }
.ps-plan { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; text-transform: lowercase; }

.ps-control { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 18px 20px; }
.ps-control label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); }
.ps-search-wrap { position: relative; }
.ps-input { width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 13px 16px; font-size: 15px; color: var(--text); font-family: var(--font-body); outline: none; transition: border-color .15s; }
.ps-input:focus { border-color: var(--accent-2); }
.ps-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; max-height: 320px; overflow-y: auto; box-shadow: 0 12px 40px rgba(0,0,0,.5); z-index: 10; display: none; }
.ps-suggest.on { display: block; }
.ps-suggest .it { padding: 11px 14px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; font-size: 14px; border-bottom: 1px solid var(--border); }
.ps-suggest .it:last-child { border-bottom: none; }
.ps-suggest .it:hover { background: var(--surface-3); color: var(--accent); }
.ps-suggest .it .uf { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }

.ps-styles { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.ps-style { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .03em; color: var(--text-muted);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px;
  cursor: pointer; transition: .15s; user-select: none; }
.ps-style:hover { color: var(--text); border-color: var(--accent-2); }
.ps-style.on { color: #0a0b14; background: var(--accent); border-color: var(--accent); font-weight: 600; }

.ps-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.ps-btn { font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; color: var(--text); background: var(--surface-3); border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; text-decoration: none; transition: .15s; }
.ps-btn:hover { color: var(--accent); border-color: var(--accent-2); }
.ps-btn:disabled { opacity: .45; cursor: default; }
.ps-btn.copied { color: #0a0b14; background: var(--accent); border-color: var(--accent); }

/* Caption card — abaixo do pôster, visual de "card" claro */
.ps-caption-wrap {
  margin-top: 24px;
  padding: 22px 22px 18px;
  background: linear-gradient(180deg, rgba(143, 232, 255, .04), rgba(143, 232, 255, .01));
  border: 1px solid var(--border);
  border-radius: 14px;
  position: relative;
}
.ps-caption-wrap::before {
  content: "📋 LEGENDA PRONTA PRA POSTAR";
  position: absolute;
  top: -10px; left: 16px;
  background: var(--surface, #0a0b14);
  padding: 2px 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  color: var(--accent, #8fe8ff);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.ps-caption-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin: 4px 0 10px;
}
.ps-caption {
  width: 100%;
  box-sizing: border-box;
  min-height: 220px;
  padding: 16px 18px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--surface-3, #14171f);
  border: 1px solid var(--border);
  border-radius: 10px;
  resize: vertical;
  outline: none;
  transition: .15s;
  white-space: pre-wrap;
}
.ps-caption:focus { border-color: var(--accent-2); }
.ps-caption-hint {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  margin-top: 10px;
  letter-spacing: .03em;
}

.ps-canvas { background:
    radial-gradient(800px 400px at 20% -10%, #1a1f3866, transparent),
    radial-gradient(1000px 500px at 80% -10%, #2a1b3866, transparent),
    var(--surface);
  border: 1px solid var(--border); border-radius: 22px; padding: 32px; min-height: 540px;
  display: flex; align-items: center; justify-content: center; }

.ps-empty { text-align: center; max-width: 640px; color: var(--text-dim); }
.ps-empty h1 { font-family: var(--font-serif); font-style: italic; font-size: 38px; line-height: 1.12; color: var(--text); margin: 0 0 12px; }
.ps-empty p { font-size: 15px; line-height: 1.55; }

.ps-figure { margin: 0; max-width: 720px; width: 100%; box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.04); border-radius: 6px; overflow: hidden; }
.ps-figure img { display: block; width: 100%; height: auto; }
.ps-figure.loading { opacity: .5; transition: opacity .2s; }

.ps-thinking { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); margin-top: 16px; text-align: center; }

/* Loader que só entra após ~2.5s (evita flicker em cache hit) */
.ps-loader { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: rgba(10,11,20,.72); backdrop-filter: blur(8px) saturate(120%); -webkit-backdrop-filter: blur(8px) saturate(120%);
  border-radius: 22px; pointer-events: none; animation: psFadeIn .25s ease-out both; }
.ps-loader-spin { width: 36px; height: 36px; border: 2.5px solid rgba(143,232,255,.25); border-top-color: var(--accent); border-radius: 50%;
  animation: psSpin 1s linear infinite; }
.ps-loader-txt { font-family: var(--font-mono); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--text); text-align: center; }
.ps-loader-sub { display: block; font-size: 10.5px; letter-spacing: .08em; text-transform: none; color: var(--text-dim); margin-top: 4px; }
.ps-canvas { position: relative; }
@keyframes psSpin { to { transform: rotate(360deg); } }
@keyframes psFadeIn { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 768px) {
  .ps-shell { padding: 18px 14px 60px; }
  .ps-empty h1 { font-size: 28px; }
  .ps-canvas { padding: 14px; }
}

/* ── Landing pública (visitante sem login) ───────────────────────── */
.ps-landing { max-width: 1180px; gap: 0; }
.ps-landing .ps-head { border-bottom: 1px solid var(--border); margin-bottom: 36px; }
.ps-btn-ghost { font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em;
  color: var(--text); background: transparent; border: 1px solid var(--border); border-radius: 999px; padding: 8px 18px;
  text-decoration: none; transition: .15s; margin-left: auto; }
.ps-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.ps-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: center; padding: 24px 0 56px; }
.ps-hero-copy h1 { font-family: var(--font-serif); font-style: italic; font-weight: 300; font-size: 56px; line-height: 1.05; margin: 0 0 22px; color: var(--text); }
.ps-hero-copy h1 em { color: var(--accent); font-style: italic; }
.ps-hero-copy p { font-size: 16.5px; line-height: 1.65; color: var(--text-muted); margin: 0 0 16px; max-width: 540px; }
.ps-hero-copy p strong { color: var(--text); font-weight: 600; }
.ps-cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.ps-cta { font-family: var(--font-body); font-size: 14.5px; font-weight: 600; letter-spacing: .01em; padding: 14px 26px; border-radius: 12px; text-decoration: none; transition: .15s; display: inline-block; }
.ps-cta-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #0a0b14; }
.ps-cta-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 32px rgba(143, 232, 255, .35); }
.ps-cta-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.ps-cta-secondary:hover { border-color: var(--accent-2); color: var(--accent); }
.ps-hero-foot { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); margin-top: 18px; letter-spacing: .03em; }

.ps-hero-vis { position: relative; aspect-ratio: 1 / 1.2; min-height: 460px; }
.ps-mini { position: absolute; margin: 0; border-radius: 8px; overflow: hidden;
  box-shadow: 0 18px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.04);
  transition: transform .25s ease; }
.ps-mini img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ps-mini-1 { top: 0; left: 8%; width: 52%; z-index: 4; transform: rotate(-4deg); }
.ps-mini-2 { top: 14%; right: 0; width: 48%; z-index: 3; transform: rotate(5deg); }
.ps-mini-3 { bottom: 6%; left: 0; width: 50%; z-index: 2; transform: rotate(3deg); }
.ps-mini-4 { bottom: 0; right: 8%; width: 46%; z-index: 1; transform: rotate(-3deg); }
.ps-mini:hover { transform: rotate(0deg) scale(1.04); z-index: 10; }

.ps-styles-showcase { margin: 56px 0; padding: 40px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.ps-styles-showcase h2 { font-family: var(--font-serif); font-style: italic; font-weight: 300; font-size: 32px; margin: 0 0 28px; color: var(--text); text-align: center; }
.ps-styles-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.ps-style-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: .2s; }
.ps-style-card:hover { border-color: var(--accent-2); transform: translateY(-3px); }
.ps-style-card img { display: block; width: 100%; aspect-ratio: 1 / 1.4; object-fit: cover; }
.ps-style-card .t { padding: 14px 16px 4px; font-size: 14px; font-weight: 600; color: var(--text); }
.ps-style-card .d { padding: 0 16px 14px; font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }

.ps-cta-block { text-align: center; padding: 56px 0; }
.ps-cta-block h3 { font-family: var(--font-serif); font-style: italic; font-weight: 300; font-size: 28px; margin: 0 0 22px; color: var(--text); }

.ps-foot { text-align: center; padding-top: 32px; border-top: 1px solid var(--border); font-family: var(--font-mono); font-size: 10.5px; color: var(--text-dim); letter-spacing: .02em; }

@media (max-width: 880px) {
  .ps-hero { grid-template-columns: 1fr; gap: 32px; }
  .ps-hero-copy h1 { font-size: 38px; }
  .ps-hero-vis { min-height: 360px; }
  .ps-styles-grid { grid-template-columns: repeat(2, 1fr); }
}
