@import "tailwindcss";

@custom-variant dark (&:where(.dark, .dark *));

@theme {
  --font-sans: var(--font-inter), system-ui, sans-serif;
  --color-primary-50: #eef2ff;
  --color-primary-100: #e0e7ff;
  --color-primary-200: #c7d2fe;
  --color-primary-300: #a5b4fc;
  --color-primary-400: #818cf8;
  --color-primary-500: #6366f1;
  --color-primary-600: #4f46e5;
  --color-primary-700: #4338ca;
  --color-primary-800: #3730a3;
  --color-primary-900: #312e81;
  --color-primary-950: #1e1b4b;
}

@layer base {
  * {
    @apply border-gray-200 dark:border-gray-700;
  }
  html {
    overflow-x: hidden;
    max-width: 100vw;
  }
  body {
    @apply bg-gray-50 text-gray-900 dark:bg-gray-950 dark:text-gray-100;
    overflow-x: hidden;
    max-width: 100vw;
  }
}

@layer components {
  .scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: theme('colors.gray.400') transparent;
  }
  .scrollbar-thin::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  .scrollbar-thin::-webkit-scrollbar-track {
    background: transparent;
  }
  .scrollbar-thin::-webkit-scrollbar-thumb {
    background-color: theme('colors.gray.400');
    border-radius: 3px;
  }
}

@layer utilities {
  .text-balance {
    text-wrap: balance;
  }

  @keyframes slide-in {
    from {
      opacity: 0;
      transform: translateX(100%);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  @keyframes slide-down {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

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

  .animate-slide-down {
    animation: slide-down 0.2s ease-out;
  }

  /* Mobile responsive utilities */
  .table-container {
    @apply overflow-x-auto scrollbar-thin;
  }

  /* Touch targets */
  .touch-target {
    @apply min-h-[44px] min-w-[44px];
  }

  /* Card responsive */
  .card-responsive {
    @apply p-4 sm:p-6;
  }

  /* Stack on mobile */
  .stack-mobile {
    @apply flex flex-col sm:flex-row;
  }
}
/* ---- Storefront template engine (presentation tokens) ---- */
.store-root { background: var(--store-background); color: var(--store-text); overflow-x: hidden; max-width: 100vw; }
.store-root img { max-width: 100%; height: auto; }
.store-root .store-scrollbar { max-width: 100vw; }
.store-heading-serif { font-family: Georgia, 'Times New Roman', serif; letter-spacing: -0.015em; }
.store-body-serif { font-family: Georgia, 'Times New Roman', serif; }
.store-heading-display { font-weight: 900; letter-spacing: -0.03em; line-height: 0.95; }
.store-heading-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Typography scale helpers */
.store-text-balance { text-wrap: balance; }
.store-eyebrow { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; }
.store-display { font-weight: 800; letter-spacing: -0.03em; line-height: 0.95; }
.store-lead { font-size: 1.1rem; line-height: 1.7; opacity: 0.8; }
.store-uppercase { text-transform: uppercase; letter-spacing: 0.08em; }

/* Spacing rhythm helpers */
.store-rhythm-tight > * + * { margin-top: 0.75rem; }
.store-rhythm-base > * + * { margin-top: 1.5rem; }
.store-rhythm-loose > * + * { margin-top: 2.5rem; }
.store-section-airy { padding-top: 5rem; padding-bottom: 5rem; }
.store-section-balanced { padding-top: 3.5rem; padding-bottom: 3.5rem; }
.store-section-compact { padding-top: 2rem; padding-bottom: 2rem; }

/* Divider styles */
.store-divider-line { height: 1px; background: var(--store-border); }
.store-divider-gradient { height: 1px; background: linear-gradient(90deg, transparent, var(--store-primary), transparent); opacity: 0.35; }
.store-divider-dots { height: 8px; background: radial-gradient(circle, var(--store-border) 1.5px, transparent 1.5px); background-size: 12px 8px; background-repeat: repeat-x; opacity: 0.6; }
.store-divider-shape { height: 2px; background: var(--store-primary); width: 48px; border-radius: 999px; }

/* Image treatments */
.store-img-sharp { border-radius: 0.375rem; }
.store-img-soft { border-radius: 1rem; }
.store-img-masked { border-radius: 1rem; clip-path: inset(0 round 1rem); }
.store-img-framed { border: 4px solid var(--store-surface); outline: 1px solid var(--store-border); outline-offset: 2px; border-radius: 0.75rem; }
.store-img-bleed { margin-left: -1rem; margin-right: -1rem; border-radius: 0; }
.store-img-floating { border-radius: 0.75rem; box-shadow: 0 20px 40px -12px rgba(0,0,0,0.18), 0 8px 16px -8px rgba(0,0,0,0.12); }
.store-scrollbar { scrollbar-width: thin; scrollbar-color: var(--store-border) transparent; }
.store-scrollbar::-webkit-scrollbar { height: 6px; width: 6px; }
.store-scrollbar::-webkit-scrollbar-thumb { background: var(--store-border); border-radius: 999px; }

/* Brand fallback gradients for no-image states */
.store-fallback-gradient { background: linear-gradient(135deg, var(--store-primary), var(--store-secondary)); }
.store-fallback-soft { background: linear-gradient(135deg, color-mix(in srgb, var(--store-primary) 18%, var(--store-surface)), var(--store-surface)); }

/* Card hover treatments */
.store-hover-lift { transition: transform 180ms ease, box-shadow 180ms ease; }
.store-hover-lift:hover { transform: translateY(-4px); box-shadow: 0 12px 28px -12px rgba(0,0,0,0.22); }
.store-hover-zoom { transition: transform 220ms ease; }
.store-hover-zoom:hover { transform: scale(1.015); }

/* Animations */
@keyframes store-reveal {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes store-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes store-scale-in {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}
.store-anim-subtle { animation: store-reveal 0.45s ease-out both; }
.store-anim-slow-reveal { animation: store-reveal 1s cubic-bezier(0.2, 0.6, 0.2, 1) both; }
.store-anim-cinematic { animation: store-reveal 1.3s ease-out both; }
.store-anim-snappy { animation: store-reveal 0.22s ease-out both; }
.store-anim-editorial { animation: store-reveal 0.9s cubic-bezier(0.16, 1, 0.3, 1) both; }
.store-anim-none { animation: none !important; }
.store-anim-fade { animation: store-fade 0.5s ease-out both; }

/* Staggered children */
.store-stagger > * { animation: store-reveal 0.5s ease-out both; }
.store-stagger > *:nth-child(2) { animation-delay: 0.08s; }
.store-stagger > *:nth-child(3) { animation-delay: 0.16s; }
.store-stagger > *:nth-child(4) { animation-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .store-anim-subtle, .store-anim-slow-reveal,
  .store-anim-cinematic, .store-anim-snappy,
  .store-anim-editorial, .store-anim-fade,
  .store-stagger > *, .store-hover-lift, .store-hover-zoom { animation: none !important; transition: none !important; }
  .store-hover-lift:hover { transform: none; box-shadow: none; }
}
