/* ── Reset & Base ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-deep: #0a0a0f;
  --bg-surface: rgba(255, 255, 255, 0.04);
  --border-glass: rgba(255, 255, 255, 0.08);
  --text-primary: #f4f4f5;
  --text-muted: #a1a1aa;
  --glow-purple: rgba(99, 102, 241, 0.4);
  --glow-cyan: rgba(6, 182, 212, 0.4);
  --glow-amber: rgba(245, 158, 11, 0.4);
  --font-display: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Segoe UI", system-ui, -apple-system, sans-serif;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ── Animated Background ── */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99, 102, 241, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 20% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(245, 158, 11, 0.08) 0%, transparent 50%),
    var(--bg-deep);
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 20%, transparent 70%);
  animation: grid-drift 20s linear infinite;
}

@keyframes grid-drift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(60px, 60px); }
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: orb-float var(--duration, 12s) var(--ease-in-out) infinite alternate;
}

.orb--1 {
  width: 400px;
  height: 400px;
  background: var(--glow-purple);
  top: -10%;
  left: 20%;
  --duration: 14s;
}

.orb--2 {
  width: 350px;
  height: 350px;
  background: var(--glow-cyan);
  bottom: -5%;
  right: 15%;
  --duration: 11s;
  animation-delay: -4s;
}

.orb--3 {
  width: 300px;
  height: 300px;
  background: var(--glow-amber);
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  --duration: 16s;
  animation-delay: -8s;
}

@keyframes orb-float {
  0% { transform: translate(0, 0) scale(1); opacity: 0.5; }
  50% { opacity: 0.8; }
  100% { transform: translate(30px, -40px) scale(1.1); opacity: 0.5; }
}

#particles {
  position: absolute;
  inset: 0;
}

/* ── Main Layout ── */
.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1100px;
  padding: clamp(1.25rem, 4vw, 2rem) clamp(1rem, 4vw, 1.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(2rem, 6vw, 3.5rem);
}

/* ── Header ── */
.header {
  text-align: center;
  opacity: 0;
  transform: translateY(24px);
  animation: fade-up 0.9s var(--ease-out-expo) 0.2s forwards;
}

.header__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.header__badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.header__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 0%, #a1a1aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header__subtitle {
  margin-top: 0.85rem;
  font-size: clamp(0.95rem, 2vw, 1.125rem);
  color: var(--text-muted);
  max-width: 480px;
  margin-inline: auto;
  line-height: 1.6;
}

/* ── Logo Showcase ── */
.showcase {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 380px;
}

.showcase__connector {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  animation: fade-in 1s var(--ease-out-expo) 1s forwards;
}

@keyframes fade-in {
  to { opacity: 1; }
}

.showcase__ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.showcase__ring--1 {
  width: 320px;
  height: 320px;
  animation: ring-pulse 4s ease-in-out infinite;
}

.showcase__ring--2 {
  width: 420px;
  height: 420px;
  animation: ring-pulse 4s ease-in-out infinite 1s;
}

@keyframes ring-pulse {
  0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.03); }
}

.logo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  gap: clamp(1rem, 3vw, 3rem);
  width: 100%;
  max-width: 900px;
  position: relative;
}

