/**
 * DIZYBIRD Design System - Base & Typography
 */

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

html {
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background-color: var(--bg-body);
  color: var(--text-body);
  font-family: var(--font-sans);
  overflow-x: clip;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-body);
  color: var(--text-body);
  overflow-x: clip;
  max-width: 100%;
}

main {
  flex: 1 0 auto;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  color: var(--text-headline);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

h1, .h1 {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

h2, .h2 {
  font-size: 2.125rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

h3, .h3 {
  font-size: 1.5rem;
  font-weight: 600;
}

h4, .h4 {
  font-size: 1.25rem;
  font-weight: 600;
}

p {
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

.text-lead {
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--text-body);
}

.text-muted {
  color: var(--text-muted);
}

.text-highlight-yellow {
  background: linear-gradient(180deg, transparent 65%, var(--brand-yellow-subtle) 65%);
  padding: 0 4px;
  border-radius: 2px;
}

.text-blue {
  color: var(--brand-blue);
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

a {
  color: var(--brand-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--brand-blue-hover);
}

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

/* Layout Containers */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.container-sm {
  width: 100%;
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}

.section {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

.section-sm {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.bg-alt {
  background-color: var(--bg-alt);
}

.bg-white {
  background-color: var(--brand-white);
}

.bg-blue-light {
  background-color: var(--brand-blue-light);
}

/* Grid System */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1024px) {
  .grid-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1, .h1 { font-size: 2.25rem; }
  h2, .h2 { font-size: 1.875rem; }
}

@media (max-width: 640px) {
  :root {
    --container-padding: 1rem;
  }
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .grid-cols-4,
  .grid-cols-3,
  .grid-cols-2 {
    grid-template-columns: 1fr;
  }
  .section {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }
  h1, .h1 { font-size: 1.875rem; }
  h2, .h2 { font-size: 1.5rem; }
}

/* Flexbox Utilities */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
