/**
 * FONT-FIXES-V60 - Master CSS Index
 * 
 * A consolidated design system for typography, spacing, and visual enhancements.
 * This file serves as the entry point for all CSS customizations.
 * 
 * STRUCTURE:
 * ├── Core Design Tokens (OKLCH color system, spacing, typography)
 * ├── Typography & Vertical Rhythm (4px base unit)
 * ├── Grid & Text Balance utilities
 * ├── App UI Components (sidebar, navbar, buttons, forms, cards)
 * ├── Webpage/Link Page Styles
 * └── Splash/Auth Page Styles
 * 
 * USAGE:
 * Include this file AFTER Bootstrap CSS for proper cascade.
 */

/* ==========================================================================
   § 0. CSS CUSTOM PROPERTIES (Design Tokens)
   Unified token system across all components
   ========================================================================== */

:root {
  /* ─────────────────────────────────────────────────────────────────────────
     OKLCH MONOCHROME PALETTE
     Using OKLCH for perceptually uniform grayscale
     ───────────────────────────────────────────────────────────────────────── */
  --cs-gray-0: oklch(100% 0 0);
  --cs-gray-50: oklch(98% 0 0);
  --cs-gray-100: oklch(96% 0 0);
  --cs-gray-150: oklch(94% 0 0);
  --cs-gray-200: oklch(91% 0 0);
  --cs-gray-300: oklch(84% 0 0);
  --cs-gray-400: oklch(73% 0 0);
  --cs-gray-500: oklch(58% 0 0);
  --cs-gray-600: oklch(44% 0 0);
  --cs-gray-700: oklch(32% 0 0);
  --cs-gray-800: oklch(22% 0 0);
  --cs-gray-900: oklch(14% 0 0);
  --cs-gray-950: oklch(10% 0 0);
  --cs-gray-1000: oklch(0% 0 0);

  /* ─────────────────────────────────────────────────────────────────────────
     SEMANTIC TOKENS (Light Theme)
     ───────────────────────────────────────────────────────────────────────── */
  --cs-surface-base: var(--cs-gray-50);
  --cs-surface-raised: var(--cs-gray-0);
  --cs-surface-sunken: var(--cs-gray-100);
  --cs-surface-interactive: var(--cs-gray-100);
  --cs-surface-interactive-hover: var(--cs-gray-150);

  --cs-border-subtle: var(--cs-gray-150);
  --cs-border-default: var(--cs-gray-200);
  --cs-border-strong: var(--cs-gray-300);
  --cs-border-focus: var(--cs-gray-900);

  --cs-text-primary: var(--cs-gray-900);
  --cs-text-secondary: var(--cs-gray-600);
  --cs-text-tertiary: var(--cs-gray-500);
  --cs-text-disabled: var(--cs-gray-400);
  --cs-text-inverse: var(--cs-gray-0);

  --cs-icon-primary: var(--cs-gray-700);
  --cs-icon-secondary: var(--cs-gray-500);

  /* ─────────────────────────────────────────────────────────────────────────
     SPACING SCALE (4px base unit)
     ───────────────────────────────────────────────────────────────────────── */
  --cs-space-0: 0;
  --cs-space-1: 4px;
  --cs-space-2: 8px;
  --cs-space-3: 12px;
  --cs-space-4: 16px;
  --cs-space-5: 20px;
  --cs-space-6: 24px;
  --cs-space-8: 32px;
  --cs-space-10: 40px;
  --cs-space-12: 48px;
  --cs-space-16: 64px;
  --cs-space-20: 80px;

  /* Rhythm aliases for compatibility */
  --rhythm-1: 0.25rem;
  --rhythm-2: 0.5rem;
  --rhythm-3: 0.75rem;
  --rhythm-4: 1rem;
  --rhythm-5: 1.25rem;
  --rhythm-6: 1.5rem;
  --rhythm-8: 2rem;
  --rhythm-10: 2.5rem;
  --rhythm-12: 3rem;
  --rhythm-16: 4rem;

  /* ─────────────────────────────────────────────────────────────────────────
     TYPOGRAPHY SCALE
     Minor Third (1.2) with Inter font family
     ───────────────────────────────────────────────────────────────────────── */
  --cs-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --cs-font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;

  --cs-text-xs: 0.75rem;     /* 12px */
  --cs-text-sm: 0.875rem;    /* 14px */
  --cs-text-base: 1rem;      /* 16px */
  --cs-text-lg: 1.125rem;    /* 18px */
  --cs-text-xl: 1.25rem;     /* 20px */
  --cs-text-2xl: 1.5rem;     /* 24px */
  --cs-text-3xl: 1.875rem;   /* 30px */
  --cs-text-4xl: 2.25rem;    /* 36px */
  --cs-text-5xl: 3rem;       /* 48px */
  --cs-text-6xl: 3.75rem;    /* 60px */

  /* Aliases for compatibility */
  --font-size-xs: var(--cs-text-xs);
  --font-size-sm: var(--cs-text-sm);
  --font-size-base: var(--cs-text-base);
  --font-size-lg: var(--cs-text-lg);
  --font-size-xl: var(--cs-text-xl);
  --font-size-2xl: var(--cs-text-2xl);
  --font-size-3xl: var(--cs-text-3xl);
  --font-size-4xl: var(--cs-text-4xl);
  --font-size-5xl: var(--cs-text-5xl);
  --font-size-6xl: var(--cs-text-6xl);

  /* Line Heights */
  --line-height-tight: 1.2;
  --line-height-snug: 1.375;
  --line-height-base: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 1.75;

  /* Font Weights */
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  /* Letter Spacing */
  --tracking-tighter: -0.05em;
  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;

  /* ─────────────────────────────────────────────────────────────────────────
     BORDER RADII
     ───────────────────────────────────────────────────────────────────────── */
  --cs-radius-sm: 4px;
  --cs-radius-md: 8px;
  --cs-radius-lg: 12px;
  --cs-radius-xl: 16px;
  --cs-radius-2xl: 20px;
  --cs-radius-full: 9999px;

  /* ─────────────────────────────────────────────────────────────────────────
     SHADOWS
     ───────────────────────────────────────────────────────────────────────── */
  --cs-shadow-sm: 0 1px 3px oklch(0% 0 0 / 0.06), 0 1px 2px oklch(0% 0 0 / 0.04);
  --cs-shadow-md: 0 4px 6px oklch(0% 0 0 / 0.05), 0 2px 4px oklch(0% 0 0 / 0.03);
  --cs-shadow-lg: 0 10px 15px oklch(0% 0 0 / 0.06), 0 4px 6px oklch(0% 0 0 / 0.03);
  --cs-shadow-xl: 0 20px 25px oklch(0% 0 0 / 0.08), 0 8px 10px oklch(0% 0 0 / 0.04);
  --cs-shadow-float: 0 8px 32px oklch(0% 0 0 / 0.12), 0 2px 8px oklch(0% 0 0 / 0.06);
  --cs-shadow-focus: 0 0 0 3px oklch(25% 0 0 / 0.1);

  /* ─────────────────────────────────────────────────────────────────────────
     TRANSITIONS
     ───────────────────────────────────────────────────────────────────────── */
  --cs-duration-fast: 100ms;
  --cs-duration-normal: 200ms;
  --cs-duration-slow: 300ms;
  --cs-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --cs-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ─────────────────────────────────────────────────────────────────────────
     Z-INDEX SCALE
     ───────────────────────────────────────────────────────────────────────── */
  --cs-z-dropdown: 100;
  --cs-z-sticky: 200;
  --cs-z-fixed: 300;
  --cs-z-modal-backdrop: 400;
  --cs-z-modal: 500;
  --cs-z-toast: 700;
  --cs-z-tooltip: 800;

  /* ─────────────────────────────────────────────────────────────────────────
     LAYOUT
     ───────────────────────────────────────────────────────────────────────── */
  --cs-navbar-height: 56px;
  --cs-sidebar-width: 260px;
}

