@import "tailwindcss" source(none);

@source "../../views";
@source "../../components";
@source "../../../app/javascript";

@theme {
  /* ─── Typography ─── */
  --font-sans: "Jost", sans-serif;
  --font-serif: "DM Serif Display", serif;
  --font-mono: "IBM Plex Mono", monospace;
  --font-nav: "Open Sans", sans-serif;

  /* Dashboard type scale — compound definitions */
  --text-display: 2.25rem;
  --text-display--line-height: 1.15;
  --text-display--letter-spacing: -0.025em;
  --text-display--font-weight: 600;

  --text-heading: 1.25rem;
  --text-heading--line-height: 1.3;
  --text-heading--letter-spacing: -0.01em;
  --text-heading--font-weight: 600;

  --text-subheading: 1rem;
  --text-subheading--line-height: 1.4;
  --text-subheading--font-weight: 600;

  --text-body: 0.9375rem;
  --text-body--line-height: 1.6;

  --text-label: 0.8125rem;
  --text-label--line-height: 1.5;
  --text-label--font-weight: 500;

  --text-caption: 0.75rem;
  --text-caption--line-height: 1.5;
  --text-caption--letter-spacing: 0.01em;

  --text-overline: 0.6875rem;
  --text-overline--line-height: 1.45;
  --text-overline--letter-spacing: 0.08em;
  --text-overline--font-weight: 600;

  --text-metric: 2rem;
  --text-metric--line-height: 1;
  --text-metric--letter-spacing: -0.02em;
  --text-metric--font-weight: 700;

  /* ─── Brand ─── */
  --color-brand: #002B56;
  --color-brand-hover: #04C2CF;
  --color-brand-pressed: #002040;
  --color-brand-subtle: #E6F9FA;
  --color-brand-wash: #F0FBFC;

  /* ─── Accent ─── */
  --color-teal: #04C2CF;
  --color-teal-hover: #03A8B4;
  --color-yellow: #FFD577;
  --color-yellow-hover: #FFC94D;

  /* ─── Surfaces ─── */
  --color-page: #FFFFFF;
  --color-surface: #F8F9FB;
  --color-surface-sunken: #F1F3F6;
  --color-surface-hover: #ECEFF3;

  /* ─── Text — all verified AA on white ─── */
  --color-ink: #111827;
  --color-ink-secondary: #374151;
  --color-ink-tertiary: #6B7280;

  /* ─── Borders ─── */
  --color-border: #E5E7EB;
  --color-border-strong: #D1D5DB;

  /* ─── Status — semantic ─── */
  --color-success: #166534;
  --color-success-bg: #F0FDF4;
  --color-warning: #92400E;
  --color-warning-bg: #FFFBEB;
  --color-danger: #991B1B;
  --color-danger-bg: #FEF2F2;

  /* ─── Focus ─── */
  --color-focus: #2563EB;

  /* ─── Animations ─── */
  --animate-fade-in: fade-in 200ms ease-out both;
  --animate-slide-up: slide-up 200ms ease-out both;
  --animate-scale-in: scale-in 200ms ease-out both;

  /* ─── Easing ─── */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

@keyframes scale-in {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

/* Animation delay utility for staggered reveals */
@utility animation-delay-* {
  animation-delay: --value([time]);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── Lightbox dialog ─── */
dialog.lightbox {
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
  padding: 0;
  border: none;
  background: transparent;
  overflow: visible;
}

dialog.lightbox::backdrop {
  background: rgba(0, 11, 27, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

dialog.lightbox[open] .lightbox-card {
  animation: lightbox-in 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

dialog.lightbox[open]::backdrop {
  animation: lightbox-backdrop-in 280ms ease-out both;
}

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

@keyframes lightbox-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
