/* ========================================
   Variables
   ======================================== */
:root {
  color-scheme: light;

  /* Brand palette */
  --color-white: #ffffff;
  --color-navy: #0b1b2b; /* deep navy */
  --color-yellow: #ffd400; /* bright yellow */
  --color-teal: #14b8a6; /* teal */
  --color-magenta: #d946ef; /* magenta/fuchsia */

  /* Semantic colors */
  --color-bg: var(--color-white);
  --color-surface: #ffffff;
  --color-text: var(--color-navy);
  --color-primary: var(--color-teal);
  --color-accent: var(--color-magenta);
  --color-success: #22c55e;
  --color-warning: var(--color-yellow);
  --color-danger: #ef4444;

  /* Neutral grays */
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  --color-border: var(--gray-200);
  --color-muted: var(--gray-600);

  /* Typography */
  --font-sans: 'Poppins', 'Inter', 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

  --fs-xs: clamp(0.75rem, 0.72rem + 0.2vw, 0.8rem);
  --fs-sm: clamp(0.875rem, 0.84rem + 0.2vw, 0.95rem);
  --fs-base: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  --fs-lg: clamp(1.125rem, 1.05rem + 0.5vw, 1.375rem);
  --fs-xl: clamp(1.25rem, 1.1rem + 0.8vw, 1.75rem);
  --fs-2xl: clamp(1.5rem, 1.3rem + 1.2vw, 2.25rem);
  --fs-3xl: clamp(1.875rem, 1.5rem + 1.6vw, 3rem);
  --fs-4xl: clamp(2.25rem, 1.7rem + 2vw, 3.75rem);

  --lh-tight: 1.1;
  --lh-snug: 1.25;
  --lh-normal: 1.5;
  --lh-relaxed: 1.7;

  /* Spacing scale (0–96px) */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-9: 36px;
  --space-10: 40px;
  --space-11: 44px;
  --space-12: 48px;
  --space-13: 52px;
  --space-14: 56px;
  --space-15: 60px;
  --space-16: 64px;
  --space-17: 68px;
  --space-18: 72px;
  --space-19: 76px;
  --space-20: 80px;
  --space-21: 84px;
  --space-22: 88px;
  --space-23: 92px;
  --space-24: 96px;

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

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06), 0 1px 1px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 10px rgba(11,27,43,0.12), 0 1px 3px rgba(11,27,43,0.06);
  --shadow-lg: 0 10px 24px rgba(11,27,43,0.18), 0 4px 8px rgba(11,27,43,0.12);

  /* Transitions */
  --ease-out: cubic-bezier(.16,1,.3,1);
  --ease-in-out: cubic-bezier(.4,0,.2,1);
  --duration-fast: 120ms;
  --duration-base: 220ms;
  --duration-slow: 420ms;

  /* Focus ring */
  --focus-color: var(--color-accent);
  --focus-ring-shadow: 0 0 0 3px rgba(217, 70, 239, 0.45);

  /* Layout */
  --container-max: 1200px;
  --container-padding: var(--space-5);
}

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

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

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

