/* ══════════════════════════════════════════════════════════════
   TZS STUDIO · Design System v6.1
   Dark: cyan/magenta/coral/lavender on deep black
   Light: warm off-white (#fdfcf9) inspired by risograph aesthetic
   ══════════════════════════════════════════════════════════════ */

/* ── Design Tokens ────────────────────────────────────────────── */
:root {
  /* Backgrounds — Dark */
  --background-light: #fdfcf9;
  --background-dark: #050507;
  --surface: #0c0c10;
  --surface2: #121216;
  --surface3: #18181d;

  /* Backgrounds — Light (warm) */
  --bg-warm: #fdfcf9;
  --surface-warm: #ffffff;
  --surface-warm-2: #f8f5ef;
  --surface-warm-3: #efece4;

  /* Borders — Dark */
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);

  /* Borders — Light (warm) */
  --border-warm: rgba(20, 18, 15, 0.06);
  --border-warm-2: rgba(20, 18, 15, 0.11);

  /* Text Scale — Dark */
  --text-primary: #f0eeeb;
  --text-mid: #b0adb5;
  --text-dim: #6e6b75;
  --text-faint: #3d3b42;

  /* Text Scale — Light */
  --text-light: #0a0a0c;
  --text-light-2: #1a1820;
  --text-light-mid: #52505a;
  --text-light-dim: #7e7c85;
  --text-light-faint: #b5b3ba;

  /* Accent Palette (same in both modes) */
  --cyan: #00d4ff;
  --magenta: #d040c0;
  --coral: #ff6b4a;
  --lavender: #b8a0ff;

  /* Typography */
  --serif: 'Instrument Serif', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Legacy aliases for Tailwind compat */
  --card-light: #ffffff;
  --card-dark: #0c0c10;
}

/* ── Light mode ─────────────────────────────────────────────── */
body {
  background-color: var(--bg-warm);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Warm selection highlight */
::selection {
  background: rgba(0, 212, 255, 0.16);
  color: var(--text-light);
}

/* ── Dark mode ──────────────────────────────────────────────── */
.dark body,
html.dark body {
  background-color: var(--background-dark);
  background-attachment: fixed;
}

html:not(.dark) body,
body:not(.dark *) {
  background-color: var(--bg-warm);
}

/* ── Grain Texture Overlay ──────────────────────────────────── */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

/* Dark mode: invert grain to white noise, screen blend adds light speckles */
.dark .grain-overlay {
  opacity: 0.12;
  mix-blend-mode: screen;
}
.dark .grain-overlay svg {
  filter: invert(1);
}

/* Light mode: risograph-style multiply grain */
html:not(.dark) .grain-overlay {
  opacity: 0.10;
  mix-blend-mode: multiply;
}

.grain-overlay svg {
  width: 100%;
  height: 100%;
}

/* ── Atmospheric Orbs ───────────────────────────────────────── */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  mix-blend-mode: screen;
}

.orb-cyan {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.3), transparent 70%);
}

.orb-magenta {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(208, 64, 192, 0.2), transparent 70%);
}

.orb-coral {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(255, 107, 74, 0.18), transparent 70%);
}

.orb-lavender {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(184, 160, 255, 0.18), transparent 70%);
}

/* ── Light Mode Ambient Orbs (warm, organic) ────────────────── */
.ambient-light {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
  filter: blur(40px);
}

/* Dark mode: reduce orb intensity for a subtle atmospheric glow */
html.dark .ambient-light {
  opacity: 0.10 !important;
  mix-blend-mode: screen;
}

.ambient-light svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-in-from-bottom-4 {
  from { transform: translateY(1rem); }
  to { transform: translateY(0); }
}

.animate-in {
  animation: fade-in 0.3s ease-out, slide-in-from-bottom-4 0.3s ease-out;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-shimmer {
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.08), transparent);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.animate-glow {
  animation: glow-pulse 3s ease-in-out infinite;
}

