/**
 * dsalathe Design System - Font Definitions
 *
 * Fonts: Inter (sans-serif), JetBrains Mono (monospace)
 *
 * This file uses Bunny Fonts (https://fonts.bunny.net) - a privacy-respecting,
 * GDPR-compliant font CDN with no tracking. For true self-hosting, see the
 * README for instructions on downloading and hosting fonts yourself.
 *
 * Usage:
 *   <link rel="stylesheet" href="https://static.dsalathe.dev/css/dsalathe-fonts.css">
 *   <link rel="stylesheet" href="https://static.dsalathe.dev/css/dsalathe-tokens.css">
 *
 * @version 1.0.0
 */

/* ============================================
 * INTER - Primary sans-serif font
 * Clean, modern, Swiss-inspired
 * ============================================ */

/* Bunny Fonts CDN (privacy-respecting alternative to Google Fonts) */
@import url('https://fonts.bunny.net/css?family=inter:300,400,500,600,700&display=swap');

/* ============================================
 * JETBRAINS MONO - Monospace font
 * Technical, developer-friendly
 * ============================================ */

@import url('https://fonts.bunny.net/css?family=jetbrains-mono:400,500,600,700&display=swap');

/* ============================================
 * FONT FACE FALLBACKS
 * For when CDN is unavailable
 * ============================================ */

/* System font stack fallback */
@supports not (font-variation-settings: normal) {
  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  }

  code, pre, kbd {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  }
}

/* ============================================
 * SELF-HOSTED FONTS (Optional)
 *
 * To self-host fonts:
 * 1. Download Inter: https://rsms.me/inter/
 * 2. Download JetBrains Mono: https://www.jetbrains.com/lp/mono/
 * 3. Place WOFF2 files in /fonts/ directory
 * 4. Uncomment the @font-face rules below
 * 5. Remove the @import rules above
 * ============================================ */

/*
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/Inter-Light.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/Inter-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/Inter-Medium.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/Inter-SemiBold.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/Inter-Bold.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/JetBrainsMono-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/JetBrainsMono-Medium.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/JetBrainsMono-SemiBold.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/JetBrainsMono-Bold.woff2') format('woff2');
}
*/
/**
 * dsalathe Design System - Design Tokens
 * Alpine/Swiss Technical Theme
 *
 * Inspired by: Alpine twilight, mountain skies at dusk, Swiss precision,
 *              northern lights over mountains, granite and slate
 *
 * Color Philosophy:
 *   - Primary: Vibrant sky blues with subtle purple tints (mountain sky at dusk)
 *   - Background: Soft lavender tones (alpine twilight, not sterile white)
 *   - Accent: Purple-to-blue gradients (northern lights over mountains)
 *   - Secondary: Deep navy (mountain shadows at night)
 *   - Neutrals: Cool grays (granite and slate rock)
 *   - Pop: Swiss red (maintained from original)
 *
 * Usage:
 *   <link rel="stylesheet" href="https://static.dsalathe.dev/css/dsalathe-tokens.css">
 *
 * @version 2.0.0
 */

