:root {
  --bg: #000000;
  --fg: #ffffff;
  --muted: rgba(255, 255, 255, 0.45);
  --line: rgba(255, 255, 255, 0.14);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* El scroll suave lo maneja scroll.js (con más calma). */
html { scroll-behavior: auto; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Space Grotesk", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Canvas de estrellas: fijo, detrás del contenido */
#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

/* ---------- Navbar ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 40px;
  background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: color 0.4s ease;
}

.nav__logo {
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.28em;
  color: currentColor;
  text-decoration: none;
}

.nav__links { display: flex; gap: 28px; }

.nav__links a {
  color: inherit;
  opacity: 0.55;
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: opacity 0.25s ease;
}
.nav__links a:hover { opacity: 1; }

.nav__cta {
  color: currentColor;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 20px;
  border: 1px solid currentColor;
  border-radius: 100px;
  opacity: 0.9;
  transition: opacity 0.25s ease, background 0.25s ease;
}
.nav__cta:hover { opacity: 1; background: rgba(128,128,128,0.12); }

/* La barra por defecto es clara (sobre el espacio). Sobre paneles blancos se invierte. */
.nav { color: #ffffff; }
.nav.nav--inverted { color: #000000; }

/* ---------- Paneles ---------- */
main { position: relative; z-index: 1; }

.panel {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 8vw;
  overflow: hidden;
}

.panel--dark { color: var(--fg); }
.panel--light { color: #000; }

/* Hero casi a pantalla completa: deja asomar apenas un sliver del marco
   blanco del panel siguiente (en su estado pequeño con esquinas redondeadas). */
.panel--hero { min-height: 92vh; padding-bottom: 40px; }

.panel__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1160px;
}

.center { text-align: center; display: flex; flex-direction: column; align-items: center; }

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  width: 100vw;
  min-width: 100vw;
  max-width: none;
  flex: 0 0 100vw;
  margin-left: 0;
  gap: 0;
}
.split .col {
  width: min(calc(100% - 72px), 520px);
  max-width: 520px;
  justify-self: center;
  transform: translateX(24px);
}

/* La "hoja" blanca que se expande al hacer scroll (reveal expansivo) */
.reveal-panel .sheet {
  position: absolute;
  inset: 6vh 6vw;
  background: #ffffff;
  border-radius: 28px;
  z-index: 1;
  transition: inset 1s var(--ease), border-radius 1s var(--ease);
}
.reveal-panel.is-in .sheet {
  inset: 0;
  border-radius: 0;
}

/* ---------- Tipografía ---------- */
.eyebrow {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-bottom: 26px;
}

/* En el hero el eyebrow es una frase: mejor en caja normal y legible */
.panel--hero .eyebrow {
  text-transform: none;
  letter-spacing: 0.03em;
  font-size: clamp(13px, 1.5vw, 16px);
  opacity: 0.6;
  max-width: 42ch;
}

/* Etiqueta "Próximamente" */
.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 10px;
  border: 1px solid currentColor;
  border-radius: 100px;
  font-size: 10px;
  letter-spacing: 0.14em;
  opacity: 0.7;
  vertical-align: middle;
}

.display {
  font-size: clamp(56px, 12vw, 160px);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 0.95;
}

.lead {
  margin-top: 26px;
  font-size: clamp(16px, 2vw, 21px);
  font-weight: 400;
  opacity: 0.65;
}

.statement {
  font-size: clamp(30px, 5.5vw, 68px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.01em;
  max-width: 20ch;
}

.title {
  font-size: clamp(30px, 4.6vw, 56px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.body {
  margin-top: 20px;
  font-size: clamp(15px, 1.6vw, 18px);
  opacity: 0.6;
  max-width: 34ch;
}

.scrollcue {
  margin-top: 56px;
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.4;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* Recuadro placeholder para el visual del producto */
.visual {
  width: min(90%, 576px);
  max-width: 576px;
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.5;
  justify-self: center;
}
.visual--ghost { border-color: var(--line); }

/* Producto Teslian Watch: entrada lateral y flotación sutil del dispositivo. */
.watch-visual {
  position: relative;
  width: min(97.5%, 624px);
  max-width: 624px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  isolation: isolate;
  justify-self: center;
}

.watch-visual::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 18%;
  right: 10%;
  bottom: 6%;
  height: 10%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.18), transparent 70%);
  filter: blur(10px);
}

.watch-visual.reveal {
  opacity: 0;
  transform: translate3d(72px, 18px, 0) scale(0.92) rotate(3deg);
  transition: opacity 1s var(--ease), transform 1.15s var(--ease);
}

.watch-visual.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1) rotate(0);
}

.watch-visual__float {
  width: 100%;
  animation: watch-float 6s ease-in-out 1.15s infinite;
  will-change: transform;
}

.watch-visual img {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}

@keyframes watch-float {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-10px) rotate(-0.7deg); }
}

