/* ==========================================================================
   Variables
   ========================================================================== */
:root {
  /* Color palette */
  --color-background: #fdfdfd;
  --color-surface: #ffffff;
  --color-surface-soft: #f6f9ff;

  --color-text: #1c2433;
  --color-text-soft: #4a5668;
  --color-text-muted: #7a8699;

  /* Brand / playful colors inspired by toys */
  --color-primary: #ffb703; /* bright, warm yellow */
  --color-primary-soft: #ffe7a8;
  --color-primary-strong: #fb8500;

  --color-sky: #4cc9ff; /* sky blue */
  --color-coral: #ff6b6b; /* coral red */
  --color-mint: #4dd4a8; /* mint green */

  --color-success: #23b26b;
  --color-warning: #ffb020;
  --color-danger: #e63946;

  --gray-50: #f7f9fc;
  --gray-100: #edf1f7;
  --gray-200: #d7deea;
  --gray-300: #c0cadb;
  --gray-400: #9ba6bc;
  --gray-500: #7e8aa3;
  --gray-600: #5b6477;
  --gray-700: #424a5a;
  --gray-800: #2d3340;
  --gray-900: #1c2028;

  /* Typography */
  --font-sans: "Baloo 2", "Poppins", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --font-heading: "Baloo 2", "Poppins", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;

  /* Font sizes (root is 16px) */
  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-md: 1rem;      /* 16px */
  --font-size-lg: 1.125rem;  /* 18px */
  --font-size-xl: 1.25rem;   /* 20px */
  --font-size-2xl: 1.5rem;   /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem;  /* 36px */

  /* Line heights */
  --line-height-tight: 1.15;
  --line-height-snug: 1.3;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (0–96px) */
  --space-0: 0;
  --space-1: 0.125rem;  /* 2px */
  --space-2: 0.25rem;   /* 4px */
  --space-3: 0.375rem;  /* 6px */
  --space-4: 0.5rem;    /* 8px */
  --space-5: 0.75rem;   /* 12px */
  --space-6: 1rem;      /* 16px */
  --space-7: 1.25rem;   /* 20px */
  --space-8: 1.5rem;    /* 24px */
  --space-9: 1.75rem;   /* 28px */
  --space-10: 2rem;     /* 32px */
  --space-12: 2.5rem;   /* 40px */
  --space-14: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */

  /* Radii (soft, friendly corners) */
  --radius-sm: 0.375rem;  /* 6px */
  --radius-md: 0.75rem;   /* 12px */
  --radius-lg: 1.25rem;   /* 20px */
  --radius-full: 999px;

  /* Shadows (playful, soft) */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 8px 20px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.16);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-normal: 180ms ease-out;
  --transition-slow: 240ms ease-out;

  /* Layout */
  --container-max-width: 1120px;
  --container-padding-x: var(--space-6);
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0.001ms;
    --transition-normal: 0.001ms;
    --transition-slow: 0.001ms;
  }
}

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

* {
  margin: 0;
}

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

body {
  min-height: 100vh;
  text-rendering: optimizeLegibility;
}

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

img {
  height: auto;
}

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

button {
  border: none;
  background: none;
  padding: 0;
}

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

ul,
ol {
  padding-left: 1.2em;
}

/* Improve text wrapping */
p,
li,
figcaption {
  text-wrap: pretty;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
body {
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height-relaxed);
  background: radial-gradient(circle at top left, #fffbe6 0, #fdfdfd 40%, #f6f9ff 100%);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

main {
  min-height: 60vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-text);
}

h1 {
  font-size: clamp(2.25rem, 3vw + 1.4rem, 3rem);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-6);
}

h2 {
  font-size: clamp(1.75rem, 2.3vw + 1.1rem, 2.25rem);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-5);
}

h3 {
  font-size: 1.5rem;
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-4);
}

h4 {
  font-size: 1.25rem;
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-3);
}

h5 {
  font-size: 1.125rem;
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-2);
}

h6 {
  font-size: 1rem;
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-2);
}

p {
  margin-bottom: var(--space-4);
  color: var(--color-text-soft);
}

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

strong {
  font-weight: 600;
}