/* ── Dark Card Surfaces ─────────────────────────────────────── */
.dark .dark-card-gradient {
  background: linear-gradient(145deg, var(--surface) 0%, var(--background-dark) 100%) !important;
  border: 1px solid var(--border) !important;
}

.dark .dark-card-gradient:hover {
  border-color: var(--border-strong) !important;
}

/* ── Gradient Border Top (for featured cards) ───────────────── */
.gradient-border-top {
  position: relative;
}

.gradient-border-top::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--magenta), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.gradient-border-top:hover::before {
  opacity: 1;
}

/* ── Quote Block ────────────────────────────────────────────── */
.v6-quote {
  padding: 24px 0 24px 28px;
  border-left: 2px solid;
  border-image: linear-gradient(180deg, var(--cyan), var(--magenta)) 1;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-light-faint);
  border-radius: 10px;
}

.dark ::-webkit-scrollbar-thumb {
  background: var(--text-faint);
}

/* ── Serif Font Utility ─────────────────────────────────────── */
.serif-font {
  font-family: var(--serif);
}

.mono-font {
  font-family: var(--mono);
}

/* ── Light Mode Warm Borders (global override) ──────────────── */
html:not(.dark) .border-gray-100 {
  border-color: var(--border-warm) !important;
}
html:not(.dark) .border-gray-200 {
  border-color: var(--border-warm-2) !important;
}

/* ── Light Mode Warm Backgrounds ────────────────────────────── */
html:not(.dark) .bg-gray-50 {
  background-color: var(--surface-warm-2) !important;
}

/* ══════════════════════════════════════════════════════════════
   LIGHT MODE ACCENT: Deep blue #0066cc instead of cyan #00d4ff
   Dark mode remains cyan. This override handles all Tailwind
   utility classes that reference the 'primary' color token.
   ══════════════════════════════════════════════════════════════ */

/* Override CSS variable for gradient-border-top and other var() usages */
html:not(.dark) {
  --cyan: #0066cc;
}

/* Text */
html:not(.dark) .text-primary { color: #0066cc !important; }
html:not(.dark) .hover\:text-primary:hover { color: #0066cc !important; }
html:not(.dark) .group-hover\:text-primary { color: inherit; }
html:not(.dark) .group:hover .group-hover\:text-primary { color: #0066cc !important; }

/* Background */
html:not(.dark) .bg-primary { background-color: #0066cc !important; }
html:not(.dark) .hover\:bg-primary:hover { background-color: #0066cc !important; }
html:not(.dark) .bg-primary\/5 { background-color: rgba(0,102,204,0.05) !important; }
html:not(.dark) .bg-primary\/10 { background-color: rgba(0,102,204,0.10) !important; }
html:not(.dark) .bg-primary\/20 { background-color: rgba(0,102,204,0.20) !important; }
html:not(.dark) .group-hover\:bg-primary { background-color: inherit; }
html:not(.dark) .group:hover .group-hover\:bg-primary { background-color: #0066cc !important; }

/* Border */
html:not(.dark) .border-primary { border-color: #0066cc !important; }

/* Shadow / Glow */
html:not(.dark) .shadow-primary\/10 { --tw-shadow-color: rgba(0,102,204,0.10) !important; }
html:not(.dark) .shadow-primary\/20 { --tw-shadow-color: rgba(0,102,204,0.20) !important; }
html:not(.dark) .shadow-primary\/50 { --tw-shadow-color: rgba(0,102,204,0.50) !important; }
html:not(.dark) .shadow-primary\/60 { --tw-shadow-color: rgba(0,102,204,0.60) !important; }
html:not(.dark) .shadow-primary\/80 { --tw-shadow-color: rgba(0,102,204,0.80) !important; }

/* Ring */
html:not(.dark) .ring-primary { --tw-ring-color: #0066cc !important; }
html:not(.dark) .focus\:ring-primary\/50:focus { --tw-ring-color: rgba(0,102,204,0.50) !important; }