/* ==========================================================================
   § 0.1 DARK THEME TOKENS
   ========================================================================== */

[data-theme-style="dark"] {
  --cs-surface-base: var(--cs-gray-950);
  --cs-surface-raised: var(--cs-gray-900);
  --cs-surface-sunken: var(--cs-gray-1000);
  --cs-surface-interactive: var(--cs-gray-800);
  --cs-surface-interactive-hover: var(--cs-gray-700);

  --cs-border-subtle: var(--cs-gray-800);
  --cs-border-default: var(--cs-gray-700);
  --cs-border-strong: var(--cs-gray-600);
  --cs-border-focus: var(--cs-gray-300);

  --cs-text-primary: var(--cs-gray-50);
  --cs-text-secondary: var(--cs-gray-400);
  --cs-text-tertiary: var(--cs-gray-500);
  --cs-text-disabled: var(--cs-gray-600);
  --cs-text-inverse: var(--cs-gray-950);

  --cs-icon-primary: var(--cs-gray-200);
  --cs-icon-secondary: var(--cs-gray-500);

  --cs-shadow-sm: 0 1px 3px oklch(0% 0 0 / 0.2);
  --cs-shadow-md: 0 4px 6px oklch(0% 0 0 / 0.25);
  --cs-shadow-lg: 0 10px 15px oklch(0% 0 0 / 0.3);
  --cs-shadow-float: 0 8px 32px oklch(0% 0 0 / 0.4);
}

