/* ===========================================================
   Consiliarius · Pitch demo (interactivo, 3D, anim, TTS)
   =========================================================== */

:root {
  --pitch-bg: #050a18;
  --pitch-mid: #0c1426;
  --pitch-accent: #e0a95f;
  --pitch-neon: #00d4b8;
  --pitch-text: #f0f3fb;
}

* { box-sizing: border-box; }

.pitch-body {
  margin: 0;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: var(--pitch-bg);
  color: var(--pitch-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  position: relative;
}

/* Animated particle background */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.cube-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ==========================================================
   Scenes container — every scene is a full viewport panel
   ========================================================== */
.scenes {
  position: relative;
  z-index: 5;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.scene {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96) translateY(8px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scene.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1) translateY(0);
}

.scene.exiting {
  opacity: 0;
  transform: scale(1.04) translateY(-8px);
}

.centered {
  text-align: center;
  max-width: 1100px;
  width: 100%;
}

/* ==========================================================
   Splash · animated 3D logo cube
   ========================================================== */
.splash { text-align: center; }

.logo-3d {
  width: 140px; height: 140px;
  margin: 0 auto 32px;
  position: relative;
  transform-style: preserve-3d;
  animation: spin-logo 14s linear infinite;
}

.logo-3d .face {
  position: absolute;
  width: 140px; height: 140px;
  display: grid; place-items: center;
  font-size: 84px; font-weight: 800;
  color: var(--pitch-accent);
  background: linear-gradient(135deg, rgba(31, 42, 68, 0.85), rgba(12, 20, 38, 0.85));
  border: 1px solid rgba(224, 169, 95, 0.3);
  box-shadow: inset 0 0 30px rgba(224, 169, 95, 0.15), 0 0 30px rgba(224, 169, 95, 0.18);
  backdrop-filter: blur(6px);
}

.logo-3d .f-front  { transform: translateZ(70px); }
.logo-3d .f-back   { transform: rotateY(180deg) translateZ(70px); }
.logo-3d .f-right  { transform: rotateY(90deg)  translateZ(70px); }
.logo-3d .f-left   { transform: rotateY(-90deg) translateZ(70px); }
.logo-3d .f-top    { transform: rotateX(90deg)  translateZ(70px); }
.logo-3d .f-bottom { transform: rotateX(-90deg) translateZ(70px); }

@keyframes spin-logo {
  0%   { transform: rotateX(0)    rotateY(0); }
  100% { transform: rotateX(360deg) rotateY(360deg); }
}

.hero-title {
  margin: 0 0 14px;
  font-size: 56px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.1;
}

.hero-title .line-1 {
  display: block;
  background: linear-gradient(90deg, #f5d8a7, #e0a95f, #d59750);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 40px rgba(224, 169, 95, 0.3);
}

.hero-title .line-2 {
  display: block;
  font-size: 22px;
  font-weight: 400;
  color: #c8cdda;
  margin-top: 8px;
  letter-spacing: 0.5px;
}

.hero-title.huge .line-1 { font-size: 72px; }

.hero-sub {
  font-size: 17px;
  color: rgba(240, 243, 251, 0.65);
  margin: 0 0 36px;
}

.btn-cta {
  background: linear-gradient(135deg, #e0a95f, #d59750);
  color: #1f2a44;
  border: none;
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 0 30px rgba(224, 169, 95, 0.3);
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(224, 169, 95, 0.5);
}

.btn-cta.primary { background: linear-gradient(135deg, var(--pitch-neon), #00b899); color: #052e16; }
.btn-cta.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--pitch-text);
  box-shadow: none;
}
.btn-cta.ghost:hover { background: rgba(255, 255, 255, 0.06); }

.hint {
  margin-top: 24px;
  font-size: 12px;
  color: rgba(240, 243, 251, 0.5);
}

.hint kbd {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 11px;
}

/* ==========================================================
   Scene titles
   ========================================================== */
.scene-title {
  font-size: 38px;
  font-weight: 800;
  margin: 0 0 12px;
  background: linear-gradient(90deg, #fff 0%, #e0a95f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.scene-sub {
  font-size: 18px;
  color: rgba(240, 243, 251, 0.7);
  margin: 0 0 36px;
}

.scene-foot {
  font-size: 15px;
  color: rgba(240, 243, 251, 0.6);
  margin-top: 28px;
}

/* ==========================================================
   Scene 2 · Animated bars
   ========================================================== */
.bars {
  max-width: 720px;
  margin: 32px auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bar {
  display: grid;
  grid-template-columns: 220px 1fr 60px;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  text-align: left;
}

.bar span { color: #c8cdda; }

.bar .fill {
  height: 14px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 7px;
  overflow: hidden;
  position: relative;
}

.bar .fill::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(90deg, #b91c1c, #e0a95f, var(--pitch-neon));
  border-radius: 7px;
  animation: fill-bar 1.4s ease-out 0.3s forwards;
}

@keyframes fill-bar {
  to { width: var(--w); }
}

.bar b {
  font-weight: 700;
  color: var(--pitch-accent);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ==========================================================
   Scene 3 · Voices grid
   ========================================================== */
.voices-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  max-width: 1000px;
  margin: 36px auto;
}

.voice-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 22px 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
  border-left: 4px solid var(--c, var(--pitch-accent));
}

.voice-card:hover {
  transform: translateY(-4px);
  border-color: var(--c);
  box-shadow: 0 8px 30px var(--c);
}

.voice-card .voice-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--c);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 22px;
  margin: 0 auto 12px;
}

.voice-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
  color: var(--pitch-text);
}

.voice-card p {
  margin: 0;
  font-size: 13px;
  color: rgba(240, 243, 251, 0.65);
  line-height: 1.4;
}

@media (max-width: 900px) {
  .voices-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================
   Scene 4 · Cube stage
   ========================================================== */
.cube-stage {
  text-align: center;
  width: 100%;
  max-width: 1100px;
}

.cube-host {
  width: 100%;
  height: 360px;
  margin: 24px 0;
  position: relative;
  border-radius: 16px;
  background: radial-gradient(ellipse at center, rgba(0, 212, 184, 0.08) 0%, transparent 70%);
}

.cube-legend {
  max-width: 720px;
  margin: 0 auto;
}

.cube-legend ol {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 14px;
  padding: 0;
  margin: 0;
  list-style: none;
  text-align: left;
}

.cube-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(240, 243, 251, 0.75);
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 12px;
  border-radius: 8px;
}

.cube-legend .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 8px var(--c);
}

.cube-legend b { color: var(--pitch-accent); margin-right: 4px; }

/* ==========================================================
   Scene 5 · Live demo
   ========================================================== */
.brand-fc {
  background: linear-gradient(90deg, #34d399, #00d4b8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.live-stage { max-width: 920px; }

.loader-wrap {
  margin: 36px auto;
  max-width: 600px;
}

.loader-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.loader-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--pitch-accent), var(--pitch-neon));
  transition: width 0.4s ease;
  border-radius: 4px;
  box-shadow: 0 0 12px var(--pitch-neon);
}

