:root {
  --bg: #0e1729;
  --navy-card: rgba(13, 21, 36, 0.88);
  --navy-solid: #121c30;
  --border: rgba(214, 224, 240, 0.16);
  --ivory: #e6e2da;
  --ivory-hover: #d8d3c9;
  --text: #e8ecf2;
  --muted: #9aa7bd;
  --accent: #7cb4ff;
  --amber: #f3b86b;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: var(--font-sans); overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.app-shell { position: relative; width: 100vw; height: 100vh; overflow: hidden; background: var(--bg); }
#scene-canvas { width: 100%; height: 100%; display: block; cursor: default; }

/* Barra superior arquitectónica minimalista */
.tt-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 36;
  height: 64px; padding: 0 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: linear-gradient(180deg, rgba(10, 17, 32, 0.72) 0%, rgba(10, 17, 32, 0.24) 68%, transparent 100%);
  pointer-events: none;
}
.tt-topbar > * { pointer-events: auto; }

.tt-brand {
  display: inline-flex; align-items: center; gap: 10px;
  border: 0; background: transparent; color: var(--text); cursor: pointer; padding: 4px 0;
  white-space: nowrap;
}
.tt-logo-box {
  width: 26px; height: 26px; display: grid; place-items: center;
  color: var(--ivory); opacity: 0.92;
}
.tt-logo-box svg { width: 22px; height: 22px; }
.tt-brand-name {
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.24em; color: var(--ivory);
}
.tt-brand-sep { color: rgba(230, 226, 218, 0.35); }
.tt-brand-sub {
  font-size: 10px; font-weight: 500; letter-spacing: 0.2em; color: rgba(230, 226, 218, 0.68);
}

.tt-nav { display: flex; align-items: center; gap: 18px; }
.tt-nav-link {
  border: 0; background: transparent; color: rgba(232, 236, 242, 0.68);
  font: 500 10.5px/1 var(--font-sans); letter-spacing: 0.18em; cursor: pointer;
  padding: 6px 2px; border-bottom: 1.5px solid transparent; transition: color .2s, border-color .2s;
  white-space: nowrap;
}
.tt-nav-link:hover, .tt-nav-link.on { color: var(--ivory); border-bottom-color: var(--ivory); }

.tt-auto-btn {
  border: 1px solid rgba(124, 180, 255, 0.42);
  background: rgba(16, 29, 54, 0.68); color: #cde2ff;
  font: 500 11px/1 var(--font-sans); letter-spacing: 0.06em;
  padding: 8px 13px; border-radius: 999px; cursor: pointer;
  backdrop-filter: blur(12px); transition: all .2s; white-space: nowrap;
}
.tt-auto-btn:hover, .tt-auto-btn.playing {
  background: rgba(124, 180, 255, 0.22); border-color: #9ec8ff; color: var(--ivory);
}

.tt-cta-btn {
  border: 0; background: var(--ivory); color: #0e1626;
  font: 600 10.5px/1 var(--font-sans); letter-spacing: 0.16em;
  padding: 10px 16px; border-radius: 3px; cursor: pointer;
  transition: background .2s, transform .18s; white-space: nowrap;
}
.tt-cta-btn:hover { background: var(--ivory-hover); transform: translateY(-1px); }

.tt-ref-note {
  position: fixed; top: 62px; left: 26px; z-index: 24;
  font-size: 10px; letter-spacing: 0.1em; color: rgba(215, 224, 240, 0.56);
  pointer-events: none;
}

/* Sobrescribir estilo de polígonos para la línea fina blanca-azul */
.app-shell .mp-poly {
  fill: rgba(185, 218, 255, 0.0);
  stroke: rgba(226, 238, 255, 0.0);
  stroke-width: 1.5;
  stroke-dasharray: none;
  opacity: 1;
}
.app-shell .mp-poly:hover, .app-shell .mp-poly.active {
  fill: rgba(190, 220, 255, 0.16);
  stroke: rgba(235, 243, 255, 0.94);
  stroke-width: 1.8;
  filter: drop-shadow(0 0 10px rgba(145, 198, 255, 0.72));
}

/* Tooltip oscuro arquitectónico exacto al video (número a la izq + ficha a la der) */
.app-shell .mp-hover-card {
  border-radius: 6px; padding: 10px 14px;
  background: rgba(12, 19, 34, 0.92);
  border: 1px solid rgba(214, 226, 245, 0.24);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.56);
}
.app-shell .mp-hover-card .tag {
  border-radius: 3px; background: rgba(230, 226, 218, 0.14); color: var(--ivory);
  font-family: var(--font-serif); font-size: 15px; font-weight: 600; padding: 2px 8px;
}

