@import "tailwindcss";

@theme {
  --color-ink-950: #f5f7fa;
  --color-ink-900: #ffffff;
  --color-ink-850: #f8fafc;
  --color-ink-800: #f1f5f9;
  --color-ink-700: #e2e8f0;
  --color-ink-600: #cbd5e1;
  --color-ink-500: #94a3b8;
  --color-ink-400: #64748b;
  --color-ink-300: #475569;
  --color-ink-200: #334155;
  --color-ink-100: #1e293b;

  --color-accent: #0094ee;
  --color-accent-50: #e6f6fe;
  --color-accent-100: #cceafd;
  --color-accent-200: #99d5fb;
  --color-accent-300: #66c1f9;
  --color-accent-400: #33acf7;
  --color-accent-500: #0094ee;
  --color-accent-600: #0077be;
  --color-accent-700: #005a8f;
  --color-accent-800: #003d60;
  --color-accent-900: #001f30;

  --container-container: 1240px;

  --radius-2xl: 1rem;
  --radius-3xl: 1.25rem;
  --radius-4xl: 1.75rem;

  --shadow-glow:
    0 0 0 1px rgba(0, 148, 238, 0.15), 0 12px 40px -8px rgba(0, 148, 238, 0.25);
  --shadow-glow-sm:
    0 0 0 1px rgba(0, 148, 238, 0.12), 0 6px 20px -6px rgba(0, 148, 238, 0.2);
  --shadow-card:
    0 1px 2px 0 rgba(15, 23, 42, 0.04), 0 4px 24px -8px rgba(15, 23, 42, 0.08);
  --shadow-card-hover:
    0 1px 2px 0 rgba(15, 23, 42, 0.06), 0 12px 40px -12px rgba(15, 23, 42, 0.12);

  --animate-fade-up: fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  --animate-fade-in: fade-in 0.8s ease both;
  --animate-float: float 6s ease-in-out infinite;
  --animate-float-slow: float-slow 9s ease-in-out infinite;
  --animate-pulse-glow: pulse-glow 5s ease-in-out infinite;
  --animate-marquee: marquee 32s linear infinite;
  --animate-spin-slow: spin-slow 28s linear infinite;

  @keyframes fade-up {
    0% {
      opacity: 0;
      transform: translateY(24px);
    }
    100% {
      opacity: 1;
      transform: translateY(0);
    }
  }
  @keyframes fade-in {
    0% {
      opacity: 0;
    }
    100% {
      opacity: 1;
    }
  }
  @keyframes float {
    0%,
    100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-10px);
    }
  }
  @keyframes float-slow {
    0%,
    100% {
      transform: translateY(0) translateX(0);
    }
    50% {
      transform: translateY(-14px) translateX(6px);
    }
  }
  @keyframes pulse-glow {
    0%,
    100% {
      opacity: 0.5;
    }
    50% {
      opacity: 0.9;
    }
  }
  @keyframes marquee {
    0% {
      transform: translateX(0);
    }
    100% {
      transform: translateX(-50%);
    }
  }
  @keyframes spin-slow {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(360deg);
    }
  }
}

@theme inline {
  --font-sans: var(--font-inter), ui-sans-serif, system-ui, sans-serif;
  --font-display:
    var(--font-space-grotesk), var(--font-inter), ui-sans-serif, system-ui,
    sans-serif;
  --font-mono:
    var(--font-jetbrains-mono), ui-monospace, SFMono-Regular, monospace;
}

@layer base {
  :root {
    color-scheme: light;
  }

  * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  html {
    scroll-behavior: smooth;
    scroll-padding-top: 5.5rem;
  }

  body {
    @apply bg-ink-950 text-ink-200 font-sans antialiased;
    background-image:
      radial-gradient(
        60rem 60rem at 75% -10%,
        rgba(0, 148, 238, 0.06),
        transparent 60%
      ),
      radial-gradient(
        50rem 50rem at 0% 20%,
        rgba(0, 148, 238, 0.04),
        transparent 55%
      );
    background-attachment: fixed;
  }

  ::selection {
    @apply bg-accent/20 text-slate-900;
  }

  h1,
  h2,
  h3,
  h4 {
    @apply font-display tracking-tight text-slate-900;
    text-wrap: balance;
  }

  button {
    @apply cursor-pointer;
  }

  :focus-visible {
    @apply outline-none ring-2 ring-accent ring-offset-2 ring-offset-ink-950 rounded-md;
  }

  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  ::-webkit-scrollbar-track {
    background: #f5f7fa;
  }
  ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
    border: 2px solid #f5f7fa;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
  }
}

