   n/* Define color variables for light and dark themes based on shadcn/ui defaults */
:root {
  --background: 0 0% 100%; /* hsl(0, 0%, 100%) */
  --foreground: 222.2 84% 4.9%; /* hsl(222.2, 84%, 4.9%) */
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 222.2 84% 4.9%;
  --primary: 222.2 47.4% 11.2%;
  --primary-foreground: 210 40% 98%;
  --secondary: 210 40% 96.1%;
  --secondary-foreground: 222.2 47.4% 11.2%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 210 40% 96.1%;
  --accent-foreground: 222.2 47.4% 11.2%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 222.2 84% 4.9%;
  --radius: 0.5rem;
}

html.dark {
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;
  --card: 222.2 84% 4.9%;
  --card-foreground: 210 40% 98%;
  --popover: 222.2 84% 4.9%;
  --popover-foreground: 210 40% 98%;
  --primary: 210 40% 98%;
  --primary-foreground: 222.2 47.4% 11.2%;
  --secondary: 217.2 32.6% 17.5%;
  --secondary-foreground: 210 40% 98%;
  --muted: 217.2 32.6% 17.5%;
  --muted-foreground: 215 20.2% 65.1%;
  --accent: 217.2 32.6% 17.5%;
  --accent-foreground: 210 40% 98%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 210 40% 98%;
  --border: 217.2 32.6% 17.5%;
  --input: 217.2 32.6% 17.5%;
  --ring: 212.7 26.8% 83.9%;
}

body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: 'Inter', sans-serif; /* Consider adding Inter via Google Fonts or similar */
}

/* Apply custom properties to Tailwind classes if needed, or use Tailwind's JIT */
.bg-background { background-color: hsl(var(--background)); }
.text-foreground { color: hsl(var(--foreground)); }
.bg-card { background-color: hsl(var(--card)); }
.text-card-foreground { color: hsl(var(--card-foreground)); }
.text-primary { color: hsl(var(--primary)); }
.bg-primary { background-color: hsl(var(--primary)); }
.text-primary-foreground { color: hsl(var(--primary-foreground)); }
.bg-secondary { background-color: hsl(var(--secondary)); }
.text-secondary-foreground { color: hsl(var(--secondary-foreground)); }
.text-muted-foreground { color: hsl(var(--muted-foreground)); }
.border-border { border-color: hsl(var(--border)); }
.bg-accent { background-color: hsl(var(--accent)); }
.text-accent-foreground { color: hsl(var(--accent-foreground)); }
.border-input { border-color: hsl(var(--input)); }
/* ... Add more for other custom colors used by shadcn/ui if Tailwind CDN doesn't fully cover them */

.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem; /* default 2rem is too much for smaller screens */
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container {
    max-width: 640px;
    padding-left: 2rem;
    padding-right: 2rem;
  }
}
@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }
}
@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
  }
}
@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}
@media (min-width: 1536px) { /* 2xl */
  .container {
    max-width: 1400px; /* from original tailwind.config.js */
  }
}


/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fadeInUp {
  animation-name: fadeInUp;
  animation-duration: 0.8s;
  animation-fill-mode: forwards;
  animation-timing-function: ease-out;
  opacity: 0; /* Start hidden, JS will trigger */
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}
.animate-fadeInLeft {
  animation-name: fadeInLeft;
  animation-duration: 0.8s;
  animation-fill-mode: forwards;
  animation-timing-function: ease-out;
  opacity: 0;
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
.animate-fadeInRight {
  animation-name: fadeInRight;
  animation-duration: 0.8s;
  animation-fill-mode: forwards;
  animation-timing-function: ease-out;
  opacity: 0;
}

.text-gradient {
  background-image: linear-gradient(to right, hsl(var(--foreground)), hsl(var(--muted-foreground)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html.dark .text-gradient {
  background-image: linear-gradient(to right, hsl(var(--foreground)), hsl(var(--muted-foreground)));
}

/* Tab styles */
.tab-trigger {
  border-bottom: 2px solid transparent;
  margin-bottom: -1px; /* Overlap with parent border */
}
.tab-trigger.active-tab {
  color: hsl(var(--primary));
  border-bottom-color: hsl(var(--primary));
  font-weight: 500;
}

/* Ensure icons in buttons are vertically aligned */
button svg, a svg {
  vertical-align: middle;
}

/* Styles from ani.mmd for canvas animation */

/* Canvas styling, scoped to the hero area */
#hero-canvas-area canvas {
  /* background: white; */ /* Original, might be overridden by JS fill */
  /* background: radial-gradient(#FFF, #DDD); */ /* Original, might be overridden by JS fill */
  /* The JS App.initDraw fills canvas with black, then App.draw uses 'rgba(0,0,0,0.1)' for trails */
  /* So, canvas background here might not be visible unless JS is modified. */
  /* For now, ensure it takes full space of its container if JS sizes it to window */
  position: absolute; /* To layer correctly within the relative hero section */
  top: 0;
  left: 0;
  width: 100%; /* Will be controlled by JS to window.innerWidth/Height */
  height: 100%; /* Will be controlled by JS to window.innerWidth/Height */
  transform-origin: 0 0;
  z-index: 0; /* Behind hero text content (which is z-10) */
}

/* UI elements from ani.mmd (hidden by default as requested) */
.ui {
  display: none; /* Kept hidden as per user request */
  position: fixed;
  z-index: 500; /* High z-index if ever made visible */
  bottom: 0;
  left: 0;
  width: 120px;
  padding: 10px;
  background: rgba(255,255,255,0.7);
  font-family: Arial, sans-serif; /* Specify font for UI */
  color: #333; /* Specify base text color for UI */
}

.ui p {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 3px; /* Added for spacing */
}

.ui p.zoom {
  margin-bottom: 5px;
}

.ui p.zoom span {
  margin-right: 5px;
  border: solid 1px #777;
  cursor: pointer;
  border-radius: 2px;
  display: inline-block; /* Ensure padding is applied correctly */
}

.ui p.zoom span.zoomin {
  padding: 2px 5px;
}

.ui p.zoom span.zoomout {
  padding: 2px 8px; /* Corrected padding from original for consistency */
}

.ui p.zoom span:hover {
  background: black;
  color: white;
}

/* This rule for .ui span.zoom seemed incomplete or redundant in original, included for completeness */
.ui span.zoom {
  /* No specific styles provided in original for this exact selector */
}

.ui a.save {
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  color: #007bff;
}
.ui a.save:hover {
  text-decoration: underline;
}

/* Light mode visibility and opacity fixes */
body:not(.dark) .hero-text-fix {
  background-image: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  color: hsl(var(--foreground)) !important;
}

body:not(.dark) .hero-text-fix span.text-primary {
  color: hsl(var(--primary)) !important;
}

/* Ensure hero buttons are not transparent in light mode */
body:not(.dark) #hero-canvas-area .container a.inline-flex {
  opacity: 1 !important;
}

/* Make card borders more visible in light mode */
body:not(.dark) .rounded-xl.border.bg-card {
  border-color: hsl(var(--border)) !important; /* Use full color, override opacity */
}