/* ── Logo Cards ── */
.logo-card {
  --accent: #6366f1;
  --glow: var(--glow-purple);
  --delay: 0s;

  position: relative;
  width: 100%;
  max-width: 260px;
  padding: clamp(1.25rem, 3vw, 2rem) clamp(1rem, 2.5vw, 1.5rem) clamp(1.1rem, 2.5vw, 1.75rem);
  border-radius: clamp(18px, 3vw, 24px);
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  text-align: center;
  cursor: default;
  opacity: 0;
  transform: translateY(40px) scale(0.95);
  animation: card-enter 0.8s var(--ease-out-expo) var(--delay) forwards;
  transition:
    transform 0.4s var(--ease-out-expo),
    border-color 0.4s ease,
    box-shadow 0.4s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.logo-card--marketing { --accent: #a855f7; --glow: var(--glow-purple); --delay: 0.5s; }
.logo-card--crm { --accent: #06b6d4; --glow: var(--glow-cyan); --delay: 0.65s; }
.logo-card--bity { --accent: #3b82f6; --glow: rgba(30, 64, 175, 0.45); --delay: 0.8s; }

.logo-card--link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

@keyframes card-enter {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.logo-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 25px;
  padding: 1px;
  background: linear-gradient(135deg, var(--accent), transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.logo-card__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120px;
  height: 120px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--glow);
  filter: blur(40px);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.logo-card__icon {
  position: relative;
  width: clamp(64px, 12vw, 88px);
  height: clamp(64px, 12vw, 88px);
  margin: 0 auto clamp(0.85rem, 2vw, 1.25rem);
  animation: icon-float 5s var(--ease-in-out) infinite;
}

.logo-card--marketing .logo-card__icon { animation-delay: 0s; }
.logo-card--crm .logo-card__icon { animation-delay: -1.6s; }
.logo-card--bity .logo-card__icon { animation-delay: -3.2s; }

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

.logo-card__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  transition: transform 0.4s var(--ease-out-expo);
}

.logo-card__name {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.logo-card__tagline {
  font-size: clamp(0.75rem, 1.8vw, 0.8rem);
  color: var(--text-muted);
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.logo-card__accent-line {
  width: 32px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  margin: 1rem auto 0;
  transform: scaleX(0);
  transition: transform 0.4s var(--ease-out-expo);
}

/* Center highlight for middle card (desktop) */
.logo-card--crm {
  transform: translateY(40px) scale(0.95);
  z-index: 2;
}

.logo-card--crm.is-centered {
  animation: card-enter-center 0.8s var(--ease-out-expo) 0.65s forwards;
}

@keyframes card-enter-center {
  to {
    opacity: 1;
    transform: translateY(-12px) scale(1.05);
  }
}

/* ── Footer ── */
.footer {
  text-align: center;
  opacity: 0;
  animation: fade-up 0.9s var(--ease-out-expo) 1.2s forwards;
}

.footer__text {
  font-size: clamp(0.75rem, 1.8vw, 0.8rem);
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.footer__divider {
  width: 40px;
  height: 1px;
  background: var(--border-glass);
  margin: 0 auto 0.75rem;
}

@keyframes fade-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Responsive ── */

/* Tablet & mobile: stack cards */
@media (max-width: 900px) {
  body {
    justify-content: flex-start;
    padding-top: max(env(safe-area-inset-top), 1.5rem);
    padding-bottom: max(env(safe-area-inset-bottom), 1.5rem);
  }

  .showcase {
    min-height: auto;
  }

  .showcase__connector {
    display: none;
  }

  .showcase__ring--1 {
    width: min(260px, 70vw);
    height: min(260px, 70vw);
  }

  .showcase__ring--2 {
    width: min(340px, 90vw);
    height: min(340px, 90vw);
  }

  .logo-grid {
    grid-template-columns: 1fr;
    max-width: min(360px, 100%);
    gap: 1rem;
  }

  .logo-card {
    max-width: none;
  }

  .logo-card--crm,
  .logo-card--crm.is-centered {
    transform: translateY(40px) scale(0.95);
    animation: card-enter 0.8s var(--ease-out-expo) 0.65s forwards;
    order: -1;
  }

  .orb--1 { width: 240px; height: 240px; }
  .orb--2 { width: 200px; height: 200px; }
  .orb--3 { width: 180px; height: 180px; }
}

/* Small phones */
@media (max-width: 480px) {
  .page {
    gap: 1.75rem;
  }

  .header__badge {
    font-size: 0.6875rem;
    padding: 0.3rem 0.75rem;
    margin-bottom: 1rem;
  }

  .header__subtitle {
    padding-inline: 0.25rem;
    font-size: 0.9rem;
  }

  .logo-grid {
    max-width: 100%;
    gap: 0.85rem;
  }

  .logo-card {
    padding: 1.15rem 1rem 1rem;
    border-radius: 18px;
  }

  .showcase__ring {
    display: none;
  }
}

/* Landscape phones */
@media (max-height: 600px) and (orientation: landscape) {
  body {
    justify-content: flex-start;
  }

  .page {
    gap: 1.25rem;
    padding-block: 1rem;
  }

  .showcase__ring,
  .showcase__connector {
    display: none;
  }

  .logo-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 100%;
    gap: 0.75rem;
  }

  .logo-card {
    padding: 0.85rem 0.65rem 0.75rem;
  }

  .logo-card--crm,
  .logo-card--crm.is-centered {
    order: 0;
    transform: translateY(40px) scale(0.95);
    animation: card-enter 0.8s var(--ease-out-expo) 0.65s forwards;
  }

  .logo-card__icon {
    width: 48px;
    height: 48px;
    margin-bottom: 0.5rem;
  }

  .logo-card__name {
    font-size: 0.95rem;
  }

  .logo-card__tagline {
    font-size: 0.6875rem;
  }

  .logo-card__accent-line {
    margin-top: 0.5rem;
  }
}

/* Hover effects — pointer devices only */
@media (hover: hover) and (pointer: fine) {
  .logo-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow:
      0 20px 60px -12px var(--glow),
      0 0 0 1px rgba(255, 255, 255, 0.05);
  }

  .logo-card:hover::before {
    opacity: 1;
  }

  .logo-card:hover .logo-card__glow {
    opacity: 0.6;
  }

  .logo-card:hover .logo-card__icon img {
    transform: scale(1.08);
  }

  .logo-card:hover .logo-card__accent-line {
    transform: scaleX(1);
  }

  .logo-card--crm:hover {
    transform: translateY(-16px) scale(1.07);
  }
}

/* Touch feedback */
@media (hover: none) {
  .logo-card:active {
    transform: scale(0.98);
    border-color: rgba(255, 255, 255, 0.12);
  }

  .logo-card--link:active {
    opacity: 0.9;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