/* ==========================================================================
   § 1. BASE ENHANCEMENTS
   ========================================================================== */

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--cs-font-sans);
  font-size: var(--cs-text-base);
  line-height: var(--line-height-base);
  background-color: var(--cs-surface-base);
  color: var(--cs-text-primary);
}

.app {
  background: var(--cs-surface-base);
}

[data-theme-style="dark"].app,
[data-theme-style="dark"] .app {
  background: var(--cs-gray-950);
}

/* Selection styling */
::selection {
  background: var(--cs-gray-900);
  color: var(--cs-gray-0);
}

[data-theme-style="dark"] ::selection {
  background: var(--cs-gray-200);
  color: var(--cs-gray-950);
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--cs-border-focus);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ==========================================================================
   § 2. TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-tight);
  color: var(--cs-text-primary);
  text-wrap: balance;
}

h1, .h1 {
  font-size: var(--cs-text-5xl);
  line-height: var(--line-height-tight);
  margin-top: 0;
  margin-bottom: var(--rhythm-6);
}

h2, .h2 {
  font-size: var(--cs-text-4xl);
  line-height: var(--line-height-tight);
  margin-top: var(--rhythm-12);
  margin-bottom: var(--rhythm-5);
}

h3, .h3 {
  font-size: var(--cs-text-3xl);
  line-height: var(--line-height-snug);
  margin-top: var(--rhythm-10);
  margin-bottom: var(--rhythm-4);
}

h4, .h4 {
  font-size: var(--cs-text-2xl);
  line-height: var(--line-height-snug);
  margin-top: var(--rhythm-8);
  margin-bottom: var(--rhythm-3);
}

h5, .h5 {
  font-size: var(--cs-text-xl);
  line-height: var(--line-height-snug);
  margin-top: var(--rhythm-6);
  margin-bottom: var(--rhythm-3);
}

h6, .h6 {
  font-size: var(--cs-text-lg);
  line-height: var(--line-height-base);
  margin-top: var(--rhythm-6);
  margin-bottom: var(--rhythm-2);
}

/* First heading in a section - no top margin */
h1:first-child, h2:first-child, h3:first-child,
h4:first-child, h5:first-child, h6:first-child,
.h1:first-child, .h2:first-child, .h3:first-child,
.h4:first-child, .h5:first-child, .h6:first-child {
  margin-top: 0;
}

