/* UltraSync: paginas del sitio (inicio e invitacion). Tokens, temas y la
   fuente vienen de /ext/ui/tokens.css: los mismos de la extension. */

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--us-ground); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--us-ground);
  color: var(--us-text);
  font: 600 16px/1.55 var(--us-font);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, p, ol, ul { margin: 0; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 2px; }
button, input { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }
.us-i { flex: none; display: block; }

.page { width: min(100% - 32px, 1040px); margin: 0 auto; padding: 24px 0 64px; }
.page.narrow { width: min(100% - 32px, 480px); }

.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 900; letter-spacing: -.01em; text-decoration: none; }
.mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--us-action);
  color: var(--us-on-action);
}

.card {
  background: var(--us-card);
  border-radius: var(--us-radius-xl);
  box-shadow: var(--us-shadow);
  padding: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  border-radius: 16px;
  background: var(--us-surface);
  color: var(--us-text);
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s, transform .35s var(--us-ease-out);
}
.btn:hover { background: color-mix(in srgb, var(--us-surface) 88%, var(--us-text)); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--us-action); color: var(--us-on-action); }
.btn.primary:hover { background: color-mix(in srgb, var(--us-action) 86%, #fff); }
.btn:disabled { cursor: default; transform: none; background: var(--us-surface); color: var(--us-text-2); }
.btn.block { width: 100%; }

.input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  border: 2px solid var(--us-border);
  background: var(--us-card);
  font-size: 16px;
  font-weight: 700;
  outline: none;
  transition: border-color .15s;
}
.input::placeholder { color: var(--us-text-2); opacity: 1; }
.input:focus { border-color: var(--us-action); }
.input[aria-invalid="true"] { border-color: var(--us-warn); }
.input.code { font-size: 22px; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; }
.input.code::placeholder { letter-spacing: .18em; }

.muted { color: var(--us-text-2); }
.hint { font-size: 14px; font-weight: 600; color: var(--us-text-2); }
.hint.err { color: var(--us-warn); font-weight: 800; }

code {
  padding: 2px 7px;
  border-radius: 7px;
  background: var(--us-surface);
  font: 800 .88em/1.4 var(--us-font);
  white-space: nowrap;
}
.copy {
  margin-left: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--us-surface);
  font-size: 13px;
  font-weight: 800;
  transition: background-color .15s;
}
.copy:hover { background: color-mix(in srgb, var(--us-surface) 85%, var(--us-text)); }

/* Pasos de instalacion: aqui el orden si importa. */
.steps { list-style: none; padding: 0; counter-reset: step; display: flex; flex-direction: column; gap: 14px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; }
.steps li::before {
  content: counter(step);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--us-surface);
  font-size: 14px;
  font-weight: 900;
}

/* ------------------------------------------------------------ inicio */

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.top .btn { height: 42px; padding: 0 16px; font-size: 14px; border-radius: 12px; }

.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  align-items: center;
  margin-top: 56px;
}
.hero h1 { font-size: clamp(38px, 5.4vw, 58px); font-weight: 900; line-height: 1.04; letter-spacing: -.03em; text-wrap: balance; }
.lead { margin-top: 18px; max-width: 34em; font-size: 18px; font-weight: 600; color: var(--us-text-2); text-wrap: pretty; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 28px; }
.cta .meta { font-size: 14px; font-weight: 700; color: var(--us-text-2); }

.have { margin-top: 28px; padding: 18px; max-width: 440px; }
.have h2 { font-size: 16px; font-weight: 900; }
.code-row { display: flex; gap: 8px; margin-top: 12px; }
.code-row .input { flex: 1; min-width: 0; }
.have .hint { margin-top: 8px; font-size: 13px; }

