/**
 * PureUtilLab - Base Design System & CSS Variables
 * File: assets/css/base.css
 */

:root {
  /* Brand Color Palette */
  --color-brand-dark: #0f172a;
  --color-brand-dark-soft: #1e293b;
  --color-brand-primary: #4f46e5;
  --color-brand-primary-hover: #4338ca;
  --color-brand-primary-light: #eef2ff;
  
  /* High-Converting Action Colors (CTA & Badges) */
  --color-action-cta: #059669;
  --color-action-cta-hover: #047857;
  --color-action-cta-active: #065f46;
  --color-accent-badge: #d97706;
  --color-accent-badge-bg: #fef3c7;
  --color-rating-star: #f59e0b;
  
  /* Pros & Cons Indicators */
  --color-pro-green: #10b981;
  --color-pro-bg: #ecfdf5;
  --color-con-red: #ef4444;
  --color-con-bg: #fef2f2;
  
  /* Neutral Typography & Backgrounds */
  --color-text-main: #1e293b;
  --color-text-secondary: #475569;
  --color-text-muted: #64748b;
  --color-text-light: #94a3b8;
  
  --color-bg-page: #f8fafc;
  --color-bg-card: #ffffff;
  --color-bg-alt: #f1f5f9;
  --color-border: #e2e8f0;
  --color-border-subtle: #f1f5f9;
  
  /* Typography Stack - System font stack for 0ms font loading & 0 CLS */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  /* Layout Sizing */
  --container-max-width: 1200px;
  --container-reading-width: 760px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  /* Elevated Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-card: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-card-hover: 0 12px 20px -3px rgba(15, 23, 42, 0.09), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-drawer: -4px 0 24px rgba(0, 0, 0, 0.15);
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modern CSS Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text-main);
  background-color: var(--color-bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main#primary {
  flex: 1 0 auto;
}

/* Typography Scale */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-brand-dark);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: 2.25rem; margin-bottom: 1rem; }
h2 { font-size: 1.75rem; margin-top: 2rem; margin-bottom: 0.85rem; }
h3 { font-size: 1.35rem; margin-top: 1.5rem; margin-bottom: 0.65rem; }
h4 { font-size: 1.15rem; margin-top: 1.25rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1.25rem; }

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

a:hover {
  color: var(--color-brand-primary-hover);
  text-decoration: underline;
}

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

ul, ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.35rem;
}

blockquote {
  border-left: 4px solid var(--color-brand-primary);
  padding: 0.75rem 1.25rem;
  background-color: var(--color-bg-alt);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

/* Container Utility */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.container-narrow {
  width: 100%;
  max-width: var(--container-reading-width);
  margin-left: auto;
  margin-right: auto;
}

/* Accessibility: Screen Reader Only */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: #ffffff;
  border-radius: 3px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
  clip: auto !important;
  clip-path: none;
  color: #21759b;
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}