:root {
  /* ============================================
   * COLOR PALETTE - Alpine/Swiss Theme
   * ============================================ */

  /* Lavender - Primary background color (alpine twilight sky) 
   * Very subtle, airy tones - the blog uses this as the main page background
   * Should feel light and breathable, not heavy or saturated */
  --ds-lavender-50: #fafaff;     /* Almost white with hint of lavender */
  --ds-lavender-100: #f0f4ff;    /* Very light lavender */
  --ds-lavender-200: #e0e7ff;    /* Your blog background color */
  --ds-lavender-300: #d0d9ff;    /* Slightly deeper - good for borders */
  --ds-lavender-400: #b8c4fc;    /* Medium lavender */
  --ds-lavender-500: #9ba8f5;    /* Balanced lavender */
  --ds-lavender-600: #7c8aeb;    /* Richer lavender */
  --ds-lavender-700: #5f6dd9;    /* Deep lavender */
  --ds-lavender-800: #4a54b8;    /* Dark lavender */
  --ds-lavender-900: #3d4494;    /* Very dark lavender */
  --ds-lavender-950: #262a5c;    /* Deepest lavender */

  /* Sky Blue - Primary action color (mountain sky at dusk) */
  --ds-sky-50: #eef8ff;
  --ds-sky-100: #d9efff;
  --ds-sky-200: #bce4ff;
  --ds-sky-300: #8ed4ff;
  --ds-sky-400: #59bbfa;
  --ds-sky-500: #4299e1;   /* Your blog primary blue */
  --ds-sky-600: #2b7dc9;
  --ds-sky-700: #2565a3;
  --ds-sky-800: #245486;
  --ds-sky-900: #22476f;
  --ds-sky-950: #172d4a;

  /* Purple - Gradient accent color (northern lights) */
  --ds-purple-50: #f5f3ff;
  --ds-purple-100: #ede9fe;
  --ds-purple-200: #ddd6fe;
  --ds-purple-300: #c4b5fd;
  --ds-purple-400: #a78bfa;
  --ds-purple-500: #667eea;   /* Your blog gradient start */
  --ds-purple-600: #5a67d8;
  --ds-purple-700: #4c51bf;
  --ds-purple-800: #434190;
  --ds-purple-900: #3c3976;
  --ds-purple-950: #27234f;

  /* Alpine Navy - Secondary deep tone (mountain shadow at night) */
  --ds-navy-50: #f4f6f8;
  --ds-navy-100: #e3e8ed;
  --ds-navy-200: #cad3dc;
  --ds-navy-300: #a5b3c1;
  --ds-navy-400: #798c9f;
  --ds-navy-500: #5e7185;
  --ds-navy-600: #4f5f72;
  --ds-navy-700: #445060;
  --ds-navy-800: #3c4552;
  --ds-navy-900: #1a202c;   /* Your blog dark text */
  --ds-navy-950: #12161e;

  /* Slate Gray - Neutral tone (granite and slate rock - cool grays) */
  --ds-slate-50: #f7f8fa;
  --ds-slate-100: #eef0f4;
  --ds-slate-200: #e2e6ec;
  --ds-slate-300: #cbd2dc;
  --ds-slate-400: #718096;   /* Your blog muted text */
  --ds-slate-500: #4a5568;   /* Your blog secondary text */
  --ds-slate-600: #4a5568;
  --ds-slate-700: #3d4556;
  --ds-slate-800: #2d3442;
  --ds-slate-900: #1e242e;
  --ds-slate-950: #0f1218;

  /* Alpine Red - Accent color (Swiss cross) */
  --ds-red-50: #FEF2F3;
  --ds-red-100: #FEE2E4;
  --ds-red-200: #FECACD;
  --ds-red-300: #FCA5AB;
  --ds-red-400: #F8717B;
  --ds-red-500: #EF4352;
  --ds-red-600: #C41E3A;
  --ds-red-700: #A91B32;
  --ds-red-800: #8C1A2E;
  --ds-red-900: #761C2D;
  --ds-red-950: #410A13;

  /* Snow White - Clean surface tones (preserved for surfaces/cards) */
  --ds-snow-50: #FFFFFF;
  --ds-snow-100: #FEFEFE;
  --ds-snow-200: #FAFBFC;
  --ds-snow-300: #F5F7F9;
  --ds-snow-400: #EEF1F4;
  --ds-snow-500: #E4E9ED;

  /* Glacier Blue - Secondary cool tone (ice/glacier) */
  --ds-glacier-50: #F0F9FB;
  --ds-glacier-100: #E0F3F7;
  --ds-glacier-200: #C2E7EF;
  --ds-glacier-300: #94D6E3;
  --ds-glacier-400: #5FBDD1;
  --ds-glacier-500: #3AA3BC;
  --ds-glacier-600: #2E849D;
  --ds-glacier-700: #2A6B80;
  --ds-glacier-800: #295969;
  --ds-glacier-900: #264A59;
  --ds-glacier-950: #14303B;

  /* Success - Alpine meadow green */
  --ds-success-50: #ECFDF5;
  --ds-success-100: #D1FAE5;
  --ds-success-200: #A7F3D0;
  --ds-success-300: #6EE7B7;
  --ds-success-400: #34D399;
  --ds-success-500: #10B981;
  --ds-success-600: #059669;
  --ds-success-700: #047857;
  --ds-success-800: #065F46;
  --ds-success-900: #064E3B;

  /* Warning - Alpine sunset */
  --ds-warning-50: #FFFBEB;
  --ds-warning-100: #FEF3C7;
  --ds-warning-200: #FDE68A;
  --ds-warning-300: #FCD34D;
  --ds-warning-400: #FBBF24;
  --ds-warning-500: #F59E0B;
  --ds-warning-600: #D97706;
  --ds-warning-700: #B45309;
  --ds-warning-800: #92400E;
  --ds-warning-900: #78350F;

  /* ============================================
   * SEMANTIC COLOR MAPPINGS
   * Light mode defaults - matching blog aesthetic
   * ============================================ */

  /* Primary colors - purple/indigo for buttons and CTAs */
  --ds-primary: var(--ds-purple-500);
  --ds-primary-hover: var(--ds-purple-600);
  --ds-primary-active: var(--ds-purple-700);
  --ds-primary-light: var(--ds-purple-100);
  --ds-primary-dark: var(--ds-purple-800);

  /* Secondary colors - sky blue for links and secondary actions */
  --ds-secondary: var(--ds-sky-500);
  --ds-secondary-hover: var(--ds-sky-600);
  --ds-secondary-active: var(--ds-sky-700);
  --ds-secondary-light: var(--ds-sky-100);

  /* Accent colors - Swiss red for alerts/important */
  --ds-accent: var(--ds-red-600);
  --ds-accent-hover: var(--ds-red-700);
  --ds-accent-active: var(--ds-red-800);
  --ds-accent-light: var(--ds-red-100);

  /* Gradient colors - northern lights (purple to blue) */
  --ds-gradient-start: var(--ds-purple-500);
  --ds-gradient-end: var(--ds-sky-500);
  --ds-gradient-primary: linear-gradient(135deg, var(--ds-gradient-start) 0%, var(--ds-gradient-end) 100%);

  /* Background colors - soft lavender page background */
  --ds-background: var(--ds-lavender-200);           /* Main page background */
  --ds-background-alt: var(--ds-lavender-100);       /* Alternate/lighter background */
  --ds-background-subtle: var(--ds-lavender-50);     /* Very subtle background */
  --ds-surface: var(--ds-snow-50);                   /* Cards, panels - pure white */
  --ds-surface-elevated: var(--ds-snow-50);          /* Elevated surfaces - white */
  --ds-surface-sunken: var(--ds-lavender-100);       /* Sunken areas - very light */

  /* Text colors - dark navy for readability on light backgrounds */
  --ds-text-primary: var(--ds-navy-900);             /* Main text - dark navy */
  --ds-text-secondary: var(--ds-slate-500);          /* Secondary text - cool gray */
  --ds-text-muted: var(--ds-slate-400);              /* Muted/helper text */
  --ds-text-inverse: var(--ds-snow-50);              /* Text on dark backgrounds */
  --ds-text-link: var(--ds-sky-500);                 /* Link color - sky blue */
  --ds-text-link-hover: var(--ds-sky-600);           /* Link hover */

  /* Border colors - subtle lavender borders */
  --ds-border: var(--ds-lavender-300);               /* Standard borders */
  --ds-border-light: var(--ds-lavender-200);         /* Subtle borders */
  --ds-border-strong: var(--ds-lavender-400);        /* Emphasized borders */
  --ds-border-focus: var(--ds-purple-500);           /* Focus state border */

  /* Input colors - clean white inputs */
  --ds-input-background: var(--ds-snow-50);          /* Input background */
  --ds-input-border: var(--ds-lavender-300);         /* Input border */
  --ds-input-border-focus: var(--ds-purple-500);     /* Input focus border */

  /* State colors */
  --ds-success: var(--ds-success-500);
  --ds-warning: var(--ds-warning-500);
  --ds-error: var(--ds-red-600);
  --ds-info: var(--ds-sky-500);

  /* ============================================
   * TYPOGRAPHY
   * Swiss precision, technical clarity
   * ============================================ */

  /* Font families */
  --ds-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --ds-font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Monaco, 'Courier New', monospace;
  --ds-font-display: var(--ds-font-sans);

  /* Font sizes - modular scale (1.25 ratio) */
  --ds-text-xs: 0.75rem;      /* 12px */
  --ds-text-sm: 0.875rem;     /* 14px */
  --ds-text-base: 1rem;       /* 16px */
  --ds-text-lg: 1.125rem;     /* 18px */
  --ds-text-xl: 1.25rem;      /* 20px */
  --ds-text-2xl: 1.5rem;      /* 24px */
  --ds-text-3xl: 1.875rem;    /* 30px */
  --ds-text-4xl: 2.25rem;     /* 36px */
  --ds-text-5xl: 3rem;        /* 48px */

  /* Line heights */
  --ds-leading-none: 1;
  --ds-leading-tight: 1.25;
  --ds-leading-snug: 1.375;
  --ds-leading-normal: 1.5;
  --ds-leading-relaxed: 1.625;
  --ds-leading-loose: 2;

  /* Font weights */
  --ds-font-light: 300;
  --ds-font-normal: 400;
  --ds-font-medium: 500;
  --ds-font-semibold: 600;
  --ds-font-bold: 700;

  /* Letter spacing */
  --ds-tracking-tighter: -0.05em;
  --ds-tracking-tight: -0.025em;
  --ds-tracking-normal: 0;
  --ds-tracking-wide: 0.025em;
  --ds-tracking-wider: 0.05em;
  --ds-tracking-widest: 0.1em;

  /* ============================================
   * SPACING
   * Swiss grid system - clean, geometric
   * ============================================ */

  --ds-space-0: 0;
  --ds-space-px: 1px;
  --ds-space-0-5: 0.125rem;   /* 2px */
  --ds-space-1: 0.25rem;      /* 4px */
  --ds-space-1-5: 0.375rem;   /* 6px */
  --ds-space-2: 0.5rem;       /* 8px */
  --ds-space-2-5: 0.625rem;   /* 10px */
  --ds-space-3: 0.75rem;      /* 12px */
  --ds-space-3-5: 0.875rem;   /* 14px */
  --ds-space-4: 1rem;         /* 16px */
  --ds-space-5: 1.25rem;      /* 20px */
  --ds-space-6: 1.5rem;       /* 24px */
  --ds-space-7: 1.75rem;      /* 28px */
  --ds-space-8: 2rem;         /* 32px */
  --ds-space-9: 2.25rem;      /* 36px */
  --ds-space-10: 2.5rem;      /* 40px */
  --ds-space-11: 2.75rem;     /* 44px */
  --ds-space-12: 3rem;        /* 48px */
  --ds-space-14: 3.5rem;      /* 56px */
  --ds-space-16: 4rem;        /* 64px */
  --ds-space-20: 5rem;        /* 80px */
  --ds-space-24: 6rem;        /* 96px */
  --ds-space-28: 7rem;        /* 112px */
  --ds-space-32: 8rem;        /* 128px */

  /* ============================================
   * ELEVATION / SHADOWS
   * Subtle, minimal - Swiss precision
   * ============================================ */

  --ds-shadow-xs: 0 1px 2px 0 rgba(44, 62, 80, 0.03);
  --ds-shadow-sm: 0 1px 3px 0 rgba(44, 62, 80, 0.05), 0 1px 2px -1px rgba(44, 62, 80, 0.05);
  --ds-shadow-md: 0 4px 6px -1px rgba(44, 62, 80, 0.07), 0 2px 4px -2px rgba(44, 62, 80, 0.07);
  --ds-shadow-lg: 0 10px 15px -3px rgba(44, 62, 80, 0.08), 0 4px 6px -4px rgba(44, 62, 80, 0.08);
  --ds-shadow-xl: 0 20px 25px -5px rgba(44, 62, 80, 0.08), 0 8px 10px -6px rgba(44, 62, 80, 0.08);
  --ds-shadow-2xl: 0 25px 50px -12px rgba(44, 62, 80, 0.15);
  --ds-shadow-inner: inset 0 2px 4px 0 rgba(44, 62, 80, 0.04);
  --ds-shadow-none: 0 0 #0000;

  /* Focus ring shadow */
  --ds-ring-offset: 2px;
  --ds-ring-width: 2px;
  --ds-ring-color: var(--ds-sky-500);
  --ds-ring: 0 0 0 var(--ds-ring-offset) var(--ds-surface), 0 0 0 calc(var(--ds-ring-offset) + var(--ds-ring-width)) var(--ds-ring-color);

  /* ============================================
   * BORDER RADIUS
   * Clean but not harsh - precision corners
   * ============================================ */

  --ds-radius-none: 0;
  --ds-radius-sm: 4px;
  --ds-radius-md: 6px;
  --ds-radius-lg: 8px;
  --ds-radius-xl: 12px;
  --ds-radius-2xl: 16px;
  --ds-radius-3xl: 24px;
  --ds-radius-full: 9999px;

  /* ============================================
   * BORDERS
   * ============================================ */

  --ds-border-width-0: 0px;
  --ds-border-width-1: 1px;
  --ds-border-width-2: 2px;
  --ds-border-width-4: 4px;

  /* ============================================
   * TRANSITIONS
   * Smooth, professional animations
   * ============================================ */

  --ds-transition-fast: 150ms;
  --ds-transition-normal: 200ms;
  --ds-transition-slow: 300ms;
  --ds-transition-slower: 500ms;

  --ds-ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ds-ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ds-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ds-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ============================================
   * Z-INDEX SCALE
   * ============================================ */

  --ds-z-dropdown: 1000;
  --ds-z-sticky: 1020;
  --ds-z-fixed: 1030;
  --ds-z-modal-backdrop: 1040;
  --ds-z-modal: 1050;
  --ds-z-popover: 1060;
  --ds-z-tooltip: 1070;

  /* ============================================
   * BREAKPOINTS (for reference in JS)
   * ============================================ */

  --ds-screen-sm: 640px;
  --ds-screen-md: 768px;
  --ds-screen-lg: 1024px;
  --ds-screen-xl: 1280px;
  --ds-screen-2xl: 1536px;

  /* ============================================
   * CONTAINER WIDTHS
   * ============================================ */

  --ds-container-sm: 640px;
  --ds-container-md: 768px;
  --ds-container-lg: 1024px;
  --ds-container-xl: 1280px;
  --ds-container-2xl: 1400px;
}