/* Teslian Dash: pantalla desplazada hacia el borde derecho con reveal tipo HUD. */
.dash-visual {
  position: relative;
  width: min(110%, 708px);
  max-width: 708px;
  margin: 0;
  aspect-ratio: 1.84 / 1;
  display: grid;
  place-items: center;
  justify-self: center;
}

.dash-visual::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 12% -4%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(84, 166, 255, 0.25), rgba(25, 82, 130, 0.08) 44%, transparent 72%);
  filter: blur(26px);
}

.dash-visual__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1.84 / 1;
  animation: dash-float 6s ease-in-out 1.1s infinite;
}

.dash-visual__frame::after {
  display: none;
}

.dash-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 52%;
  filter: contrast(1.03) drop-shadow(0 24px 26px rgba(0, 0, 0, 0.48));
}

.dash-visual.reveal {
  opacity: 0;
  clip-path: inset(0 0 0 24% round 22px);
  transform: translate3d(96px, 0, 0) scale(0.94);
  transition: opacity 0.9s var(--ease), transform 1.15s var(--ease), clip-path 1.1s var(--ease);
}

.dash-visual.reveal.is-visible {
  opacity: 1;
  clip-path: inset(0 0 0 0 round 22px);
  transform: translate3d(0, 0, 0) scale(1);
}

@keyframes dash-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* Teslian Pro: dispositivo vertical con entrada en perspectiva. */
.pro-visual {
  --pro-height: 620px;
  position: relative;
  width: min(100%, 640px);
  height: var(--pro-height);
  display: grid;
  place-items: center;
  justify-self: center;
  perspective: 1000px;
}

.pro-visual::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 58%;
  height: 72%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(51, 203, 174, 0.16), rgba(55, 133, 255, 0.07) 48%, transparent 72%);
  filter: blur(28px);
}

.pro-visual__float {
  position: absolute;
  top: 0;
  left: 50%;
  width: calc(var(--pro-height) * 1.333333);
  height: var(--pro-height);
  display: grid;
  place-items: center;
  translate: -50% 0;
  animation: pro-float 6.4s ease-in-out 1.15s infinite;
}

.pro-visual img {
  display: block;
  width: auto;
  max-width: none;
  height: var(--pro-height);
  filter: drop-shadow(0 28px 30px rgba(0, 0, 0, 0.2));
}

.pro-visual.reveal {
  opacity: 0;
  transform: translate3d(82px, 12px, 0) scale(0.92) rotateY(-7deg);
  transform-origin: center right;
  transition: opacity 0.95s var(--ease), transform 1.2s var(--ease);
}

.pro-visual.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1) rotateY(0);
}

@keyframes pro-float {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-9px) rotate(0.35deg); }
}

/* Wraps y Lock Sounds: interfaces panorámicas con reveal lateral reversible. */
.media-visual {
  position: relative;
  width: min(97%, 620px);
  max-width: 620px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 22px;
  justify-self: center;
  isolation: isolate;
}

.media-visual--space {
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45), 0 0 64px rgba(75, 135, 255, 0.08);
}