p {
  margin-top: 0;
  margin-bottom: var(--rhythm-4);
  color: var(--cs-text-secondary);
  text-wrap: pretty;
}

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

.lead {
  font-size: var(--cs-text-xl);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-relaxed);
  text-wrap: balance;
}

small, .small, .text-muted {
  color: var(--cs-text-tertiary) !important;
}

a {
  color: var(--cs-text-primary);
  transition: color var(--cs-duration-fast) var(--cs-ease);
}

a:hover {
  color: var(--cs-text-secondary);
  text-decoration: none;
}

code {
  font-family: var(--cs-font-mono);
  background: var(--cs-surface-sunken);
  padding: 2px 6px;
  border-radius: var(--cs-radius-sm);
  font-size: var(--cs-text-sm);
}

/* ==========================================================================
   § 3. APP SIDEBAR
   ========================================================================== */

.app-sidebar {
  background: var(--cs-surface-raised);
  border: 1px solid var(--cs-border-subtle);
  border-radius: var(--cs-radius-xl);
  box-shadow: var(--cs-shadow-lg);
}

[data-theme-style="dark"] .app-sidebar {
  background: var(--cs-surface-raised);
  border-color: var(--cs-border-subtle);
}

.app-sidebar-title a {
  color: var(--cs-text-primary);
  font-weight: var(--font-weight-semibold);
}

.app-sidebar-links > li > a {
  color: var(--cs-text-secondary);
  font-size: var(--cs-text-sm);
  font-weight: var(--font-weight-medium);
  border-radius: var(--cs-radius-lg);
  transition: all var(--cs-duration-fast) var(--cs-ease);
}

.app-sidebar-links > li > a:hover {
  background: var(--cs-surface-interactive);
  color: var(--cs-text-primary);
}

.app-sidebar-links > li.active > a:not(.default) {
  background: var(--cs-gray-900);
  color: var(--cs-gray-0);
}

[data-theme-style="dark"] .app-sidebar-links > li.active > a:not(.default) {
  background: var(--cs-gray-100);
  color: var(--cs-gray-950);
}

.app-sidebar-footer > a {
  color: var(--cs-text-secondary);
  border-top: 1px solid var(--cs-border-subtle);
  border-radius: 0 0 var(--cs-radius-xl) var(--cs-radius-xl);
}

.app-sidebar-footer > a:hover {
  background: var(--cs-surface-interactive);
  color: var(--cs-text-primary);
}

.app-overlay {
  background: oklch(0% 0 0 / 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ==========================================================================
   § 4. NAVBAR
   ========================================================================== */

.navbar-main {
  background: var(--cs-surface-raised);
  border-bottom: 1px solid var(--cs-border-subtle);
  min-height: var(--cs-navbar-height) !important;
}

[data-theme-style="dark"] .navbar-main {
  background: var(--cs-surface-raised);
  border-color: var(--cs-border-subtle);
}

.navbar-main .navbar-nav > li > a {
  font-size: var(--cs-text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--cs-text-secondary);
  border-radius: var(--cs-radius-lg);
  transition: all var(--cs-duration-fast) var(--cs-ease);
}

.navbar-main .navbar-nav > li > a:hover {
  color: var(--cs-text-primary);
  background: var(--cs-surface-interactive);
}

.app-navbar {
  border-bottom: 1px solid var(--cs-border-subtle);
  min-height: var(--cs-navbar-height);
}

/* Floating navbar variant */
.navbar-floating {
  position: fixed !important;
  top: var(--cs-space-3);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - var(--cs-space-6));
  max-width: 1200px;
  border: 1px solid var(--cs-border-subtle);
  border-radius: var(--cs-radius-2xl);
  box-shadow: var(--cs-shadow-float);
  z-index: var(--cs-z-fixed);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: oklch(from var(--cs-surface-raised) l c h / 0.9);
}

/* ==========================================================================
   § 5. BUTTONS
   ========================================================================== */

.btn {
  font-family: var(--cs-font-sans);
  font-size: var(--cs-text-sm);
  font-weight: var(--font-weight-medium);
  border-radius: var(--cs-radius-lg);
  transition: all var(--cs-duration-fast) var(--cs-ease);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--cs-gray-900);
  border-color: var(--cs-gray-900);
  color: var(--cs-gray-0);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--cs-gray-800);
  border-color: var(--cs-gray-800);
  color: var(--cs-gray-0);
}