/* ============================================
 * DARK MODE TOKENS
 * Alpine night theme
 * ============================================ */

@media (prefers-color-scheme: dark) {
  :root.ds-auto-dark,
  :root:not(.ds-light) {
    --ds-background: var(--ds-navy-950);
    --ds-background-alt: var(--ds-navy-900);
    --ds-background-subtle: var(--ds-navy-900);
    --ds-surface: var(--ds-navy-900);
    --ds-surface-elevated: var(--ds-navy-800);
    --ds-surface-sunken: var(--ds-navy-950);

    --ds-text-primary: var(--ds-lavender-100);
    --ds-text-secondary: var(--ds-slate-400);
    --ds-text-muted: var(--ds-slate-500);
    --ds-text-link: var(--ds-sky-400);
    --ds-text-link-hover: var(--ds-sky-300);

    --ds-border: var(--ds-navy-700);
    --ds-border-light: var(--ds-navy-800);
    --ds-border-strong: var(--ds-navy-600);

    --ds-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 2px -1px rgba(0, 0, 0, 0.2);
    --ds-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --ds-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);

    /* Dark mode gradient - slightly adjusted for contrast */
    --ds-gradient-start: var(--ds-purple-400);
    --ds-gradient-end: var(--ds-sky-400);
  }
}

/* Explicit dark mode class */
:root.ds-dark {
  --ds-background: var(--ds-navy-950);
  --ds-background-alt: var(--ds-navy-900);
  --ds-background-subtle: var(--ds-navy-900);
  --ds-surface: var(--ds-navy-900);
  --ds-surface-elevated: var(--ds-navy-800);
  --ds-surface-sunken: var(--ds-navy-950);

  --ds-text-primary: var(--ds-lavender-100);
  --ds-text-secondary: var(--ds-slate-400);
  --ds-text-muted: var(--ds-slate-500);
  --ds-text-link: var(--ds-sky-400);
  --ds-text-link-hover: var(--ds-sky-300);

  --ds-border: var(--ds-navy-700);
  --ds-border-light: var(--ds-navy-800);
  --ds-border-strong: var(--ds-navy-600);

  --ds-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 2px -1px rgba(0, 0, 0, 0.2);
  --ds-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --ds-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);

  /* Dark mode gradient - slightly adjusted for contrast */
  --ds-gradient-start: var(--ds-purple-400);
  --ds-gradient-end: var(--ds-sky-400);
}
/**
 * dsalathe Design System - Theme & Base Styles
 * Alpine/Swiss Technical Theme
 *
 * Includes: Reset, base typography, utility classes
 * Requires: dsalathe-tokens.css
 *
 * Usage:
 *   <link rel="stylesheet" href="https://static.dsalathe.dev/css/dsalathe-tokens.css">
 *   <link rel="stylesheet" href="https://static.dsalathe.dev/css/dsalathe-theme.css">
 *
 * @version 1.0.0
 */

/* ============================================
 * CSS RESET - Modern, minimal
 * ============================================ */

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
  font-feature-settings: normal;
  font-variation-settings: normal;
}