/* Links */
a {
  color: var(--color-primary-strong);
  text-decoration: none;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

a:hover {
  color: var(--color-coral);
}

a:active {
  transform: translateY(1px);
}

/* Focus styles (accessibility) */
:focus-visible {
  outline: 3px solid var(--color-sky);
  outline-offset: 2px;
}

/* Forms base */
input,
select,
textarea {
  border-radius: var(--radius-md);
}

/* ==========================================================================
   Utilities
   ========================================================================== */

/* Layout helpers */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-inline: auto;
  padding-inline: var(--container-padding-x);
}

.container--wide {
  max-width: 1360px;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

.grid {
  display: grid;
}

.grid-auto-fit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-6);
}

.w-full {
  width: 100%;
}

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

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

.hidden {
  display: none !important;
}

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

/* Pills / badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge--primary {
  background: var(--color-primary-soft);
  color: var(--color-text);
}

.badge--success {
  background: rgba(35, 178, 107, 0.12);
  color: var(--color-success);
}

.badge--danger {
  background: rgba(230, 57, 70, 0.12);
  color: var(--color-danger);
}

/* ==========================================================================
   Components
   ========================================================================== */

/* Buttons */
.button {
  --btn-bg: var(--color-primary);
  --btn-bg-hover: var(--color-primary-strong);
  --btn-color: #1f2933;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  border: 0;
  font-size: var(--font-size-md);
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  background: var(--btn-bg);
  color: var(--btn-color);
  box-shadow: 0 8px 0 rgba(251, 133, 0, 0.45);
  transform: translateY(0);
  transition:
    background-color var(--transition-normal),
    box-shadow var(--transition-normal),
    transform var(--transition-fast),
    opacity var(--transition-fast);
}

.button:hover {
  background-color: var(--btn-bg-hover);
  box-shadow: 0 6px 0 rgba(230, 125, 0, 0.55);
  transform: translateY(1px);
}

.button:active {
  box-shadow: 0 2px 0 rgba(230, 125, 0, 0.7);
  transform: translateY(3px);
}

.button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
  transform: none;
}

.button--primary {
  --btn-bg: var(--color-primary);
  --btn-bg-hover: var(--color-primary-strong);
  --btn-color: #1f2933;
  color: var(--btn-color)!important;
}

.button--sky {
  --btn-bg: var(--color-sky);
  --btn-bg-hover: #34b8f2;
  --btn-color: #0f172a;
   color: var(--btn-color)!important;
}

.button--outline {
  --btn-bg: #ffffff;
  --btn-bg-hover: #ffffff;
  --btn-color: var(--color-text);
  box-shadow: 0 0 0 2px var(--color-primary-soft);
   color: var(--btn-color)!important;
}

.button--sm {
  padding: 0.45rem 1rem;
  font-size: var(--font-size-sm);
}

.button--lg {
  padding: 0.8rem 1.7rem;
  font-size: var(--font-size-lg);
}

/* Inputs */
.input,
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--gray-200);
  background-color: #ffffff;
  color: var(--color-text);
  font-size: var(--font-size-md);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast);
}

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

.input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--color-sky);
  box-shadow: 0 0 0 3px rgba(76, 201, 255, 0.35);
}

.input--error {
  border-color: var(--color-danger);
}

.input--error:focus-visible {
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.25);
}

label {
  display: inline-block;
  margin-bottom: 0.25rem;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
}

.form-field {
  margin-bottom: var(--space-4);
}

.form-helper {
  margin-top: 0.25rem;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* Card */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.card--playful {
  border-radius: 1.5rem;
  background: linear-gradient(145deg, #ffffff 0%, #fdf7ff 40%, #f6fbff 100%);
  box-shadow: var(--shadow-md);
}

.card__header {
  margin-bottom: var(--space-4);
}

.card__title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-2);
}

.card__body {
  font-size: var(--font-size-md);
  color: var(--color-text-soft);
}

/* Review / rating snippets (trust & safety) */
.stars {
  display: inline-flex;
  gap: 0.15rem;
  color: #ffc94a;
  font-size: 0.9rem;
}

.review-snippet {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--font-size-sm);
  color: var(--color-text-soft);
}

/* ==========================================================================
   Motion & Reduced Motion Handling
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