[data-theme-style="dark"] .btn-primary {
  background: var(--cs-gray-100);
  border-color: var(--cs-gray-100);
  color: var(--cs-gray-950);
}

[data-theme-style="dark"] .btn-primary:hover,
[data-theme-style="dark"] .btn-primary:focus {
  background: var(--cs-gray-200);
  border-color: var(--cs-gray-200);
  color: var(--cs-gray-950);
}

.btn-secondary {
  background: var(--cs-surface-interactive);
  border-color: var(--cs-border-default);
  color: var(--cs-text-primary);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: var(--cs-surface-interactive-hover);
  border-color: var(--cs-border-strong);
  color: var(--cs-text-primary);
}

.btn-outline-primary,
.btn-outline-secondary {
  background: transparent;
  border-color: var(--cs-border-default);
  color: var(--cs-text-primary);
}

.btn-outline-primary:hover,
.btn-outline-secondary:hover {
  background: var(--cs-surface-interactive);
  border-color: var(--cs-border-strong);
  color: var(--cs-text-primary);
}

.btn-light {
  background: var(--cs-surface-raised);
  border-color: var(--cs-border-default);
  color: var(--cs-text-primary);
}

.btn-light:hover {
  background: var(--cs-surface-interactive);
  border-color: var(--cs-border-strong);
  color: var(--cs-text-primary);
}

.btn-dark {
  background: var(--cs-gray-900);
  border-color: var(--cs-gray-900);
  color: var(--cs-gray-0);
}

.btn-dark:hover {
  background: var(--cs-gray-800);
  border-color: var(--cs-gray-800);
}

/* ==========================================================================
   § 6. FORMS
   ========================================================================== */

.form-control {
  font-family: var(--cs-font-sans);
  font-size: var(--cs-text-base);
  color: var(--cs-text-primary);
  background: var(--cs-surface-raised);
  border: 1px solid var(--cs-border-default);
  border-radius: var(--cs-radius-lg);
  transition: all var(--cs-duration-fast) var(--cs-ease);
}

.form-control::placeholder {
  color: var(--cs-text-tertiary);
}

.form-control:hover {
  border-color: var(--cs-border-strong);
}

.form-control:focus {
  border-color: var(--cs-border-focus);
  box-shadow: var(--cs-shadow-focus);
  background: var(--cs-surface-raised);
  color: var(--cs-text-primary);
}

.form-control:disabled {
  background: var(--cs-surface-sunken);
  color: var(--cs-text-disabled);
}

[data-theme-style="dark"] .form-control {
  background: var(--cs-surface-raised);
  border-color: var(--cs-border-default);
  color: var(--cs-text-primary);
}

.input-group-text {
  background: var(--cs-surface-sunken);
  border: 1px solid var(--cs-border-default);
  color: var(--cs-text-secondary);
  font-size: var(--cs-text-sm);
}

label,
.form-label,
.col-form-label {
  font-size: var(--cs-text-sm);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-base);
  margin-bottom: var(--rhythm-2);
}

/* ==========================================================================
   § 7. CARDS
   ========================================================================== */

.card {
  background: var(--cs-surface-raised);
  border: 1px solid var(--cs-border-subtle);
  border-radius: var(--cs-radius-xl);
}

