:root {
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 22px;
  --radius-pill: 100px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
}

[data-theme="aurora"] {
  --bg-base:      #FBFAF6;
  --bg-elev-1:    rgba(251, 250, 246, 0.55);
  --bg-elev-2:    rgba(251, 250, 246, 0.82);
  --bg-elev-3:    rgba(251, 250, 246, 0.92);
  --ink:          #0F1430;
  --ink-soft:     rgba(15, 20, 48, 0.72);
  --ink-muted:    rgba(15, 20, 48, 0.55);
  --ink-faint:    rgba(15, 20, 48, 0.28);
  --border-glass: rgba(255, 255, 255, 0.55);
  --border-soft:  rgba(15, 20, 48, 0.08);
  --mint:         #C8F0D8;
  --blue:         #BCDCFB;
  --lavender:     #D8D4F5;
  --powder:       #9FB8E8;
  --accent:       var(--powder);
  --accent-soft:  rgba(159, 184, 232, 0.22);
  --inner-spec:   rgba(255, 255, 255, 0.40);
  --shadow-sm:    0 6px 20px -8px rgba(15, 20, 48, 0.18);
  --shadow-md:    0 24px 60px -24px rgba(15, 20, 48, 0.25);
  --shadow-lg:    0 40px 100px -30px rgba(15, 20, 48, 0.30);
  --btn-bg:       var(--ink);
  --btn-fg:       var(--bg-base);
  --font-stack:   system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Montserrat', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-stack);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

[data-theme="aurora"] body::before {
  content: "";
  position: fixed; inset: 0; z-index: -3;
  background:
    radial-gradient(circle at 15% 10%, var(--mint)     0%, transparent 45%),
    radial-gradient(circle at 85% 25%, var(--blue)     0%, transparent 50%),
    radial-gradient(circle at 20% 75%, var(--lavender) 0%, transparent 48%),
    radial-gradient(circle at 85% 90%, var(--blue)     0%, transparent 45%),
    linear-gradient(135deg, var(--mint) 0%, var(--blue) 45%, var(--lavender) 100%);
  background-size: 200% 200%;
  animation: gradientShift 26s ease-in-out infinite alternate;
}
[data-theme="aurora"] body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  opacity: 0.32; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.06 0 0 0 0 0.08 0 0 0 0 0.18 0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
@keyframes gradientShift {
  0%   { background-position: 0% 0%, 100% 0%, 0% 100%, 100% 100%, 0% 0%; }
  100% { background-position: 20% 10%, 80% 20%, 10% 90%, 90% 80%, 100% 100%; }
}

:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent);
  border-color: var(--accent);
}

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

[data-theme="cala"] {
  --bg-base:      #FAFBF8;
  --bg-elev-1:    #FFFFFF;
  --bg-elev-2:    #FFFFFF;
  --bg-elev-3:    #FFFFFF;
  --sand:         #EFEAE7;
  --aqua:         #E4EDF1;
  --aqua-soft:    #C2ECED;
  --ink:          #14171B;
  --ink-soft:     rgba(20, 23, 27, 0.70);
  --ink-muted:    rgba(20, 23, 27, 0.52);
  --ink-faint:    rgba(20, 23, 27, 0.30);
  --border-glass: rgba(20, 23, 27, 0.10);
  --border-soft:  rgba(20, 23, 27, 0.08);

  --accent:       #2F7C84;
  --accent-soft:  rgba(47, 124, 132, 0.14);
  --inner-spec:   rgba(255, 255, 255, 0);
  --shadow-sm:    0 1px 2px rgba(20, 23, 27, 0.06);
  --shadow-md:    0 6px 20px -12px rgba(20, 23, 27, 0.16);
  --shadow-lg:    0 18px 44px -22px rgba(20, 23, 27, 0.22);
  --btn-bg:       var(--ink);
  --btn-fg:       #FFFFFF;
  --font-stack:   system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Montserrat', system-ui, -apple-system, sans-serif;
}

[data-theme="cala_night"] {
  --bg-base:      #14171B;
  --bg-elev-1:    #1B1F24;
  --bg-elev-2:    #20252B;
  --bg-elev-3:    #262C33;
  --sand:         #22262A;
  --aqua:         #1B2A2E;
  --aqua-soft:    #2A4A4F;
  --ink:          #F2F5F4;
  --ink-soft:     rgba(242, 245, 244, 0.78);
  --ink-muted:    rgba(242, 245, 244, 0.52);
  --ink-faint:    rgba(242, 245, 244, 0.30);
  --border-glass: rgba(255, 255, 255, 0.10);
  --border-soft:  rgba(255, 255, 255, 0.07);
  --accent:       #6FC7CE;
  --accent-soft:  rgba(111, 199, 206, 0.16);
  --inner-spec:   rgba(255, 255, 255, 0);
  --shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.40);
  --shadow-md:    0 6px 20px -12px rgba(0, 0, 0, 0.55);
  --shadow-lg:    0 18px 44px -22px rgba(0, 0, 0, 0.65);
  --btn-bg:       var(--accent);
  --btn-fg:       #0F1316;
  --font-stack:   system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Montserrat', system-ui, -apple-system, sans-serif;
}
