/* Self-hosted Inter (variable font) — bypasses Yandex/Phoenix Google blocking */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter.woff2') format('woff2-variations'),
       url('/assets/fonts/inter.woff2') format('woff2');
}

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

:root {
  --purple: #8b5cf6;
  --purple-deep: #6d28d9;
  --bg: #0a0a0f;
  --white: #ffffff;
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   HOMEPAGE HERO
   ======================================== */

.hero {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Video Background — single, forced full cover */
.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  filter: blur(1.5px);
}

@media (max-width: 768px) {
  .hero-video {
    width: auto;
    height: 100vh;
    min-width: 100vw;
    left: 50%;
    transform: translateX(-50%);
  }
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.2);
  z-index: 1;
}

/* Mobile gradient fallback */
.hero-gradient {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.15) 0%, rgba(0, 0, 0, 1) 70%);
  z-index: 0;
}

/* Hero Content */
.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 24px;
}

/* Top-right login */
.hero-login {
  position: absolute;
  top: 32px;
  right: 36px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-link {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 100px;
  transition: all 0.3s;
}

.login-link:hover {
  color: #fff;
  background: rgba(139, 92, 246, 0.1);
}

.signup-link {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 100px;
  background: #8b5cf6;
  transition: all 0.3s;
}

.signup-link:hover {
  background: #6d28d9;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

@media (max-width: 768px) {
  .hero-login {
    top: 20px;
    right: 16px;
    gap: 6px;
  }
  .login-link, .signup-link {
    font-size: 12px;
    padding: 6px 12px;
  }
}

/* Top-left brand */
.hero-brand {
  position: absolute;
  top: 32px;
  left: 36px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Brand logo — single image */
.brand-logo-img {
  width: 52px;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.5));
  animation: brandFade 0.6s ease-out;
}

@keyframes brandFade {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand-text {
  /* always visible */
}

.brand-text.animate {
  animation: brandTextIn 0.6s ease-out 1.1s forwards;
}

@keyframes brandTextIn {
  to { opacity: 1; transform: translateX(0); }
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.brand-tagline {
  font-size: 11px;
  font-weight: 500;
  color: rgba(139, 92, 246, 0.8);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Center logo — video animation, identical on every device */
.logo-video {
  width: 320px;
  height: auto;
  display: block;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  background: transparent;
}

/* Hidden — replaced by video */
.logo-assembly {
  position: relative;
  width: 280px;
  height: 213px; /* logo aspect ratio: 574x435 = 0.758 */
  margin: 0 auto;
}

.logo-assembly::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 220px;
  height: 220px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(139, 92, 246, 0.4) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

.frag {
  position: absolute;
  width: 33.34%;
  height: 33.34%;
  background-image: url('/assets/logo.png');
  background-repeat: no-repeat;
  background-size: 300% 300%;
  opacity: 0;
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.4));
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

/* Position each fragment + offset background + dedicated animation */
.frag[data-piece="1"] { top: 0;     left: 0;     background-position: 0% 0%;    animation: fragIn1 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards; }
.frag[data-piece="2"] { top: 0;     left: 33.33%; background-position: 50% 0%;   animation: fragIn2 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.05s forwards; }
.frag[data-piece="3"] { top: 0;     left: 66.66%; background-position: 100% 0%;  animation: fragIn3 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.25s forwards; }
.frag[data-piece="4"] { top: 33.33%; left: 0;     background-position: 0% 50%;  animation: fragIn4 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.35s forwards; }
.frag[data-piece="5"] { top: 33.33%; left: 33.33%; background-position: 50% 50%;  animation: fragIn5 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.45s forwards; }
.frag[data-piece="6"] { top: 33.33%; left: 66.66%; background-position: 100% 50%; animation: fragIn6 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.10s forwards; }
.frag[data-piece="7"] { top: 66.66%; left: 0;     background-position: 0% 100%; animation: fragIn7 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.30s forwards; }
.frag[data-piece="8"] { top: 66.66%; left: 33.33%; background-position: 50% 100%; animation: fragIn8 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.40s forwards; }
.frag[data-piece="9"] { top: 66.66%; left: 66.66%; background-position: 100% 100%; animation: fragIn9 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.20s forwards; }

@keyframes fragIn1 { 0% { opacity: 0; -webkit-transform: translate(-180px, -120px) rotate(-20deg) scale(0.4); transform: translate(-180px, -120px) rotate(-20deg) scale(0.4); } 100% { opacity: 1; -webkit-transform: translate(0, 0) rotate(0) scale(1); transform: translate(0, 0) rotate(0) scale(1); } }
@keyframes fragIn2 { 0% { opacity: 0; -webkit-transform: translate(0, -180px) rotate(15deg) scale(0.4); transform: translate(0, -180px) rotate(15deg) scale(0.4); } 100% { opacity: 1; -webkit-transform: translate(0, 0) rotate(0) scale(1); transform: translate(0, 0) rotate(0) scale(1); } }
@keyframes fragIn3 { 0% { opacity: 0; -webkit-transform: translate(200px, -100px) rotate(22deg) scale(0.4); transform: translate(200px, -100px) rotate(22deg) scale(0.4); } 100% { opacity: 1; -webkit-transform: translate(0, 0) rotate(0) scale(1); transform: translate(0, 0) rotate(0) scale(1); } }
@keyframes fragIn4 { 0% { opacity: 0; -webkit-transform: translate(-220px, 0) rotate(-15deg) scale(0.4); transform: translate(-220px, 0) rotate(-15deg) scale(0.4); } 100% { opacity: 1; -webkit-transform: translate(0, 0) rotate(0) scale(1); transform: translate(0, 0) rotate(0) scale(1); } }
@keyframes fragIn5 { 0% { opacity: 0; -webkit-transform: scale(0.2); transform: scale(0.2); } 100% { opacity: 1; -webkit-transform: scale(1); transform: scale(1); } }
@keyframes fragIn6 { 0% { opacity: 0; -webkit-transform: translate(220px, 30px) rotate(12deg) scale(0.4); transform: translate(220px, 30px) rotate(12deg) scale(0.4); } 100% { opacity: 1; -webkit-transform: translate(0, 0) rotate(0) scale(1); transform: translate(0, 0) rotate(0) scale(1); } }
@keyframes fragIn7 { 0% { opacity: 0; -webkit-transform: translate(-180px, 140px) rotate(-18deg) scale(0.4); transform: translate(-180px, 140px) rotate(-18deg) scale(0.4); } 100% { opacity: 1; -webkit-transform: translate(0, 0) rotate(0) scale(1); transform: translate(0, 0) rotate(0) scale(1); } }
@keyframes fragIn8 { 0% { opacity: 0; -webkit-transform: translate(0, 180px) rotate(10deg) scale(0.4); transform: translate(0, 180px) rotate(10deg) scale(0.4); } 100% { opacity: 1; -webkit-transform: translate(0, 0) rotate(0) scale(1); transform: translate(0, 0) rotate(0) scale(1); } }
@keyframes fragIn9 { 0% { opacity: 0; -webkit-transform: translate(200px, 130px) rotate(-12deg) scale(0.4); transform: translate(200px, 130px) rotate(-12deg) scale(0.4); } 100% { opacity: 1; -webkit-transform: translate(0, 0) rotate(0) scale(1); transform: translate(0, 0) rotate(0) scale(1); } }

/* Typing Text */
.typing-container {
  margin-top: 16px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.typing-text {
  font-size: 64px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
  line-height: 1.1;
  white-space: nowrap;
}

.typing-cursor {
  display: inline-block;
  width: 3px;
  height: 64px;
  background: var(--white);
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 500ms step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Buttons */
.hero-buttons {
  margin-top: 60px;
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: center;
}

.hero-btn {
  display: inline-block;
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  color: var(--white);
  background: transparent;
  border: 1.5px solid rgba(139, 92, 246, 0.6);
  border-radius: 100px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.25);
  white-space: nowrap;
}

.hero-btn.animate {
  animation: btnIn 0.6s ease-out forwards;
}

.hero-btn:hover {
  background: rgba(139, 92, 246, 0.12);
  border-color: var(--purple);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4), 0 0 60px rgba(139, 92, 246, 0.2), 0 0 100px rgba(139, 92, 246, 0.1), inset 0 0 30px rgba(139, 92, 246, 0.06);
  text-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

@keyframes btnIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  opacity: 0.5;
  animation: bounce 2s ease-in-out infinite;
}

.scroll-indicator svg {
  width: 24px;
  height: 24px;
  stroke: var(--white);
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

/* ========================================
   SERVICE PAGES
   ======================================== */

.service-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 40px 24px;
  overflow: hidden;
}

.service-page .hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(6px);
  transform: scale(1.1);
  background: var(--bg);
}

@media (max-width: 768px) {
  .service-page .hero-video {
    width: auto;
    height: 100vh;
    min-width: 100vw;
    left: 50%;
    transform: translateX(-50%) scale(1.1);
  }
}

.service-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.back-link {
  position: absolute;
  top: 32px;
  left: 32px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.3s ease;
}

.back-link:hover {
  color: var(--white);
}

.back-link svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.service-logo {
  width: 80px;
  height: auto;
  margin-bottom: 48px;
}

.service-title {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  text-align: center;
}

.service-subtitle {
  font-size: 18px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
  max-width: 560px;
  text-align: center;
  line-height: 1.6;
  margin-bottom: 32px;
}

.status-badge {
  display: inline-block;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--purple);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 100px;
  margin-bottom: 40px;
  letter-spacing: 0.02em;
}

.cta-btn {
  display: inline-block;
  padding: 16px 40px;
  font-size: 16px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  border-radius: 100px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cta-btn--filled {
  background: var(--purple);
  color: var(--white);
  border: none;
}

.cta-btn--filled:hover {
  background: var(--purple-deep);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.5);
}

.cta-btn--outlined {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(139, 92, 246, 0.6);
}

.cta-btn--outlined:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--purple);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.4);
}

