/* =========================================================
   EFÍMERO — sistema de diseño
   Concepto: una señal que se apaga. Todo lo que se ve
   sugiere temporalidad: anillos que se vacían, texto que
   se desvanece, un tono de "antes de que se borre".
   ========================================================= */

:root {
  /* Modo claro */
  --bg: #F2F3F7;
  --bg-elevated: #FFFFFF;
  --ink: #14161F;
  --ink-soft: #565A6B;
  --border: #DFE1EA;
  --accent: #6C4CFF;       /* violeta eléctrico — presencia, conexión */
  --accent-ink: #FFFFFF;
  --ember: #FF6F59;        /* coral/ember — lo que expira, lo que se quema */
  --success: #21B37C;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-soft: 0 8px 30px rgba(20, 22, 31, 0.08);
}

[data-theme="dark"] {
  --bg: #0E101A;
  --bg-elevated: #171A28;
  --ink: #EDEEF5;
  --ink-soft: #9297AC;
  --border: #2A2E42;
  --accent: #8B72FF;
  --accent-ink: #0E101A;
  --ember: #FF8468;
  --success: #33D194;
  --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  transition: background 0.3s ease, color 0.3s ease;
}

a { color: inherit; text-decoration: none; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

h1, h2, h3, .font-display {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  margin: 0;
}

.mono { font-family: var(--font-mono); letter-spacing: 0.02em; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-md);
  padding: 12px 22px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 6px 20px rgba(108, 76, 255, 0.35);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(108, 76, 255, 0.45); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1160px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
}
.logo-wrap { position: relative; }
.logo-btn {
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; cursor: pointer;
  color: var(--ink); padding: 6px 4px;
}
.logo-mark { color: var(--accent); display: flex; }
.logo-text { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }

.logo-menu {
  position: absolute; top: calc(100% + 10px); left: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column;
  min-width: 210px;
  padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: all 0.18s ease;
}
.logo-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.logo-menu a {
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 0.92rem; color: var(--ink);
}
.logo-menu a:hover { background: var(--bg); color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-elevated);
  color: var(--ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ---------- Hero ---------- */
.hero {
  max-width: 1160px; margin: 0 auto;
  padding: 72px 24px 40px;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px;
  align-items: center;
}
.hero-eyebrow {
  font-family: var(--font-mono); font-size: 0.8rem;
  color: var(--ember); text-transform: uppercase; letter-spacing: 0.12em;
  display: flex; align-items: center; gap: 8px;
}
.hero-eyebrow::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ember); animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.hero h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.4rem);
  line-height: 1.08; margin: 18px 0 20px;
}
.hero p.lead { color: var(--ink-soft); font-size: 1.08rem; max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }

/* Elemento firma: anillo de cuenta atrás con mensaje disolviéndose */
.vanish-demo {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-soft);
}
.vanish-demo-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.vanish-ring {
  width: 46px; height: 46px; border-radius: 50%;
  background: conic-gradient(var(--ember) var(--pct, 65%), var(--border) 0);
  display: flex; align-items: center; justify-content: center;
}
.vanish-ring span {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.68rem; color: var(--ink-soft);
}
.demo-bubble {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
  font-size: 0.92rem;
  animation: fadeAway 6s ease-in-out infinite;
}
.demo-bubble.b2 { animation-delay: 1.2s; }
.demo-bubble.b3 { animation-delay: 2.4s; }
@keyframes fadeAway {
  0%, 55% { opacity: 1; filter: blur(0); }
  85% { opacity: 0.25; filter: blur(1.5px); }
  100% { opacity: 1; filter: blur(0); }
}

/* ---------- Features ---------- */
.section { max-width: 1160px; margin: 0 auto; padding: 40px 24px; }
.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  margin-top: 28px;
}
.feature-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.feature-card .num { font-family: var(--font-mono); color: var(--accent); font-size: 0.85rem; }
.feature-card h3 { font-size: 1.05rem; margin: 10px 0 8px; }
.feature-card p { color: var(--ink-soft); font-size: 0.92rem; margin: 0; }