/* La escena: el overlay de verdad, en chico, sobre un video cualquiera. */
.scene {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(180deg, #2c3456 0%, #4b3f63 44%, #b8655b 72%, #e8a361 100%);
  box-shadow: var(--us-shadow-lift);
}
.scene .sun { position: absolute; left: 54%; top: 46%; width: 22%; aspect-ratio: 1; border-radius: 50%; background: #f7c77a; opacity: .9; }
.scene .sea { position: absolute; left: 0; right: 0; bottom: 0; height: 34%; background: #1d2238; }
.scene .bar { position: absolute; left: 20px; right: 20px; bottom: 16px; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, .28); }
.scene .bar::before { content: ""; position: absolute; inset: 0 38% 0 0; border-radius: inherit; background: #fff; }

.s-dock {
  position: absolute;
  right: 14px;
  top: 50%;
  translate: 0 -50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, #26201b 95%, transparent);
  color: #f5ece3;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .65);
}
.s-sync { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 40px; padding: 4px 0 7px; margin-bottom: 2px; border-bottom: 1px solid #3d342c; font-size: 11px; font-weight: 700; color: #b9aa9b; }
.s-sync b { color: #f5ece3; font-size: 14px; font-weight: 900; line-height: 1; }
.s-sync i { width: 7px; height: 7px; border-radius: 50%; background: #6fd39a; }
.s-dock span:not(.s-sync) { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.s-dock span.on { background: var(--us-action); color: #1f1915; }

.s-feed { position: absolute; left: 16px; bottom: 34px; display: flex; flex-direction: column; gap: 8px; max-width: 64%; }
.s-msg { display: flex; align-items: flex-end; gap: 8px; }
.s-msg .av { width: 28px; height: 28px; font-size: 15px; }
.s-msg .bubble { padding: 7px 12px 8px; border-radius: 18px 18px 18px 6px; background: color-mix(in srgb, #26201b 95%, transparent); color: #f5ece3; font-size: 14px; font-weight: 600; line-height: 1.35; box-shadow: var(--us-shadow); }
.s-msg .bubble b { display: block; font-size: 12px; font-weight: 900; color: var(--who-ink); }
.s-msg:nth-child(1) { animation: s-in .6s var(--us-ease-out) .3s both; }
.s-msg:nth-child(2) { animation: s-in .6s var(--us-ease-out) 1.2s both; }
@keyframes s-in { from { opacity: 0; transform: translateY(14px) scale(.94); } }

.s-float { position: absolute; right: 74px; bottom: 30%; display: flex; flex-direction: column; align-items: center; gap: 4px; animation: rise 3.2s var(--us-ease-out) infinite; }
.s-float.two { right: 120px; animation-delay: 1.6s; }
.s-float .e { font-size: 38px; line-height: 1; }
.s-float .tag { display: flex; align-items: center; gap: 5px; padding: 3px 8px 3px 3px; border-radius: 999px; background: color-mix(in srgb, #26201b 95%, transparent); color: #f5ece3; font-size: 11px; font-weight: 800; }
.s-float .tag .av { width: 18px; height: 18px; font-size: 10px; }
@keyframes rise {
  0% { opacity: 0; transform: translateY(30px) scale(.6); }
  14% { opacity: 1; transform: translateY(0) scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-120px) scale(.9); }
}

/* avatares (los mismos de la extension) */
.av {
  --who-fill: var(--us-action);
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--who-fill) 30%, #26201b);
  box-shadow: inset 0 0 0 2px var(--who-fill);
  line-height: 1;
}

.features {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 40px 56px;
  align-items: start;
  margin-top: 104px;
}
.features > h2 { font-size: clamp(28px, 3.4vw, 36px); font-weight: 900; line-height: 1.1; letter-spacing: -.025em; text-wrap: balance; }
.features dl { margin: 0; }
.features dl > div { padding: 20px 0; border-top: 1px solid var(--us-border); }
.features dl > div:first-child { padding-top: 4px; border-top: 0; }
.features dt { font-size: 19px; font-weight: 900; letter-spacing: -.01em; }
.features dd { margin: 4px 0 0; max-width: 34em; color: var(--us-text-2); }

.install { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px; align-items: start; margin-top: 88px; padding: 32px; }
.install h2 { font-size: 26px; font-weight: 900; letter-spacing: -.02em; line-height: 1.15; }
.install > div > p { margin-top: 10px; color: var(--us-text-2); }
.install .btn { margin-top: 20px; }

.foot { margin-top: 40px; text-align: center; font-size: 13px; font-weight: 700; color: var(--us-text-2); }

/* ------------------------------------------------------------ invitacion */

.join-card { margin-top: 28px; }
.join-card h1 { font-size: 22px; font-weight: 900; line-height: 1.25; }
.join-card h1 .code { display: block; margin-top: 2px; font-size: 52px; letter-spacing: .1em; line-height: 1.05; }
.join-card .lead { margin-top: 10px; font-size: 16px; }
.join-card .section { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--us-border); }
.join-card .section h2 { font-size: 16px; font-weight: 900; margin-bottom: 14px; }
.join-card .steps { font-size: 15px; }
.join-card .btn.block { margin-top: 4px; }

.me-row { display: flex; align-items: center; gap: 12px; }
.me-row .av { width: 52px; height: 52px; font-size: 27px; background: color-mix(in srgb, var(--who-fill) 24%, var(--us-card)); }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; font-size: 13px; font-weight: 800; color: var(--us-text-2); }
.field .input { color: var(--us-text); }
.form { display: flex; flex-direction: column; gap: 12px; }
.status { font-size: 15px; font-weight: 700; }
.status.ok { color: var(--us-ok); }
.status.err { color: var(--us-warn); font-weight: 800; }

/* ------------------------------------------------------------ angosto */

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 36px; margin-top: 36px; }
  .features { grid-template-columns: 1fr; gap: 20px; margin-top: 72px; }
  .install { grid-template-columns: 1fr; gap: 20px; padding: 24px; margin-top: 64px; }
}
@media (max-width: 480px) {
  .card { padding: 20px; }
  .have { padding: 16px; }
  .scene { border-radius: 20px; }
  .s-feed { max-width: 74%; }
  .s-dock { right: 10px; }
  .join-card h1 .code { font-size: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .s-msg:nth-child(n) { animation: fade .3s ease-out both; }
  .s-float { animation: none; opacity: 1; }
  .s-float.two { display: none; }
  @keyframes fade { from { opacity: 0; } }
}
