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

/* Global font setup: Inter for body, Söhne for headings (if available) */
html, body, #app, button, input, select, textarea {
  font-family: var(--font-body) !important;
}

/* Route‑controlled perforated background (applies when body has .bg-perforated) */
body.bg-perforated {
  /* Dark metal base */
  background-color: #0b0c10;
  /* Subtle vignette to add depth */
  background-image:
    radial-gradient(ellipse at center, rgba(0,0,0,0.00) 0%, rgba(0,0,0,0.35) 60%, rgba(0,0,0,0.65) 100%),
    url('/perforated-dark.svg');
  background-repeat: no-repeat, repeat;
  background-size: cover, 18px 18px; /* hole grid size */
  background-attachment: fixed, fixed;
}

@layer components {
  .all-\[unset\] {
    all: unset;
  }
  /* Smooth fade hover for interactive elements */
  .btn-fade {
    transition: opacity 0.25s ease, background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
  }
  .btn-fade:hover { opacity: 0.92; }
  .btn-fade:active { opacity: 0.84; }
  .btn-fade:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(240, 162, 59, 0.35);
  }
  /* Shine animation for hero buttons (match CardNav CTA) */
  .hero-cta-shine {
    position: relative;
    overflow: hidden;
  }
  .hero-cta-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -70%;
    width: 70%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
    border-radius: inherit;
  }
  .hero-cta-shine:hover::before {
    left: 110%;
  }

  /* Hero main visual: keep drop shadow on desktop, remove on mobile */
  .hero-main-visual {
    filter:
      drop-shadow(0 14px 30px rgba(0, 0, 0, 0.20))
      drop-shadow(0 -3px 16px rgba(0, 0, 0, 0.12))
      drop-shadow(12px 0 24px rgba(0, 0, 0, 0.16))
      drop-shadow(-12px 0 24px rgba(0, 0, 0, 0.16));
  }
}

@media (max-width: 768px) {
  .hero-main-visual {
    filter: none;
  }
}

/* NIK Heading System */
@layer components {
  .nik-heading-hero {
    font-family: var(--font-heading);
    font-weight: 400;
    letter-spacing: -0.01em;
    color: #000000;
    line-height: 1.22;
    font-size: clamp(36px, 5vw, 57px);
  }

  .nik-heading-section {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.015em;
    color: #111827;
    line-height: 1.1;
    font-size: clamp(28px, 4vw, 48px);
  }

  .nik-heading__accent {
    color: #dc9208;
    font-weight: 800;
  }
}

@layer utilities {
  /* Ensure scroll-snap utilities work even when used in index.html */
  .snap-y { scroll-snap-type: y var(--tw-scroll-snap-strictness); }
  .snap-mandatory { --tw-scroll-snap-strictness: mandatory; }
  .snap-proximity { --tw-scroll-snap-strictness: proximity; }
  /* Safety in case some sections miss the class at build */
  .snap-start { scroll-snap-align: start; }

  /* Font family utilities (independent of Tailwind config) */
  .font-heading { font-family: var(--font-heading); }
  .font-body { font-family: var(--font-body); }
}

@layer utilities {
  .theme-coach-detail {
    --primary: 37 94% 56%;
    --primary-foreground: 0 0% 6%;
  }

  .bg-card-dark {
    background-color: #1A1A21;
  }

  .font-display {
    font-family: var(--font-heading);
  }

  .scrollbar-hide::-webkit-scrollbar {
    display: none;
  }
  .scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .custom-scrollbar::-webkit-scrollbar {
    width: 6px;
  }
  .custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
  }
  .custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 9999px;
  }
}

:root {
  /* Font families */
  --font-heading: "Sohne Leicht", "Sohne", "Söhne", "Inter var", Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-body: "Inter var", Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  /* Backward-compatible variable used in Tailwind config */
  --body-text-font-family: var(--font-body);
  --body-text-font-size: 20px;
  --body-text-font-style: normal;
  --body-text-font-weight: 500;
  --body-text-letter-spacing: 0px;
  --body-text-line-height: 150%;
}

