/* ============================================================
   LUMAFY AI — Design System v2 / Premium Sunrise
   Ground-up visual upgrade: depth, motion, texture, spring physics
   ============================================================ */

:root {
  /* ── LIGHT MODE COLORS ───────────────────────────────────── */
  --color-bg: #FBF6F0;
  --color-bg-alt: #F7F0E8;
  --color-surface: #FFFFFF;
  --color-surface-2: #FBF6F0;
  --color-surface-glass: rgba(255,249,245,0.70);
  --color-surface-offset: #F7F0E8;
  --color-divider: rgba(26,22,20,0.06);
  --color-border: rgba(232,130,12,0.10);
  --color-border-strong: rgba(232,130,12,0.25);
  --color-text: #1A1614;
  --color-text-muted: #6B5E57;
  --color-text-faint: #B5A89E;
  --color-text-inverse: #FFFFFF;
  --color-primary: #E8820C;
  --color-primary-hover: #D0720A;
  --color-primary-active: #B86208;
  --color-primary-highlight: rgba(232,130,12,0.06);
  --color-primary-glow: rgba(232,130,12,0.18);
  --color-accent: #F4603A;
  --color-accent-hover: #E05030;
  --color-accent-highlight: rgba(244,96,58,0.06);
  --color-success: #2E8B57;
  --color-success-bg: #E8F5EE;
  --color-warning: #B8860B;
  --color-warning-bg: #FEF3C7;
  --color-error: #C0392B;
  --color-error-bg: #FDECEA;

  /* ── SPACING ─────────────────────────────────────────────── */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
  --space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem;
  --space-16: 4rem; --space-20: 5rem; --space-24: 6rem; --space-32: 8rem;
  --section-padding: clamp(64px, 8vw, 128px);

  /* ── TYPE SCALE ──────────────────────────────────────────── */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: clamp(1.375rem, 1.1rem + 1.1vw, 1.875rem);
  --text-2xl: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem);
  --text-hero: clamp(2.25rem, 0.5rem + 5vw, 4.5rem);

  /* ── RADII ───────────────────────────────────────────────── */
  --radius-sm: 0.375rem; --radius-md: 0.75rem;
  --radius-lg: 1.125rem; --radius-xl: 1.5rem;
  --radius-2xl: 2rem; --radius-full: 9999px;

  /* ── WARM-TINTED SHADOWS ─────────────────────────────────── */
  --shadow-xs: 0 1px 2px rgba(26,22,20,0.04);
  --shadow-sm: 0 1px 2px rgba(26,22,20,0.04), 0 4px 12px rgba(26,22,20,0.06);
  --shadow-md: 0 2px 4px rgba(26,22,20,0.04), 0 12px 32px rgba(26,22,20,0.10);
  --shadow-lg: 0 4px 8px rgba(26,22,20,0.04), 0 24px 60px rgba(26,22,20,0.12);
  --shadow-xl: 0 8px 16px rgba(26,22,20,0.05), 0 40px 80px rgba(26,22,20,0.14);
  --shadow-glow: 0 4px 16px rgba(232,130,12,0.40), 0 1px 4px rgba(232,130,12,0.25);
  --shadow-glow-accent: 0 4px 16px rgba(244,96,58,0.35), 0 1px 4px rgba(244,96,58,0.20);

  /* ── MOTION ──────────────────────────────────────────────── */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 200ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 380ms cubic-bezier(0.16, 1, 0.3, 1);

  /* ── FONTS ───────────────────────────────────────────────── */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  /* ── LAYOUT ──────────────────────────────────────────────── */
  --content-narrow: 600px;
  --content-default: 960px;
  --content-wide: 1200px;
  --nav-height: 64px;
  --bottom-nav-height: 68px;
}