.media-visual--light {
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 28px 72px rgba(11, 26, 46, 0.18);
}

.media-visual__image {
  width: 100%;
  height: 100%;
  animation: media-breathe 8s ease-in-out 1.15s infinite;
}

.media-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-visual.reveal {
  opacity: 0;
  clip-path: inset(0 0 0 22% round 22px);
  transform: translate3d(88px, 12px, 0) scale(0.94);
  transition: opacity 0.9s var(--ease), transform 1.15s var(--ease), clip-path 1.05s var(--ease);
}

.media-visual.reveal.is-visible {
  opacity: 1;
  clip-path: inset(0 0 0 0 round 22px);
  transform: translate3d(0, 0, 0) scale(1);
}

@keyframes media-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.018); }
}

/* Tres botones del hero: Apps · Lock Sounds · Wraps */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 44px;
}
.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 30px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 100px;
  color: var(--fg);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.3s var(--ease), background 0.3s ease, border-color 0.3s ease;
}
.hero-btn:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}
.hero-btn .arrow { opacity: 0.55; transition: transform 0.3s ease, opacity 0.3s ease; }
.hero-btn:hover .arrow { transform: translateX(3px); opacity: 1; }

/* ---------- Subpáginas (Apps · Lock Sounds · Wraps) ---------- */
.subpage-note {
  margin-top: 30px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.subpage-note::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fg);
  opacity: 0.6;
}

/* Botón "Ver más" de cada producto (se adapta a panel claro/oscuro) */
.more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  padding: 11px 22px;
  border: 1px solid currentColor;
  border-radius: 100px;
  color: inherit;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.9;
  background: rgba(128, 128, 128, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.25s ease, gap 0.25s ease, background 0.25s ease;
}
.more:hover { opacity: 1; gap: 12px; background: rgba(128, 128, 128, 0.16); }
.more .arrow { transition: transform 0.25s ease; }
.more:hover .arrow { transform: translateX(3px); }

/* Botón */
.btn {
  margin-top: 40px;
  display: inline-block;
  text-decoration: none;
  color: #000;
  background: #fff;
  font-weight: 500;
  font-size: 15px;
  padding: 14px 34px;
  border-radius: 100px;
  transition: transform 0.25s var(--ease), opacity 0.25s ease;
}
.btn:hover { transform: translateY(-2px); opacity: 0.9; }

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 40px 8vw;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.footer__logo { letter-spacing: 0.28em; color: var(--fg); }
.footer__links { display: flex; gap: 22px; }
.footer__links a { color: var(--muted); text-decoration: none; }
.footer__links a:hover { color: var(--fg); }

/* ---------- Reveal al scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* pequeño escalonado entre elementos hermanos */
.reveal.is-visible:nth-child(2) { transition-delay: 0.06s; }
.reveal.is-visible:nth-child(3) { transition-delay: 0.12s; }
.reveal.is-visible:nth-child(4) { transition-delay: 0.18s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .reveal-panel .sheet { inset: 0; border-radius: 0; transition: none; }
  .scrollcue { animation: none; }
  .watch-visual__float { animation: none; }
  .dash-visual__frame { animation: none; }
  .pro-visual__float { animation: none; }
  .media-visual__image { animation: none; }
}

@media (max-width: 860px) {
  .split {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    min-width: 0;
    flex: initial;
    margin-left: 0;
    gap: 6vw;
    text-align: left;
  }
  .split .col { width: 100%; max-width: 520px; justify-self: auto; transform: none; }
  .visual { width: 100%; max-width: none; }
  .watch-visual { width: min(112%, 552px); align-self: center; max-width: 552px; }
  .dash-visual { width: min(112%, 672px); align-self: center; max-width: 672px; }
  .pro-visual {
    --pro-height: min(132vw, 560px);
    width: min(112%, 552px);
    align-self: center;
  }
  .media-visual { width: min(112%, 620px); align-self: center; }
}

@media (max-width: 640px) {
  .nav { padding: 18px 20px; }
  .nav__links { display: none; }
}