[data-theme-style="dark"] .card {
  background: var(--cs-surface-raised);
  border-color: var(--cs-border-subtle);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--cs-border-subtle);
  padding: var(--cs-space-4) var(--cs-space-5);
}

.card-body {
  padding: var(--cs-space-5);
}

.card-footer {
  background: var(--cs-surface-sunken);
  border-top: 1px solid var(--cs-border-subtle);
  padding: var(--cs-space-4) var(--cs-space-5);
}

.card-title {
  font-size: var(--cs-text-xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-snug);
  margin-bottom: var(--rhythm-3);
  text-wrap: balance;
}

/* ==========================================================================
   § 8. DROPDOWNS
   ========================================================================== */

.dropdown-menu {
  background: var(--cs-surface-raised);
  border: 1px solid var(--cs-border-subtle);
  border-radius: var(--cs-radius-xl);
  box-shadow: var(--cs-shadow-float);
  padding: var(--cs-space-2);
}

[data-theme-style="dark"] .dropdown-menu {
  background: var(--cs-surface-raised);
  border-color: var(--cs-border-subtle);
}

.dropdown-item {
  color: var(--cs-text-primary);
  font-size: var(--cs-text-sm);
  font-weight: 450;
  border-radius: var(--cs-radius-lg);
  padding: var(--cs-space-2) var(--cs-space-3);
  transition: background var(--cs-duration-fast) var(--cs-ease);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--cs-surface-interactive);
  color: var(--cs-text-primary);
}

.dropdown-item.active,
.dropdown-item:active {
  background: var(--cs-gray-900);
  color: var(--cs-gray-0);
}

[data-theme-style="dark"] .dropdown-item.active,
[data-theme-style="dark"] .dropdown-item:active {
  background: var(--cs-gray-100);
  color: var(--cs-gray-950);
}

.dropdown-divider {
  border-top: 1px solid var(--cs-border-subtle);
  margin: var(--cs-space-2) 0;
}

/* ==========================================================================
   § 9. MODALS
   ========================================================================== */

.modal-content {
  background: var(--cs-surface-raised);
  border: none;
  border-radius: var(--cs-radius-2xl);
  box-shadow: var(--cs-shadow-xl);
  padding: var(--cs-space-4);
}

[data-theme-style="dark"] .modal-content {
  background: var(--cs-surface-raised);
}

.modal-header {
  padding: var(--cs-space-4);
  border-bottom: none;
}

.modal-body {
  padding: var(--cs-space-4);
  font-size: var(--cs-text-base);
  line-height: var(--line-height-base);
}

.modal-footer {
  padding: var(--cs-space-4);
  border-top: none;
}

.modal-title {
  font-size: var(--cs-text-xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-snug);
}

.modal-backdrop {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background-color: oklch(0% 0 0 / 0.5);
}

/* ==========================================================================
   § 10. ALERTS & BADGES
   ========================================================================== */

.alert {
  font-size: var(--cs-text-sm);
  line-height: var(--line-height-base);
  padding: var(--rhythm-4);
  margin-bottom: var(--rhythm-4);
  border-radius: var(--cs-radius-lg);
}

.badge {
  font-size: var(--cs-text-xs);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  letter-spacing: var(--tracking-wide);
  padding: var(--rhythm-1) var(--rhythm-2);
  border-radius: var(--cs-radius-sm);
}

/* ==========================================================================
   § 11. TABLES
   ========================================================================== */

table {
  margin-bottom: var(--rhythm-4);
}

th,
td {
  padding: var(--rhythm-3) var(--rhythm-4);
  line-height: var(--line-height-base);
  vertical-align: top;
}

th {
  font-weight: var(--font-weight-semibold);
}

/* ==========================================================================
   § 12. UTILITY CLASSES
   ========================================================================== */