/*
 * Bootstrap-style responsive container — the site's standard fixed-width section wrapper
 * (`className="container"`). Deliberately plain CSS (unlayered) so it wins over Tailwind's
 * built-in `container` utility. `container-fluid` is the always-100%-wide, guttered variant.
 */
.container,
.container-fluid {
  width: 100%;
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (min-width: 576px) {
  .container {
    max-width: 540px;
  }
}
@media (min-width: 768px) {
  .container {
    max-width: 720px;
  }
}
@media (min-width: 992px) {
  .container {
    max-width: 960px;
  }
}
@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }
}
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
}
@media (min-width: 1660px) {
  .container {
    max-width: 1420px;
  }
}

@utility surface {
  @apply rounded-2xl border border-slate-200/80 bg-white shadow-card;
}

@utility surface-hover {
  @apply transition-all duration-300 hover:border-slate-300 hover:shadow-card-hover;
}

@utility eyebrow {
  @apply inline-flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.22em] text-accent-600;
}

@utility btn-primary {
  @apply inline-flex items-center justify-center gap-2 rounded-full bg-accent-600 px-5 py-3 text-sm font-semibold text-white shadow-glow-sm transition-all duration-200 hover:bg-accent-700 hover:shadow-glow active:scale-[0.98];
}

@utility btn-secondary {
  @apply inline-flex items-center justify-center gap-2 rounded-full border border-slate-200 bg-white px-5 py-3 text-sm font-semibold text-slate-900 transition-all duration-200 hover:border-slate-300 hover:bg-slate-50 active:scale-[0.98];
}

@utility btn-ghost {
  @apply inline-flex items-center justify-center gap-2 rounded-full px-4 py-2 text-sm font-semibold text-ink-300 transition-all duration-200 hover:text-slate-900;
}

@utility section-eyebrow {
  @apply inline-flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.22em] text-accent-600 mb-4;
}

@utility section-title {
  @apply text-3xl sm:text-4xl lg:text-[2.75rem] font-semibold leading-[1.1] tracking-tight text-slate-900;
}

@utility section-desc {
  @apply mt-4 max-w-2xl text-base sm:text-lg leading-relaxed text-ink-300;
}

@utility grid-glow {
  background-image:
    linear-gradient(to right, rgba(15, 23, 42, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Scroll-reveal used by ScrollReveal.tsx and the apply modal */
@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Hero — slow, ease-in-out ambient motion */
@theme {
  --animate-float-editor: float-editor 10s ease-in-out infinite;
  --animate-float-card-a: float-card-a 7s ease-in-out infinite;
  --animate-float-card-b: float-card-b 8.5s ease-in-out infinite;
  --animate-float-card-c: float-card-c 6.5s ease-in-out infinite;
  --animate-glow-pulse: glow-pulse 9s ease-in-out infinite;
  --animate-draw-line: draw-line 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.7s both;
  --animate-dash-flow: dash-flow 30s linear infinite;
  --animate-drift-a: drift-a 14s ease-in-out infinite;
  --animate-drift-b: drift-b 18s ease-in-out infinite;
  --animate-drift-c: drift-c 22s ease-in-out infinite;
  --animate-status-pulse: status-pulse 2.4s ease-in-out infinite;

  @keyframes float-editor {
    0%,
    100% {
      transform: rotate(-2deg) translateY(0);
    }
    50% {
      transform: rotate(-2deg) translateY(-10px);
    }
  }
  @keyframes float-card-a {
    0%,
    100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-6px);
    }
  }
  @keyframes float-card-b {
    0%,
    100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-8px);
    }
  }
  @keyframes float-card-c {
    0%,
    100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-4px);
    }
  }
  @keyframes glow-pulse {
    0%,
    100% {
      opacity: 0.35;
      transform: scale(1);
    }
    50% {
      opacity: 0.6;
      transform: scale(1.05);
    }
  }
  @keyframes draw-line {
    from {
      stroke-dashoffset: 320;
      opacity: 0;
    }
    to {
      stroke-dashoffset: 0;
      opacity: 1;
    }
  }
  @keyframes dash-flow {
    to {
      stroke-dashoffset: -200;
    }
  }
  @keyframes drift-a {
    0%,
    100% {
      transform: translate(0, 0);
    }
    25% {
      transform: translate(10px, -14px);
    }
    50% {
      transform: translate(22px, -4px);
    }
    75% {
      transform: translate(8px, 10px);
    }
  }
  @keyframes drift-b {
    0%,
    100% {
      transform: translate(0, 0) rotate(45deg);
    }
    33% {
      transform: translate(-14px, 10px) rotate(45deg);
    }
    66% {
      transform: translate(-6px, -16px) rotate(45deg);
    }
  }
  @keyframes drift-c {
    0%,
    100% {
      transform: translate(0, 0);
    }
    50% {
      transform: translate(-18px, -12px);
    }
  }
  @keyframes status-pulse {
    0%,
    100% {
      box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45);
    }
    50% {
      box-shadow: 0 0 0 5px rgba(52, 211, 153, 0);
    }
  }
}

