/* ==================== Variables ==================== */
:root {
  /* Brand palette inspired by: pastel mint, soft coral, light beige, graphite gray, sky blue */
  --color-bg: #F6F2EA;              /* light beige background */
  --color-surface: #FFFFFF;         /* cards, panels */
  --color-text: #2E3135;            /* graphite gray */
  --color-text-muted: #5D6169;

  --color-primary: #7FD9C8;         /* pastel mint */
  --color-primary-600: #42C2AF;     /* hover/deeper */
  --color-primary-700: #2AA997;

  --color-secondary: #8ECDF1;       /* sky blue */
  --color-secondary-600: #4EB2E6;
  --color-secondary-700: #329AD1;

  --color-accent: #FF9AA2;          /* soft coral */
  --color-accent-600: #FF6F7A;
  --color-accent-700: #F05460;

  --color-success: #2FBF71;
  --color-warning: #FFC857;
  --color-danger:  #E15554;

  /* Neutral grays */
  --gray-50:  #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;

  /* Typography */
  --font-sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --font-heading: "Poppins", var(--font-sans);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 1.875rem;
  --fs-4xl: 2.25rem;
  --fs-5xl: 3rem;

  --lh-tight: 1.2;
  --lh-normal: 1.6;
  --lh-loose: 1.8;
  --measure: 65ch; /* comfortable line length */

  /* Spacing scale (0–96px) */
  --space-0: 0px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 64px;
  --space-11: 80px;
  --space-12: 96px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 6px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 28px rgba(0,0,0,0.12);

  /* Transitions */
  --duration-fast: 150ms;
  --duration-normal: 220ms;
  --duration-slow: 400ms;
  --easing-standard: cubic-bezier(0.2, 0.7, 0.2, 1);

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

/* ==================== Reset / Normalize ==================== */
*, *::before, *::after { box-sizing: border-box; }

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

html, body { height: 100%; }

body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }

ul[role="list"], ol[role="list"] { list-style: none; margin: 0; padding: 0; }

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

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

button, [type="button"], [type="reset"], [type="submit"] { -webkit-appearance: none; appearance: none; }

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

/* ==================== Base ==================== */
body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--color-accent-600); color: #ffffff; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-text);
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-4);
}

h1 { font-size: clamp(2rem, 1.4rem + 2.5vw, var(--fs-5xl)); }
 h2 { font-size: clamp(1.625rem, 1.2rem + 1.8vw, var(--fs-4xl)); }
 h3 { font-size: clamp(1.375rem, 1.1rem + 1.2vw, var(--fs-3xl)); }
 h4 { font-size: clamp(1.125rem, 1.05rem + 0.6vw, var(--fs-2xl)); }
 h5 { font-size: var(--fs-lg); }
 h6 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: 0.02em; }

p { margin-bottom: var(--space-6); max-width: var(--measure); color: var(--color-text); }

a { color: var(--color-primary-700); text-decoration: none; transition: color var(--duration-normal) var(--easing-standard), text-underline-offset var(--duration-normal) var(--easing-standard); }

a:hover { color: var(--color-accent-700); text-decoration: underline; text-underline-offset: 3px; }

hr { border: 0; border-top: 1px solid var(--gray-200); margin: var(--space-7) 0; }

/* ==================== Utilities ==================== */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--space-7);
}

@media (max-width: 480px) {
  .container { padding-inline: var(--space-6); }
}

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.grid { display: grid; gap: var(--space-7); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-7); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-7); }
.grid-auto-fit { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: var(--space-7); }

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

/* ==================== Components ==================== */
/* Buttons */
.btn {
  --btn-bg: var(--gray-200);
  --btn-fg: var(--color-text);
  --btn-bd: transparent;

  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-2);
  padding: calc(var(--space-3) + 2px) var(--space-7);
  border-radius: var(--radius-lg);
  border: 1px solid var(--btn-bd);
  background-color: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: background-color var(--duration-normal) var(--easing-standard), color var(--duration-normal) var(--easing-standard), border-color var(--duration-normal) var(--easing-standard), transform var(--duration-fast) var(--easing-standard);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-primary { --btn-bg: var(--color-primary-600); --btn-fg: #ffffff; --btn-bd: var(--color-primary-600); }
.btn-primary:hover { background-color: var(--color-primary-700); border-color: var(--color-primary-700); }

.btn-secondary { --btn-bg: var(--color-secondary-600); --btn-fg: #ffffff; --btn-bd: var(--color-secondary-600); }
.btn-secondary:hover { background-color: var(--color-secondary-700); border-color: var(--color-secondary-700); }

.btn-accent { --btn-bg: var(--color-accent-600); --btn-fg: #ffffff; --btn-bd: var(--color-accent-600); }
.btn-accent:hover { background-color: var(--color-accent-700); border-color: var(--color-accent-700); }

.btn-outline { --btn-bg: transparent; --btn-fg: var(--color-text); --btn-bd: var(--gray-300); }
.btn-outline:hover { background-color: var(--gray-100); }

.btn-ghost { --btn-bg: transparent; --btn-fg: var(--color-primary-700); --btn-bd: transparent; }
.btn-ghost:hover { background-color: color-mix(in srgb, var(--color-primary) 16%, transparent); }

/* Inputs */
.input, input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="tel"], input[type="number"], select, textarea {
  width: 100%;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
  background-color: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--duration-normal) var(--easing-standard), box-shadow var(--duration-normal) var(--easing-standard), background-color var(--duration-normal) var(--easing-standard);
}

.input::placeholder, input::placeholder, textarea::placeholder { color: var(--gray-500); }

.input:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--color-primary-600); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 25%, transparent); }

select { background-image: none; }

label { display: inline-block; margin-bottom: var(--space-2); font-weight: 600; }

/* Cards */
.card {
  background-color: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-7);
}

.card:hover { box-shadow: var(--shadow-md); transition: box-shadow var(--duration-normal) var(--easing-standard); }

.card-header { margin-bottom: var(--space-4); }
.card-title { margin: 0; font-family: var(--font-heading); font-size: var(--fs-2xl); line-height: var(--lh-tight); }
.card-body { font-size: var(--fs-base); color: var(--color-text); }

/* Badges (optional lightweight for e-commerce labels) */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 2px var(--space-3);
  font-size: var(--fs-sm);
  border-radius: var(--radius-full);
  background: var(--gray-100);
  color: var(--color-text);
}
.badge-success { background: color-mix(in srgb, var(--color-success) 18%, white); color: var(--color-success); }
.badge-warning { background: color-mix(in srgb, var(--color-warning) 18%, white); color: #8A5A00; }
.badge-danger  { background: color-mix(in srgb, var(--color-danger) 18%, white); color: var(--color-danger); }

/* Navigation helpers */
.nav-inline { display: flex; gap: var(--space-6); align-items: center; }
.nav-inline a { color: var(--color-text); opacity: 0.9; }
.nav-inline a:hover { color: var(--color-primary-700); opacity: 1; }

/* Product grid helper (for galleries, best-sellers) */
.product-grid { display: grid; gap: var(--space-7); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ==================== Accessibility ==================== */
:focus-visible { outline: 2px solid var(--color-primary-700); outline-offset: 2px; }

.btn:focus-visible { outline-color: var(--color-accent-700); }

/* Ensure media scales within prose */
.prose img, .prose video { border-radius: var(--radius-md); }

/* Smooth corners on interactive elements */
button, .btn, input, select, textarea { -webkit-tap-highlight-color: transparent; }

/* Print-friendly base */
@media print {
  .btn, .card, .badge { box-shadow: none !important; }
  a { text-decoration: underline; }
}