/* ── DARK MODE ──────────────────────────────────────────────── */
[data-theme='dark'] {
  --color-bg: #1A1614;
  --color-bg-alt: #211A16;
  --color-surface: #261E18;
  --color-surface-2: #2E2318;
  --color-surface-glass: rgba(26,22,20,0.85);
  --color-surface-offset: #2E2318;
  --color-divider: rgba(255,249,245,0.06);
  --color-border: rgba(244,160,58,0.12);
  --color-border-strong: rgba(244,160,58,0.28);
  --color-text: #F5E8DA;
  --color-text-muted: #B89878;
  --color-text-faint: #6B5040;
  --color-text-inverse: #1A1614;
  --color-primary: #F4A03A;
  --color-primary-hover: #F5B55A;
  --color-primary-active: #F7C87A;
  --color-primary-highlight: rgba(244,160,58,0.10);
  --color-primary-glow: rgba(244,160,58,0.22);
  --color-accent: #F47B5A;
  --color-accent-hover: #F5916E;
  --color-accent-highlight: rgba(244,123,90,0.08);
  --color-success: #4ade80;
  --color-success-bg: #14532d;
  --color-warning: #fbbf24;
  --color-warning-bg: #451a03;
  --color-error: #f87171;
  --color-error-bg: #7f1d1d;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.28);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.28), 0 4px 12px rgba(0,0,0,0.35);
  --shadow-md: 0 2px 4px rgba(0,0,0,0.30), 0 12px 32px rgba(0,0,0,0.42);
  --shadow-lg: 0 4px 8px rgba(0,0,0,0.32), 0 24px 60px rgba(0,0,0,0.50);
  --shadow-xl: 0 8px 16px rgba(0,0,0,0.35), 0 40px 80px rgba(0,0,0,0.60);
  --shadow-glow: 0 4px 16px rgba(244,160,58,0.40), 0 1px 4px rgba(244,160,58,0.25);
  --shadow-glow-accent: 0 4px 16px rgba(244,123,90,0.35), 0 1px 4px rgba(244,123,90,0.20);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --color-bg: #1A1614; --color-bg-alt: #211A16;
    --color-surface: #261E18; --color-surface-2: #2E2318;
    --color-surface-glass: rgba(26,22,20,0.85);
    --color-surface-offset: #2E2318;
    --color-divider: rgba(255,249,245,0.06);
    --color-border: rgba(244,160,58,0.12);
    --color-border-strong: rgba(244,160,58,0.28);
    --color-text: #F5E8DA; --color-text-muted: #B89878;
    --color-text-faint: #6B5040; --color-text-inverse: #1A1614;
    --color-primary: #F4A03A; --color-primary-hover: #F5B55A;
    --color-primary-active: #F7C87A;
    --color-primary-highlight: rgba(244,160,58,0.10);
    --color-primary-glow: rgba(244,160,58,0.22);
    --color-accent: #F47B5A; --color-accent-hover: #F5916E;
    --color-accent-highlight: rgba(244,123,90,0.08);
    --color-success: #4ade80; --color-success-bg: #14532d;
    --color-error: #f87171; --color-error-bg: #7f1d1d;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.28);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.28), 0 4px 12px rgba(0,0,0,0.35);
    --shadow-md: 0 2px 4px rgba(0,0,0,0.30), 0 12px 32px rgba(0,0,0,0.42);
    --shadow-lg: 0 4px 8px rgba(0,0,0,0.32), 0 24px 60px rgba(0,0,0,0.50);
    --shadow-xl: 0 8px 16px rgba(0,0,0,0.35), 0 40px 80px rgba(0,0,0,0.60);
    --shadow-glow: 0 4px 16px rgba(244,160,58,0.40), 0 1px 4px rgba(244,160,58,0.25);
    --shadow-glow-accent: 0 4px 16px rgba(244,123,90,0.35), 0 1px 4px rgba(244,123,90,0.20);
  }
}

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; scroll-padding-top: var(--nav-height); }
body { font-family: var(--font-body); font-size: var(--text-base); color: var(--color-text); background-color: var(--color-bg); line-height: 1.6; min-height: 100dvh; }
img, svg { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
input, button, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, h5 { text-wrap: balance; line-height: 1.2; font-family: var(--font-display); }
p, li { text-wrap: pretty; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── CUSTOM SCROLLBAR ───────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #FBF6F0; }
::-webkit-scrollbar-thumb { background: rgba(232,130,12,0.30); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(232,130,12,0.50); }

/* ── FOCUS ──────────────────────────────────────────────────── */
:focus-visible { outline: 2px solid rgba(232,130,12,0.60); outline-offset: 3px; border-radius: 4px; }

/* ── LAYOUT ─────────────────────────────────────────────────── */
.container { width: 100%; max-width: var(--content-wide); margin-inline: auto; padding-inline: clamp(var(--space-4), 5vw, var(--space-12)); }
.container--narrow { max-width: var(--content-narrow); }
.container--default { max-width: var(--content-default); }

/* ── KEYFRAMES ──────────────────────────────────────────────── */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes heroReveal {
  from { opacity: 0; transform: translateY(32px) scale(0.97); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes auroraShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes orbFloat {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(30px,-20px) scale(1.05); }
  66% { transform: translate(-20px,15px) scale(0.95); }
}

/* ── SCROLL REVEAL SYSTEM ────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1), transform 0.7s cubic-bezier(0.16,1,0.3,1);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }
.reveal-delay-4 { transition-delay: 320ms; }

/* ── NOISE TEXTURE UTILITY ───────────────────────────────────── */
.noisy { position: relative; }
.noisy::after {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.035; pointer-events: none; z-index: 1; mix-blend-mode: multiply;
}

/* ── GLASS CARD ─────────────────────────────────────────────── */
.card-glass {
  background: rgba(255,249,245,0.70);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.80);
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(26,22,20,0.06), 0 16px 40px rgba(26,22,20,0.08), inset 0 1px 0 rgba(255,255,255,0.9);
}

/* ── GRADIENT TEXT ──────────────────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, #E8820C 0%, #F4603A 50%, #F9A56D 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-2); padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full); font-size: var(--text-sm);
  font-weight: 600; letter-spacing: 0.01em;
  transition: all var(--transition); white-space: nowrap;
  cursor: pointer; border: none; position: relative; overflow: hidden;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: #E8820C; color: #fff;
  box-shadow: 0 2px 12px rgba(232,130,12,0.25);
}
.btn-primary:hover { background: var(--color-primary-hover); box-shadow: 0 4px 24px rgba(232,130,12,0.35); transform: translateY(-1px); }
.btn-hero {
  background: linear-gradient(135deg, #E8820C 0%, #F4603A 100%);
  color: #fff;
  padding: 1rem 2rem;
  font-size: var(--text-base);
  box-shadow: var(--shadow-glow);
  width: 100%;
  border: 1px solid rgba(255,255,255,0.15);
  position: relative; overflow: hidden;
}
.btn-hero::after {
  content: '';
  position: absolute; top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: shimmer 3s infinite;
}
.btn-hero:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(232,130,12,0.50); filter: brightness(1.05); }
.btn-outline {
  border: 1.5px solid rgba(232,130,12,0.20); color: var(--color-text);
  background: transparent;
}
.btn-outline:hover { border-color: #E8820C; color: #E8820C; background: var(--color-primary-highlight); }
.btn-ghost { color: var(--color-text-muted); background: transparent; }
.btn-ghost:hover { color: var(--color-text); background: var(--color-surface-offset); }
.btn-accent { background: var(--color-accent); color: #fff; box-shadow: var(--shadow-glow-accent); }
.btn-accent:hover { background: var(--color-accent-hover); transform: translateY(-1px); }
.btn-sm { padding: 0.5rem 1rem; font-size: var(--text-xs); }
.btn-lg { padding: 1rem 2rem; font-size: var(--text-base); }
.btn-full { width: 100%; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: var(--radius-full); }
.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ── NAV ─────────────────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 100; height: var(--nav-height);
  background: rgba(251,246,240,0.82);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-bottom: 1px solid rgba(232,130,12,0.08);
  transition: box-shadow 0.3s ease, background 0.3s ease;
}
.header.scrolled {
  background: rgba(251,246,240,0.95);
  box-shadow: 0 1px 0 rgba(232,130,12,0.10), 0 4px 24px rgba(26,22,20,0.06);
}
.nav {
  display: flex; align-items: center; gap: var(--space-4);
  height: 100%; max-width: var(--content-wide); margin: 0 auto;
  padding-inline: clamp(var(--space-4), 5vw, var(--space-12));
}
.logo { display: flex; align-items: center; gap: var(--space-3); color: var(--color-text); flex-shrink: 0; }
.logo-text {
  font-family: var(--font-display); font-size: 1.25rem;
  letter-spacing: -0.02em; color: var(--color-text);
}
.logo-text .ai {
  background: linear-gradient(135deg, #E8820C, #F4603A);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-spacer { flex: 1; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted); transition: all var(--transition);
}
.theme-toggle:hover { color: var(--color-text); background: var(--color-surface-offset); }

/* ── FORMS ───────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: var(--space-2); }
.form-label { font-size: var(--text-sm); font-weight: 500; color: var(--color-text); }
.form-input {
  padding: 0.75rem 1rem; border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg); background: var(--color-surface);
  color: var(--color-text); font-size: var(--text-base);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%; outline: none;
  -webkit-appearance: none; appearance: none;
}
.form-input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 4px var(--color-primary-glow); }
.form-input::placeholder { color: var(--color-text-faint); }
.form-input.error { border-color: var(--color-error); }
.form-hint { font-size: var(--text-xs); color: var(--color-text-muted); }
.form-error { font-size: var(--text-xs); color: var(--color-error); display: flex; align-items: center; gap: var(--space-1); }

/* ── CARDS ───────────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), 0 0 40px rgba(232,130,12,0.06);
  border-color: rgba(232,130,12,0.20);
}

/* ── BADGES ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: 0.25rem 0.625rem; border-radius: var(--radius-full);
  font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.02em;
}
.badge-pro { background: linear-gradient(135deg, #E8820C, #F4603A); color: #fff; }
.badge-trial { background: rgba(232,130,12,0.08); color: #E8820C; border: 1px solid rgba(232,130,12,0.25); }
.badge-dot { width: 7px; height: 7px; background: #4ade80; border-radius: 50%; box-shadow: 0 0 8px #4ade80; animation: pulse 2.4s infinite; }

/* ── UTILITIES ────────────────────────────────────────────────── */
.hidden { display: none !important; }
.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; }
.spinner { animation: spin 0.9s linear infinite; }

/* ── LOGO SVG ─────────────────────────────────────────────────── */
.logo-svg path, .logo-svg circle, .logo-svg line { stroke: currentColor; }

/* ── MODAL/OVERLAY ────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(26,22,20,0.72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-4); opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-box {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl); padding: var(--space-8);
  max-width: 420px; width: 100%;
  transform: translateY(12px); transition: transform var(--transition);
  box-shadow: var(--shadow-xl);
}
.modal-overlay.active .modal-box { transform: translateY(0); }
.modal-icon { width: 56px; height: 56px; border-radius: var(--radius-xl); background: var(--color-primary-highlight); display: flex; align-items: center; justify-content: center; margin: 0 auto var(--space-5); }
.modal-title { font-family: var(--font-display); font-size: var(--text-xl); text-align: center; margin-bottom: var(--space-2); }
.modal-desc { font-size: var(--text-sm); color: var(--color-text-muted); text-align: center; margin-bottom: var(--space-6); line-height: 1.6; }
.modal-actions { display: flex; flex-direction: column; gap: var(--space-3); }
