
/* 
  =============================================================
  TDV ECOSYSTEM DESIGN TOKENS (Linear / Vercel / Stripe Grade)
  =============================================================
*/
:root {
  /* LIGHT MODE SURFACES (Alabaster & Pure White) */
  --surface-bg: #F8FAFC;
  --surface-card: #FFFFFF;
  --surface-elevated: #F1F5F9;
  
  /* BORDERS */
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-hover: rgba(0, 0, 0, 0.12);
  
  /* SHADOWS (Surface elevation, not heavy black boxes) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.02);

  /* SPRING PHYSICS & ANIMATIONS */
  --transition-spring: 150ms cubic-bezier(0.22, 1, 0.36, 1);
  --transition-spring-slow: 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

html.dark {
  /* DARK MODE SURFACES (Deep Charcoal / Slate) */
  --surface-bg: #090A0F;
  --surface-card: #0F1117;
  --surface-elevated: #161922;
  
  /* BORDERS */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  
  /* SHADOWS (Dark mode uses almost no shadow, relies on border & elevation) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Base resets for optical perfection */
body {
  background-color: var(--surface-bg);
  transition: background-color var(--transition-spring), color var(--transition-spring);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography refinements */
.tabular-nums { font-variant-numeric: tabular-nums; }
.tracking-tight { letter-spacing: -0.02em; }
.max-w-65ch { max-width: 65ch; }

/* Concentric Border Radius Utility Math */
.radius-card { border-radius: 20px; padding: 12px; }
.radius-inner { border-radius: 8px; /* 20 - 12 = 8 */ }

/* Micro-interactions: Buttons */
.btn-spring {
  transition: all var(--transition-spring);
}
.btn-spring:active {
  transform: scale(0.98);
}

/* Micro-interactions: Cards */
.card-spring {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-spring);
}
.card-spring:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Skeleton Loading (No Layout Shifts) */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton-pulse {
  background: linear-gradient(90deg, var(--surface-elevated) 25%, var(--border-subtle) 50%, var(--surface-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: inherit;
}

/* Ensure minimum touch targets for mobile */
@media (max-width: 768px) {
  button, a.tap-target, .tap-target {
    min-height: 44px;
    min-width: 44px;
  }
}

/* TDV Hub — Main Portal Styles
 * Extracted from index.html inline <style> block.
 * Do NOT add Tailwind utilities here — use Tailwind classes in HTML instead.
 */

:root {
  color-scheme: dark;
}
html, body {
  max-width: 100vw;
  overflow-x: clip;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
}
html.light {
  color-scheme: light;
}
body {
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Strict Dual Theme Backgrounds */
html.dark body {
  background-color: #09090b;
  color: #f4f4f5;
  background-image: 
    radial-gradient(at 0% 0%, rgba(147, 51, 234, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 60%, rgba(126, 34, 206, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
}

html.light body {
  background-color: #fafafa;
  color: #09090b;
  background-image: 
    radial-gradient(at 0% 0%, rgba(147, 51, 234, 0.06) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.04) 0px, transparent 50%);
  background-attachment: fixed;
}

/* Dual-Theme Cards conforming to zinc-900 / white */
.hub-card {
  background-color: #ffffff;
  border: 1px solid #e4e4e7;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
}

html.dark .hub-card {
  background-color: #18181b;
  border: 1px solid #27272a;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
}

.hub-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px rgba(147, 51, 234, 0.12);
  border-color: #d8b4fe;
}

html.dark .hub-card:hover {
  box-shadow: 0 16px 30px -10px rgba(0, 0, 0, 0.7), 0 0 20px -5px rgba(147, 51, 234, 0.15);
  border-color: #7e22ce;
}

.pulse-dot {
  animation: pulseGlow 2s infinite ease-in-out;
}
@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.85); }
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
}
.accordion-content.open {
  max-height: 400px;
  transition: max-height 0.4s ease-in-out;
}

/* Custom clean scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(161, 161, 170, 0.25);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(147, 51, 234, 0.5);
}
