/* ==========================================================================
   KHINA BUSINESS GROUP - DESIGN SYSTEM & MAIN STYLES
   ========================================================================== */

:root {
  /* Brand Core Palette */
  --color-brand-primary: #2563eb;
  --color-brand-hover: #1d4ed8;
  --color-brand-light: #38bdf8;
  --color-brand-accent: #6366f1;
  
  /* App Specific Accent Colors */
  --color-mystyle-accent: #c084fc;
  --color-mystyle-gradient: linear-gradient(135deg, #ec4899 0%, #8b5cf6 50%, #6366f1 100%);
  --color-calisia-accent: #10b981;
  --color-calisia-gradient: linear-gradient(135deg, #10b981 0%, #14b8a6 50%, #06b6d4 100%);

  /* Neutrals & Dark Surfaces */
  --bg-body: #090d16;
  --bg-surface-1: #0f172a;
  --bg-surface-2: #1e293b;
  --bg-surface-3: #334155;
  --bg-surface-glass: rgba(15, 23, 42, 0.75);
  
  /* Borders & Dividers */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.16);
  --border-highlight: rgba(56, 189, 248, 0.35);

  /* Typography Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-inverse: #0f172a;

  /* Status Colors */
  --status-info: #38bdf8;
  --status-success: #10b981;
  --status-warning: #f59e0b;
  --status-danger: #ef4444;
  --status-warning-bg: rgba(245, 158, 11, 0.12);
  --status-info-bg: rgba(56, 189, 248, 0.12);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Layout & Spacing */
  --max-width: 1200px;
  --max-width-narrow: 840px;
  --header-height: 76px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(37, 99, 235, 0.25);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

/* Base Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  color-scheme: dark;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

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

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.65;
  font-size: 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(37, 99, 235, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 60%, rgba(99, 102, 241, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Accessibility: Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1.5rem;
  background: var(--color-brand-primary);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  z-index: 1000;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--transition-fast);
}
.skip-link:focus {
  top: 1.5rem;
}

/* Accessible Focus States */
:focus-visible {
  outline: 2px solid var(--color-brand-light);
  outline-offset: 3px;
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  color: #ffffff;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(1.75rem, 4.5vw, 3.4rem);
  font-weight: 800;
  margin-bottom: 1.25rem;
  overflow-wrap: break-word;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  margin-bottom: 0.75rem;
}

p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

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

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

a:hover {
  color: #ffffff;
  text-decoration: underline;
}

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

ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
}

li {
  margin-bottom: 0.5rem;
}

strong {
  color: #ffffff;
}

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

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

main {
  flex: 1 0 auto;
}

section {
  padding: 4.5rem 0;
}

.section-alt {
  background-color: rgba(15, 23, 42, 0.4);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

/* Utility Flex & Grid */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }

/* Text Utilities */
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-gradient {
  background: linear-gradient(135deg, #ffffff 40%, var(--color-brand-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

code {
  word-break: break-word;
}

@media (max-width: 640px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  .container, .container-narrow {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  h1 {
    font-size: 1.35rem;
    line-height: 1.25;
    word-break: break-word;
  }
  .badge {
    font-size: 0.68rem;
    padding: 0.25rem 0.5rem;
    max-width: 100%;
  }
}
