/* ── Reset & Custom Cursors ───────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* macOS Black Custom Cursors */
html, body {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24'%3E%3Cpath d='M5.5 3L18.5 15.2H12.2L9.5 21.5L5.5 3Z' fill='black' stroke='white' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 4 2, auto;
}
a, button, input[type="radio"], input[type="checkbox"], select, [data-nav], [data-mobilenav], .cursor-pointer {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 24 24'%3E%3Cpath d='M10.5 11V4.5a1.5 1.5 0 0 1 3 0V11m0-5.5a1.5 1.5 0 0 1 3 0v4m0-3a1.5 1.5 0 0 1 3 0v6c0 3-2 5-5 5H8.5c-3 0-5-2-5-5V9.5a1.5 1.5 0 0 1 3 0V11' fill='black' stroke='white' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 10 2, pointer !important;
}
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], input[type="url"], textarea {
  cursor: text !important;
}

/* ── Premium Apple/SaaS Monochrome Theme ─────────────────────────────────── */
:root {
  --bg: #ffffff;
  --surface: #f5f5f7;
  --surface-hover: #e5e5ea;
  --border: #e5e5ea;
  --text: #1d1d1f;
  --text-muted: #86868b;
  --accent: #000000;
  --accent-fg: #ffffff;
  --glass: rgba(255, 255, 255, 0.75);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.04);

  /* Luxury motion & elevation tokens */
  --ease-luxury: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-lift: 0 20px 60px rgba(0, 0, 0, 0.10);
  --shadow-lift-lg: 0 30px 90px rgba(0, 0, 0, 0.14);
  --ring: 0 0 0 3px rgba(0, 0, 0, 0.08);
}
html.dark {
  --bg: #000000;
  --surface: #1c1c1e;
  --surface-hover: #2c2c2e;
  --border: #38383a;
  --text: #f5f5f7;
  --text-muted: #86868b;
  --accent: #ffffff;
  --accent-fg: #000000;
  --glass: rgba(0, 0, 0, 0.75);
  --shadow: 0 4px 24px rgba(255, 255, 255, 0.04);
  --shadow-lift: 0 20px 60px rgba(0, 0, 0, 0.55);
  --shadow-lift-lg: 0 30px 90px rgba(0, 0, 0, 0.65);
  --ring: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

html { scroll-behavior: smooth; }
/* Lenis takes over smooth scrolling once initialized; native scroll-behavior
   is disabled so the two never fight (see app.js initSmoothScroll). */
html.lenis { scroll-behavior: auto; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  transition: background 0.4s var(--ease-luxury), color 0.4s var(--ease-luxury);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

/* ── Selection ───────────────────────────────────────────────────────────── */
::selection { background: var(--accent); color: var(--accent-fg); }

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes slideUp {
  from { transform: translateX(-50%) translateY(30px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.page-fade { animation: fadeIn 0.5s var(--ease-luxury) forwards; }

/* Scroll-reveal utility — driven by GSAP/ScrollTrigger in app.js.
   Elements start hidden so there's no flash before JS runs the reveal;
   if JS fails to init for any reason this still resolves to visible. */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  will-change: opacity, transform;
}
[data-reveal].reveal-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.9s var(--ease-luxury), transform 0.9s var(--ease-luxury);
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  html { scroll-behavior: auto; }
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* ── Accessibility: focus states ─────────────────────────────────────────── */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 8px;
}

/* ── Form Elements ───────────────────────────────────────────────────────── */
input, select, textarea {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  transition: all 0.25s var(--ease-out-soft);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent) !important;
  outline: none;
  box-shadow: var(--ring);
}
input::placeholder, textarea::placeholder { color: var(--text-muted) !important; }

/* ── Components ──────────────────────────────────────────────────────────── */
.glass-nav {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-bottom: 1px solid var(--border);
  transition: background 0.4s var(--ease-luxury), border-color 0.4s var(--ease-luxury);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  transition: transform 0.35s var(--ease-out-soft), opacity 0.25s ease, background-color 0.3s, box-shadow 0.35s var(--ease-out-soft);
  will-change: transform;
}
.btn-primary:hover:not(:disabled) { transform: scale(1.02); opacity: 0.92; box-shadow: var(--shadow-lift); }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  transition: transform 0.3s var(--ease-out-soft), background 0.3s var(--ease-out-soft), border-color 0.3s var(--ease-out-soft);
}
.btn-outline:hover:not(:disabled) { background: var(--surface); border-color: var(--text); transform: translateY(-1px); }
.btn-outline:active:not(:disabled) { transform: translateY(0); }
.btn-outline:disabled { opacity: 0.5; cursor: not-allowed; }

/* Magnetic buttons — JS (app.js) nudges these via transform on mousemove;
   the transition below is what makes the release feel elastic rather than snappy. */
.magnetic { transition: transform 0.5s var(--ease-out-soft); }

.card-minimal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.4s var(--ease-out-soft), transform 0.4s var(--ease-out-soft), border-color 0.4s var(--ease-out-soft);
}
.card-minimal:hover { box-shadow: var(--shadow-lift); }

/* Premium skeleton shimmer (replaces flat Tailwind pulse where used with .skeleton) */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface);
}
.skeleton::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--surface-hover), transparent);
  background-size: 400px 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}

/* Premium spinner for async admin/checkout actions */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
  vertical-align: -3px;
}

/* Subtle floating accent for empty-state icons */
.float-slow { animation: floatSlow 4s ease-in-out infinite; }
