/* ── LANDING ────────────────────────────────────────────────────────────── */
.landing {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.landing-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Textura de papel */
.paper-texture {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 27px,
      rgba(26,54,110,0.06) 27px,
      rgba(26,54,110,0.06) 28px
    );
}

/* Líneas verticales de cuaderno */
.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 47px,
      rgba(26,54,110,0.04) 47px,
      rgba(26,54,110,0.04) 48px
    );
}

/* SVG decorativo */
.deco-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.18;
}
.deco-arc      { stroke: var(--ink-2); }
.deco-line     { stroke: var(--ink-3); }
.deco-dot      { fill: var(--ink-2); }
.deco-dot-accent { fill: var(--blue); }
.deco-label    { fill: var(--ink-2); font-family: 'Caveat', cursive; font-size: 14px; }
.deco-label-sm { fill: var(--ink-3); font-family: 'Caveat', cursive; font-size: 12px; }
.deco-theta    { stroke: var(--blue-mid); }

.landing-content {
  position: relative;
  z-index: 2;
  max-width: 820px;
  text-align: center;
  padding: 40px 24px;
}

.landing-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 28px;
  opacity: 0;
}

.landing-title {
  font-family: var(--font-serif);
  font-size: clamp(56px, 9vw, 110px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -1px;
  color: var(--ink-0);
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.title-line {
  display: block;
  opacity: 0;
  transform: translateY(30px);
}

.accent-line {
  color: var(--blue);
  font-style: italic;
}

.landing-desc {
  font-family: var(--font-bask);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-2);
  max-width: 540px;
  margin: 0 auto 32px;
  opacity: 0;
}

.landing-formula {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 44px;
  padding: 16px 24px;
  border-top: 1px solid var(--ink-5);
  border-bottom: 1px solid var(--ink-5);
  opacity: 0;
}

.formula-sep { color: var(--ink-5); font-size: 16px; }

.landing-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 32px;
  background: var(--ink-0);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 2px;
  opacity: 0;
  transition: background 0.2s, transform 0.15s var(--ease-spring);
}

.landing-cta:hover {
  background: var(--blue);
  transform: translateY(-2px);
}

.landing-cta:active { transform: translateY(0); }

.landing-credits {
  position: absolute;
  bottom: 24px;
  right: 28px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: 2px;
  opacity: 0;
}

/* ── APP ────────────────────────────────────────────────────────────────── */
.app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.app.hidden { display: none; }

/* ── HEADER ─────────────────────────────────────────────────────────────── */
.site-header {
  height: var(--header-h);
  background: var(--paper);
  border-bottom: 1px solid var(--ink-5);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  z-index: 100;
  flex-shrink: 0;
}

.back-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink-5);
  border-radius: 50%;
  color: var(--ink-2);
  transition: border-color 0.15s, color 0.15s;
}
.back-btn:hover { border-color: var(--ink-2); color: var(--ink-0); }

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif);
  font-size: 16px;
  font-style: italic;
  color: var(--ink-0);
}
.logo-mark { color: var(--blue); font-style: normal; font-size: 18px; }

.mode-nav {
  display: flex;
  gap: 2px;
  margin-left: auto;
  background: var(--paper-warm);
  border: 1px solid var(--ink-5);
  border-radius: 3px;
  padding: 3px;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--ink-3);
  border-radius: 2px;
  transition: all 0.15s;
}
.mode-btn .btn-pip {
  width: 5px; height: 5px;
  border-radius: 50%;
  border: 1px solid var(--ink-4);
  transition: all 0.15s;
}
.mode-btn.active {
  background: var(--paper);
  color: var(--ink-0);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.mode-btn.active .btn-pip { background: var(--blue); border-color: var(--blue); }
.mode-btn:hover:not(.active) { color: var(--ink-0); background: rgba(26,20,18,0.04); }

/* Cámara */
.cam-nav {
  display: flex;
  gap: 2px;
  background: var(--paper-warm);
  border: 1px solid var(--ink-5);
  border-radius: 3px;
  padding: 3px;
}
.cam-btn {
  width: 30px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 2px;
  color: var(--ink-3);
  transition: all 0.12s;
}
.cam-btn:hover { background: var(--paper); color: var(--ink-1); }
.cam-btn.active { background: var(--ink-0); color: var(--paper); }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theta-display {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--blue-mid);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.icon-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--ink-5);
  border-radius: 50%;
  color: var(--ink-2);
  transition: all 0.15s;
}
.icon-btn:hover { border-color: var(--ink-2); color: var(--ink-0); }
.icon-btn.muted { color: var(--ink-4); border-color: var(--ink-5); }


/* ── SELECTOR DE ESCENARIO ──────────────────────────────────────────────── */
/* ── PANEL FLOTANTE DE ESCENARIO ─────────────────────────────────────────── */
/* Esquina inferior derecha del stage, sobre el canvas 3D                     */
.scenario-panel {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 50;
  pointer-events: all;
}

/* Etiqueta encima del panel */
.scenario-panel::before {
  content: 'ESCENARIO';
  display: block;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 2.5px;
  color: rgba(244,240,232,0.35);
  margin-bottom: 2px;
  text-align: right;
}

.scenario-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(26, 20, 18, 0.80);
  border: 1px solid rgba(244, 240, 232, 0.10);
  border-radius: 3px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: rgba(244, 240, 232, 0.55);
  cursor: pointer;
  transition: all 0.18s var(--ease-spring);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  min-width: 140px;
  justify-content: flex-start;
}

/* Barra de acento lateral izquierda */
.scenario-btn::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: transparent;
  transition: background 0.15s;
}

.scenario-btn:hover {
  background: rgba(26, 20, 18, 0.92);
  border-color: rgba(244, 240, 232, 0.25);
  color: rgba(244, 240, 232, 0.90);
  transform: translateX(-3px);
}

.scenario-btn:hover::before {
  background: var(--blue-light);
}

.scenario-btn.active {
  background: rgba(26, 58, 110, 0.75);
  border-color: rgba(74, 114, 184, 0.50);
  color: rgba(244, 240, 232, 1.0);
  transform: translateX(-3px);
}

.scenario-btn.active::before {
  background: var(--blue-light);
}

.sc-icon {
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.sc-label {
  flex: 1;
  text-align: left;
}

/* Indicador de preview de color (punto de color del escenario) */
.sc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.7;
}

/* ── STAGE ──────────────────────────────────────────────────────────────── */
.stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

/* El panel de escenario debe sobresalir sin cortarse */
#scenario-nav {
  overflow: visible;
}

.scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-smooth);
}
.scene.active { opacity: 1; pointer-events: all; }

canvas { width: 100%; height: 100%; display: block; }

/* ── CONTROLS BAR ───────────────────────────────────────────────────────── */
.controls-bar {
  height: var(--footer-h);
  background: var(--paper-dark);
  border-top: 1px solid var(--ink-5);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 20px;
  flex-shrink: 0;
  z-index: 100;
}