/* Contact — form card entrance (fade-up + scale 0.98 → 1) */
@theme {
  --animate-card-in: card-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;

  @keyframes card-in {
    from {
      opacity: 0;
      transform: translateY(20px) scale(0.98);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
}

/* Technology tabs — panel content transition and hidden-scrollbar helper */
@theme {
  --animate-tab-in: tab-in 0.3s ease-out both;

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

@utility no-scrollbar {
  scrollbar-width: none;
  &::-webkit-scrollbar {
    display: none;
  }
}

/* How We Work — step activation */
@theme {
  --animate-step-pop: step-pop 0.4s ease-in-out both;
  --animate-step-ring: step-ring 0.9s ease-out both;

  @keyframes step-pop {
    0% {
      transform: scale(0.96);
    }
    55% {
      transform: scale(1.04);
    }
    100% {
      transform: scale(1);
    }
  }
  @keyframes step-ring {
    0% {
      opacity: 0.45;
      transform: scale(1);
    }
    100% {
      opacity: 0;
      transform: scale(1.55);
    }
  }
}

/* Site-wide smoothness: every link and button eases between states unless a component sets its own timing. */
@layer base {
  a,
  button,
  [role="tab"],
  input,
  textarea,
  select {
    transition-property:
      color, background-color, border-color, box-shadow, opacity, transform;
    transition-duration: 200ms;
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  }
}

/* Image reveal (clip-path wipe with a slight zoom-out) */
@theme {
  --animate-image-reveal: image-reveal 1s cubic-bezier(0.22, 1, 0.36, 1) both;

  @keyframes image-reveal {
    from {
      opacity: 0;
      clip-path: inset(10% 10% 10% 10% round 2rem);
      transform: scale(1.06);
    }
    to {
      opacity: 1;
      clip-path: inset(0 0 0 0 round 0);
      transform: scale(1);
    }
  }
}

/* CTA banner — expanding ripple rings, pulsing core and a slowly shifting gradient */
@theme {
  --animate-ripple: ripple 6s cubic-bezier(0.22, 0.6, 0.36, 1) infinite;
  --animate-core-pulse: core-pulse 4s ease-in-out infinite;
  --animate-gradient-shift: gradient-shift 18s ease-in-out infinite;

  @keyframes ripple {
    0% {
      transform: scale(0.3);
      opacity: 0;
    }
    15% {
      opacity: 0.55;
    }
    100% {
      transform: scale(1);
      opacity: 0;
    }
  }
  @keyframes core-pulse {
    0%,
    100% {
      transform: scale(1);
    }
    50% {
      transform: scale(1.08);
    }
  }
  @keyframes gradient-shift {
    0%,
    100% {
      background-position: 0% 40%;
    }
    50% {
      background-position: 100% 60%;
    }
  }
}
