/* ==========================================================================
   Base Styles
   ========================================================================== */

/* Reset and Normalize */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Root Variables */
:root {
  /* Typography */
  --font-family-display: "Söhne", "Inter", "Segoe UI", sans-serif;
  --font-family-sans: "Inter", "Segoe UI", sans-serif;
  --font-family-mono: "IBM Plex Mono", "SFMono-Regular", monospace;

  /* Spacing Scale */
  --space-1: 0.25rem; /* 4px */
  --space-2: 0.5rem; /* 8px */
  --space-3: 0.75rem; /* 12px */
  --space-4: 1rem; /* 16px */
  --space-5: 1.5rem; /* 24px */
  --space-6: 2rem; /* 32px */
  --space-7: 3rem; /* 48px */
  --layout-main-top: clamp(var(--space-4), 4vw, var(--space-6));
  --page-gutter-mobile: var(--space-4); /* 16px */
  --page-gutter-desktop: clamp(1.5rem, 4vw, 3rem);

  /* DSTLA palette */
  --dstla-ink: #0b0b0c;
  --dstla-cloud: #f5f5f2;
  --dstla-graphite: #1c1c1f;
  --dstla-steel: #272a35;
  --dstla-cobalt: #5f7cff;
  --dstla-cobalt-dark: #3a52c8;
  --dstla-ice: #c9d6ff;
  --dstla-signal-green: #88ffc4;
  --dstla-amber: #ffc773;
  --dstla-error: #ff7a7a;

  /* Semantic colors */
  --color-primary: var(--dstla-cobalt);
  --color-primary-light: var(--dstla-ice);
  --color-primary-dark: var(--dstla-cobalt-dark);
  --color-primary-button-text: #ffffff;
  --color-secondary: var(--dstla-steel);
  --color-text: var(--dstla-ink);
  --color-text-light: #6f7284;
  --color-text-muted: #8e92a4;
  --color-background: var(--dstla-cloud);
  --color-surface: #ffffff;
  --color-surface-alt: #ececf3;
  --color-border: rgba(9, 9, 11, 0.12);
  --color-border-strong: rgba(9, 9, 11, 0.28);
  --color-error: var(--dstla-error);
  --color-error-light: rgba(255, 122, 122, 0.16);
  --color-success: var(--dstla-signal-green);
  --color-success-light: rgba(136, 255, 196, 0.16);
  --color-warning: var(--dstla-amber);
  --color-warning-light: rgba(255, 199, 115, 0.2);
  --color-info: var(--dstla-cobalt);

  /* Shadows */
  --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 24px 60px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 40px 120px rgba(0, 0, 0, 0.2);

  /* Borders */
  --border-radius-sm: 0.375rem;
  --border-radius-md: 0.75rem;
  --border-radius-lg: 1rem;
  --border-radius-pill: 999px;

  /* Transitions */
  --transition-fast: 0.2s ease-in-out;
  --transition-default: 0.3s ease-in-out;
}

[data-theme="dark"] {
  --color-text: #f8f8f9;
  --color-text-light: #c7cad5;
  --color-text-muted: #9ea3b8;
  --color-background: #070708;
  --color-surface: #111216;
  --color-surface-alt: #15161c;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(255, 255, 255, 0.18);
  --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 24px 60px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 40px 120px rgba(0, 0, 0, 0.8);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --color-text: #f8f8f9;
    --color-text-light: #c7cad5;
    --color-text-muted: #9ea3b8;
    --color-background: #070708;
    --color-surface: #111216;
    --color-surface-alt: #15161c;
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-strong: rgba(255, 255, 255, 0.18);
    --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 24px 60px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 40px 120px rgba(0, 0, 0, 0.8);
  }
}

/* Base Typography */
body {
  font-family: var(--font-family-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-background);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  color: var(--color-text);
  font-family: var(--font-family-display);
  letter-spacing: -0.015em;
}

h4,
h5,
h6 {
  font-family: var(--font-family-sans);
  letter-spacing: normal;
}

h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: 1.2;
}

h3 {
  font-size: 1.5rem;
  line-height: 1.3;
}

p {
  margin-bottom: 1rem;
  color: var(--color-text-light);
}

/* Links */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

/* Lists */
ul,
ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Images */
img {
  max-width: 100%;
  display: block;
}

/* Utility Classes */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--page-gutter-desktop);
}

@media (max-width: 640px) {
  .container {
    padding: 0 var(--page-gutter-mobile);
  }
}

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

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-light);
  margin-bottom: 0.35rem;
}

.microcopy {
  font-size: 0.875rem;
  color: var(--color-text-light);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: var(--border-radius-pill);
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text);
  background-color: var(--color-surface-alt);
  border: 1px solid var(--color-border);
}

.mt-1 {
  margin-top: 0.25rem !important;
}
.mt-2 {
  margin-top: 0.5rem !important;
}
.mt-3 {
  margin-top: 0.75rem !important;
}
.mt-4 {
  margin-top: 1rem !important;
}
.mt-5 {
  margin-top: 1.5rem !important;
}
.mt-6 {
  margin-top: 2rem !important;
}

.mb-1 {
  margin-bottom: 0.25rem !important;
}
.mb-2 {
  margin-bottom: 0.5rem !important;
}
.mb-3 {
  margin-bottom: 0.75rem !important;
}
.mb-4 {
  margin-bottom: 1rem !important;
}
.mb-5 {
  margin-bottom: 1.5rem !important;
}
.mb-6 {
  margin-bottom: 2rem !important;
}

.pt-1 {
  padding-top: 0.25rem !important;
}
.pt-2 {
  padding-top: 0.5rem !important;
}
.pt-3 {
  padding-top: 0.75rem !important;
}
.pt-4 {
  padding-top: 1rem !important;
}
.pt-5 {
  padding-top: 1.5rem !important;
}
.pt-6 {
  padding-top: 2rem !important;
}

.pb-1 {
  padding-bottom: 0.25rem !important;
}
.pb-2 {
  padding-bottom: 0.5rem !important;
}
.pb-3 {
  padding-bottom: 0.75rem !important;
}
.pb-4 {
  padding-bottom: 1rem !important;
}
.pb-5 {
  padding-bottom: 1.5rem !important;
}
.pb-6 {
  padding-bottom: 2rem !important;
}

.flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

.flex-row {
  flex-direction: row;
}

.align-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

thead {
  background-color: var(--color-surface);
}

th,
td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  text-align: left;
}

/* Code */
pre,
code {
  font-family: var(--font-family-mono);
  background-color: var(--color-surface);
  padding: 0.25rem 0.5rem;
  border-radius: var(--border-radius-sm);
  overflow-x: auto;
}