:root {
  --animate-spin: spin 1s linear infinite;
}

.animate-fade-in {
  animation: fade-in 1s var(--animation-delay, 0s) ease forwards;
}

.animate-fade-up {
  animation: fade-up 1s var(--animation-delay, 0s) ease forwards;
}

.animate-marquee {
  animation: marquee var(--duration) infinite linear;
}

.animate-marquee-vertical {
  animation: marquee-vertical var(--duration) linear infinite;
}

.animate-shimmer {
  animation: shimmer 8s infinite;
}

.animate-spin {
  animation: var(--animate-spin);
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

@keyframes image-glow {
  0% {
    opacity: 0;
    animation-timing-function: cubic-bezier(0.74, 0.25, 0.76, 1);
  }

  10% {
    opacity: 0.7;
    animation-timing-function: cubic-bezier(0.12, 0.01, 0.08, 0.99);
  }

  to {
    opacity: 0.4;
  }
}

@keyframes fade-in {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-up {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes shimmer {
  0%,
  90%,
  to {
    background-position: calc(-100% - var(--shimmer-width)) 0;
  }

  30%,
  60% {
    background-position: calc(100% + var(--shimmer-width)) 0;
  }
}

@keyframes marquee {
  0% {
    transform: translate(0);
  }

  to {
    transform: translateX(calc(-100% - var(--gap)));
  }
}

@keyframes marquee-vertical {
  0% {
    transform: translateY(0);
  }

  to {
    transform: translateY(calc(-100% - var(--gap)));
  }
}


@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 0 0% 3.9%;

    --muted: 0 0% 96.1%;
    --muted-foreground: 0 0% 45.1%;

    --popover: 0 0% 100%;
    --popover-foreground: 0 0% 3.9%;

    --border: 0 0% 89.8%;
    --input: 0 0% 89.8%;

    --card: 0 0% 100%;
    --card-foreground: 0 0% 3.9%;

    --primary: 0 0% 9%;
    --primary-foreground: 0 0% 98%;

    --secondary: 0 0% 96.1%;
    --secondary-foreground: 0 0% 9%;

    --accent: 0 0% 96.1%;
    --accent-foreground: 0 0% 9%;

    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 98%;

    --ring: 0 0% 3.9%;

    --radius: 0.5rem;

    --chart-1: 12 76% 61%;

    --chart-2: 173 58% 39%;

    --chart-3: 197 37% 24%;

    --chart-4: 43 74% 66%;

    --chart-5: 27 87% 67%;
  }

  .dark {
    --background: 0 0% 3.9%;
    --foreground: 0 0% 98%;

    --muted: 0 0% 14.9%;
    --muted-foreground: 0 0% 63.9%;

    --accent: 0 0% 14.9%;
    --accent-foreground: 0 0% 98%;

    --popover: 0 0% 3.9%;
    --popover-foreground: 0 0% 98%;

    --border: 0 0% 14.9%;
    --input: 0 0% 14.9%;

    --card: 0 0% 3.9%;
    --card-foreground: 0 0% 98%;

    --primary: 0 0% 98%;
    --primary-foreground: 0 0% 9%;

    --secondary: 0 0% 14.9%;
    --secondary-foreground: 0 0% 98%;

    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 0 0% 98%;

    --ring: 0 0% 83.1%;

    --radius: 0.5rem;

    --chart-1: 220 70% 50%;

    --chart-2: 160 60% 45%;

    --chart-3: 30 80% 55%;

    --chart-4: 280 65% 60%;

    --chart-5: 340 75% 55%;
  }
}

@layer base {
  * {
    @apply border-border;
  }

  body {
    @apply bg-background text-foreground;
    font-feature-settings: "rlig" 1, "calt" 1;
  }
}