body { min-height: 100vh; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

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

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

button, input, select, textarea { font: inherit; color: inherit; border: 0; background: none; }

button { cursor: pointer; }

/* Remove animations and smooth scroll if user prefers 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-relaxed);
  color: var(--color-text);
  background: var(--color-bg);
  accent-color: var(--color-primary);
}

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

/* Headings */
h1, h2, h3, h4, h5, h6 { color: var(--color-text); font-weight: 800; line-height: var(--lh-snug); letter-spacing: -0.015em; }

h1 { font-size: var(--fs-4xl); margin-block: var(--space-6) var(--space-4); }
h2 { font-size: var(--fs-3xl); margin-block: var(--space-6) var(--space-4); }
h3 { font-size: var(--fs-2xl); margin-block: var(--space-5) var(--space-3); }
h4 { font-size: var(--fs-xl);  margin-block: var(--space-4) var(--space-2); }
h5 { font-size: var(--fs-lg);  margin-block: var(--space-3) var(--space-2); }
h6 { font-size: var(--fs-sm);  margin-block: var(--space-2) var(--space-1); text-transform: uppercase; letter-spacing: .06em; }

/* Links */
a { color: var(--color-primary); text-decoration: none; text-underline-offset: 2px; transition: color var(--duration-base) var(--ease-in-out), text-decoration-color var(--duration-base) var(--ease-in-out); }
a:hover { color: var(--color-accent); text-decoration: underline; text-decoration-thickness: 2px; }
a:focus-visible { outline: none; box-shadow: var(--focus-ring-shadow); border-radius: var(--radius-sm); }

/* Text */
p { margin-block: var(--space-3); }
small { font-size: var(--fs-sm); color: var(--color-muted); }
mark { background: var(--color-yellow); color: currentColor; padding-inline: 0.2em; border-radius: 4px; }

hr { border: 0; border-top: 1px solid var(--color-border); margin-block: var(--space-8); }

/* Forms base */
label { display: inline-block; font-weight: 600; margin-block-end: var(--space-2); }

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

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

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

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



.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-2);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-pill);
  font-weight: 700;
  line-height: 1;
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-fast) var(--ease-out), box-shadow var(--duration-base) var(--ease-in-out), filter var(--duration-base) var(--ease-in-out), background-color var(--duration-base) var(--ease-in-out);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); filter: brightness(0.98); }
.btn:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.6; cursor: not-allowed; filter: none; }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-md), var(--focus-ring-shadow); }

.btn--accent { background: var(--color-accent)!important; color: #fff!important; }
.btn--success { background: var(--color-success); color: #fff }
.btn--warning { background: var(--color-warning); color: #000; }
.btn--danger { background: var(--color-danger); color: #fff; }
.btn--ghost { background: transparent; color: var(--color-text); border: 1px solid var(--color-border); }
.btn--outline { background: transparent; color: var(--color-primary); border: 2px solid var(--color-primary); }

/* Inputs */
.input, input[type='text'], input[type='email'], input[type='password'], input[type='search'], input[type='tel'], input[type='url'], input[type='number'], select, textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--color-text);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
  transition: border-color var(--duration-base) var(--ease-in-out), box-shadow var(--duration-base) var(--ease-in-out), background-color var(--duration-base) var(--ease-in-out);
}
.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); box-shadow: var(--focus-ring-shadow); }
.input:disabled, input:disabled, select:disabled, textarea:disabled { background: var(--gray-50); color: var(--gray-500); cursor: not-allowed; }

input[type='checkbox'], input[type='radio'] { width: 1.1em; height: 1.1em; border-radius: 4px; border: 1px solid var(--color-border); accent-color: var(--color-primary); }

/* Cards */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
}
.card--hover { transition: transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out); }
.card--hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* Badges (playful tag for collections) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 700;
  background: var(--gray-100);
  color: var(--color-text);
}
.badge--accent { background: var(--color-accent); color: #fff!important; }
.badge--primary { background: var(--color-primary); color: #fff; }
.badge--sunny { background: var(--color-yellow); color: #111827; }

/* Navigation helpers */
.nav-inline { display: inline-flex; gap: var(--space-4); align-items: center; }
.nav-inline a { padding: var(--space-4) var(--space-3); border-radius: var(--radius-pill); }
.nav-inline a:hover { background: var(--gray-100); }
.nav-inline a:focus-visible { outline: none; box-shadow: var(--focus-ring-shadow); }

/* ========================================
   Accessibility
   ======================================== */
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring-shadow); }

/* Make focus ring more visible on dark elements */
.btn:focus-visible,
.nav-inline a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible { box-shadow: var(--focus-ring-shadow); }

/* Reduce motion respect already handled in reset section */