/* Destello de extracción sobre la fachada */
.tt-facade-highlight {
  position: fixed; inset: 0; z-index: 25; pointer-events: none;
  display: grid; place-items: center;
  transition: opacity .35s ease;
}
.tt-facade-highlight.hidden { opacity: 0; }
.tt-facade-frame {
  width: min(82vw, 1080px); height: 9.2vh; min-height: 52px;
  border: 2px solid rgba(236, 244, 255, 0.95);
  background: rgba(164, 206, 255, 0.14);
  box-shadow: 0 0 28px rgba(130, 190, 255, 0.55), inset 0 0 18px rgba(230, 240, 255, 0.25);
  position: relative; display: grid; place-items: center;
  animation: ttExtractPulse 0.95s ease-in-out infinite;
}
@keyframes ttExtractPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.015); }
}
.tt-facade-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 6px rgba(243, 184, 107, 0.28), 0 0 18px rgba(243, 184, 107, 0.9);
}
.tt-facade-tag {
  position: absolute; bottom: -32px; left: 50%; transform: translateX(-50%);
  padding: 5px 12px; border-radius: 4px; white-space: nowrap;
  background: rgba(11, 18, 32, 0.9); border: 1px solid var(--border);
  font-size: 10px; font-weight: 600; letter-spacing: 0.18em; color: var(--ivory);
}

/* Pill flotante dentro de la maqueta 3D */
.tt-float-pill {
  position: fixed; left: 39%; top: 47%; transform: translate(-50%, -50%); z-index: 28;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(14, 22, 38, 0.86); border: 1px solid rgba(230, 226, 218, 0.42);
  color: var(--ivory); font: 600 10px/1 var(--font-sans); letter-spacing: 0.16em;
  cursor: pointer; backdrop-filter: blur(12px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.48);
  transition: opacity .28s, transform .2s, background .2s;
}
.tt-float-pill:hover { background: var(--ivory); color: #0e1626; transform: translate(-50%, -52%) scale(1.04); }
.tt-float-pill.hidden { opacity: 0; pointer-events: none; }
.tt-pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--amber);
  box-shadow: 0 0 0 4px rgba(243, 184, 107, 0.3);
}

/* Guía discreta inferior izquierda en vista torre */
.tt-tower-cue {
  position: fixed; left: 26px; bottom: 62px; z-index: 26;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 13px; border-radius: 4px;
  background: rgba(11, 18, 32, 0.72); border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  font-size: 10px; font-weight: 500; letter-spacing: 0.16em; color: rgba(230, 236, 245, 0.84);
  transition: opacity .28s;
}
.tt-tower-cue.hidden { opacity: 0; pointer-events: none; }
.tt-cue-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* Tarjeta oscura "Residencia A" (derecha de la maqueta flotante) */
.tt-res-card {
  position: fixed; right: 34px; top: 50%; transform: translateY(-50%); z-index: 32;
  width: min(332px, calc(100vw - 32px));
  padding: 24px 24px 22px; border-radius: 8px;
  background: var(--navy-card); border: 1px solid var(--border);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.58);
  transition: opacity .42s cubic-bezier(.16, 1, .3, 1), transform .42s cubic-bezier(.16, 1, .3, 1);
}
.tt-res-card.hidden { opacity: 0; pointer-events: none; transform: translate(28px, -50%); }

.tt-res-kicker {
  display: block; font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.2em; color: var(--accent); text-transform: uppercase;
}
.tt-card-x {
  border: 1px solid var(--border); background: rgba(255,255,255,0.06); color: var(--muted);
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 11px;
  display: grid; place-items: center; flex-shrink: 0;
}
.tt-card-x:hover { color: var(--ivory); border-color: var(--ivory); }
.tt-res-title {
  margin: 6px 0 16px; font-family: var(--font-serif);
  font-size: 32px; font-weight: 500; line-height: 1.02; color: var(--ivory);
}

.tt-res-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.tt-res-stats b { display: block; font-size: 16px; font-weight: 600; color: var(--ivory); }
.tt-res-stats small { display: block; font-size: 9px; letter-spacing: 0.14em; color: var(--muted); margin-top: 3px; }

.tt-res-divider { height: 14px; }
.tt-res-price-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.tt-res-price-lbl { font-size: 9.5px; letter-spacing: 0.18em; color: var(--muted); }
.tt-res-price { font-family: var(--font-serif); font-size: 26px; font-weight: 600; color: var(--ivory); }

.tt-res-desc {
  margin: 0 0 14px; font-size: 12.2px; line-height: 1.55; color: var(--muted);
}
.tt-res-list {
  margin: 0 0 18px; padding: 0; list-style: none; display: grid; gap: 7px;
}
.tt-res-list li {
  font-size: 11.5px; color: rgba(232, 236, 242, 0.84);
  padding-left: 14px; position: relative;
}
.tt-res-list li::before {
  content: ""; position: absolute; left: 0; top: 6px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}

