/* ═══════════════════════════════════════════════════════════
   Scene System v1.0 — ESPÍRITU TANGO
   "El cuerpo es la interfaz."

   Shared scene styles. Import after tango.css.
   ═══════════════════════════════════════════════════════════ */

/* ─── Scene Container ─── */
.scene {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.scene--top {
  justify-content: flex-start;
  padding-top: var(--s-3xl);
}

.scene--bottom {
  justify-content: flex-end;
  padding-bottom: var(--s-3xl);
}

/* ─── Mini Entrada (1s ritual) ─── */
.ritual-mini {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.8s var(--release);
  pointer-events: none;
}

.ritual-mini.despierta {
  opacity: 0;
}

.ritual-mini-texto {
  font-family: var(--f-code);
  font-size: var(--t-xs);
  color: rgba(240, 232, 236, 0.15);
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

/* ─── Hero / Title Area ─── */
.scene-hero {
  text-align: center;
  padding: var(--s-2xl) var(--s-lg) var(--s-lg);
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.8s var(--approach),
              transform 0.8s var(--approach);
}

.scene-hero.visible {
  opacity: 1;
  transform: translateY(0);
}

.scene-hero .monumento {
  margin-top: var(--s-sm);
}

.scene-hero .ko {
  margin-top: var(--s-xs);
}

/* ─── Scene Interaction Zone ─── */
.scene-interaction {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--s-lg);
  position: relative;
}

/* ─── Revelation ─── */
.scene-revelation {
  position: relative;
  z-index: 5;
  padding: var(--s-xl) var(--s-lg);
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.2s var(--approach),
              transform 1.2s var(--approach);
  pointer-events: none;
  width: 100%;
  max-width: var(--max-w);
}

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

.scene-line {
  font-family: var(--f-monument);
  font-size: var(--t-xl);
  font-weight: 400;
  font-style: italic;
  color: var(--glow);
  line-height: 1.5;
  opacity: 0;
  transform: translateY(10px);
  animation: scene-line-in 1s var(--approach) forwards;
}

.scene-line:nth-child(1) { animation-delay: 0.3s; }
.scene-line:nth-child(2) { animation-delay: 0.8s; }
.scene-line:nth-child(3) { animation-delay: 1.3s; }

.scene-line.ko {
  font-family: var(--f-ko);
  font-size: var(--t-md);
  font-style: normal;
  color: rgba(240, 232, 236, 0.35);
  margin-top: var(--s-sm);
}

@keyframes scene-line-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Scene Details (folded) ─── */
.scene-details {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s var(--approach) 1.5s;
}

.scene-revelation.visible ~ .scene-details,
.scene-details.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Scene Flow Navigation ─── */
.scene-flow {
  width: 100%;
  max-width: var(--max-w);
  margin: var(--s-xl) auto;
  padding: 0 var(--s-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  opacity: 0;
  transition: opacity 1s var(--approach) 2s;
}

.scene-revelation.visible ~ .scene-flow,
.scene-flow.visible {
  opacity: 1;
}

.scene-flow-prev,
.scene-flow-next {
  font-family: var(--f-voice);
  font-size: var(--t-sm);
}

.scene-flow-current {
  font-family: var(--f-code);
  font-size: var(--t-xs);
  color: var(--dim);
  letter-spacing: 0.1em;
}

/* ─── Gesture Target (circle with rings) ─── */
.gesture-zone {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  z-index: 10;
  transition: opacity 1.2s var(--release);
}

.gesture-zone.revealed {
  opacity: 0;
  pointer-events: none;
}

.gesture-target {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1px solid rgba(233, 30, 99, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--half) var(--approach),
              border-color var(--half) var(--approach),
              box-shadow var(--half) var(--approach);
}

.gesture-target::before {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1px solid rgba(233, 30, 99, 0.08);
  transition: all var(--half) var(--approach);
}

.gesture-target::after {
  content: '';
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: rgba(233, 30, 99, 0.04);
  transition: all var(--half) var(--approach);
}

.gesture-zone.touching .gesture-target {
  border-color: rgba(233, 30, 99, 0.5);
  box-shadow: 0 0 40px rgba(233, 30, 99, 0.12);
  transform: scale(1.04);
}

.gesture-zone.touching .gesture-target::before {
  border-color: rgba(233, 30, 99, 0.25);
}

.gesture-zone.touching .gesture-target::after {
  background: rgba(233, 30, 99, 0.08);
}

.gesture-zone.completed .gesture-target {
  border-color: var(--magenta);
  box-shadow: 0 0 60px rgba(233, 30, 99, 0.2);
  transform: scale(1.1);
}

.gesture-zone.completed .gesture-target::before {
  border-color: rgba(233, 30, 99, 0.35);
}

.gesture-zone.completed .gesture-target::after {
  background: rgba(233, 30, 99, 0.12);
}

.gesture-prompt {
  position: relative;
  z-index: 2;
  font-family: var(--f-code);
  font-size: var(--t-xs);
  letter-spacing: 0.25em;
  color: rgba(233, 30, 99, 0.3);
  text-transform: uppercase;
  transition: color var(--half) var(--approach),
              opacity var(--half) var(--approach);
}

.gesture-zone.touching .gesture-prompt {
  color: rgba(233, 30, 99, 0.6);
}

.gesture-zone.completed .gesture-prompt {
  opacity: 0;
}

/* ─── Glow (radiates from touch point) ─── */
.gesture-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(
    circle at var(--glow-x, 50%) var(--glow-y, 50%),
    rgba(233, 30, 99, 0.25) 0%,
    rgba(233, 30, 99, 0.08) 25%,
    rgba(233, 30, 99, 0.02) 50%,
    transparent 70%
  );
}

.gesture-glow.visible { opacity: 1; }

.gesture-glow.complete {
  background: radial-gradient(
    circle at var(--glow-x, 50%) var(--glow-y, 50%),
    rgba(233, 30, 99, 0.4) 0%,
    rgba(233, 30, 99, 0.15) 20%,
    rgba(233, 30, 99, 0.04) 40%,
    transparent 60%
  );
  opacity: 1;
  transition: opacity 1.5s var(--release);
}

/* ─── Scene-specific: Touch Counter ─── */
.touch-counter {
  font-family: var(--f-monument);
  font-size: var(--t-3xl);
  color: var(--glow);
  text-align: center;
  opacity: 0.15;
  transition: opacity var(--half) var(--approach);
}

.touch-counter.active {
  opacity: 0.5;
}

.touch-counter.complete {
  opacity: 1;
  color: var(--magenta);
  text-shadow: 0 0 40px rgba(233, 30, 99, 0.3);
}

/* ─── Scene-specific: Merge Zones ─── */
.merge-zone {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 240px;
  margin: 0 auto;
}

.merge-body {
  position: absolute;
  width: 70px;
  height: 140px;
  border-radius: 35px 35px 20px 20px;
  border: 1px solid rgba(233, 30, 99, 0.15);
  transition: all 0.6s var(--approach);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.merge-body--lead {
  left: 30px;
  top: 50px;
  background: rgba(233, 30, 99, 0.04);
}

.merge-body--follow {
  right: 30px;
  top: 50px;
  background: rgba(233, 30, 99, 0.02);
}

.merge-body.merged {
  left: 50%;
  top: 50px;
  transform: translateX(-50%) scale(1.15);
  border-color: var(--magenta);
  box-shadow: 0 0 40px rgba(233, 30, 99, 0.2);
  cursor: default;
}

.merge-body-label {
  font-family: var(--f-code);
  font-size: 0.5rem;
  letter-spacing: 0.15em;
  color: rgba(233, 30, 99, 0.3);
  text-transform: uppercase;
}

.merge-connector {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 1px;
  background: rgba(233, 30, 99, 0.2);
  transform: translate(-50%, -50%);
  transition: all 0.6s var(--approach);
}

.merge-connector.connected {
  width: 140px;
}

/* ─── Tap Ripple ─── */
.tap-ripple {
  position: fixed;
  pointer-events: none;
  z-index: 8;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(233, 30, 99, 0.3);
  opacity: 0;
  animation: ripple-out 0.8s ease-out forwards;
}

@keyframes ripple-out {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(15); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════
   T3 — 3-Layer Discovery System
   explorador: 3+ unique pages visited
   ═══════════════════════════════════════════════════════════ */

/* Layer 1: Explorador (3+ 방문) — 은은한 금빛 시안 */
body.explorador .scene-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(212, 175, 55, 0.04) 0%, transparent 60%);
  pointer-events: none;
}

body.explorador .pie-marca {
  opacity: 0.8;
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
}

body.explorador .puerta--principal {
  border-color: var(--gold);
  color: var(--gold);
}

/* Layer 2: Veterano (7+ 방문) — 마젠타 아우라 */
body.explorador--veterano .scene-hero::after {
  background: radial-gradient(ellipse at 50% 0%, rgba(233, 30, 99, 0.06) 0%, transparent 60%);
}

body.explorador--veterano .ritual-mini-texto {
  color: var(--magenta);
  letter-spacing: 0.3em;
}

/* Layer 3: Maestro (15+ 방문) — 전체 글로우 */
body.explorador--maestro {
  box-shadow: inset 0 0 60px rgba(212, 175, 55, 0.03);
}

body.explorador--maestro .pie-marca {
  opacity: 1;
  text-shadow: 0 0 30px rgba(212, 175, 55, 0.3), 0 0 60px rgba(233, 30, 99, 0.1);
}

/* Secret content — explorador 전용 표시 */
.secret-content {
  display: none;
}
body.explorador .secret-content {
  display: block;
}
body.explorador .secret-content--inline {
  display: inline;
}