html:focus-within {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  line-height: var(--ds-leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

a {
  color: inherit;
  text-decoration: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

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

/* ============================================
 * BASE STYLES
 * ============================================ */

body {
  font-family: var(--ds-font-sans);
  font-size: var(--ds-text-base);
  color: var(--ds-text-primary);
  background-color: var(--ds-background);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--ds-font-display);
  font-weight: var(--ds-font-semibold);
  line-height: var(--ds-leading-tight);
  color: var(--ds-text-primary);
  letter-spacing: var(--ds-tracking-tight);
}

h1 {
  font-size: var(--ds-text-4xl);
  font-weight: var(--ds-font-bold);
}

h2 {
  font-size: var(--ds-text-3xl);
}

h3 {
  font-size: var(--ds-text-2xl);
}

h4 {
  font-size: var(--ds-text-xl);
}

h5 {
  font-size: var(--ds-text-lg);
}

h6 {
  font-size: var(--ds-text-base);
}

p {
  line-height: var(--ds-leading-relaxed);
  color: var(--ds-text-secondary);
}

a {
  color: var(--ds-text-link);
  transition: color var(--ds-transition-fast) var(--ds-ease-out);
}

a:hover {
  color: var(--ds-text-link-hover);
}

strong,
b {
  font-weight: var(--ds-font-semibold);
}

small {
  font-size: var(--ds-text-sm);
}

code,
kbd,
samp,
pre {
  font-family: var(--ds-font-mono);
  font-size: 0.9em;
}

code {
  background-color: var(--ds-surface-sunken);
  padding: var(--ds-space-0-5) var(--ds-space-1);
  border-radius: var(--ds-radius-sm);
  font-size: var(--ds-text-sm);
}

pre {
  background-color: var(--ds-navy-900);
  color: var(--ds-snow-100);
  padding: var(--ds-space-4);
  border-radius: var(--ds-radius-lg);
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
  font-size: var(--ds-text-sm);
}

blockquote {
  border-left: 4px solid var(--ds-glacier-400);
  padding-left: var(--ds-space-4);
  color: var(--ds-text-secondary);
  font-style: italic;
}

hr {
  border: none;
  border-top: 1px solid var(--ds-border);
  margin: var(--ds-space-8) 0;
}

/* Lists with content */
.ds-list ul,
.ds-list ol {
  padding-left: var(--ds-space-6);
}

.ds-list ul {
  list-style-type: disc;
}

.ds-list ol {
  list-style-type: decimal;
}

.ds-list li {
  margin-bottom: var(--ds-space-2);
  line-height: var(--ds-leading-relaxed);
}

/* Tables */
table {
  width: 100%;
}

th {
  text-align: left;
  font-weight: var(--ds-font-semibold);
  padding: var(--ds-space-3) var(--ds-space-4);
  border-bottom: 2px solid var(--ds-border);
}

td {
  padding: var(--ds-space-3) var(--ds-space-4);
  border-bottom: 1px solid var(--ds-border-light);
}

/* Focus styles */
:focus-visible {
  outline: none;
  box-shadow: var(--ds-ring);
}

/* Selection */
::selection {
  background-color: var(--ds-sky-200);
  color: var(--ds-navy-900);
}

/* ============================================
 * UTILITY CLASSES
 * ============================================ */

/* Container */
.ds-container {
  width: 100%;
  max-width: var(--ds-container-xl);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--ds-space-4);
  padding-right: var(--ds-space-4);
}

@media (min-width: 640px) {
  .ds-container {
    padding-left: var(--ds-space-6);
    padding-right: var(--ds-space-6);
  }
}

@media (min-width: 1024px) {
  .ds-container {
    padding-left: var(--ds-space-8);
    padding-right: var(--ds-space-8);
  }
}

/* Text colors */
.ds-text-primary { color: var(--ds-text-primary); }
.ds-text-secondary { color: var(--ds-text-secondary); }
.ds-text-muted { color: var(--ds-text-muted); }
.ds-text-inverse { color: var(--ds-text-inverse); }
.ds-text-link { color: var(--ds-text-link); }
.ds-text-success { color: var(--ds-success); }
.ds-text-warning { color: var(--ds-warning); }
.ds-text-error { color: var(--ds-error); }

/* Background colors */
.ds-bg-background { background-color: var(--ds-background); }
.ds-bg-surface { background-color: var(--ds-surface); }
.ds-bg-elevated { background-color: var(--ds-surface-elevated); }
.ds-bg-primary { background-color: var(--ds-primary); }
.ds-bg-secondary { background-color: var(--ds-secondary); }
.ds-bg-accent { background-color: var(--ds-accent); }

/* Font sizes */
.ds-text-xs { font-size: var(--ds-text-xs); }
.ds-text-sm { font-size: var(--ds-text-sm); }
.ds-text-base { font-size: var(--ds-text-base); }
.ds-text-lg { font-size: var(--ds-text-lg); }
.ds-text-xl { font-size: var(--ds-text-xl); }
.ds-text-2xl { font-size: var(--ds-text-2xl); }
.ds-text-3xl { font-size: var(--ds-text-3xl); }
.ds-text-4xl { font-size: var(--ds-text-4xl); }

/* Font weights */
.ds-font-light { font-weight: var(--ds-font-light); }
.ds-font-normal { font-weight: var(--ds-font-normal); }
.ds-font-medium { font-weight: var(--ds-font-medium); }
.ds-font-semibold { font-weight: var(--ds-font-semibold); }
.ds-font-bold { font-weight: var(--ds-font-bold); }

/* Font families */
.ds-font-sans { font-family: var(--ds-font-sans); }
.ds-font-mono { font-family: var(--ds-font-mono); }

/* Spacing utilities */
.ds-p-0 { padding: var(--ds-space-0); }
.ds-p-1 { padding: var(--ds-space-1); }
.ds-p-2 { padding: var(--ds-space-2); }
.ds-p-3 { padding: var(--ds-space-3); }
.ds-p-4 { padding: var(--ds-space-4); }
.ds-p-6 { padding: var(--ds-space-6); }
.ds-p-8 { padding: var(--ds-space-8); }

.ds-m-0 { margin: var(--ds-space-0); }
.ds-m-1 { margin: var(--ds-space-1); }
.ds-m-2 { margin: var(--ds-space-2); }
.ds-m-3 { margin: var(--ds-space-3); }
.ds-m-4 { margin: var(--ds-space-4); }
.ds-m-6 { margin: var(--ds-space-6); }
.ds-m-8 { margin: var(--ds-space-8); }
.ds-m-auto { margin: auto; }

.ds-mt-0 { margin-top: var(--ds-space-0); }
.ds-mt-1 { margin-top: var(--ds-space-1); }
.ds-mt-2 { margin-top: var(--ds-space-2); }
.ds-mt-4 { margin-top: var(--ds-space-4); }
.ds-mt-6 { margin-top: var(--ds-space-6); }
.ds-mt-8 { margin-top: var(--ds-space-8); }

.ds-mb-0 { margin-bottom: var(--ds-space-0); }
.ds-mb-1 { margin-bottom: var(--ds-space-1); }
.ds-mb-2 { margin-bottom: var(--ds-space-2); }
.ds-mb-4 { margin-bottom: var(--ds-space-4); }
.ds-mb-6 { margin-bottom: var(--ds-space-6); }
.ds-mb-8 { margin-bottom: var(--ds-space-8); }

/* Gap utilities */
.ds-gap-1 { gap: var(--ds-space-1); }
.ds-gap-2 { gap: var(--ds-space-2); }
.ds-gap-3 { gap: var(--ds-space-3); }
.ds-gap-4 { gap: var(--ds-space-4); }
.ds-gap-6 { gap: var(--ds-space-6); }
.ds-gap-8 { gap: var(--ds-space-8); }

/* Flexbox */
.ds-flex { display: flex; }
.ds-inline-flex { display: inline-flex; }
.ds-flex-col { flex-direction: column; }
.ds-flex-row { flex-direction: row; }
.ds-flex-wrap { flex-wrap: wrap; }
.ds-items-start { align-items: flex-start; }
.ds-items-center { align-items: center; }
.ds-items-end { align-items: flex-end; }
.ds-justify-start { justify-content: flex-start; }
.ds-justify-center { justify-content: center; }
.ds-justify-end { justify-content: flex-end; }
.ds-justify-between { justify-content: space-between; }
.ds-flex-1 { flex: 1 1 0%; }
.ds-flex-auto { flex: 1 1 auto; }
.ds-flex-none { flex: none; }

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

/* Border radius */
.ds-rounded-none { border-radius: var(--ds-radius-none); }
.ds-rounded-sm { border-radius: var(--ds-radius-sm); }
.ds-rounded { border-radius: var(--ds-radius-md); }
.ds-rounded-lg { border-radius: var(--ds-radius-lg); }
.ds-rounded-xl { border-radius: var(--ds-radius-xl); }
.ds-rounded-full { border-radius: var(--ds-radius-full); }

/* Shadows */
.ds-shadow-none { box-shadow: var(--ds-shadow-none); }
.ds-shadow-sm { box-shadow: var(--ds-shadow-sm); }
.ds-shadow { box-shadow: var(--ds-shadow-md); }
.ds-shadow-lg { box-shadow: var(--ds-shadow-lg); }
.ds-shadow-xl { box-shadow: var(--ds-shadow-xl); }

/* Borders */
.ds-border { border: 1px solid var(--ds-border); }
.ds-border-light { border: 1px solid var(--ds-border-light); }
.ds-border-strong { border: 1px solid var(--ds-border-strong); }
.ds-border-t { border-top: 1px solid var(--ds-border); }
.ds-border-b { border-bottom: 1px solid var(--ds-border); }
.ds-border-l { border-left: 1px solid var(--ds-border); }
.ds-border-r { border-right: 1px solid var(--ds-border); }

/* Display */
.ds-block { display: block; }
.ds-inline-block { display: inline-block; }
.ds-inline { display: inline; }
.ds-hidden { display: none; }

/* Width & Height */
.ds-w-full { width: 100%; }
.ds-h-full { height: 100%; }
.ds-min-h-screen { min-height: 100vh; }

/* Overflow */
.ds-overflow-hidden { overflow: hidden; }
.ds-overflow-auto { overflow: auto; }
.ds-overflow-x-auto { overflow-x: auto; }
.ds-overflow-y-auto { overflow-y: auto; }

/* Position */
.ds-relative { position: relative; }
.ds-absolute { position: absolute; }
.ds-fixed { position: fixed; }
.ds-sticky { position: sticky; }

/* Text alignment */
.ds-text-left { text-align: left; }
.ds-text-center { text-align: center; }
.ds-text-right { text-align: right; }

/* Opacity */
.ds-opacity-0 { opacity: 0; }
.ds-opacity-50 { opacity: 0.5; }
.ds-opacity-75 { opacity: 0.75; }
.ds-opacity-100 { opacity: 1; }

/* Cursor */
.ds-cursor-pointer { cursor: pointer; }
.ds-cursor-not-allowed { cursor: not-allowed; }

/* Transitions */
.ds-transition {
  transition-property: color, background-color, border-color, box-shadow, transform, opacity;
  transition-timing-function: var(--ds-ease-out);
  transition-duration: var(--ds-transition-normal);
}

.ds-transition-fast {
  transition-duration: var(--ds-transition-fast);
}

.ds-transition-slow {
  transition-duration: var(--ds-transition-slow);
}

/* Screen reader only */
.ds-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;
}

