@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700;800;900&display=swap');

:root {
  --bg-color: #FFFFFF;
  --surface: #FFFFFF;
  --surface-tint: #E5E5EA;
  --primary: #4B4B4B;
  --secondary: #777777;
  --tertiary: #AFAFAF;
  --brand: #58CC02;
  --brand-shadow: #58A700;
  --active: #1CB0F6;
  --active-shadow: #1899D6;
  --danger: #FF4B4B;
  --gold: #FFC800;
  --font-family: 'Nunito', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-brand: 'Nunito', "Avenir Next", "Segoe UI", sans-serif;
  --border-radius: 20px;
  --btn-radius: 16px;
  --shadow-soft: 0 4px 0 var(--surface-tint);
  --shadow-lift: 0 6px 0 var(--surface-tint);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background:
    radial-gradient(circle at 12% 10%, rgba(88, 204, 2, 0.12), transparent 24%),
    radial-gradient(circle at 88% 18%, rgba(28, 176, 246, 0.12), transparent 26%),
    linear-gradient(180deg, #F8F9FD 0%, #EFF1F8 100%);
  color: var(--primary);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.page-orb {
  display: none;
}

.page-orb--brand {
  display: none;
}

.page-orb--active {
  display: none;
}

.lang-toggle {
  position: absolute;
  top: 24px;
  right: 24px;
  display: inline-flex;
  background: transparent;
  border: none;
  border-radius: 20px;
  padding: 4px;
  box-shadow: none;
  z-index: 10;
  gap: 4px;
}

.lang-toggle a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--secondary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.lang-toggle a:hover {
  color: var(--primary);
  background: rgba(0, 0, 0, 0.04);
  transform: none;
}

.lang-toggle a.active {
  background: rgba(0, 0, 0, 0.06);
  color: var(--primary);
  box-shadow: none;
  transform: none;
}

.lang-toggle a.active:active {
  transform: none;
  box-shadow: none;
}

a {
  color: var(--active);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 20px 36px;
  position: relative;
  z-index: 1;
}

/* Typography styles */
h1, h2, h3 {
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-top: 0;
  color: var(--primary);
}

h1 {
  font-size: 3rem;
  margin-bottom: 20px;
}

h2 {
  font-size: 2rem;
  margin-bottom: 16px;
}

p {
  font-size: 1.1rem;
  color: var(--secondary);
}

/* Card Style */
.card {
  background: var(--surface);
  border-radius: var(--border-radius);
  padding: 30px;
  border: 2px solid var(--surface-tint);
  box-shadow: var(--shadow-soft);
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.card > * {
  position: relative;
  z-index: 1;
}

/* Flat 3D Button Style */
.btn {
  display: inline-block;
  background-color: var(--brand);
  color: white;
  font-family: var(--font-family);
  font-weight: 800;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-align: center;
  padding: 16px 32px;
  border-radius: var(--btn-radius);
  border: 2px solid transparent;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--brand-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  text-decoration: none !important;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  filter: brightness(1.05);
}

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 0px 0 var(--brand-shadow);
}

.btn-secondary {
  background-color: var(--surface);
  color: var(--primary);
  box-shadow: 0 4px 0 var(--surface-tint);
  border: 2px solid var(--surface-tint);
}

.btn-secondary:active {
  transform: translateY(4px);
  box-shadow: 0 0px 0 var(--surface-tint);
}

/* Legal Documents Content */
.legal-content {
  background-color: var(--surface);
  border-radius: var(--border-radius);
  padding: 40px;
  border: 2px solid var(--surface-tint);
  box-shadow: var(--shadow-soft);
  margin-bottom: 30px;
}

.legal-content h2 {
  font-size: 1.5rem;
  margin-top: 30px;
  border-bottom: 2px solid var(--bg-color);
  padding-bottom: 10px;
}

.legal-content p, .legal-content li {
  color: var(--primary);
  font-size: 1rem;
  margin-bottom: 12px;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 44px 20px 24px;
  position: relative;
}

.hero-glow {
  display: none;
}

.hero .app-icon {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  border: 2px solid var(--surface-tint);
  box-shadow: 0 6px 0 var(--surface-tint);
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
  will-change: transform;
}

.hero-title,
.hero-copy,
.hero-actions {
  position: relative;
  z-index: 1;
}

.hero-title {
  max-width: none;
  margin-left: auto;
  margin-right: auto;
}

.hero-copy {
  max-width: 760px;
  margin: 0 auto;
}

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

.brand-title {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
  cursor: default;
  overflow: visible;
}

.brand-shell {
  position: relative;
  display: inline-flex;
  align-items: flex-end;
  gap: clamp(0.1em, 0.75vw, 0.18em);
  padding: 0.2em 0.24em 0.38em;
  line-height: 1.02;
  isolation: isolate;
  overflow: visible;
}

.brand-shell::before {
  content: "";
  position: absolute;
  inset: 16% -3% 10%;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06));
  filter: blur(16px);
  opacity: 0.78;
  z-index: -2;
}

