/* CSS Document */

:root {
  --bg-main: #020617;
  --bg-panel: #02081a;
  --bg-card: #0b1220;
  --primary: #2563eb;
  --primary-soft: #60a5fa;
  --accent: #22c55e;
  --accent-soft: #4ade80;
  --signal: #facc15;
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --border-subtle: rgba(148, 163, 184, 0.45);
  --radius-lg: 18px;
  --shadow-soft: 0 24px 50px rgba(0, 0, 0, 0.8);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #0b1120 0%, #020617 55%, #000 100%);
  color: var(--text-main);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */

.splash-header {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(2, 6, 23, 0.96);
  backdrop-filter: blur(18px);
}

.splash-brand {
  width: min(1120px, 100% - 2.75rem);
  margin-inline: auto;
}

.splash-logo {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.logo-orb {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: conic-gradient(
    from 220deg,
    #22c55e,
    #22c55e,
    #2563eb,
    #38bdf8,
    #22c55e
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #020617;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.8);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-weight: 700;
  font-size: 1rem;
}

.logo-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Main */

.splash-main {
  flex: 1;
  display: flex;
  align-items: stretch;
}

.splash-hero {
  width: min(1120px, 100% - 2.75rem);
  margin-inline: auto;
  padding: 2.8rem 0 2.4rem;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 3rem;
  align-items: center;
}

.hero-left {
  max-width: 540px;
}

.hero-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary-soft);
}

.splash-hero h1 {
  margin: 0 0 0.9rem;
  font-size: clamp(2rem, 2.2vw + 1.4rem, 2.8rem);
}

.hero-copy {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.lang-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.lang-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.9rem 1.4rem;
  border-radius: 16px;
  min-width: 180px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: linear-gradient(135deg, #020617, #02081a);
  color: var(--text-main);
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.7);
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    border-color 0.15s ease, background 0.15s ease;
}

.lang-btn .lang-label {
  font-weight: 700;
  font-size: 1rem;
}

.lang-btn .lang-sub {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.lang-btn:hover {
  transform: translateY(-1px);
  border-color: var(--primary-soft);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.85);
}

.lang-en {
  background: radial-gradient(circle at top left, #1d4ed8 0, #020617 70%);
}

.lang-es {
  background: radial-gradient(circle at top left, #16a34a 0, #020617 70%);
}

/* Right side: animated home */

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

.home-scene {
  position: relative;
  width: 320px;
  height: 280px;
  border-radius: 26px;
  background: radial-gradient(
      circle at top,
      rgba(37, 99, 235, 0.2),
      transparent 55%
    ),
    radial-gradient(circle at bottom, #020617, #000);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.6);
  overflow: hidden;
}

/* Glow behind house */

.home-glow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at center, #22c55e33, transparent 70%);
  opacity: 0.4;
  filter: blur(12px);
  pointer-events: none;
}

/* House shell */

.home-shell {
  position: absolute;
  inset: 18px 18px 65px 18px;
  border-radius: 18px;
  background: linear-gradient(145deg, #020617, #020b26);
  border: 1px solid rgba(148, 163, 184, 0.5);
  box-shadow: 0 12px 25px rgba(15, 23, 42, 0.9);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

/* Rooms */

.room {
  position: relative;
  border-radius: 14px;
  background: radial-gradient(circle at top, #0f172a, #020617);
  border: 1px solid rgba(148, 163, 184, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.room-icon {
  font-size: 1.5rem;
  animation: iconGlow 3s ease-in-out infinite;
}

.room-label {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Room lighting animation */

.room::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, #facc1544, transparent 75%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.room-living::before {
  animation: roomOn 6s infinite;
}
.room-kitchen::before {
  animation: roomOn 6s infinite 1.5s;
}
.room-bedroom::before {
  animation: roomOn 6s infinite 3s;
}
.room-office::before {
  animation: roomOn 6s infinite 4.5s;
}

/* Nodes (devices) */

.node {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: radial-gradient(circle at top, #fef9c3, #facc15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.9);
  color: #111827;
  animation: nodePulse 2.6s ease-in-out infinite;
}

.node-thermostat {
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
}
.node-lock {
  bottom: 10px;
  left: 14px;
}
.node-camera {
  top: 16px;
  right: 12px;
}
.node-energy {
  bottom: 12px;
  right: 16px;
}

/* Tooltips */

.node::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-muted);
  font-size: 0.7rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.node:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

/* Signals (connections between hub and devices) */

.signal {
  position: absolute;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(148, 163, 184, 0.2),
    var(--signal),
    rgba(148, 163, 184, 0.2)
  );
  transform-origin: left center;
  opacity: 0.7;
  overflow: hidden;
}

.signal::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    #fef08a,
    transparent
  );
  transform: translateX(-100%);
  animation: signalFlow 2.5s linear infinite;
}

/* Approximate positions for signals */

.signal-1 {
  left: 50%;
  bottom: 52px;
  width: 52%;
  transform: rotate(-18deg);
}

.signal-2 {
  left: -5%;
  bottom: 52px;
  width: 52%;
  transform: rotate(12deg);
}

.signal-3 {
  left: 50%;
  top: 42px;
  width: 52%;
  transform: rotate(5deg);
}

.signal-4 {
  left: -4%;
  top: 48px;
  width: 55%;
  transform: rotate(-8deg);
}

/* Central hub */

.hub {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hub-core {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: radial-gradient(circle at top, #22c55e, #16a34a);
  box-shadow: 0 0 35px rgba(34, 197, 94, 0.9);
  position: relative;
  z-index: 3;
}

.hub-ring {
  position: absolute;
  border-radius: 999px;
  border: 1px dashed rgba(148, 163, 184, 0.6);
  animation: ringPulse 4s ease-out infinite;
}

.hub-ring-1 {
  width: 72px;
  height: 72px;
}
.hub-ring-2 {
  width: 104px;
  height: 104px;
  animation-delay: 0.8s;
}
.hub-ring-3 {
  width: 136px;
  height: 136px;
  animation-delay: 1.6s;
}

.hub-label {
  position: absolute;
  bottom: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Hint */

.hint {
  margin-top: 0.7rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Footer */

.splash-footer {
  padding: 0.75rem 0 0.9rem;
  border-top: 1px solid rgba(15, 23, 42, 0.9);
  background: #020617;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* Animations */

@keyframes iconGlow {
  0%, 100% {
    filter: drop-shadow(0 0 0 rgba(250, 204, 21, 0));
    transform: translateY(0);
  }
  50% {
    filter: drop-shadow(0 0 10px rgba(250, 204, 21, 0.7));
    transform: translateY(-1px);
  }
}

@keyframes roomOn {
  0%,
  25% {
    opacity: 0;
  }
  35%,
  70% {
    opacity: 1;
  }
  80%,
  100% {
    opacity: 0;
  }
}

@keyframes nodePulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.9);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(250, 204, 21, 0.9);
  }
}

@keyframes signalFlow {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes ringPulse {
  0% {
    opacity: 0.5;
    transform: scale(0.9);
  }
  100% {
    opacity: 0;
    transform: scale(1.2);
  }
}

/* Responsive */

@media (max-width: 900px) {
  .splash-hero {
    grid-template-columns: minmax(0, 1fr);
    text-align: left;
  }

  .hero-left {
    order: 1;
  }

  .hero-right {
    order: 2;
  }

  .splash-hero {
    gap: 2.4rem;
  }
}

@media (max-width: 640px) {
  .splash-hero {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .lang-buttons {
    flex-direction: column;
  }

  .home-scene {
    width: 100%;
    max-width: 320px;
  }
}
