:root {
  color-scheme: dark;
  --ink: #09080b; --white: #f3e9dc; --muted: #c8c1bb;
  --button: #e4007c; --button-text: #ffffff; --link: #f2b705; --eyebrow: #f2b705;
  --wood: #e4007c; --monitor: #2a3d8f; --chair: #6a2c70; --plant: #f2b705;
  --floor: #e8681b; --rug: #6a2c70; --wall: #f3e9dc; --mug: #f3e9dc; --cart: #f2b705;
  --jade: #2DE2C4; --surface: #100e12d9; --border: #827b85;
}
* { box-sizing: border-box; }
html { min-width: 280px; background: var(--ink); }
body { margin: 0; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--white); }
a { color: var(--link); text-underline-offset: 5px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; }
.page { position: relative; isolation: isolate; height: 100svh; min-height: 0; overflow: hidden; background: var(--ink); }
header { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px clamp(24px, 4vw, 64px); }
.brand { display: inline-flex; align-items: baseline; gap: 12px; text-decoration: none; color: var(--white); font-size: 20px; letter-spacing: -.6px; font-weight: 700; }
.brand span { font-size: 14px; font-weight: 500; letter-spacing: -.2px; color: var(--link); }
.demo-link { font-size: 13px; font-weight: 500; white-space: nowrap; }
/* Selector de idioma «EN · ES» (v16): enlaces normales, sin cookies ni redirección. */
.header-end { display: flex; align-items: center; gap: 18px; }
.lang { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.lang a { padding: 4px 3px; color: var(--muted); text-decoration: none; }
.lang a:hover { color: var(--white); text-decoration: underline; text-underline-offset: 5px; }
.lang a[aria-current="page"] { color: var(--white); font-weight: 600; }
main { display: block; }
.hero { position: absolute; z-index: 2; top: 65px; left: clamp(24px, 4vw, 64px); max-width: 460px; padding: 8px 0; }
.hero::before { content: ""; position: absolute; z-index: -1; inset: -28px -55px; background: radial-gradient(ellipse at 25% 40%, #09080bb3, transparent 72%); pointer-events: none; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 7px; font-size: 10px; line-height: 1.4; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; color: var(--eyebrow); }
.eyebrow::before { content: ""; flex-shrink: 0; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
h1 { margin: 0; font-size: clamp(40px, 3.5vw, 56px); line-height: 1.05; letter-spacing: -.05em; font-weight: 750; }
.promise { margin: 5px 0 0; font-size: 14px; line-height: 1.4; color: var(--muted); font-weight: 500; }
.intro { margin: 6px 0 0; max-width: 440px; font-size: 14px; line-height: 1.5; color: var(--eyebrow); text-wrap: balance; }
#room { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; }
#room canvas { display: block; width: 100%; height: 100%; }
.room-overlay { position: absolute; inset: 0; visibility: hidden; }
#room[data-rendering="webgl"] .room-overlay { visibility: visible; }
.dialogue { position: absolute; left: 0; top: 0; width: 214px; display: grid; gap: 5px; will-change: transform; }
.dialogue[hidden], .dialogue [hidden], .camera-label[hidden], .scene-indicator[hidden] { display: none; }
.bubble { padding: 8px 11px; border: 1px solid var(--link); border-radius: 10px 10px 10px 2px; background: var(--ink); color: var(--white); font-size: 13px; line-height: 1.35; box-shadow: 0 3px 18px #0007; }
.speaker { display: block; margin-bottom: 2px; color: var(--link); font-size: 9px; letter-spacing: .08em; }
.reply { justify-self: end; min-width: 54px; border-radius: 9px 9px 2px 9px; border-color: var(--button); background: var(--button); color: var(--button-text); }
.reply .speaker { color: inherit; opacity: .9; }
.confirmation { position: absolute; left: 0; top: 0; padding: 4px 6px; border-radius: 5px; background: var(--ink); color: var(--link); font-size: 10px; line-height: 1.3; }
.scene-code { position: absolute; margin: 0; padding: 7px 9px; border: 1px dotted var(--link); border-radius: 6px; background: var(--ink); color: var(--white); font: 10px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre; }
.scene-code[hidden] { display: none; }
.camera-label { position: absolute; padding: 2px 4px; color: var(--muted); background: var(--ink); border-radius: 3px; font: 8px/1.3 ui-monospace, monospace; }
.camera-label[data-confirming="true"] { color: var(--link); }
/* Dock inferior: selector de escena + formulario, uno sobre otro (el selector nunca tapa texto ni formulario). */
.dock { position: absolute; z-index: 2; bottom: 42px; left: 50%; transform: translateX(-50%); width: min(calc(100% - 40px), 620px); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.scene-picker { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 14px; max-width: 100%; }
.scene-switch { display: flex; gap: 6px; }
.scene-pill { height: 28px; padding: 0 13px; border: 1px solid var(--border); border-radius: 999px; background: #100e12e6; color: var(--white); font-size: 12px; font-weight: 600; letter-spacing: .01em; }
.scene-pill:hover { border-color: var(--white); }
.scene-pill[aria-pressed="true"] { border-color: var(--button); background: var(--button); color: var(--button-text); }
.scene-indicator { text-align: center; padding: 4px 8px 2px; border-radius: 10px; background: #100e12b3; }
.scene-indicator[hidden] { display: block !important; visibility: hidden; }
.scene-name { margin: 0; font-size: 10px; line-height: 1.2; color: var(--muted); }
.scene-dots { display: flex; justify-content: center; }
.scene-dots button:nth-child(5) { margin-left: 10px; }
.scene-dots button { position: relative; width: 16px; height: 18px; padding: 0; gap: 0; border-radius: 4px; background: none; transition: none; }
.scene-dots button:hover { transform: none; }
.scene-dots button::before { content: ""; position: absolute; inset: 0; margin: auto; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); opacity: .5; }
.scene-dots button:hover::before { opacity: 1; }
.scene-dots button[data-active="true"]::before { width: 6px; height: 6px; background: var(--link); opacity: 1; }
/* Respaldo sin WebGL: plano de puntos en CSS, sin recursos adicionales. */
#room[data-rendering="fallback"] { background: radial-gradient(ellipse at center, #ffffff08, transparent 70%); }
#room[data-rendering="fallback"]::before { content: ""; position: absolute; inset: 14% 14% 12%; border: 1px dotted var(--wall); border-bottom-color: var(--wood); background: radial-gradient(circle, var(--wood) 1px, transparent 1.4px) 0 0 / 17px 17px; transform: perspective(700px) rotateX(9deg) rotateY(-12deg); opacity: .65; }
#room[data-rendering="fallback"]::after { content: ""; position: absolute; width: 25%; height: 24%; left: 28%; top: 36%; border: 2px dotted var(--monitor); box-shadow: 0 65px 0 -1px var(--ink), 0 67px 0 0 var(--wood); }
.signup { width: 100%; padding: 10px 12px; border: 1px solid #ffffff14; border-radius: 12px; background: #100e129e; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
form { position: relative; width: 100%; margin: 0; padding: 0; text-align: left; }
.form-row { display: flex; gap: 8px; }
input[type="email"] { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: 7px; background: #0c0b0ef0; color: var(--white); font: inherit; font-size: 14px; }
input::placeholder { color: var(--muted); opacity: 1; }
input[type="email"]:focus { border-color: var(--link); }
button { display: inline-flex; justify-content: center; align-items: center; gap: 14px; border: 0; border-radius: 7px; padding: 0 18px; height: 44px; background: var(--button); color: var(--button-text); font: inherit; font-weight: 650; font-size: 14px; white-space: nowrap; cursor: pointer; transition: transform .18s; }
button:hover { transform: translateY(-1px); }
button:disabled { cursor: wait; opacity: .8; transform: none; }
button svg { width: 16px; height: 16px; }
/* Casillas del aviso (v14): dos columnas en escritorio para no alargar el formulario. */
.consents { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 18px; margin: 9px 0 0; }
.consent { padding-right: 0; display: flex; align-items: flex-start; gap: 8px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.consent input { flex-shrink: 0; width: 16px; height: 16px; margin: 0; accent-color: var(--button); }
.consent label { cursor: pointer; }
.consent .opt { color: var(--white); opacity: .72; white-space: nowrap; }
.notice-short { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.notice-short .pending { color: var(--white); background: #e4007c40; border-radius: 3px; padding: 0 3px; white-space: nowrap; }
.status { margin: 0; font-size: 13px; line-height: 1.5; color: var(--white); }
.status:not(:empty) { margin-top: 8px; }
.status[data-state="error"] { color: #ffc5b8; }
.camera-invite { display: flex; justify-content: center; position: relative; margin-top: 14px; }
.secondary { height: 42px; padding: 0 16px; gap: 9px; border: 1.5px solid var(--jade); background: #05080af2; color: #ffffff; font-size: 15px; font-weight: 500; animation: camera-pulse 4s ease-in-out infinite; }
.secondary svg { width: 19px; height: 19px; color: var(--jade); }
@keyframes camera-pulse { 0%, 65%, 100% { box-shadow: 0 0 0 0 #2de2c400; } 80% { box-shadow: 0 0 0 4px #2de2c426; } }
.camera-invite .status { font-size: 12px; }
[hidden] { display: none !important; }
.camera-controls { position: absolute; z-index: 3; right: 22px; bottom: 48px; width: 190px; padding-right: 30px; color: var(--muted); font-size: 11px; }
.camera-actions { position: absolute; right: 0; top: 4px; display: grid; gap: 5px; }
.icon-button { width: 25px; height: 25px; padding: 3px; border: 1px solid var(--border); background: #09080bcc; color: var(--white); font-size: 15px; font-weight: 400; gap: 0; }
.icon-button:disabled { cursor: default; opacity: .35; }
.icon-button[aria-pressed="true"] { color: var(--link); border-color: var(--link); }
.camera-tutorial { display: block; margin: 7px -30px 0 0; text-align: center; white-space: nowrap; color: var(--white); font-size: 11px; }
.camera-preview { position: relative; width: 160px; aspect-ratio: 4 / 3; border: 1px solid var(--link); border-radius: 14px; overflow: hidden; background: var(--ink); }
#camera-video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camera-preview span { position: absolute; bottom: 4px; left: 5px; font-size: 9px; color: var(--white); background: #09080bcc; padding: 3px 5px; border-radius: 6px; }
.camera-preview span::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; margin-right: 5px; background: var(--link); }
.camera-info { position: absolute; right: 0; bottom: 100%; width: min(300px, calc(100vw - 32px)); margin-bottom: 8px; padding: 12px; background: #100e12ee; border: 1px solid var(--border); border-radius: 10px; font-size: 11px; line-height: 1.5; }
.camera-info p { margin: 0 0 8px; }
.camera-info p:last-child { margin: 0; }
.camera-choices { display: block; margin-top: 4px; }
#camera-status { position: absolute; bottom: 30px; right: 0; width: 260px; background: var(--ink); }
#camera-status:empty { display: none; }
.page:has(.camera-controls:not([hidden])) .dock { width: min(calc(100% - 280px), 580px); left: 45%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
footer { position: absolute; z-index: 2; bottom: 0; width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px clamp(24px, 4vw, 64px); color: var(--muted); font-size: 11px; }
footer p { margin: 0; }
footer p::before { content: ""; display: inline-block; vertical-align: 2px; margin-right: 8px; width: 4px; height: 4px; border-radius: 50%; background: var(--eyebrow); }
/* Escritorio (≥761 px): el selector va arriba, junto a «Watch the demo», lejos de los aparatos; el formulario recupera su posición propia. */
@media (min-width: 761px) {
  .dock { display: contents; }
  .signup { position: absolute; z-index: 2; bottom: 42px; left: 50%; transform: translateX(-50%); width: min(calc(100% - 40px), 620px); }
  .page:has(.camera-controls:not([hidden])) .signup { width: min(calc(100% - 280px), 580px); left: 45%; }
  .scene-picker { position: absolute; z-index: 3; top: 11px; right: calc(clamp(24px, 4vw, 64px) + 190px); max-width: none; flex-wrap: nowrap; }
}
/* v17: escritorio ancho (≥1000 px). El bloque del formulario era de ~239 px y cruzaba aparatos; ahora es una franja baja y ancha:
   fila 1 = correo + «Join the waitlist» + botón de cámara a la derecha; fila 2 = casillas en 2 columnas; fila 3 = aviso corto.
   El cuarto de puntos NO cambia (no se toca la cámara ni el encuadre). En modo cámara (panel a la derecha) vuelve al bloque apilado de 580 px. */
@media (min-width: 1000px) {
  .signup { bottom: 28px; width: min(calc(100% - 40px), 960px); padding: 9px 12px 8px; }
  .signup .form-row { padding-right: calc(var(--camera-btn-w, 232px) + 14px); }
  .signup .camera-invite { position: absolute; top: 9px; right: 12px; margin: 0; }
  .signup .secondary { height: 44px; }
  .signup .consents { margin-top: 7px; gap: 3px 22px; }
  .signup .notice-short { margin-top: 6px; font-size: 12px; line-height: 1.4; }
  .signup #camera-status { bottom: calc(100% + 8px); }
  .page:has(.camera-controls:not([hidden])) .signup { bottom: 28px; padding: 9px 12px 8px; }
  .page:has(.camera-controls:not([hidden])) .signup .form-row { padding-right: 0; }
  .page:has(.camera-controls:not([hidden])) .signup .camera-invite { position: relative; top: auto; right: auto; margin-top: 0; }
  .page:has(.camera-controls:not([hidden])) .signup .consents { margin-top: 7px; gap: 3px 18px; }
  .page:has(.camera-controls:not([hidden])) .signup .notice-short { margin-top: 6px; line-height: 1.4; }
  .page:has(.camera-controls:not([hidden])) .signup #camera-status { bottom: 30px; }
}
/* v18: sólo tableta/ventana mediana. Franja flotante y selector dentro de la barra.
   La variable también delimita los cambios del encuadre 3D en main.js. */
@media (min-width: 761px) and (max-width: 1024px) {
  .page { --tablet-layout: 1; }
  header { padding: 18px 24px; gap: 12px; }
  .brand { gap: 8px; }
  .header-end { gap: 12px; }
  .dock { display: contents; }
  .scene-picker { position: absolute; z-index: 3; top: 11px; right: 210px; max-width: none; flex-wrap: nowrap; gap: 10px; }
  .scene-indicator { width: 170px; }
  .hero { top: 65px; left: 24px; }
  .signup { position: absolute; z-index: 2; bottom: 28px; left: 50%; transform: translateX(-50%); width: calc(100% - 40px); padding: 9px 12px 8px; }
  .signup .form-row { padding-right: calc(var(--camera-btn-w, 232px) + 14px); }
  .signup .camera-invite { position: absolute; top: 9px; right: 12px; margin: 0; }
  .signup .secondary { height: 44px; }
  .signup .consents { margin-top: 7px; gap: 3px 18px; }
  .signup .notice-short { margin-top: 6px; font-size: 12px; line-height: 1.4; }
  .signup #camera-status { bottom: calc(100% + 8px); }
  .page:has(.camera-controls:not([hidden])) .signup { width: calc(100% - 280px); left: 45%; bottom: 28px; }
  .page:has(.camera-controls:not([hidden])) .signup .form-row { padding-right: 0; }
  .page:has(.camera-controls:not([hidden])) .signup .camera-invite { position: relative; top: auto; right: auto; margin: 0; }
  .page:has(.camera-controls:not([hidden])) .signup #camera-status { bottom: 30px; }
}
@media (max-width: 600px) {
  header { padding: 18px 20px; gap: 10px; }
  .brand { font-size: 17px; gap: 7px; }
  .brand span { font-size: 12px; }
  .demo-link { font-size: 11px; }
  .header-end { gap: 12px; }
  .lang { font-size: 11px; }

  .hero { top: 62px; left: 20px; right: 20px; max-width: 350px; padding: 0; }
  .eyebrow { font-size: 9px; letter-spacing: 1.2px; max-width: 340px; margin-bottom: 10px; }
  h1 { font-size: clamp(32px, 8.8vw, 44px); }
  .promise { font-size: 13px; margin-top: 6px; }
  .intro { margin: 9px 0 0; max-width: 330px; font-size: 12px; line-height: 1.5; }
  .dock { bottom: 42px; }
  .camera-invite { margin-top: 14px; }
  .consents { grid-template-columns: 1fr; gap: 4px; margin-top: 7px; }
  .consent { font-size: 10.5px; line-height: 1.4; gap: 7px; }
  .notice-short { font-size: 12px; line-height: 1.4; margin-top: 6px; }
  /* v19: recuperar espacio en el formulario ES sin bajar el aviso de 12 px.
     Al ocultar el botón de cámara también queda espacio para las flechas de viaje. */
  :lang(es) .consents { gap: 2px; margin-top: 2px; }
  :lang(es) .notice-short { line-height: 1.25; margin-top: 4px; }
  :lang(es) .camera-invite { margin-top: 2px; }
  .camera-controls { bottom: var(--controls-bottom, 282px); right: 12px; width: 144px; padding-right: 26px; } /* v14: antes 240px; el formulario con casillas es más alto y el panel tapaba el botón */
  .camera-preview { width: 118px; }
  .camera-tutorial { font-size: 9px; margin-right: -26px; }
  .icon-button { width: 23px; height: 23px; }
  .camera-actions { gap: 3px; }
  .page:has(.camera-controls:not([hidden])) .dock { width: calc(100% - 40px); left: 50%; }
  .dialogue { width: 172px; gap: 4px; }
  .bubble { padding: 6px 8px; font-size: 11px; }
  .speaker { font-size: 8px; }
  .confirmation { font-size: 9px; }
  .scene-code { font-size: 8px; padding: 5px 7px; }
  .camera-label { font-size: 7px; }
  form { width: 100%; padding: 0; }
  .form-row { gap: 8px; }
  .form-row input[type="email"] { padding: 0 11px; font-size: 13px; }
  button { padding: 0 12px; gap: 7px; font-size: 12px; }
  button svg { width: 13px; height: 13px; }
  footer { padding: 18px 20px; font-size: 10px; }
}
@media (max-width: 360px) { .form-row { flex-direction: column; } .form-row input[type="email"] { flex: none; width: 100%; } button { width: 100%; } .brand { font-size: 15px; } .demo-link { font-size: 10px; } .header-end { gap: 8px; } .lang { font-size: 10px; } }
/* v16: en ≤300 px (p. ej. plegable cerrado, 280) el selector EN · ES no cabe junto a «Watch the demo»; ese enlace sólo baja a #demo, que ya está en pantalla. */
@media (max-width: 300px) { .demo-link { display: none; } }
@media (prefers-reduced-motion: reduce) { .secondary { animation: none; } button { transition: none; } button:hover { transform: none; } }