.brand-word {
  position: relative;
  display: inline-flex;
  align-items: flex-end;
  gap: 0.02em;
  font-family: var(--font-brand);
  font-size: clamp(2.72rem, 8.5vw, 4.7rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  white-space: nowrap;
  text-rendering: geometricPrecision;
  overflow: visible;
}

.brand-word::before {
  content: "";
  position: absolute;
  inset: 26% -0.04em 10%;
  border-radius: 999px;
  opacity: 0.46;
  filter: blur(18px);
  z-index: -1;
}

.brand-word--chess::before {
  background: radial-gradient(circle, rgba(90, 101, 128, 0.3), transparent 70%);
}

.brand-word--hop {
  margin-left: 0.01em;
  transform: translateY(-0.01em) skewX(-2deg);
}

.brand-word--hop::before {
  background: radial-gradient(circle, rgba(88, 204, 2, 0.2), rgba(28, 176, 246, 0.12) 54%, transparent 74%);
}

.brand-letter {
  position: relative;
  display: inline-block;
  transform-origin: 50% 100%;
  will-change: transform, opacity, filter;
  padding-bottom: 0.04em;
}

.brand-letter::before {
  content: attr(data-letter);
  position: absolute;
  inset: 0;
  transform: translate(0.02em, 0.08em);
  color: rgba(49, 56, 72, 0.08);
  z-index: -1;
  filter: blur(1.4px);
  opacity: 0.85;
  pointer-events: none;
}

.brand-word--chess .brand-letter {
  color: #465065;
  background: linear-gradient(180deg, #7B859C 0%, #606A82 44%, #313848 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter:
    drop-shadow(0 0.02em 0 rgba(255, 255, 255, 0.22))
    drop-shadow(0 0.08em 0.12em rgba(31, 40, 59, 0.12));
}

.brand-word--hop .brand-letter {
  color: var(--brand);
  background: linear-gradient(180deg, #BDFF72 0%, #7CE719 34%, #49C61B 72%, #24B8D3 118%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter:
    drop-shadow(0 0.02em 0 rgba(255, 255, 255, 0.22))
    drop-shadow(0 0.08em 0.12em rgba(22, 97, 74, 0.12));
}

.brand-word--hop .brand-letter::before {
  color: rgba(55, 153, 39, 0.08);
}

.brand-word--hop .brand-letter:nth-child(2) {
  margin-inline: -0.01em 0.01em;
}

.brand-word--hop .brand-letter:nth-child(2)::after {
  content: "";
  position: absolute;
  inset: 0.31em 0.15em 0.23em;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 34%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.3) 36%, rgba(255, 255, 255, 0) 58%);
  opacity: 0.58;
  filter: blur(0.6px);
  pointer-events: none;
}

.brand-swoosh {
  position: absolute;
  right: 0.14em;
  bottom: -0.01em;
  width: 1.95em;
  height: 0.09em;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(28, 176, 246, 0), rgba(80, 214, 255, 0.5) 20%, rgba(28, 176, 246, 0.8) 46%, rgba(88, 204, 2, 0.88) 74%, rgba(88, 204, 2, 0));
  filter: blur(0.8px) drop-shadow(0 0.08em 0.12em rgba(58, 170, 99, 0.08));
  transform: skewX(-28deg);
  transform-origin: 0% 50%;
  z-index: -1;
  opacity: 0.56;
}

