@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  --brand: #0f766e;
  --brand-gold: #f59e0b;
  --bg-base: #f8fafc;
  --bg-layer: rgba(255, 255, 255, 0.92);
}

.dark {
  color-scheme: dark;
  --bg-base: #050816;
  --bg-layer: rgba(2, 6, 23, 0.9);
}

body {
  font-family: theme('fontFamily.sans');
  background-color: var(--bg-base);
  background-image:
    linear-gradient(135deg, var(--bg-layer), rgba(241, 245, 249, 0.6)),
    radial-gradient(circle at 20% 20%, rgba(15, 118, 110, 0.12), transparent 50%),
    radial-gradient(circle at 80% 0%, rgba(245, 158, 11, 0.12), transparent 45%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.2) 0px, rgba(255, 255, 255, 0.2) 1px, transparent 1px, transparent 15px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0px, rgba(255, 255, 255, 0.12) 1px, transparent 1px, transparent 15px);
  background-attachment: fixed;
  background-size: cover;
  color: #0f172a;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.dark body {
  background-color: var(--bg-base);
  background-image:
    linear-gradient(135deg, var(--bg-layer), rgba(2, 6, 23, 0.8)),
    radial-gradient(circle at 15% 15%, rgba(14, 165, 233, 0.2), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(124, 58, 237, 0.25), transparent 55%),
    repeating-linear-gradient(0deg, rgba(15, 23, 42, 0.5) 0px, rgba(15, 23, 42, 0.5) 1px, transparent 1px, transparent 15px),
    repeating-linear-gradient(90deg, rgba(15, 23, 42, 0.4) 0px, rgba(15, 23, 42, 0.4) 1px, transparent 1px, transparent 15px);
  color: #f8fafc;
}

@layer utilities {
  @keyframes slide-in-right {
    from {
      transform: translateX(100%);
      opacity: 0;
    }

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

  @keyframes slide-in-top {
    from {
      transform: translateY(-20px);
      opacity: 0;
    }

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

  @keyframes fade-in {
    from {
      opacity: 0;
    }

    to {
      opacity: 1;
    }
  }

  @keyframes scale-in {
    from {
      transform: scale(0.95);
      opacity: 0;
    }

    to {
      transform: scale(1);
      opacity: 1;
    }
  }

  .animate-slide-in-right {
    animation: slide-in-right 0.3s ease-out;
  }

  .animate-slide-in-top {
    animation: slide-in-top 0.3s ease-out;
  }

  .animate-fade-in {
    animation: fade-in 0.2s ease-out;
  }

  .animate-scale-in {
    animation: scale-in 0.2s ease-out;
  }

  @keyframes gcx-letter-reveal {
    0%, 100% {
      opacity: 0.58;
      transform: translateY(0) scale(0.98);
    }

    22%, 48% {
      opacity: 1;
      transform: translateY(-5px) scale(1.04);
    }
  }

  @keyframes gcx-rule-reveal {
    0%, 100% {
      opacity: 0.55;
      transform: scaleX(0.88);
    }

    28%, 72% {
      opacity: 1;
      transform: scaleX(1);
    }
  }

  @keyframes gcx-phrase-reveal {
    0%, 100% {
      opacity: 0.5;
      transform: translateY(0);
    }

    24%, 50% {
      opacity: 1;
      transform: translateY(-2px);
    }
  }

  .gcx-loader {
    width: min(90vw, 34rem);
    padding: 2rem 1.25rem;
  }

  .gcx-loader__mark {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    font-size: clamp(3rem, 10vw, 4.75rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0;
  }

  .gcx-loader__letter {
    animation: gcx-letter-reveal 2.4s ease-in-out infinite;
    opacity: 0.58;
  }

  .gcx-loader__letter:nth-child(2) {
    animation-delay: 0.18s;
  }

  .gcx-loader__letter:nth-child(3) {
    animation-delay: 0.36s;
  }

  .gcx-loader__rule {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: min(12rem, 52vw);
    height: 0.25rem;
    margin: 1rem auto 1.15rem;
    overflow: hidden;
    border-radius: 9999px;
    animation: gcx-rule-reveal 2.4s ease-in-out infinite;
    transform-origin: center;
  }

  .gcx-loader__tagline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.85rem;
    min-height: 2.75rem;
  }

  .gcx-loader__phrase {
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0;
    animation: gcx-phrase-reveal 2.4s ease-in-out infinite;
    opacity: 0.5;
  }

  .gcx-loader__phrase:nth-child(2) {
    animation-delay: 0.2s;
  }

  .gcx-loader__phrase:nth-child(3) {
    animation-delay: 0.4s;
  }

  @media (max-width: 420px) {
    .gcx-loader__tagline {
      flex-direction: column;
      gap: 0.25rem;
      min-height: 4.5rem;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .gcx-loader__letter,
    .gcx-loader__rule,
    .gcx-loader__phrase {
      animation: none;
      opacity: 1;
      transform: none;
    }
  }

  html {
    scroll-behavior: smooth;
  }

  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  ::-webkit-scrollbar-track {
    background: transparent;
  }

  ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
  }

  .dark ::-webkit-scrollbar-thumb {
    background: #475569;
  }

  .dark ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
  }
}
