*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0a0a0f;
  --surface: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f0f0f5;
  --text-muted: rgba(240, 240, 245, 0.55);
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.35);
  --font: 'Outfit', system-ui, -apple-system, sans-serif;
  --radius: 24px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ── Animated background ── */

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: float 20s ease-in-out infinite;
}

.orb-1 {
  width: 50vw;
  height: 50vw;
  max-width: 600px;
  max-height: 600px;
  background: #4338ca;
  top: -10%;
  left: -10%;
  animation-delay: 0s;
}

.orb-2 {
  width: 40vw;
  height: 40vw;
  max-width: 500px;
  max-height: 500px;
  background: #7c3aed;
  bottom: -15%;
  right: -10%;
  animation-delay: -7s;
}

.orb-3 {
  width: 30vw;
  height: 30vw;
  max-width: 400px;
  max-height: 400px;
  background: #2563eb;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
  opacity: 0.25;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(30px, -40px) scale(1.05); }
  66%       { transform: translate(-20px, 20px) scale(0.95); }
}

.orb-3 {
  animation-name: float-center;
}

@keyframes float-center {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  33%       { transform: translate(calc(-50% + 30px), calc(-50% - 40px)) scale(1.05); }
  66%       { transform: translate(calc(-50% - 20px), calc(-50% + 20px)) scale(0.95); }
}

/* ── Language bar ── */

.lang-bar {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  padding: 1.25rem 1.5rem;
}

.lang-switch {
  display: flex;
  gap: 0.5rem;
  padding: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 2px solid transparent;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
  opacity: 0.45;
}

.lang-btn:hover {
  opacity: 0.85;
  background: rgba(255, 255, 255, 0.06);
}

.lang-btn[aria-pressed="true"] {
  opacity: 1;
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  background: rgba(99, 102, 241, 0.12);
}

.lang-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.flag {
  width: 28px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* ── Hero / Card ── */

.hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.5rem 3rem;
  position: relative;
  z-index: 5;
}

.card {
  display: block;
  width: 100%;
  max-width: 520px;
  text-align: center;
  padding: 3rem 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 24px 48px -12px rgba(0, 0, 0, 0.5);
  animation: card-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(32px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: 1.75rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(124, 58, 237, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--accent);
  animation: icon-pulse 3s ease-in-out infinite;
}

@keyframes icon-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50%      { box-shadow: 0 0 30px 4px var(--accent-glow); }
}

.icon {
  width: 36px;
  height: 36px;
}

.title {
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #fff 30%, rgba(255, 255, 255, 0.65));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: opacity var(--transition);
}

.subtitle {
  font-size: clamp(1rem, 3vw, 1.125rem);
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 340px;
  margin: 0 auto 2rem;
  transition: opacity var(--transition);
}

.title.switching,
.subtitle.switching,
.footer-text.switching {
  opacity: 0;
}

/* ── Loading dots ── */

.pulse-bar {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: dot-bounce 1.4s ease-in-out infinite;
}

.pulse-dot:nth-child(2) { animation-delay: 0.16s; }
.pulse-dot:nth-child(3) { animation-delay: 0.32s; }

@keyframes dot-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%           { transform: scale(1);    opacity: 1;   }
}

/* ── Footer ── */

.footer {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 1.5rem;
}

.footer-text {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 300;
  transition: opacity var(--transition);
}

/* ── Responsive ── */

@media (max-width: 480px) {
  .lang-bar {
    padding: 1rem;
  }

  .card {
    padding: 2.25rem 1.5rem;
  }

  .lang-btn {
    width: 40px;
    height: 40px;
  }

  .flag {
    width: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
