/* ========================================================================== 
   Variables
   ========================================================================== */

:root {
  /* Color palette */
  --color-background: #fdfcff;
  --color-surface: #ffffff;
  --color-text: #213047;
  --color-text-muted: #6f7a8b;

  --color-primary: #ffb400; /* sunny yellow */
  --color-primary-soft: #ffe7a8;
  --color-accent-blue: #43a7ff; /* sky blue */
  --color-accent-pink: #ff6fa8; /* candy pink */
  --color-accent-mint: #4ed8a2; /* mint green */

  --color-success: #2bbf6a;
  --color-warning: #ffb400;
  --color-danger: #ff4c5b;

  --color-gray-50: #f8fafc;
  --color-gray-100: #eef2f7;
  --color-gray-200: #dde3ee;
  --color-gray-300: #c5cfdf;
  --color-gray-400: #a2afc5;
  --color-gray-500: #838fa5;
  --color-gray-600: #667189;
  --color-gray-700: #4a5267;
  --color-gray-800: #32384a;
  --color-gray-900: #1e2330;

  /* Typography */
  --font-sans: "Baloo 2", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --font-rounded: "Fredoka", "Baloo 2", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;

  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;    /* 16px */
  --font-size-md: 1.0625rem; /* 17px */
  --font-size-lg: 1.25rem;   /* 20px */
  --font-size-xl: 1.5rem;    /* 24px */
  --font-size-2xl: 1.875rem; /* 30px */
  --font-size-3xl: 2.25rem;  /* 36px */
  --font-size-4xl: 3rem;     /* 48px */

  --line-height-tight: 1.1;
  --line-height-snug: 1.25;
  --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-6: 0.75rem;   /* 12px */
  --space-8: 1rem;      /* 16px */
  --space-10: 1.25rem;  /* 20px */
  --space-12: 1.5rem;   /* 24px */
  --space-16: 2rem;     /* 32px */
  --space-20: 2.5rem;   /* 40px */
  --space-24: 3rem;     /* 48px */
  --space-32: 4rem;     /* 64px */
  --space-40: 5rem;     /* 80px */
  --space-48: 6rem;     /* 96px */

  /* Radius */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* Shadows (soft and playful) */
  --shadow-xs: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 4px 10px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 10px 25px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.18);

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

  /* Layout */
  --container-max-width: 1280px;
}

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

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

/* ========================================================================== 
   Reset / Normalize
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
}

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

picture {
  display: block;
}

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

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

ul,
ol {
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure {
  margin: 0;
}

:focus {
  outline: none;
}

/* ========================================================================== 
   Base Styles
   ========================================================================== */

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  background: radial-gradient(circle at top left, #fffbe8 0, #fdfcff 40%, #f3f7ff 100%);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-rounded);
  font-weight: 600;
  line-height: var(--line-height-tight);
  color: var(--color-text);
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(2.25rem, 3vw + 1.5rem, 3rem);
  margin-bottom: var(--space-16);
}

h2 {
  font-size: clamp(1.875rem, 2.2vw + 1.2rem, 2.25rem);
  margin-bottom: var(--space-12);
}

h3 {
  font-size: clamp(1.5rem, 1.5vw + 1rem, 1.875rem);
  margin-bottom: var(--space-10);
}

h4 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-8);
}

h5 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-6);
}

h6 {
  font-size: var(--font-size-base);
  margin-bottom: var(--space-4);
}

p {
  margin-bottom: var(--space-8);
  color: var(--color-text-muted);
}

strong,
.b {
  font-weight: 600;
}

a {
  color: var(--color-accent-blue);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

a:hover {
  color: var(--color-accent-pink);
  transform: translateY(-1px);
}

a:focus-visible {
  outline: 3px solid rgba(67, 167, 255, 0.7);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

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

hr {
  border: none;
  border-top: 1px dashed var(--color-gray-200);
  margin: var(--space-16) 0;
}

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

/* Layout helpers */

.container {
  max-width: var(--container-max-width);
  margin-inline: auto;
  padding-inline: var(--space-12);
}


.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

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

.flex-row {
  flex-direction: row;
}

.flex-wrap {
  flex-wrap: wrap;
}

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

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-around {
  justify-content: space-around;
}

.gap-xs {
  gap: var(--space-4);
}

.gap-sm {
  gap: var(--space-8);
}

.gap-md {
  gap: var(--space-12);
}

.gap-lg {
  gap: var(--space-16);
}

.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-12);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-16);
}

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

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

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

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

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