/* ============================================
 * RESPONSIVE UTILITIES
 * ============================================ */

@media (min-width: 640px) {
  .sm\:ds-flex { display: flex; }
  .sm\:ds-hidden { display: none; }
  .sm\:ds-block { display: block; }
  .sm\:ds-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:ds-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:ds-flex-row { flex-direction: row; }
  .sm\:ds-text-left { text-align: left; }
}

@media (min-width: 768px) {
  .md\:ds-flex { display: flex; }
  .md\:ds-hidden { display: none; }
  .md\:ds-block { display: block; }
  .md\:ds-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:ds-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:ds-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md\:ds-flex-row { flex-direction: row; }
}

@media (min-width: 1024px) {
  .lg\:ds-flex { display: flex; }
  .lg\:ds-hidden { display: none; }
  .lg\:ds-block { display: block; }
  .lg\:ds-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:ds-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/**
 * dsalathe Design System - Component Styles
 * Alpine/Swiss Technical Theme
 *
 * Pre-styled components: buttons, cards, forms, badges, navigation
 * Requires: dsalathe-tokens.css
 *
 * Usage:
 *   <link rel="stylesheet" href="https://static.dsalathe.dev/css/dsalathe-tokens.css">
 *   <link rel="stylesheet" href="https://static.dsalathe.dev/css/dsalathe-components.css">
 *
 * @version 1.0.0
 */

/* ============================================
 * BUTTONS
 * Swiss precision - clean, confident
 * ============================================ */

.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ds-space-2);
  padding: var(--ds-space-2-5) var(--ds-space-4);
  font-family: var(--ds-font-sans);
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-font-medium);
  line-height: var(--ds-leading-tight);
  text-decoration: none;
  border-radius: var(--ds-radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--ds-transition-fast) var(--ds-ease-out);
  white-space: nowrap;
  user-select: none;
}

.ds-btn:focus-visible {
  outline: none;
  box-shadow: var(--ds-ring);
}

.ds-btn:disabled,
.ds-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary Button - Sky blue action */
.ds-btn-primary {
  background-color: var(--ds-primary);
  color: var(--ds-text-inverse);
  border-color: var(--ds-primary);
}

.ds-btn-primary:hover {
  background-color: var(--ds-primary-hover);
  border-color: var(--ds-primary-hover);
}

.ds-btn-primary:active {
  background-color: var(--ds-primary-active);
  border-color: var(--ds-primary-active);
}

/* Secondary Button - Alpine navy */
.ds-btn-secondary {
  background-color: var(--ds-secondary);
  color: var(--ds-text-inverse);
  border-color: var(--ds-secondary);
}

.ds-btn-secondary:hover {
  background-color: var(--ds-secondary-hover);
  border-color: var(--ds-secondary-hover);
}

.ds-btn-secondary:active {
  background-color: var(--ds-secondary-active);
  border-color: var(--ds-secondary-active);
}

