/* ═══════════════════════════════════════════════════════════
   Ciclo del deseo · Pentágono 3D (Three.js)
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg:           #0c0e11;
  --bg-soft:      #14171c;
  --text:         #e8e6e1;
  --text-mid:     #c8c6c1;
  --subtext:      #8a8a8e;
  --border:       #2a2a2e;
  --accent:       #6b9ebb;
  --accent-soft:  rgba(107, 158, 187, 0.12);
}

[data-theme="light"] {
  --bg:           #f4e9da;
  --bg-soft:      #ede3d6;
  --text:         #1e1410;
  --text-mid:     #3d2b22;
  --subtext:      #6b5a4e;
  --border:       #d4c4b0;
  --accent:       #2b5d73;
  --accent-soft:  rgba(43, 93, 115, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: 'DM Mono', ui-monospace, monospace;
  -webkit-font-smoothing: antialiased;
}
html.embedded { overflow-x: hidden; }
html.embedded body { overflow-x: hidden; }

.container {
  max-width: 920px; margin: 0 auto;
  padding: clamp(24px, 4vw, 56px) clamp(16px, 3vw, 32px);
}
html.embedded .container { padding: clamp(16px, 3vw, 32px) clamp(12px, 3vw, 24px); }

/* ── Header (sólo standalone) ── */
.head { text-align: center; margin-bottom: clamp(20px, 3vw, 36px); }
html.embedded .head { display: none; }
.kicker {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--subtext); margin: 0 0 0.6rem;
}
.title {
  font-family: 'DM Serif Display', serif; font-weight: 400;
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  color: var(--text); margin: 0 0 0.5rem;
  letter-spacing: -0.01em; line-height: 1.15;
}
.lede {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.82rem; color: var(--subtext); margin: 0;
  max-width: 44ch; margin-inline: auto; line-height: 1.55;
}

/* ── Stage / Canvas host ── */
.stage {
  margin: 0;
  display: flex; flex-direction: column; align-items: center;
}

.canvas-host {
  position: relative;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 1 / 1;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--border) inset;
}
.canvas-host canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  border-radius: 4px;
}

/* ── Labels HTML overlay (proyectadas desde Three.js) ── */
.labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.label {
  position: absolute;
  left: 0; top: 0;
  font-family: 'DM Serif Display', serif;
  font-style: italic;
  font-size: clamp(13px, 1.9vw, 17px);
  color: var(--text);
  white-space: nowrap;
  letter-spacing: 0.005em;
  will-change: transform;
  /* Sutil halo de fondo para legibilidad cuando el label se solapa con el muelle */
  text-shadow:
    0 0 6px var(--bg),
    0 0 6px var(--bg),
    0 0 8px var(--bg);
  /* JS escribe transform y opacidad cada resize */
}

html.embedded .head { display: none; }
html.embedded .container {
  padding-top: 8px;
  padding-bottom: 0;
}