.w-full {
  width: 100%;
}

.m-auto {
  margin: auto;
}

.mt-0 {
  margin-top: 0;
}

.mt-sm {
  margin-top: var(--space-8);
}

.mt-md {
  margin-top: var(--space-12);
}

.mt-lg {
  margin-top: var(--space-16);
}

.mb-0 {
  margin-bottom: 0;
}

.mb-sm {
  margin-bottom: var(--space-8);
}

.mb-md {
  margin-bottom: var(--space-12);
}

.mb-lg {
  margin-bottom: var(--space-16);
}

.p-sm {
  padding: var(--space-8);
}

.p-md {
  padding: var(--space-12);
}

.p-lg {
  padding: var(--space-16);
}

.rounded-sm {
  border-radius: var(--radius-sm);
}

.rounded-md {
  border-radius: var(--radius-md);
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.rounded-pill {
  border-radius: var(--radius-pill);
}

.bg-surface {
  background-color: var(--color-surface);
}

.bg-soft-yellow {
  background-color: #fff8d9;
}

.bg-soft-blue {
  background-color: #e6f3ff;
}

.bg-soft-pink {
  background-color: #ffe3f0;
}

.bg-soft-mint {
  background-color: #e3fff3;
}

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

.shadow-sm {
  box-shadow: var(--shadow-sm);
}

.shadow-md {
  box-shadow: var(--shadow-md);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

/* 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;
}

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

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-pill);
  border: none;
  font-family: var(--font-rounded);
  font-weight: 600;
  font-size: var(--font-size-md);
  line-height: 1;
  background-color: var(--color-primary);
  color: #1f2933;
  box-shadow: var(--shadow-sm);
  transition: background-color var(--transition-normal),
    box-shadow var(--transition-normal),
    transform var(--transition-fast),
    filter var(--transition-fast);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  filter: brightness(1.03);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

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

.btn-primary {
  background: linear-gradient(135deg, #ffb400, #ffd46a);
  color: #3b2a00!important;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ffb400, #ffe086);
}

.btn-secondary {
  background-color: var(--color-accent-blue);
  color: #ffffff!important;
}

.btn-ghost {
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--color-text)!important;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: var(--font-size-sm);
}

.btn-lg {
  padding: 0.9rem 1.8rem;
  font-size: var(--font-size-lg);
}

.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 999px;
}

.btn:focus-visible {
  outline: 3px solid rgba(255, 111, 168, 0.8);
  outline-offset: 2px;
}

/* Form elements */

.input,
select,
textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-gray-200);
  background-color: #ffffff;
  color: var(--color-text);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  transition: border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast),
    transform var(--transition-fast);
}

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

.input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--color-accent-pink);
  box-shadow: 0 0 0 3px rgba(255, 111, 168, 0.25);
  outline: none;
}

.input[aria-invalid="true"],
.input.is-invalid {
  border-color: var(--color-danger);
}

label {
  display: inline-block;
  margin-bottom: var(--space-4);
  font-weight: 500;
  font-size: var(--font-size-sm);
}

.form-help {
  margin-top: var(--space-4);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* Card */

.card {
  position: relative;
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-12);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition-normal),
    transform var(--transition-normal),
    border-radius var(--transition-normal);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card--playful {
  border-radius: 22px;
  background: radial-gradient(circle at top left, #fff8d9 0, #ffffff 40%);
}

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

.card__title {
  font-family: var(--font-rounded);
  font-size: var(--font-size-lg);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-2);
}

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

.card__body {
  margin-top: var(--space-4);
}

.card__footer {
  margin-top: var(--space-10);
}

/* Focus-visible global helper for custom interactive elements */

[tabindex]:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
[role="link"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(67, 167, 255, 0.75);
  outline-offset: 2px;
}

/* Badges for playful labels (e.g., ages, tags) */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge--yellow {
  background-color: #fff1b8;
  color: #7a4c00;
}

.badge--blue {
  background-color: #d5ebff;
  color: #0f4f96;
}

.badge--pink {
  background-color: #ffd6ea;
  color: #8a214f;
}

.badge--mint {
  background-color: #c8ffe5;
  color: #006644;
}
