/* ============================================
   SKINCARE COMPARE — Design System
   Premium UK Skincare Comparison Platform
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Colours */
  --color-bg: #FAFAF8;
  --color-bg-warm: #F5F4F0;
  --color-bg-card: #FFFFFF;
  --color-bg-hover: #F0EFEB;
  --color-bg-accent: #EEF4F2;

  --color-text-primary: #2C2C2C;
  --color-text-secondary: #5A5A5A;
  --color-text-tertiary: #8A8A8A;
  --color-text-inverse: #FFFFFF;

  --color-accent: #7BA697;
  --color-accent-dark: #5E8E7E;
  --color-accent-light: #D4E5DE;
  --color-accent-bg: #EEF4F2;

  --color-warning: #C9A96E;
  --color-warning-light: #F5EFE0;
  --color-warning-bg: #FBF7EF;

  --color-success: #7BA697;
  --color-success-light: #E8F0EC;

  --color-caution: #C4956A;
  --color-caution-light: #F8EFE6;

  --color-info: #7B9DB5;
  --color-info-light: #E8F0F5;

  --color-border: #E8E7E3;
  --color-border-light: #F0EFEB;
  --color-border-dark: #D4D3CF;

  --color-highlight: #E8F5EE;

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'DM Sans', 'Inter', -apple-system, sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.3125rem;
  --text-2xl: 1.625rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  --text-5xl: 3.25rem;

  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.02em;
  --tracking-wider: 0.06em;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Borders & Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-xl: 0 16px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.04);

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

  /* Layout */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1200px;
  --container-2xl: 1360px;

  --header-height: 64px;
  --header-height-compact: 56px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  min-height: 100vh;
  overflow-x: hidden;
}

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

a {
  color: var(--color-accent-dark);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--color-accent);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

ul, ol {
  list-style: none;
}

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

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-8);
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 var(--space-12);
  }
}

.container--narrow {
  max-width: var(--container-md);
}

.container--wide {
  max-width: var(--container-2xl);
}

/* --- Typography Classes --- */
.heading-1 {
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}

.heading-2 {
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
}

.heading-3 {
  font-size: var(--text-xl);
  font-weight: 600;
}

.heading-4 {
  font-size: var(--text-lg);
  font-weight: 600;
}

.text-secondary {
  color: var(--color-text-secondary);
}

.text-tertiary {
  color: var(--color-text-tertiary);
}

.text-accent {
  color: var(--color-accent-dark);
}

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

.text-xs {
  font-size: var(--text-xs);
}

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

.font-medium {
  font-weight: 500;
}

@media (min-width: 768px) {
  .heading-1 {
    font-size: var(--text-4xl);
  }
  .heading-2 {
    font-size: var(--text-3xl);
  }
  .heading-3 {
    font-size: var(--text-2xl);
  }
}

@media (min-width: 1024px) {
  .heading-1 {
    font-size: var(--text-5xl);
  }
}

/* --- Section Spacing --- */
.section {
  padding: var(--space-16) 0;
}

.section--sm {
  padding: var(--space-10) 0;
}

.section--lg {
  padding: var(--space-20) 0;
}

.section-header {
  margin-bottom: var(--space-8);
}

.section-header p {
  color: var(--color-text-secondary);
  margin-top: var(--space-2);
  font-size: var(--text-md);
  max-width: 540px;
}

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

.section-header--center p {
  margin-left: auto;
  margin-right: auto;
}

/* --- Visually Hidden (accessibility) --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* --- Skeleton Loading --- */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-warm) 25%, var(--color-bg) 50%, var(--color-bg-warm) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

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

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

.skeleton--title {
  height: 1.5em;
  width: 60%;
  margin-bottom: var(--space-3);
}

.skeleton--image {
  aspect-ratio: 1;
  width: 100%;
  border-radius: var(--radius-md);
}

.skeleton--card {
  height: 200px;
  border-radius: var(--radius-lg);
}

/* --- Fade-in animation --- */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