/* Font size utilities */
.fs-xs { font-size: var(--cs-text-xs); }
.fs-sm { font-size: var(--cs-text-sm); }
.fs-base { font-size: var(--cs-text-base); }
.fs-lg { font-size: var(--cs-text-lg); }
.fs-xl { font-size: var(--cs-text-xl); }
.fs-2xl { font-size: var(--cs-text-2xl); }
.fs-3xl { font-size: var(--cs-text-3xl); }
.fs-4xl { font-size: var(--cs-text-4xl); }
.fs-5xl { font-size: var(--cs-text-5xl); }

/* Line height utilities */
.lh-tight { line-height: var(--line-height-tight); }
.lh-snug { line-height: var(--line-height-snug); }
.lh-base { line-height: var(--line-height-base); }
.lh-relaxed { line-height: var(--line-height-relaxed); }
.lh-loose { line-height: var(--line-height-loose); }

/* Letter spacing utilities */
.tracking-tighter { letter-spacing: var(--tracking-tighter); }
.tracking-tight { letter-spacing: var(--tracking-tight); }
.tracking-normal { letter-spacing: var(--tracking-normal); }
.tracking-wide { letter-spacing: var(--tracking-wide); }
.tracking-wider { letter-spacing: var(--tracking-wider); }

/* Rhythm margin utilities */
.mt-rhythm-1 { margin-top: var(--rhythm-1); }
.mt-rhythm-2 { margin-top: var(--rhythm-2); }
.mt-rhythm-3 { margin-top: var(--rhythm-3); }
.mt-rhythm-4 { margin-top: var(--rhythm-4); }
.mt-rhythm-6 { margin-top: var(--rhythm-6); }
.mt-rhythm-8 { margin-top: var(--rhythm-8); }

.mb-rhythm-1 { margin-bottom: var(--rhythm-1); }
.mb-rhythm-2 { margin-bottom: var(--rhythm-2); }
.mb-rhythm-3 { margin-bottom: var(--rhythm-3); }
.mb-rhythm-4 { margin-bottom: var(--rhythm-4); }
.mb-rhythm-6 { margin-bottom: var(--rhythm-6); }
.mb-rhythm-8 { margin-bottom: var(--rhythm-8); }

/* Text truncation */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.text-truncate-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Prose container for long-form content */
.prose {
  max-width: 65ch;
}

.prose > * + * {
  margin-top: var(--rhythm-4);
}

/* ==========================================================================
   § 13. GRID & TEXT BALANCE
   ========================================================================== */

.link-grid-image-wrapper {
  aspect-ratio: 1 / 1;
  height: auto !important;
}

.link-grid-image-wrapper[data-aspect="4-3"] { aspect-ratio: 4 / 3; }
.link-grid-image-wrapper[data-aspect="16-9"] { aspect-ratio: 16 / 9; }
.link-grid-image-wrapper[data-aspect="3-4"] { aspect-ratio: 3 / 4; }

.link-grid-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.link-grid-image-wrapper[data-fit="cover"] img {
  object-fit: cover !important;
}

/* ==========================================================================
   § 14. RESPONSIVE TYPOGRAPHY
   ========================================================================== */

@media (max-width: 575.98px) {
  h1, .h1 { font-size: var(--cs-text-4xl); }
  h2, .h2 { font-size: var(--cs-text-3xl); }
  h3, .h3 { font-size: var(--cs-text-2xl); }
  h4, .h4 { font-size: var(--cs-text-xl); }
  h5, .h5 { font-size: var(--cs-text-lg); }
  h6, .h6 { font-size: var(--cs-text-base); }
  .lead { font-size: var(--cs-text-lg); }
}

/* ==========================================================================
   § 15. ACCESSIBILITY
   ========================================================================== */

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

/* Focus visible for keyboard navigation */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--cs-border-focus);
  outline-offset: 2px;
}

/* ==========================================================================
   § 16. PRINT STYLES
   ========================================================================== */

@media print {
  .app-sidebar,
  .navbar-main,
  .app-navbar {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
}