.tt-res-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tt-btn-outline {
  border: 1px solid rgba(230, 226, 218, 0.28); background: transparent; color: var(--ivory);
  font: 600 9.8px/1.2 var(--font-sans); letter-spacing: 0.12em;
  padding: 12px 10px; border-radius: 3px; cursor: pointer; text-align: center;
  transition: background .2s, border-color .2s;
}
.tt-btn-outline:hover { background: rgba(230, 226, 218, 0.1); border-color: var(--ivory); }

.tt-btn-ivory {
  border: 0; background: var(--ivory); color: #0e1626;
  font: 700 9.8px/1.2 var(--font-sans); letter-spacing: 0.12em;
  padding: 12px 10px; border-radius: 3px; cursor: pointer; text-align: center; text-decoration: none;
  transition: background .2s;
}
.tt-btn-ivory:hover { background: var(--ivory-hover); }

/* Modal ligero Solicitar Info */
.tt-modal {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(7, 12, 22, 0.72); backdrop-filter: blur(10px);
  display: grid; place-items: center; padding: 18px;
  transition: opacity .24s;
}
.tt-modal.hidden { opacity: 0; pointer-events: none; }
.tt-modal-card {
  width: min(440px, 100%); padding: 26px; border-radius: 10px;
  background: var(--navy-solid); border: 1px solid var(--border);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.65);
}
.tt-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tt-modal-head h2 { margin: 6px 0 0; font-family: var(--font-serif); font-size: 27px; font-weight: 500; color: var(--ivory); }
.tt-modal-close {
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
}
.tt-modal-copy { margin: 14px 0 20px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.tt-modal-copy b { color: var(--ivory); }
.tt-modal-actions { display: grid; grid-template-columns: 1.25fr 1fr; gap: 10px; }

/* Objetos propios del Inicio tipo app de THE SOLENNE (prefijo tt-obj-) */
.tt-obj-tower {
  width: 112px; height: 196px; border-radius: 4px;
  background: linear-gradient(180deg, rgba(124,180,255,.18), rgba(14,23,41,.9));
  border: 1.5px solid rgba(230,226,218,.42); position: relative;
  display: flex; flex-direction: column; justify-content: space-evenly; padding: 10px 8px;
  box-shadow: 0 22px 44px rgba(0,0,0,.5);
}
.tt-obj-tower i {
  display: block; height: 7px; border-radius: 1px; background: rgba(230,226,218,.18);
}
.tt-obj-tower i.lit {
  background: var(--ivory); box-shadow: 0 0 18px rgba(124,180,255,.95);
  transform: translateX(14px); animation: ttSlideSlab 2.8s ease-in-out infinite;
}
@keyframes ttSlideSlab {
  0%, 100% { transform: translateX(4px); }
  50% { transform: translateX(22px); }
}

.tt-obj-cut {
  width: 210px; height: 126px; border-radius: 6px;
  background: #17233b; border: 1.5px solid rgba(230,226,218,.5);
  transform: perspective(500px) rotateX(44deg) rotateZ(-14deg);
  display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 6px; padding: 10px;
  box-shadow: 0 24px 40px rgba(0,0,0,.55);
}
.tt-obj-cut span { border: 1px solid rgba(243,184,107,.45); background: rgba(243,184,107,.12); border-radius: 3px; }

.tt-obj-sea {
  width: 210px; height: 132px; border-radius: 8px; overflow: hidden;
  border: 1.5px solid rgba(230,226,218,.4); position: relative;
  background: linear-gradient(180deg, #1b3f82 0%, #2a5fb3 52%, #132544 100%);
  display: grid; place-items: end center; padding-bottom: 14px;
}
.tt-obj-sea b { font-family: var(--font-serif); font-size: 20px; color: var(--ivory); letter-spacing: .06em; }

@media (max-width: 1120px) {
  .tt-brand-sep, .tt-brand-sub { display: none; }
  .tt-nav { gap: 11px; }
  .tt-res-card { right: 18px; width: 288px; padding: 18px 18px 16px; }
  .tt-res-title { font-size: 27px; margin-bottom: 12px; }
  .tt-float-pill { left: 34%; }
}

@media (max-width: 740px) {
  .tt-res-card { right: 14px; left: 14px; top: auto; bottom: 56px; transform: none; width: auto; padding: 16px; }
  .tt-res-card.hidden { transform: translateY(20px); }
  .tt-float-pill { left: 50%; top: 38%; }
}