.service-footer {
  position: absolute;
  bottom: 32px;
  z-index: 3;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.3);
  text-align: center;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  /* Keep video on mobile too */
  .hero-video {
    display: block;
  }

  .hero-overlay {
    display: block;
  }

  .hero-gradient {
    display: none;
  }

  /* Brand */
  .hero-brand {
    top: 20px;
    left: 20px;
    gap: 10px;
  }

  .brand-logo-img {
    width: 40px;
  }

  .brand-name {
    font-size: 14px;
  }

  .brand-tagline {
    font-size: 9px;
  }

  /* Center logo */
  .logo-video {
    width: 220px;
  }
  .logo-assembly {
    width: 200px;
    height: 152px;
  }

  .center-logo-fragment {
    width: 180px;
  }

  /* Typing */
  .typing-container {
    min-height: 50px;
  }

  .typing-text {
    font-size: 32px;
    white-space: normal;
    word-break: break-word;
    max-width: 100%;
  }

  .typing-container {
    margin-top: 8px;
    max-width: 100%;
    overflow: hidden;
  }

  .typing-cursor {
    height: 32px;
    width: 2px;
  }

  /* Buttons */
  .hero-buttons {
    flex-direction: column;
    width: 100%;
    gap: 12px;
    margin-top: 24px;
  }

  .hero-btn {
    width: 100%;
    text-align: center;
    padding: 14px 24px;
  }

  /* Scroll indicator */
  .scroll-indicator {
    display: none;
  }

  /* Service pages */
  .service-title {
    font-size: 32px;
  }

  .service-subtitle {
    font-size: 16px;
  }

  .back-link {
    top: 20px;
    left: 20px;
  }

  .service-footer {
    bottom: 20px;
    padding: 0 20px;
  }
}