/* Accent Button - Swiss red */
.ds-btn-accent {
  background-color: var(--ds-accent);
  color: var(--ds-text-inverse);
  border-color: var(--ds-accent);
}

.ds-btn-accent:hover {
  background-color: var(--ds-accent-hover);
  border-color: var(--ds-accent-hover);
}

.ds-btn-accent:active {
  background-color: var(--ds-accent-active);
  border-color: var(--ds-accent-active);
}

/* Outline Button */
.ds-btn-outline {
  background-color: transparent;
  color: var(--ds-primary);
  border-color: var(--ds-primary);
}

.ds-btn-outline:hover {
  background-color: var(--ds-primary);
  color: var(--ds-text-inverse);
}

.ds-btn-outline:active {
  background-color: var(--ds-primary-hover);
}

/* Outline Secondary */
.ds-btn-outline-secondary {
  background-color: transparent;
  color: var(--ds-secondary);
  border-color: var(--ds-border-strong);
}

.ds-btn-outline-secondary:hover {
  background-color: var(--ds-secondary);
  color: var(--ds-text-inverse);
  border-color: var(--ds-secondary);
}

/* Ghost Button */
.ds-btn-ghost {
  background-color: transparent;
  color: var(--ds-text-primary);
  border-color: transparent;
}

.ds-btn-ghost:hover {
  background-color: var(--ds-surface-sunken);
}

.ds-btn-ghost:active {
  background-color: var(--ds-border);
}

/* Link Button */
.ds-btn-link {
  background-color: transparent;
  color: var(--ds-text-link);
  border-color: transparent;
  padding: 0;
}

.ds-btn-link:hover {
  color: var(--ds-text-link-hover);
  text-decoration: underline;
}

/* Button Sizes */
.ds-btn-xs {
  padding: var(--ds-space-1) var(--ds-space-2);
  font-size: var(--ds-text-xs);
  border-radius: var(--ds-radius-sm);
}

.ds-btn-sm {
  padding: var(--ds-space-1-5) var(--ds-space-3);
  font-size: var(--ds-text-sm);
}

.ds-btn-lg {
  padding: var(--ds-space-3) var(--ds-space-6);
  font-size: var(--ds-text-base);
}

.ds-btn-xl {
  padding: var(--ds-space-4) var(--ds-space-8);
  font-size: var(--ds-text-lg);
  border-radius: var(--ds-radius-lg);
}

/* Full width button */
.ds-btn-full {
  width: 100%;
}

/* Icon button */
.ds-btn-icon {
  padding: var(--ds-space-2);
  aspect-ratio: 1;
}

.ds-btn-icon.ds-btn-sm {
  padding: var(--ds-space-1-5);
}

.ds-btn-icon.ds-btn-lg {
  padding: var(--ds-space-3);
}

/* Button with loading spinner */
.ds-btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.ds-btn-loading::after {
  content: '';
  position: absolute;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ds-spin 0.6s linear infinite;
  color: var(--ds-text-inverse);
}

/* ============================================
 * CARDS
 * Clean surfaces with subtle elevation
 * ============================================ */

.ds-card {
  background-color: var(--ds-surface);
  border-radius: var(--ds-radius-lg);
  border: 1px solid var(--ds-border-light);
  box-shadow: var(--ds-shadow-sm);
  overflow: hidden;
}

.ds-card-elevated {
  box-shadow: var(--ds-shadow-md);
  border-color: transparent;
}

.ds-card-interactive {
  cursor: pointer;
  transition: all var(--ds-transition-fast) var(--ds-ease-out);
}

.ds-card-interactive:hover {
  box-shadow: var(--ds-shadow-lg);
  transform: translateY(-2px);
}

.ds-card-interactive:active {
  transform: translateY(0);
}

.ds-card-header {
  padding: var(--ds-space-4) var(--ds-space-6);
  border-bottom: 1px solid var(--ds-border-light);
}

.ds-card-body {
  padding: var(--ds-space-6);
}

.ds-card-footer {
  padding: var(--ds-space-4) var(--ds-space-6);
  border-top: 1px solid var(--ds-border-light);
  background-color: var(--ds-surface-sunken);
}

.ds-card-title {
  font-size: var(--ds-text-lg);
  font-weight: var(--ds-font-semibold);
  color: var(--ds-text-primary);
  margin: 0;
}

.ds-card-subtitle {
  font-size: var(--ds-text-sm);
  color: var(--ds-text-secondary);
  margin-top: var(--ds-space-1);
}

/* Card variants */
.ds-card-ghost {
  background-color: transparent;
  border: none;
  box-shadow: none;
}

.ds-card-outlined {
  box-shadow: none;
  border-color: var(--ds-border);
}

/* ============================================
 * FORM ELEMENTS
 * Clean, accessible inputs
 * ============================================ */

.ds-input,
.ds-select,
.ds-textarea {
  display: block;
  width: 100%;
  padding: var(--ds-space-2-5) var(--ds-space-3);
  font-family: var(--ds-font-sans);
  font-size: var(--ds-text-sm);
  line-height: var(--ds-leading-normal);
  color: var(--ds-text-primary);
  background-color: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-md);
  transition: border-color var(--ds-transition-fast) var(--ds-ease-out),
              box-shadow var(--ds-transition-fast) var(--ds-ease-out);
}

.ds-input:hover,
.ds-select:hover,
.ds-textarea:hover {
  border-color: var(--ds-border-strong);
}

.ds-input:focus,
.ds-select:focus,
.ds-textarea:focus {
  outline: none;
  border-color: var(--ds-border-focus);
  box-shadow: var(--ds-ring);
}

.ds-input::placeholder,
.ds-textarea::placeholder {
  color: var(--ds-text-muted);
}

.ds-input:disabled,
.ds-select:disabled,
.ds-textarea:disabled {
  background-color: var(--ds-surface-sunken);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Input sizes */
.ds-input-sm {
  padding: var(--ds-space-1-5) var(--ds-space-2-5);
  font-size: var(--ds-text-xs);
}

.ds-input-lg {
  padding: var(--ds-space-3) var(--ds-space-4);
  font-size: var(--ds-text-base);
}

/* Input states */
.ds-input-error {
  border-color: var(--ds-error);
}

.ds-input-error:focus {
  box-shadow: 0 0 0 var(--ds-ring-offset) var(--ds-surface),
              0 0 0 calc(var(--ds-ring-offset) + var(--ds-ring-width)) var(--ds-error);
}

.ds-input-success {
  border-color: var(--ds-success);
}

/* Select */
.ds-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%237F8C97' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right var(--ds-space-2) center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: var(--ds-space-10);
}

/* Textarea */
.ds-textarea {
  min-height: 100px;
  resize: vertical;
}

/* Label */
.ds-label {
  display: block;
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-font-medium);
  color: var(--ds-text-primary);
  margin-bottom: var(--ds-space-1-5);
}

.ds-label-required::after {
  content: '*';
  color: var(--ds-error);
  margin-left: var(--ds-space-1);
}

/* Help text */
.ds-help-text {
  font-size: var(--ds-text-xs);
  color: var(--ds-text-secondary);
  margin-top: var(--ds-space-1-5);
}

.ds-help-text-error {
  color: var(--ds-error);
}

/* Form group */
.ds-form-group {
  margin-bottom: var(--ds-space-4);
}

