/**
 * Boutme Design System — Base Reset & Typography
 */

/* ─── Import Font ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;900&display=swap');

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--bm-font-sans);
  font-size: var(--bm-text-base);
  line-height: var(--bm-leading-base);
  color: var(--bm-text-primary);
  background-color: var(--bm-bg-base);
  min-height: 100dvh;
  overflow-x: hidden;
  font-feature-settings: "cv01", "cv03", "cv04", "cv09";
}

/* ─── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bm-border-strong); border-radius: var(--bm-radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--bm-text-tertiary); }

/* ─── Selection ───────────────────────────────────────────────── */
::selection { background: var(--bm-accent-dim); color: var(--bm-text-primary); }

/* ─── Focus ───────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--bm-accent);
  outline-offset: 2px;
  border-radius: var(--bm-radius-xs);
}

/* ─── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--bm-font-sans);
  color: var(--bm-text-primary);
  letter-spacing: -0.02em;
  line-height: var(--bm-leading-tight);
  font-weight: var(--bm-weight-semibold);
}

h1 { font-size: var(--bm-text-3xl); letter-spacing: -0.03em; }
h2 { font-size: var(--bm-text-2xl); }
h3 { font-size: var(--bm-text-xl); }
h4 { font-size: var(--bm-text-md); letter-spacing: -0.01em; }
h5 { font-size: var(--bm-text-base); }
h6 { font-size: var(--bm-text-sm); }

p {
  color: var(--bm-text-secondary);
  line-height: var(--bm-leading-base);
}

a {
  color: var(--bm-accent);
  text-decoration: none;
  transition: color var(--bm-dur-fast) var(--bm-ease-out);
}
a:hover { color: var(--bm-accent-hover); }

small, .bm-text-xs { font-size: var(--bm-text-xs); }
.bm-text-sm        { font-size: var(--bm-text-sm); }
.bm-text-base      { font-size: var(--bm-text-base); }
.bm-text-md        { font-size: var(--bm-text-md); }
.bm-text-lg        { font-size: var(--bm-text-lg); }
.bm-text-xl        { font-size: var(--bm-text-xl); }
.bm-text-2xl       { font-size: var(--bm-text-2xl); }

.bm-text-primary   { color: var(--bm-text-primary) !important; }
.bm-text-secondary { color: var(--bm-text-secondary) !important; }
.bm-text-tertiary  { color: var(--bm-text-tertiary) !important; }
.bm-text-accent    { color: var(--bm-accent) !important; }
.bm-text-brand     { color: var(--bm-brand) !important; }
.bm-text-green     { color: var(--bm-green) !important; }
.bm-text-red       { color: var(--bm-red) !important; }
.bm-text-yellow    { color: var(--bm-yellow) !important; }
.bm-text-purple    { color: var(--bm-purple) !important; }

.bm-font-light    { font-weight: var(--bm-weight-light); }
.bm-font-regular  { font-weight: var(--bm-weight-regular); }
.bm-font-medium   { font-weight: var(--bm-weight-medium); }
.bm-font-semibold { font-weight: var(--bm-weight-semibold); }
.bm-font-bold     { font-weight: var(--bm-weight-bold); }
.bm-font-black    { font-weight: var(--bm-weight-black); }

.bm-tracking-tight  { letter-spacing: -0.03em; }
.bm-tracking-normal { letter-spacing: 0; }
.bm-tracking-wide   { letter-spacing: 0.05em; }

img { max-width: 100%; height: auto; display: block; }

/* ─── Utility: Spacing ────────────────────────────────────────── */
.bm-mt-0 { margin-top: 0; }
.bm-mt-2 { margin-top: var(--bm-space-2); }
.bm-mt-4 { margin-top: var(--bm-space-4); }
.bm-mt-6 { margin-top: var(--bm-space-6); }
.bm-mt-8 { margin-top: var(--bm-space-8); }
.bm-mb-2 { margin-bottom: var(--bm-space-2); }
.bm-mb-4 { margin-bottom: var(--bm-space-4); }
.bm-mb-6 { margin-bottom: var(--bm-space-6); }
.bm-mb-8 { margin-bottom: var(--bm-space-8); }

.bm-p-0 { padding: 0; }
.bm-p-4 { padding: var(--bm-space-4); }
.bm-p-6 { padding: var(--bm-space-6); }
.bm-p-8 { padding: var(--bm-space-8); }

/* ─── Utility: Display ────────────────────────────────────────── */
.bm-flex        { display: flex; }
.bm-flex-col    { display: flex; flex-direction: column; }
.bm-items-center{ align-items: center; }
.bm-justify-between { justify-content: space-between; }
.bm-justify-center  { justify-content: center; }
.bm-gap-2  { gap: var(--bm-space-2); }
.bm-gap-3  { gap: var(--bm-space-3); }
.bm-gap-4  { gap: var(--bm-space-4); }
.bm-gap-6  { gap: var(--bm-space-6); }
.bm-gap-8  { gap: var(--bm-space-8); }
.bm-w-full { width: 100%; }
.bm-hidden { display: none; }

/* ─── Preloader ───────────────────────────────────────────────── */
#preloader {
  position: fixed;
  inset: 0;
  background: var(--bm-bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--bm-z-top);
  transition: opacity var(--bm-dur-slow) var(--bm-ease-out), visibility var(--bm-dur-slow);
}
#preloader.bm-loaded, #preloader.preloader-hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.bm-preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--bm-space-4);
}
.bm-preloader-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--bm-radius-md);
  animation: bm-pulse 1.5s ease-in-out infinite;
}
.bm-preloader-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--bm-border-default);
  border-top-color: var(--bm-accent);
  border-radius: 50%;
  animation: bm-spin 0.8s linear infinite;
}

/* ─── Divider ─────────────────────────────────────────────────── */
.bm-divider {
  height: 1px;
  background: var(--bm-border-subtle);
  border: none;
  margin: var(--bm-space-4) 0;
}
.bm-divider-text {
  display: flex;
  align-items: center;
  gap: var(--bm-space-3);
  color: var(--bm-text-tertiary);
  font-size: var(--bm-text-sm);
}
.bm-divider-text::before,
.bm-divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--bm-border-subtle);
}
