/* ==========================================================================
   LuxeCart — Core Stylesheet
   Design tokens, resets, typography, layout primitives
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ---- Brand palette ---- */
  --color-ink:        #111111;
  --color-accent:     #4F46E5;
  --color-accent-2:   #7C74F0;
  --color-bg:         #F8FAFC;
  --color-card:       #FFFFFF;
  --color-line:       #E7E9EF;
  --color-muted:      #6B7280;
  --color-success:    #12805C;
  --color-warning:    #B45309;
  --color-danger:     #C0362C;

  /* ---- Dark mode overrides (applied via [data-theme="dark"]) ---- */
  --color-ink-dark:    #F5F5F7;
  --color-bg-dark:     #0B0B0E;
  --color-card-dark:   #17171C;
  --color-line-dark:   #2A2A31;
  --color-muted-dark:  #9A9AA5;

  /* ---- Type ---- */
  --font-display: 'Fraunces', 'Iowan Old Style', serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* ---- Radius / shadow ---- */
  --radius:      16px;
  --radius-sm:   10px;
  --radius-lg:   24px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(17,17,17,0.04);
  --shadow-sm: 0 2px 8px rgba(17,17,17,0.06);
  --shadow-md: 0 8px 24px rgba(17,17,17,0.08);
  --shadow-lg: 0 20px 48px rgba(17,17,17,0.12);
  --shadow-accent: 0 12px 32px rgba(79,70,229,0.28);

  /* ---- Spacing scale ---- */
  --space-1: 0.4rem;
  --space-2: 0.8rem;
  --space-3: 1.2rem;
  --space-4: 1.6rem;
  --space-5: 2.4rem;
  --space-6: 3.2rem;
  --space-7: 4.8rem;
  --space-8: 6.4rem;
  --space-9: 9.6rem;

  /* ---- Container ---- */
  --container-max: 1320px;
  --edge-pad: clamp(1.25rem, 4vw, 4rem);

  /* ---- Motion ---- */
  --ease-out: cubic-bezier(.16,.84,.44,1);
  --ease-in-out: cubic-bezier(.65,0,.35,1);
  --dur-fast: .2s;
  --dur-med: .45s;
  --dur-slow: .8s;

  color-scheme: light;
}

[data-theme="dark"] {
  --color-ink:  var(--color-ink-dark);
  --color-bg:   var(--color-bg-dark);
  --color-card: var(--color-card-dark);
  --color-line: var(--color-line-dark);
  --color-muted:var(--color-muted-dark);
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.35);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.45);
  --shadow-lg: 0 20px 48px rgba(0,0,0,0.55);
  color-scheme: dark;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul[class], ol[class] { list-style: none; margin: 0; padding: 0; }
img, picture, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; background: none; border: none; }

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--dur-med) var(--ease-out), color var(--dur-med) var(--ease-out);
  overflow-x: hidden;
}

:focus-visible {
  outline: 2.5px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Type scale ---- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.08;
  color: var(--color-ink);
}
.h-display  { font-size: clamp(2.75rem, 6vw, 5.5rem); font-weight: 400; letter-spacing: -0.02em; }
h1, .h1     { font-size: clamp(2.25rem, 4.4vw, 3.6rem); }
h2, .h2     { font-size: clamp(1.8rem, 3vw, 2.6rem); }
h3, .h3     { font-size: clamp(1.3rem, 2vw, 1.7rem); }
h4, .h4     { font-size: 1.15rem; font-weight: 600; font-family: var(--font-body); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.eyebrow::before {
  content: '';
  width: 18px; height: 1px;
  background: var(--color-accent);
}

.lede { font-size: 1.125rem; color: var(--color-muted); max-width: 46ch; }
.price { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; }

/* ---- Layout primitives ---- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--edge-pad);
}
.section { padding-block: var(--space-8); }
.section-tight { padding-block: var(--space-6); }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.section-head .stack { max-width: 640px; }
.stack > * + * { margin-top: var(--space-2); }

.grid { display: grid; gap: var(--space-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-12 { grid-template-columns: repeat(12, 1fr); }

.text-center { text-align: center; }
.text-muted { color: var(--color-muted); }
.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;
}
.skip-link {
  position: absolute; left: 0; top: -60px;
  background: var(--color-ink); color: #fff;
  padding: 0.8rem 1.4rem; z-index: 999;
  border-radius: 0 0 var(--radius-sm) 0;
  transition: top var(--dur-fast);
}
.skip-link:focus { top: 0; }

/* ---- Preloader ---- */
.preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--color-ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-4);
  /* Safety net: even if JS never runs or throws, this guarantees the overlay
     clears itself and stops blocking interaction. JS normally hides it well
     before this fires. */
  animation: preloaderFallback 2.4s ease forwards;
}
@keyframes preloaderFallback {
  0%, 88% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; pointer-events: none; }
}
@media (prefers-reduced-motion: reduce) {
  .preloader { animation-duration: .01ms; }
}
.preloader__mark {
  font-family: var(--font-display);
  font-size: 2.4rem; color: #fff; letter-spacing: -0.02em;
  overflow: hidden;
}
.preloader__bar {
  width: 220px; height: 2px; background: rgba(255,255,255,0.15);
  border-radius: var(--radius-pill); overflow: hidden;
}
.preloader__bar span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-2));
}
.preloader__pct {
  font-family: var(--font-mono); font-size: 0.75rem; color: rgba(255,255,255,0.5);
  letter-spacing: 0.1em;
}
body.is-loading { overflow: hidden; }

/* ---- Utility reveal classes (GSAP targets) ---- */
.reveal-up { opacity: 0; transform: translateY(28px); }
.reveal-fade { opacity: 0; }
.reveal-scale { opacity: 0; transform: scale(.96); }

/* ---- Back to top ---- */
.back-to-top {
  position: fixed; right: var(--space-5); bottom: var(--space-5);
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--color-ink); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: all var(--dur-fast) var(--ease-out);
  z-index: 400;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

/* ---- Toast ---- */
.toast-stack {
  position: fixed; top: var(--space-4); right: var(--space-4);
  z-index: 2000; display: flex; flex-direction: column; gap: 0.6rem;
  width: min(320px, calc(100vw - 2rem));
}
.toast {
  background: var(--color-ink); color: #fff;
  padding: 0.9rem 1.1rem; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); font-size: 0.9rem;
  display: flex; align-items: center; gap: 0.7rem;
  transform: translateX(120%); opacity: 0;
  transition: all var(--dur-med) var(--ease-out);
}
.toast.is-visible { transform: translateX(0); opacity: 1; }
.toast__icon { color: var(--color-accent-2); flex-shrink: 0; }