.brand-swoosh::after {
  content: "";
  position: absolute;
  right: 0.28em;
  top: 0.28em;
  width: 1.3em;
  height: 0.08em;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(28, 176, 246, 0), rgba(28, 176, 246, 0.34), rgba(88, 204, 2, 0.42), rgba(88, 204, 2, 0));
  opacity: 0.24;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 12px;
  align-items: stretch;
}

.feature-card {
  text-align: center;
  min-height: 100%;
}

.feature-card .icon-wrapper {
  width: 64px;
  height: 64px;
  background: var(--surface);
  border: 2px solid var(--surface-tint);
  border-radius: var(--btn-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 20px;
  color: var(--active);
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  will-change: transform;
}

.icon-wrapper--brand {
  color: var(--brand);
}

.icon-wrapper--active {
  color: var(--active);
}

.icon-wrapper--gold {
  color: var(--gold);
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: #D8D8DF;
}

.feature-card:hover .icon-wrapper {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

/* Opponents Section */
.opponents-section {
  padding: 120px 0 50px;
  margin-top: 60px;
  text-align: center;
  overflow: hidden;
}

.opponents-header {
  margin-bottom: 50px;
}

.opponents-header h2 {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.opponents-scroller {
  position: relative;
  display: flex;
  overflow: hidden;
  width: 100%;
  padding: 30px 0;
  mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.opponents-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 24px;
  width: max-content;
  min-width: 100%;
  animation: scrollMarquee 30s linear infinite;
  padding: 0 12px;
}

.opponents-grid:hover {
  animation-play-state: paused;
}

@keyframes scrollMarquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-50% - 12px)); }
}

.opponent-card {
  position: relative;
  width: 150px;
  height: 150px;
  background: var(--surface);
  border: 4px solid white;
  border-radius: 28px;
  padding: 8px;
  box-shadow: 0 12px 24px rgba(0,0,0,0.08); /* A richer, more game-like shadow */
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  cursor: pointer;
  flex: 0 0 auto;
}

/* Subtle staggered rotation */
.opponent-card:nth-child(odd) {
  transform: rotate(-3deg);
}
.opponent-card:nth-child(even) {
  transform: rotate(3deg);
}

.opponent-card:hover {
  transform: translateY(-8px) scale(1.1) rotate(0deg) !important;
  box-shadow: 0 20px 32px rgba(88, 204, 2, 0.2); /* Duolingo green glow */
  z-index: 10;
}

.opponent-card img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 20px;
  object-fit: cover;
  background-color: var(--surface-tint);
}

.opponent-level {
  position: absolute;
  top: -12px;
  right: -12px;
  background: var(--active);
  color: white;
  font-size: 0.9rem;
  font-weight: 900;
  padding: 6px 12px;
  border-radius: 20px;
  border: 3px solid white;
  z-index: 2;
  box-shadow: 0 4px 0 var(--active-shadow);
  transform: rotate(10deg);
  transition: background 0.3s, box-shadow 0.3s;
}

.opponent-card:hover .opponent-level {
  background: var(--brand); /* Turns green when hovered */
  box-shadow: 0 4px 0 var(--brand-shadow);
}

/* Footer */
footer {
  text-align: center;
  padding: 48px 20px 54px;
  color: var(--secondary);
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

footer a {
  color: var(--secondary);
  font-weight: bold;
}

.footer-links {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 20px;
}

@media (max-width: 768px) {
  .lang-toggle {
    top: 16px;
    right: 16px;
    padding: 4px;
  }

  .container {
    padding: 16px 16px 30px;
  }

  .hero {
    padding: 32px 12px 22px;
  }

  .hero-glow {
    width: 88vw;
    top: 62px;
    height: 210px;
  }

  h1 {
    font-size: clamp(2.4rem, 11vw, 3rem);
  }

  .brand-word {
    font-size: clamp(2.55rem, 13vw, 3.55rem);
    letter-spacing: -0.035em;
  }

  p {
    font-size: 1rem;
  }

  .card {
    padding: 26px 22px;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .page-orb {
    width: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .page-orb,
  .hero-glow {
    display: none;
  }

  .brand-swoosh {
    filter: none;
  }
}
