/* ============================================
   Living Lofi — Base Styles
   Reset, variables, typography, utilities
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Brand Colors */
  --ll-lavender: #FAF5FF;
  --ll-lavender-mid: #F0E6FF;
  --ll-lavender-deep: #E2D1F9;
  --ll-purple: #535DDC;
  --ll-purple-light: #7B83E8;
  --ll-purple-dark: #3D45A8;
  --ll-magenta: #9B046F;
  --ll-magenta-light: #C4388E;
  --ll-magenta-dark: #7A0358;
  --ll-charcoal: #2E2A39;
  --ll-charcoal-light: #4A4458;
  --ll-cream: #FDFBF7;
  --ll-white: #FFFFFF;

  /* Rainbow accent palette */
  --ll-pink: #FF6B9D;
  --ll-coral: #FF8A80;
  --ll-peach: #FFB088;
  --ll-gold: #FFD166;
  --ll-mint: #7ECEC1;
  --ll-sky: #82C4F8;
  --ll-iris: #A78BFA;

  /* Gradients */
  --ll-gradient-hero: linear-gradient(135deg, #E2D1F9 0%, #F0E6FF 30%, #FAF5FF 60%, #E8F4FD 100%);
  --ll-gradient-purple: linear-gradient(135deg, #535DDC 0%, #9B046F 100%);
  --ll-gradient-soft: linear-gradient(180deg, #FAF5FF 0%, #FFFFFF 100%);
  --ll-gradient-rainbow: linear-gradient(90deg, #FF6B9D, #FFD166, #7ECEC1, #82C4F8, #A78BFA, #FF6B9D);
  --ll-gradient-iridescent: linear-gradient(135deg, #E8D5F5 0%, #D4E7FA 25%, #F5E6EC 50%, #D4F0E7 75%, #E8D5F5 100%);

  /* Typography */
  --ll-font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --ll-font-body: 'Quicksand', 'Segoe UI', system-ui, sans-serif;
  --ll-font-size-xs: 0.75rem;
  --ll-font-size-sm: 0.875rem;
  --ll-font-size-base: 1rem;
  --ll-font-size-md: 1.125rem;
  --ll-font-size-lg: 1.25rem;
  --ll-font-size-xl: 1.5rem;
  --ll-font-size-2xl: 2rem;
  --ll-font-size-3xl: 2.5rem;
  --ll-font-size-4xl: 3.5rem;
  --ll-font-size-5xl: 4.5rem;
  --ll-line-height-tight: 1.15;
  --ll-line-height-normal: 1.6;
  --ll-line-height-relaxed: 1.8;

  /* Spacing */
  --ll-space-xs: 0.25rem;
  --ll-space-sm: 0.5rem;
  --ll-space-md: 1rem;
  --ll-space-lg: 1.5rem;
  --ll-space-xl: 2rem;
  --ll-space-2xl: 3rem;
  --ll-space-3xl: 4rem;
  --ll-space-4xl: 6rem;
  --ll-space-5xl: 8rem;

  /* Layout */
  --ll-max-width: 1200px;
  --ll-max-width-narrow: 800px;
  --ll-max-width-wide: 1400px;
  --ll-border-radius-sm: 8px;
  --ll-border-radius-md: 12px;
  --ll-border-radius-lg: 20px;
  --ll-border-radius-xl: 32px;
  --ll-border-radius-full: 9999px;

  /* Shadows */
  --ll-shadow-sm: 0 1px 3px rgba(46, 42, 57, 0.08);
  --ll-shadow-md: 0 4px 12px rgba(46, 42, 57, 0.1);
  --ll-shadow-lg: 0 8px 30px rgba(46, 42, 57, 0.12);
  --ll-shadow-xl: 0 16px 50px rgba(46, 42, 57, 0.15);
  --ll-shadow-glow: 0 0 30px rgba(83, 93, 220, 0.2);
  --ll-shadow-glow-magenta: 0 0 30px rgba(155, 4, 111, 0.15);

  /* Transitions */
  --ll-transition-fast: 150ms ease;
  --ll-transition-base: 250ms ease;
  --ll-transition-slow: 400ms ease;
  --ll-transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index scale */
  --ll-z-base: 1;
  --ll-z-dropdown: 100;
  --ll-z-sticky: 200;
  --ll-z-overlay: 300;
  --ll-z-modal: 400;
  --ll-z-toast: 500;
}

/* --- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--ll-font-body);
  font-size: var(--ll-font-size-base);
  font-weight: 500;
  line-height: var(--ll-line-height-normal);
  color: var(--ll-charcoal);
  background-color: var(--ll-lavender);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-width: 0;
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--ll-font-heading);
  font-weight: 600;
  line-height: var(--ll-line-height-tight);
  color: var(--ll-charcoal);
}

h1 { font-size: var(--ll-font-size-3xl); }
h2 { font-size: var(--ll-font-size-2xl); }
h3 { font-size: var(--ll-font-size-xl); }
h4 { font-size: var(--ll-font-size-lg); }

@media (min-width: 768px) {
  h1 { font-size: var(--ll-font-size-4xl); }
  h2 { font-size: var(--ll-font-size-3xl); }
  h3 { font-size: var(--ll-font-size-2xl); }
}

@media (min-width: 1024px) {
  h1 { font-size: var(--ll-font-size-5xl); }
}

p {
  margin-bottom: var(--ll-space-md);
}

p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 700;
}

/* --- Layout Utilities --- */
.ll-container {
  width: 100%;
  max-width: var(--ll-max-width);
  margin-inline: auto;
  padding-inline: var(--ll-space-lg);
}

.ll-container--narrow {
  max-width: var(--ll-max-width-narrow);
}

.ll-container--wide {
  max-width: var(--ll-max-width-wide);
}

.ll-section {
  padding-block: var(--ll-space-3xl);
}

@media (min-width: 768px) {
  .ll-section {
    padding-block: var(--ll-space-4xl);
  }
}

@media (min-width: 1024px) {
  .ll-section {
    padding-block: var(--ll-space-5xl);
  }
}

.ll-grid {
  display: grid;
  gap: var(--ll-space-xl);
}

.ll-flex {
  display: flex;
  gap: var(--ll-space-md);
}

/* --- Scroll Animations --- */
.ll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.ll-reveal--left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.ll-reveal--right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.ll-reveal--scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.ll-reveal.is-visible,
.ll-reveal--left.is-visible,
.ll-reveal--right.is-visible,
.ll-reveal--scale.is-visible {
  opacity: 1;
  transform: none;
}

/* Staggered children */
.ll-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.ll-stagger.is-visible > *:nth-child(1) { transition-delay: 0ms; opacity: 1; transform: none; }
.ll-stagger.is-visible > *:nth-child(2) { transition-delay: 100ms; opacity: 1; transform: none; }
.ll-stagger.is-visible > *:nth-child(3) { transition-delay: 200ms; opacity: 1; transform: none; }
.ll-stagger.is-visible > *:nth-child(4) { transition-delay: 300ms; opacity: 1; transform: none; }
.ll-stagger.is-visible > *:nth-child(5) { transition-delay: 400ms; opacity: 1; transform: none; }
.ll-stagger.is-visible > *:nth-child(6) { transition-delay: 500ms; opacity: 1; transform: none; }

/* --- Sparkle Animation (brand element) --- */
@keyframes ll-sparkle {
  0%, 100% { opacity: 0; transform: scale(0) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(180deg); }
}

@keyframes ll-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

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

@keyframes ll-rainbow-shift {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes ll-pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(83, 93, 220, 0.15); }
  50% { box-shadow: 0 0 40px rgba(83, 93, 220, 0.3); }
}

/* --- Accessibility --- */
.ll-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--ll-purple);
  outline-offset: 3px;
  border-radius: 2px;
}

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

  html {
    scroll-behavior: auto;
  }

  .ll-reveal,
  .ll-reveal--left,
  .ll-reveal--right,
  .ll-reveal--scale {
    opacity: 1;
    transform: none;
  }

  .ll-stagger > * {
    opacity: 1;
    transform: none;
  }
}