.loader-text {
  font-size: 14px;
  color: rgba(240, 243, 251, 0.65);
  font-family: 'Courier New', monospace;
  margin: 0;
}

.live-checks {
  list-style: none;
  margin: 18px auto;
  padding: 0;
  max-width: 480px;
  text-align: left;
  font-size: 13px;
  font-family: 'Courier New', monospace;
}

.live-checks li {
  padding: 6px 12px;
  margin-bottom: 4px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  color: rgba(240, 243, 251, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-checks li.ok {
  color: #34d399;
  border-left: 3px solid #34d399;
}

.live-checks li.ok::before { content: "✓"; }
.live-checks li::before { content: "○"; opacity: 0.5; }

.live-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 20px auto;
  max-width: 700px;
}

.live-kpi {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.live-kpi .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--pitch-accent);
}

.live-kpi .value {
  font-size: 22px;
  font-weight: 700;
  margin-top: 4px;
  color: var(--pitch-text);
  font-variant-numeric: tabular-nums;
}

#live-next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

/* ==========================================================
   Scene 6 · Capabilities grid
   ========================================================== */
.cap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 1000px;
  margin: 32px auto;
}

.cap-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 18px 16px;
  text-align: center;
  transition: all 0.3s;
}

.cap-card:hover {
  transform: translateY(-3px);
  border-color: var(--pitch-neon);
  background: rgba(0, 212, 184, 0.06);
}

.cap-icon {
  font-size: 28px;
  display: block;
  margin-bottom: 8px;
}

.cap-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--pitch-accent);
}

.cap-card p {
  margin: 0;
  font-size: 12px;
  color: rgba(240, 243, 251, 0.6);
  line-height: 1.4;
}

@media (max-width: 800px) {
  .cap-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================
   CTA row
   ========================================================== */
.cta-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 32px 0 24px;
}

/* ==========================================================
   Side controls
   ========================================================== */
.pitch-controls {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  gap: 8px;
  z-index: 50;
  background: rgba(12, 20, 38, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 6px;
  backdrop-filter: blur(8px);
}

.pitch-controls button {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--pitch-text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.pitch-controls button:hover {
  background: rgba(0, 212, 184, 0.15);
  color: var(--pitch-neon);
}

.pitch-controls button.active {
  background: rgba(224, 169, 95, 0.25);
  color: var(--pitch-accent);
}

.scene-indicator {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 50;
  font-size: 12px;
  font-family: 'Courier New', monospace;
  color: rgba(240, 243, 251, 0.5);
  background: rgba(12, 20, 38, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 6px 14px;
  backdrop-filter: blur(8px);
}

/* Voice selector inline en pitch-controls */
.voice-select {
  background: rgba(255, 255, 255, 0.06);
  color: var(--pitch-text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  max-width: 220px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.voice-select:hover { border-color: var(--pitch-neon); }
.voice-select:focus { border-color: var(--pitch-accent); }
.voice-select option {
  background: var(--pitch-mid);
  color: var(--pitch-text);
}
.voice-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Audio status pill */
.audio-status {
  position: fixed;
  left: 24px;
  bottom: 60px;
  z-index: 50;
  font-size: 11px;
  font-family: 'Courier New', monospace;
  color: rgba(240, 243, 251, 0.7);
  background: rgba(12, 20, 38, 0.85);
  border: 1px solid rgba(0, 212, 184, 0.25);
  border-radius: 999px;
  padding: 5px 12px;
  backdrop-filter: blur(8px);
  letter-spacing: 0.3px;
  transition: all 0.3s;
}
