/* =========================================================================
   AnyTesh Universal WebGL2 Fluid Ink Transition Engine (Series A)
   100% Vanilla JS, WebGL2 GLSL 3.00 es, and CSS. Zero External Libraries.
   ========================================================================= */

/* Series A Universal 60-30-10 Palette Token Overrides */
html.dark {
  --bg: #1C1C1C;
  --bg-2: #252525;
  --bg-card: #252525;
  --bg-elevated: #242424;
  --bg-surface: #2A2A2A;
  --background: #1C1C1C;
  --surface: #252525;
  --surface-elevated: #2A2A2A;
  --foreground: #D8CEB0;
  --ink: #D8CEB0;
  --muted: rgba(216, 206, 176, 0.7);
  --muted-2: rgba(216, 206, 176, 0.4);
  --line: rgba(216, 206, 176, 0.12);
  --line-strong: rgba(216, 206, 176, 0.22);
  --border: rgba(216, 206, 176, 0.12);
  --card-border: rgba(216, 206, 176, 0.08);
  --glass: rgba(28, 28, 28, 0.65);
  --glass-card: rgba(36, 36, 36, 0.6);
  --glass-hover: rgba(44, 44, 44, 0.85);
}

html.light,
html:not(.dark) {
  --bg: #F4F2EC;
  --bg-2: #EAE6DC;
  --bg-card: #EAE6DC;
  --bg-elevated: #EAE6DC;
  --bg-surface: #E0DBD0;
  --background: #F4F2EC;
  --surface: #EAE6DC;
  --surface-elevated: #E0DBD0;
  --foreground: #1C1C1C;
  --ink: #1C1C1C;
  --muted: rgba(28, 28, 28, 0.72);
  --muted-2: rgba(28, 28, 28, 0.45);
  --line: rgba(28, 28, 28, 0.12);
  --line-strong: rgba(28, 28, 28, 0.24);
  --border: rgba(28, 28, 28, 0.12);
  --card-border: rgba(28, 28, 28, 0.08);
  --glass: rgba(244, 242, 236, 0.75);
  --glass-card: rgba(234, 230, 220, 0.7);
  --glass-hover: rgba(224, 219, 208, 0.9);
}

/* Fullscreen WebGL2 Ink Transition Canvas */
#ink-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999990;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#ink-canvas.active {
  opacity: 1;
  pointer-events: auto;
}

/* Tap Marker Feedback */
.tap-marker {
  position: fixed;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #E34A26;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  z-index: 999999;
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
}

.tap-marker.pulse {
  transform: translate(-50%, -50%) scale(1.6);
  opacity: 0.85;
}

/* =========================================================================
   Morphing Sun <-> Moon SVG Toggle Button
   ========================================================================= */
.theme-toggle-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: transparent;
  color: var(--ink, #D8CEB0);
  border: 1px solid rgba(216, 206, 176, 0.2);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.theme-toggle-btn.has-label {
  width: auto !important;
  border-radius: 0.75rem !important;
  padding: 0.5rem 1rem !important;
}

.theme-toggle-btn:hover {
  border-color: #2F6BFF;
  transform: scale(1.08);
}

.theme-toggle-btn:active {
  transform: scale(0.94);
}

.theme-toggle-svg {
  width: 1.2rem;
  height: 1.2rem;
  color: currentColor;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.theme-sun-rays {
  transform-origin: 12px 12px;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.35s ease;
}

.theme-sun-center,
.theme-moon-cutter {
  transform-origin: 12px 12px;
  transition: transform 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

html:not(.dark) .theme-toggle-svg {
  transform: rotate(0deg);
}
html:not(.dark) .theme-sun-rays {
  transform: scale(1) rotate(0deg);
  opacity: 1;
}
html:not(.dark) .theme-sun-center {
  transform: scale(1);
}
html:not(.dark) .theme-moon-cutter {
  transform: translate(9px, -9px);
}

html.dark .theme-toggle-svg {
  transform: rotate(-45deg);
}
html.dark .theme-sun-rays {
  transform: scale(0) rotate(-60deg);
  opacity: 0;
}
html.dark .theme-sun-center {
  transform: scale(1.68);
}
html.dark .theme-moon-cutter {
  transform: translate(0px, 0px);
}
