/*
 * Copyright (c) 2025-present Beijing Tensorfer Co., Ltd. All rights reserved.
 *
 * This software is protected by copyright law and international treaties.
 * Unauthorized reproduction or distribution of this software, or any portion of it,
 * may result in severe civil and criminal penalties, and will be prosecuted to the
 * maximum extent possible under the law.
 *
 * For licensing information, please contact support@tensorfer.com.
 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family:
    "Nunito Sans",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    "Open Sans",
    "Helvetica Neue",
    sans-serif;
}

body {
  line-height: 1.6;
  color: #333;
}

a {
  text-decoration: none;
  color: inherit;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.primary-btn {
  background-color: rgb(0, 200, 180);
  color: white;
  border: none;
}

.primary-btn:hover {
  background-color: rgb(0, 180, 160);
}

.secondary-btn {
  background-color: transparent;
  color: white;
  border: 2px solid white;
  margin-right: 15px;
}

.secondary-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

nav {
  background-color: rgba(0, 105, 101, 0.9);
  color: white;
  padding: 15px 5%;
  position: fixed;
  width: 100%;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 2rem;
  font-weight: 500;
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-links a {
  font-weight: 500;
  transition: opacity 0.3s;
}

.nav-links a:hover {
  opacity: 0.8;
}

/* Language switcher */
.lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  background: transparent;
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.lang-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.7);
}

.lang-toggle .lang-sep {
  opacity: 0.5;
  font-weight: 400;
}

.lang-toggle .lang-current-label {
  font-weight: 700;
  letter-spacing: 0.05em;
}

.lang-toggle .lang-caret {
  font-size: 0.7rem;
  opacity: 0.85;
  transition: transform 0.2s;
}

.lang-switcher.open .lang-caret {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: white;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  padding: 4px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
  z-index: 1100;
}

.lang-switcher.open .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  color: #333;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.lang-option:hover {
  background: rgb(0, 200, 180);
  color: white;
}

.lang-option[aria-selected="true"] {
  font-weight: 700;
  color: rgb(0, 105, 101);
}

.lang-option[aria-selected="true"]::after {
  content: "✓";
  margin-left: auto;
  color: rgb(0, 200, 180);
}

.lang-option .lang-code {
  font-size: 0.75rem;
  opacity: 0.6;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.hero {
  background-color: rgb(0, 105, 101);
  color: white;
  padding: 180px 10% 120px;
  text-align: center;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 20px;
  line-height: 1.2;
}

.hero p {
  font-size: 1.5rem;
  max-width: 800px;
  margin: 0 auto 40px;
  opacity: 0.9;
}

.hero-buttons {
  margin-top: 30px;
}

.features {
  background-color: white;
  padding: 100px 10%;
}

.section-title {
  text-align: center;
  color: rgb(0, 105, 101);
  font-size: 2.5rem;
  margin-bottom: 60px;
  min-height: 1.2em;
}

.feature-rows {
  max-width: 1100px;
  margin: 0 auto;
}

.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  margin-bottom: 90px;
}

.feature-row:last-child {
  margin-bottom: 0;
}

.feature-row.reverse .feature-anim {
  order: 2;
}

.feature-anim {
  background-color: #f9f9f9;
  border-radius: 12px;
  padding: 28px;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.3s,
    box-shadow 0.3s;
}

.feature-anim:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.feature-anim svg {
  width: 100%;
  height: auto;
  max-width: 380px;
}

.feature-text h3 {
  color: rgb(0, 105, 101);
  font-size: 1.8rem;
  margin-bottom: 18px;
}

.feature-text p {
  color: #666;
  font-size: 1.05rem;
  line-height: 1.7;
}

.kv-block,
.layer-bar,
.pod,
.eq-bar,
.progress-fill {
  transform-box: fill-box;
}

.kv-off {
  animation: kv-offload 4.5s infinite ease-in-out;
}