/* ---------- Formularios (crear / unirse) ---------- */
.form-card {
  max-width: 460px; margin: 60px auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-soft);
}
.form-card h1 { font-size: 1.6rem; margin-bottom: 6px; }
.form-card .sub { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 26px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.field input[type="text"],
.field input[type="code"] {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--ink); font-size: 0.98rem;
}
.field input.code-input {
  font-family: var(--font-mono); letter-spacing: 0.3em; text-transform: uppercase;
  text-align: center; font-size: 1.3rem;
}
.toggle-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.switch { position: relative; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; background: var(--border);
  border-radius: 999px; cursor: pointer; transition: 0.2s;
}
.switch .slider::before {
  content: ''; position: absolute; width: 18px; height: 18px;
  left: 3px; top: 3px; background: white; border-radius: 50%; transition: 0.2s;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.hint { font-size: 0.78rem; color: var(--ink-soft); margin-top: 6px; }

/* ---------- Sala de chat ---------- */
.chat-shell {
  max-width: 900px; margin: 0 auto; padding: 20px 16px 0;
  display: flex; flex-direction: column;
  height: calc(100vh - 66px);
}
.chat-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  margin-bottom: 14px;
}
.chat-topbar .room-info { display: flex; align-items: center; gap: 12px; }
.chat-topbar .room-code { font-family: var(--font-mono); background: var(--bg); padding: 4px 10px; border-radius: 6px; font-size: 0.85rem; }
.chat-topbar .expiry { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--ink-soft); }

.messages {
  flex: 1; overflow-y: auto; padding: 10px 4px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.msg { max-width: 72%; padding: 10px 14px; border-radius: var(--radius-md); font-size: 0.94rem; }
.msg.mine { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.msg.theirs { align-self: flex-start; background: var(--bg-elevated); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.system { align-self: center; background: transparent; color: var(--ink-soft); font-size: 0.78rem; font-family: var(--font-mono); }
.msg .meta { font-size: 0.7rem; opacity: 0.7; margin-bottom: 3px; }
.msg audio { width: 220px; height: 34px; }
.msg.expiring { animation: fadeAway 2.4s ease-in forwards; }

.composer {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  margin: 14px 0 18px;
}
.composer input[type="text"] {
  flex: 1; border: none; background: transparent; color: var(--ink);
  font-size: 0.98rem; padding: 8px;
}
.composer input:focus { outline: none; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--ink); display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.icon-btn.recording { background: var(--ember); border-color: var(--ember); color: white; animation: pulse 1s infinite; }
.icon-btn.send { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- Legal / páginas de contenido ---------- */
.legal-page { max-width: 760px; margin: 0 auto; padding: 60px 24px 80px; }
.legal-page h1 { font-size: 2rem; margin-bottom: 18px; }
.legal-page h2 { font-size: 1.2rem; margin: 28px 0 10px; }
.legal-page p, .legal-page li { color: var(--ink-soft); font-size: 0.96rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 60px; }
.footer-inner {
  max-width: 1160px; margin: 0 auto; padding: 48px 24px 24px;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px;
}
.footer-logo { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.footer-tagline { color: var(--ink-soft); font-size: 0.88rem; margin: 8px 0 16px; }
.footer-col h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); margin-bottom: 12px; }
.footer-col a { display: block; padding: 5px 0; font-size: 0.9rem; color: var(--ink-soft); }
.footer-col a:hover { color: var(--accent); }
.lang-select select {
  background: var(--bg); border: 1px solid var(--border); color: var(--ink);
  border-radius: var(--radius-sm); padding: 6px 10px; font-size: 0.85rem;
}
.footer-bottom {
  text-align: center; padding: 16px; font-size: 0.78rem; color: var(--ink-soft);
  border-top: 1px solid var(--border);
}

/* ---------- Scroll to top ---------- */
.scroll-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--shadow-soft);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: all 0.2s ease;
}
.scroll-top.show { opacity: 1; visibility: visible; transform: translateY(0); }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed; left: 20px; right: 20px; bottom: 20px; z-index: 70;
  max-width: 640px; margin: 0 auto;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-soft);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 12px;
}
.cookie-banner p { margin: 0; font-size: 0.86rem; color: var(--ink-soft); }
.cookie-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .features-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}