/* Checkbox & Radio */
.ds-checkbox,
.ds-radio {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-2);
  cursor: pointer;
  font-size: var(--ds-text-sm);
}

.ds-checkbox input,
.ds-radio input {
  appearance: none;
  width: 1rem;
  height: 1rem;
  border: 1px solid var(--ds-border-strong);
  background-color: var(--ds-surface);
  cursor: pointer;
  transition: all var(--ds-transition-fast) var(--ds-ease-out);
}

.ds-checkbox input {
  border-radius: var(--ds-radius-sm);
}

.ds-radio input {
  border-radius: var(--ds-radius-full);
}

.ds-checkbox input:checked,
.ds-radio input:checked {
  background-color: var(--ds-primary);
  border-color: var(--ds-primary);
}

.ds-checkbox input:checked {
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
}

.ds-radio input:checked {
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");
}

.ds-checkbox input:focus-visible,
.ds-radio input:focus-visible {
  box-shadow: var(--ds-ring);
}

/* ============================================
 * BADGES / TAGS
 * Compact status indicators
 * ============================================ */

.ds-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-1);
  padding: var(--ds-space-0-5) var(--ds-space-2);
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-font-medium);
  line-height: var(--ds-leading-normal);
  border-radius: var(--ds-radius-full);
  white-space: nowrap;
}

/* Badge variants */
.ds-badge-default {
  background-color: var(--ds-surface-sunken);
  color: var(--ds-text-secondary);
}

.ds-badge-primary {
  background-color: var(--ds-primary-light);
  color: var(--ds-primary-dark);
}

.ds-badge-secondary {
  background-color: var(--ds-secondary-light);
  color: var(--ds-secondary);
}

.ds-badge-accent {
  background-color: var(--ds-accent-light);
  color: var(--ds-accent);
}

.ds-badge-success {
  background-color: var(--ds-success-100);
  color: var(--ds-success-700);
}

.ds-badge-warning {
  background-color: var(--ds-warning-100);
  color: var(--ds-warning-700);
}

.ds-badge-error {
  background-color: var(--ds-red-100);
  color: var(--ds-red-700);
}

/* Solid badge variants */
.ds-badge-solid-primary {
  background-color: var(--ds-primary);
  color: var(--ds-text-inverse);
}

.ds-badge-solid-secondary {
  background-color: var(--ds-secondary);
  color: var(--ds-text-inverse);
}

.ds-badge-solid-accent {
  background-color: var(--ds-accent);
  color: var(--ds-text-inverse);
}

.ds-badge-solid-success {
  background-color: var(--ds-success);
  color: var(--ds-text-inverse);
}

/* Badge sizes */
.ds-badge-sm {
  padding: var(--ds-space-0-5) var(--ds-space-1-5);
  font-size: 0.625rem;
}

.ds-badge-lg {
  padding: var(--ds-space-1) var(--ds-space-3);
  font-size: var(--ds-text-sm);
}

/* Dot badge */
.ds-badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--ds-radius-full);
  background-color: currentColor;
}

/* ============================================
 * NAVIGATION
 * Clean, structured navigation
 * ============================================ */

.ds-nav {
  display: flex;
  align-items: center;
  gap: var(--ds-space-1);
}

.ds-nav-vertical {
  flex-direction: column;
  align-items: stretch;
}

.ds-nav-item {
  display: flex;
  align-items: center;
  gap: var(--ds-space-2);
  padding: var(--ds-space-2) var(--ds-space-3);
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-font-medium);
  color: var(--ds-text-secondary);
  text-decoration: none;
  border-radius: var(--ds-radius-md);
  transition: all var(--ds-transition-fast) var(--ds-ease-out);
}

.ds-nav-item:hover {
  color: var(--ds-text-primary);
  background-color: var(--ds-surface-sunken);
}

.ds-nav-item.active,
.ds-nav-item[aria-current="page"] {
  color: var(--ds-primary);
  background-color: var(--ds-primary-light);
}

/* Tabs */
.ds-tabs {
  display: flex;
  border-bottom: 1px solid var(--ds-border);
}

.ds-tab {
  padding: var(--ds-space-3) var(--ds-space-4);
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-font-medium);
  color: var(--ds-text-secondary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--ds-transition-fast) var(--ds-ease-out);
}

.ds-tab:hover {
  color: var(--ds-text-primary);
  border-bottom-color: var(--ds-border-strong);
}

.ds-tab.active,
.ds-tab[aria-selected="true"] {
  color: var(--ds-primary);
  border-bottom-color: var(--ds-primary);
}

/* Pills */
.ds-pills {
  display: flex;
  gap: var(--ds-space-1);
  padding: var(--ds-space-1);
  background-color: var(--ds-surface-sunken);
  border-radius: var(--ds-radius-lg);
}

.ds-pill {
  padding: var(--ds-space-1-5) var(--ds-space-3);
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-font-medium);
  color: var(--ds-text-secondary);
  text-decoration: none;
  border-radius: var(--ds-radius-md);
  transition: all var(--ds-transition-fast) var(--ds-ease-out);
}

.ds-pill:hover {
  color: var(--ds-text-primary);
}

.ds-pill.active,
.ds-pill[aria-selected="true"] {
  color: var(--ds-text-primary);
  background-color: var(--ds-surface);
  box-shadow: var(--ds-shadow-sm);
}

/* Breadcrumbs */
.ds-breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--ds-space-2);
  font-size: var(--ds-text-sm);
}

.ds-breadcrumb {
  color: var(--ds-text-secondary);
  text-decoration: none;
  transition: color var(--ds-transition-fast) var(--ds-ease-out);
}

.ds-breadcrumb:hover {
  color: var(--ds-text-primary);
}

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

.ds-breadcrumb-current {
  color: var(--ds-text-primary);
  font-weight: var(--ds-font-medium);
}

/* ============================================
 * ALERTS / NOTIFICATIONS
 * ============================================ */

.ds-alert {
  display: flex;
  gap: var(--ds-space-3);
  padding: var(--ds-space-4);
  border-radius: var(--ds-radius-lg);
  border-left: 4px solid;
}

.ds-alert-info {
  background-color: var(--ds-sky-50);
  border-left-color: var(--ds-info);
  color: var(--ds-sky-800);
}

.ds-alert-success {
  background-color: var(--ds-success-50);
  border-left-color: var(--ds-success);
  color: var(--ds-success-800);
}

.ds-alert-warning {
  background-color: var(--ds-warning-50);
  border-left-color: var(--ds-warning);
  color: var(--ds-warning-800);
}

.ds-alert-error {
  background-color: var(--ds-red-50);
  border-left-color: var(--ds-error);
  color: var(--ds-red-800);
}

.ds-alert-title {
  font-weight: var(--ds-font-semibold);
  margin-bottom: var(--ds-space-1);
}

.ds-alert-content {
  font-size: var(--ds-text-sm);
}

/* ============================================
 * AVATAR
 * ============================================ */