.kv-load {
  animation: kv-load 4.5s infinite ease-in-out;
}

.hit-badge {
  transform-box: fill-box;
  transform-origin: center;
  animation: hit-show 4.5s infinite ease-in-out;
}

.layer-bar {
  animation: layer-load 4s infinite ease-in-out;
}

.progress-fill {
  transform-origin: left;
  animation: progress-fill 4s infinite ease-out;
}

.pod {
  transform-origin: center;
  animation: pod-pulse 4.5s infinite ease-in-out;
}

.eq-bar {
  transform-origin: bottom;
  animation: bar-pulse 2.4s infinite ease-in-out;
}

@keyframes kv-offload {
  0% {
    transform: translateX(0);
    opacity: 0;
  }
  4% {
    opacity: 1;
  }
  22% {
    transform: translateX(64px);
    opacity: 1;
  }
  26% {
    transform: translateX(64px);
    opacity: 0;
  }
  100% {
    transform: translateX(64px);
    opacity: 0;
  }
}

@keyframes kv-load {
  0%,
  26% {
    transform: translateX(0);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  48% {
    transform: translateX(52px);
    opacity: 1;
  }
  62% {
    transform: translateX(52px);
    opacity: 1;
  }
  66% {
    transform: translateX(52px);
    opacity: 0;
  }
  100% {
    transform: translateX(52px);
    opacity: 0;
  }
}

@keyframes hit-show {
  0%,
  48% {
    opacity: 0;
    transform: scale(0.85);
  }
  54% {
    opacity: 1;
    transform: scale(1);
  }
  88% {
    opacity: 1;
    transform: scale(1);
  }
  94% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 0;
    transform: scale(0.85);
  }
}

@keyframes layer-load {
  0% {
    transform: translateX(0);
    opacity: 0;
  }
  6% {
    opacity: 1;
  }
  42% {
    transform: translateX(195px);
    opacity: 1;
  }
  86% {
    transform: translateX(195px);
    opacity: 1;
  }
  90% {
    transform: translateX(195px);
    opacity: 0;
  }
  100% {
    transform: translateX(195px);
    opacity: 0;
  }
}

@keyframes progress-fill {
  0% {
    transform: scaleX(0);
  }
  52% {
    transform: scaleX(1);
  }
  88% {
    transform: scaleX(1);
  }
  92% {
    transform: scaleX(0);
  }
  100% {
    transform: scaleX(0);
  }
}

@keyframes pod-pulse {
  0% {
    transform: scale(0.5);
    opacity: 0.4;
  }
  19%,
  56% {
    transform: scale(1);
    opacity: 1;
  }
  75% {
    transform: scale(0.5);
    opacity: 0.4;
  }
  100% {
    transform: scale(0.5);
    opacity: 0.4;
  }
}

@keyframes bar-pulse {
  0%,
  100% {
    transform: scaleY(0.65);
  }
  50% {
    transform: scaleY(1);
  }
}

footer {
  background-color: rgb(0, 80, 75);
  color: white;
  padding: 80px 10% 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 100px;
  position: relative;
  bottom: 20px;
  margin: 30px 0px;
}
.relative-logo {
  position: relative;
  left: 10px;
  bottom: 10px;
  margin-right: 150px;
  font-size: 2rem;
  font-weight: 500;
}

footer h3 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: rgb(0, 200, 180);
}

footer ul {
  list-style: none;
}

footer li {
  margin-bottom: 10px;
  cursor: pointer;
  transition: opacity 0.3s;
}

footer li:hover {
  opacity: 0.8;
}

.footer-bottom {
  text-align: right;
  padding-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 1024px) {
  .feature-row {
    gap: 40px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero p {
    font-size: 1.2rem;
  }

  .feature-row {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .feature-row.reverse .feature-anim {
    order: 0;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 150px 5% 80px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .btn {
    width: 100%;
  }

  .secondary-btn {
    margin-right: 0;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}
