/* ================================================================
   SLB Main — Reset, Layout, Typography, Utilities
   ================================================================ */

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--fw-normal);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; transition: color var(--dur-fast) ease; }
a:hover { color: var(--color-primary-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }

/* ---- Container ---- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}
.container-wide { max-width: var(--max-width-wide); }
.container-narrow { max-width: var(--max-width-narrow); }

/* ---- CSS Grid System ---- */
.grid { display: grid; gap: var(--space-lg); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
.grid-asymmetric { grid-template-columns: 1fr; }

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-asymmetric { grid-template-columns: 2fr 1fr; }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-asymmetric { grid-template-columns: 1.5fr 1fr 1.5fr; }
}

/* ---- Flex utilities ---- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--color-text);
}
h1 { font-size: clamp(2rem, 4vw + 0.5rem, var(--text-5xl)); }
h2 { font-size: clamp(1.5rem, 3vw + 0.25rem, var(--text-3xl)); }
h3 { font-size: var(--text-xl); font-weight: var(--fw-semibold); }
h4 { font-size: var(--text-lg); font-weight: var(--fw-semibold); }
h5 { font-size: var(--text-base); font-weight: var(--fw-semibold); }

p { line-height: var(--lh-relaxed); color: var(--color-text-secondary); }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-mono { font-family: var(--font-mono); }
.font-medium { font-weight: var(--fw-medium); }
.font-semibold { font-weight: var(--fw-semibold); }
.font-bold { font-weight: var(--fw-bold); }
.leading-tight { line-height: var(--lh-tight); }
.leading-relaxed { line-height: var(--lh-relaxed); }
.tracking-tight { letter-spacing: var(--ls-tight); }
.uppercase { text-transform: uppercase; letter-spacing: var(--ls-wider); }

/* ---- Section pattern ---- */
.section {
  padding: var(--section-gap-mobile) 0;
}
@media (min-width: 1024px) {
  .section { padding: var(--section-gap) 0; }
}
.section-header {
  margin-bottom: var(--sp-8);
}
.section-header h2 {
  margin-bottom: var(--sp-3);
}
.section-header p {
  max-width: 520px;
  color: var(--color-text-tertiary);
}
.section-header.centered {
  text-align: center;
}
.section-header.centered p {
  margin: 0 auto;
}

/* ---- Spacing utilities ---- */
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-8 { margin-bottom: var(--sp-8); }

/* ---- Display ---- */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }
.w-full { width: 100%; }
.max-w-prose { max-width: 680px; }

/* ---- Responsive visibility ---- */
.mobile-only { display: block; }
.desktop-only { display: none; }
@media (min-width: 1024px) {
  .mobile-only { display: none; }
  .desktop-only { display: block; }
}

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