.ds-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--ds-radius-full);
  background-color: var(--ds-glacier-200);
  color: var(--ds-glacier-700);
  font-weight: var(--ds-font-semibold);
  font-size: var(--ds-text-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.ds-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ds-avatar-xs { width: 24px; height: 24px; font-size: var(--ds-text-xs); }
.ds-avatar-sm { width: 32px; height: 32px; font-size: var(--ds-text-xs); }
.ds-avatar-lg { width: 48px; height: 48px; font-size: var(--ds-text-base); }
.ds-avatar-xl { width: 64px; height: 64px; font-size: var(--ds-text-lg); }
.ds-avatar-2xl { width: 96px; height: 96px; font-size: var(--ds-text-2xl); }

/* Avatar group */
.ds-avatar-group {
  display: flex;
  flex-direction: row-reverse;
}

.ds-avatar-group .ds-avatar {
  border: 2px solid var(--ds-surface);
  margin-left: -8px;
}

.ds-avatar-group .ds-avatar:last-child {
  margin-left: 0;
}

/* ============================================
 * DIVIDER
 * ============================================ */

.ds-divider {
  border: none;
  border-top: 1px solid var(--ds-border);
  margin: var(--ds-space-4) 0;
}

.ds-divider-vertical {
  border-top: none;
  border-left: 1px solid var(--ds-border);
  height: auto;
  align-self: stretch;
  margin: 0 var(--ds-space-4);
}

.ds-divider-text {
  display: flex;
  align-items: center;
  gap: var(--ds-space-4);
  color: var(--ds-text-muted);
  font-size: var(--ds-text-sm);
}

.ds-divider-text::before,
.ds-divider-text::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--ds-border);
}

/* ============================================
 * SPINNER / LOADING
 * ============================================ */

.ds-spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--ds-border);
  border-top-color: var(--ds-primary);
  border-radius: var(--ds-radius-full);
  animation: ds-spin 0.6s linear infinite;
}

.ds-spinner-sm {
  width: 1rem;
  height: 1rem;
  border-width: 1.5px;
}

.ds-spinner-lg {
  width: 2rem;
  height: 2rem;
  border-width: 3px;
}

@keyframes ds-spin {
  to { transform: rotate(360deg); }
}

/* ============================================
 * SKELETON LOADING
 * ============================================ */

.ds-skeleton {
  background: linear-gradient(
    90deg,
    var(--ds-surface-sunken) 25%,
    var(--ds-border-light) 50%,
    var(--ds-surface-sunken) 75%
  );
  background-size: 200% 100%;
  animation: ds-shimmer 1.5s infinite;
  border-radius: var(--ds-radius-sm);
}

.ds-skeleton-text {
  height: 1em;
  margin-bottom: var(--ds-space-2);
}

.ds-skeleton-text:last-child {
  width: 60%;
}

.ds-skeleton-circle {
  border-radius: var(--ds-radius-full);
}

@keyframes ds-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
 * TOOLTIP
 * ============================================ */

.ds-tooltip {
  position: relative;
}

.ds-tooltip-content {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--ds-space-1-5) var(--ds-space-2-5);
  background-color: var(--ds-navy-900);
  color: var(--ds-snow-100);
  font-size: var(--ds-text-xs);
  border-radius: var(--ds-radius-md);
  white-space: nowrap;
  margin-bottom: var(--ds-space-2);
  opacity: 0;
  visibility: hidden;
  transition: all var(--ds-transition-fast) var(--ds-ease-out);
  z-index: var(--ds-z-tooltip);
}

.ds-tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ds-navy-900);
}

.ds-tooltip:hover .ds-tooltip-content {
  opacity: 1;
  visibility: visible;
}

/* ============================================
 * DROPDOWN
 * ============================================ */

.ds-dropdown {
  position: relative;
  display: inline-block;
}

.ds-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  padding: var(--ds-space-1);
  background-color: var(--ds-surface);
  border: 1px solid var(--ds-border-light);
  border-radius: var(--ds-radius-lg);
  box-shadow: var(--ds-shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all var(--ds-transition-fast) var(--ds-ease-out);
  z-index: var(--ds-z-dropdown);
}

.ds-dropdown:hover .ds-dropdown-menu,
.ds-dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(var(--ds-space-1));
}

.ds-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--ds-space-2);
  width: 100%;
  padding: var(--ds-space-2) var(--ds-space-3);
  font-size: var(--ds-text-sm);
  color: var(--ds-text-primary);
  text-decoration: none;
  border-radius: var(--ds-radius-md);
  transition: background-color var(--ds-transition-fast) var(--ds-ease-out);
}

.ds-dropdown-item:hover {
  background-color: var(--ds-surface-sunken);
}

.ds-dropdown-divider {
  height: 1px;
  background-color: var(--ds-border-light);
  margin: var(--ds-space-1) 0;
}

/* ============================================
 * MODAL
 * ============================================ */

.ds-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(44, 62, 80, 0.5);
  z-index: var(--ds-z-modal-backdrop);
  opacity: 0;
  visibility: hidden;
  transition: all var(--ds-transition-normal) var(--ds-ease-out);
}

.ds-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.ds-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  background-color: var(--ds-surface);
  border-radius: var(--ds-radius-xl);
  box-shadow: var(--ds-shadow-2xl);
  z-index: var(--ds-z-modal);
  opacity: 0;
  visibility: hidden;
  transition: all var(--ds-transition-normal) var(--ds-ease-out);
  overflow: hidden;
}

.ds-modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.ds-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--ds-space-4) var(--ds-space-6);
  border-bottom: 1px solid var(--ds-border-light);
}

.ds-modal-title {
  font-size: var(--ds-text-lg);
  font-weight: var(--ds-font-semibold);
  margin: 0;
}

.ds-modal-body {
  padding: var(--ds-space-6);
  overflow-y: auto;
}

.ds-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--ds-space-3);
  padding: var(--ds-space-4) var(--ds-space-6);
  border-top: 1px solid var(--ds-border-light);
  background-color: var(--ds-surface-sunken);
}

/* ============================================
 * PROGRESS BAR
 * ============================================ */

.ds-progress {
  width: 100%;
  height: 8px;
  background-color: var(--ds-surface-sunken);
  border-radius: var(--ds-radius-full);
  overflow: hidden;
}

.ds-progress-bar {
  height: 100%;
  background-color: var(--ds-primary);
  border-radius: var(--ds-radius-full);
  transition: width var(--ds-transition-slow) var(--ds-ease-out);
}

.ds-progress-bar-success {
  background-color: var(--ds-success);
}

.ds-progress-bar-warning {
  background-color: var(--ds-warning);
}

.ds-progress-bar-error {
  background-color: var(--ds-error);
}

/* ============================================
 * TABLE
 * ============================================ */

.ds-table {
  width: 100%;
  border-collapse: collapse;
}

.ds-table th {
  text-align: left;
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-font-semibold);
  text-transform: uppercase;
  letter-spacing: var(--ds-tracking-wide);
  color: var(--ds-text-secondary);
  padding: var(--ds-space-3) var(--ds-space-4);
  border-bottom: 2px solid var(--ds-border);
  background-color: var(--ds-surface-sunken);
}

.ds-table td {
  padding: var(--ds-space-3) var(--ds-space-4);
  border-bottom: 1px solid var(--ds-border-light);
  font-size: var(--ds-text-sm);
}

.ds-table tbody tr:hover {
  background-color: var(--ds-surface-sunken);
}

.ds-table-striped tbody tr:nth-child(even) {
  background-color: var(--ds-snow-300);
}
