@import "tailwindcss";
@import "tw-animate-css";

@custom-variant dark (&:is(.dark *));

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --font-sans: var(--font-geist-sans);
  --font-mono: var(--font-geist-mono);
  --color-sidebar-ring: var(--sidebar-ring);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar: var(--sidebar);
  --color-chart-5: var(--chart-5);
  --color-chart-4: var(--chart-4);
  --color-chart-3: var(--chart-3);
  --color-chart-2: var(--chart-2);
  --color-chart-1: var(--chart-1);
  --color-ring: var(--ring);
  --color-input: var(--input);
  --color-border: var(--border);
  --color-destructive: var(--destructive);
  --color-accent-foreground: var(--accent-foreground);
  --color-accent: var(--accent);
  --color-muted-foreground: var(--muted-foreground);
  --color-muted: var(--muted);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-secondary: var(--secondary);
  --color-primary-foreground: var(--primary-foreground);
  --color-primary: var(--primary);
  --color-popover-foreground: var(--popover-foreground);
  --color-popover: var(--popover);
  --color-card-foreground: var(--card-foreground);
  --color-card: var(--card);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
}

:root {
  --radius: 0.75rem;

  /* AHE Brand: Royal Blue / Dark Navy / White */
  --background: oklch(1 0 0);
  --foreground: oklch(0.18 0.03 260);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.18 0.03 260);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.18 0.03 260);

  /* Royal blue primary */
  --primary: oklch(0.45 0.18 258);
  --primary-foreground: oklch(0.99 0 0);

  --secondary: oklch(0.96 0.02 255);
  --secondary-foreground: oklch(0.22 0.05 260);

  --muted: oklch(0.965 0.008 255);
  --muted-foreground: oklch(0.48 0.03 258);

  --accent: oklch(0.93 0.05 255);
  --accent-foreground: oklch(0.22 0.05 260);

  --destructive: oklch(0.58 0.22 27);
  --border: oklch(0.91 0.01 255);
  --input: oklch(0.91 0.01 255);
  --ring: oklch(0.45 0.18 258);

  --chart-1: oklch(0.45 0.18 258);
  --chart-2: oklch(0.6 0.16 200);
  --chart-3: oklch(0.7 0.15 160);
  --chart-4: oklch(0.78 0.18 80);
  --chart-5: oklch(0.62 0.22 30);

  --sidebar: oklch(0.21 0.04 258);
  --sidebar-foreground: oklch(0.97 0.01 255);
  --sidebar-primary: oklch(0.55 0.2 258);
  --sidebar-primary-foreground: oklch(0.99 0 0);
  --sidebar-accent: oklch(0.27 0.05 258);
  --sidebar-accent-foreground: oklch(0.97 0.01 255);
  --sidebar-border: oklch(0.3 0.04 258);
  --sidebar-ring: oklch(0.55 0.2 258);

  /* Brand-specific tokens */
  --brand-navy: oklch(0.22 0.06 260);
  --brand-navy-deep: oklch(0.16 0.05 260);
  --brand-royal: oklch(0.45 0.18 258);
  --brand-royal-light: oklch(0.6 0.18 255);
  --brand-cyan: oklch(0.7 0.15 200);
}

.dark {
  --background: oklch(0.15 0.03 260);
  --foreground: oklch(0.97 0.005 255);
  --card: oklch(0.2 0.035 260);
  --card-foreground: oklch(0.97 0.005 255);
  --popover: oklch(0.2 0.035 260);
  --popover-foreground: oklch(0.97 0.005 255);
  --primary: oklch(0.6 0.18 258);
  --primary-foreground: oklch(0.99 0 0);
  --secondary: oklch(0.27 0.04 260);
  --secondary-foreground: oklch(0.97 0.005 255);
  --muted: oklch(0.25 0.035 260);
  --muted-foreground: oklch(0.7 0.02 255);
  --accent: oklch(0.3 0.05 258);
  --accent-foreground: oklch(0.97 0.005 255);
  --destructive: oklch(0.65 0.2 25);
  --border: oklch(0.3 0.03 258);
  --input: oklch(0.3 0.03 258);
  --ring: oklch(0.6 0.18 258);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  html {
    scroll-behavior: smooth;
  }
  body {
    @apply bg-background text-foreground;
    font-feature-settings: "rlig" 1, "calt" 1;
  }
  ::selection {
    background: oklch(0.45 0.18 258);
    color: white;
  }
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: oklch(0.96 0.01 255);
}
::-webkit-scrollbar-thumb {
  background: oklch(0.7 0.05 258);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: oklch(0.5 0.1 258);
}

/* Premium utilities (plain CSS to remain @apply-safe) */
.container-px {
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 640px) {
  .container-px { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (min-width: 1024px) {
  .container-px { padding-left: 2rem; padding-right: 2rem; }
}
.container-mx {
  margin-left: auto;
  margin-right: auto;
  max-width: 80rem;
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 640px) {
  .container-mx { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (min-width: 1024px) {
  .container-mx { padding-left: 2rem; padding-right: 2rem; }
}
.brand-gradient {
  background: linear-gradient(135deg, oklch(0.22 0.06 260) 0%, oklch(0.32 0.08 258) 50%, oklch(0.45 0.18 258) 100%);
}
.brand-gradient-soft {
  background: linear-gradient(135deg, oklch(0.97 0.02 255) 0%, oklch(0.94 0.04 255) 100%);
}
.navy-bg {
  background-color: var(--brand-navy-deep);
}
.royal-text {
  color: var(--brand-royal);
}
.glass {
  backdrop-filter: blur(12px) saturate(180%);
  background-color: rgba(255, 255, 255, 0.75);
}
.glass-dark {
  backdrop-filter: blur(12px) saturate(180%);
  background-color: rgba(11, 31, 77, 0.6);
}
.shadow-brand {
  box-shadow: 0 10px 40px -10px oklch(0.45 0.18 258 / 0.35);
}
.shadow-soft {
  box-shadow: 0 4px 24px -8px oklch(0.2 0.05 260 / 0.12);
}
.mask-fade-b {
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}
.grid-pattern {
  background-image:
    linear-gradient(oklch(1 0 0 / 0.04) 1px, transparent 1px),
    linear-gradient(90deg, oklch(1 0 0 / 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* Reveal-on-scroll base */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Marquee animation */
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.animate-marquee {
  animation: marquee 30s linear infinite;
}

/* Before/After slider handle */
.ba-handle {
  cursor: ew-resize;
}
