/* ==========================================
   Variables
   ========================================== */
:root {
  /* Brand & semantic colors */
  --color-background: #ffffff;
  --color-surface: #ffffff;
  --color-text: #111827; /* gray-900 */
  --color-muted: #6b7280; /* gray-500 */
  --color-primary: #8b5cf6; /* violet-500 */
  --color-primary-hover: #7c3aed; /* violet-600 */
  --color-success: #16a34a; /* green-600 */
  --color-success-hover: #15803d; /* green-700 */
  --color-warning: #f59e0b; /* amber-500 */
  --color-warning-hover: #d97706; /* amber-600 */
  --color-danger: #dc2626; /* red-600 */
  --color-danger-hover: #b91c1c; /* red-700 */

  /* Neutral gray scale */
  --gray-0: #ffffff;
  --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: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --fs-xs: clamp(0.75rem, 0.72rem + 0.2vw, 0.825rem);
  --fs-sm: clamp(0.875rem, 0.84rem + 0.25vw, 0.95rem);
  --fs-base: 1rem;
  --fs-md: clamp(1.025rem, 0.98rem + 0.3vw, 1.125rem);
  --fs-lg: clamp(1.125rem, 1.05rem + 0.6vw, 1.35rem);
  --fs-xl: clamp(1.25rem, 1.1rem + 1vw, 1.6rem);
  --fs-2xl: clamp(1.5rem, 1.2rem + 1.8vw, 2rem);
  --fs-3xl: clamp(1.875rem, 1.4rem + 2.5vw, 2.5rem);
  --fs-4xl: clamp(2.25rem, 1.6rem + 3.2vw, 3.25rem);
  --fs-5xl: clamp(2.75rem, 1.8rem + 4.2vw, 4rem);

  --lh-tight: 1.2;
  --lh-normal: 1.5;
  --lh-relaxed: 1.7;

  /* 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: 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: 14px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.12);
  --shadow-lg: 0 12px 28px rgba(16, 24, 40, 0.18);
  --shadow-glow-primary: 0 8px 24px rgba(139, 92, 246, 0.35);

  /* Motion */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --easing-standard: cubic-bezier(.2, .7, .3, 1);

  /* Layout */
  --container-max: 72rem; /* ~1152px */
  --container-pad: var(--space-5);

  /* Focus */
  --focus-outline-color: var(--color-primary);
  --focus-outline-width: 3px;
  --focus-outline-offset: 2px;

  /* Accent gradient for vibrant vibe */
  --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-background: #0b0d12;
    --color-surface: #111827;
    --color-text: #e5e7eb;
    --color-muted: #9ca3af;
    --color-primary: #a78bfa; /* slightly brighter in dark */
    --color-primary-hover: #8b5cf6;

    /* Dark neutrals */
    --gray-0: #0b0d12;
    --gray-50: #0f172a;
    --gray-100: #111827;
    --gray-200: #1f2937;
    --gray-300: #374151;
    --gray-400: #4b5563;
    --gray-500: #6b7280;
    --gray-600: #9ca3af;
    --gray-700: #d1d5db;
    --gray-800: #e5e7eb;
    --gray-900: #f9fafb;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
    --shadow-glow-primary: 0 8px 24px rgba(167, 139, 250, 0.45);

    --gradient-primary: linear-gradient(135deg, #a78bfa 0%, #f472b6 100%);
  }
}

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

/* Remove default margins */
body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
h1, h2, h3, h4, h5, h6, p, figure{hyphens: auto;
  overflow-wrap: anywhere;}
/* Smooth scrolling */
html { scroll-behavior: smooth; }

/* Typography adjustments */
html { -webkit-text-size-adjust: 100%; }

/* Media elements are responsive by default */
img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }

/* Inherit fonts for form controls */
input, button, textarea, select { font: inherit; color: inherit; }

/* Improve text rendering */
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }

/* Remove animations/transitions for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { 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 {
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  background-color: var(--color-background);
  color: var(--color-text);
  accent-color: var(--color-primary);
}

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

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  color: var(--color-text);
}
h1 { font-size: var(--fs-5xl); margin-block: 0 0.6em; }
h2 { font-size: var(--fs-4xl); margin-block: 0 0.6em; }
h3 { font-size: var(--fs-3xl); margin-block: 0 0.6em; }
h4 { font-size: var(--fs-2xl); margin-block: 0 0.5em; }
h5 { font-size: var(--fs-xl); margin-block: 0 0.5em; }
h6 { font-size: var(--fs-lg); margin-block: 0 0.4em; }

/* Links */
a { color: var(--color-primary); text-decoration: none; text-underline-offset: 3px; transition: color var(--duration-fast) var(--easing-standard); }
a:hover { text-decoration: underline; }
a:focus-visible { outline: var(--focus-outline-width) solid var(--focus-outline-color); outline-offset: var(--focus-outline-offset); }

/* Paragraphs with comfortable measure */
p { max-width: 70ch; line-height: var(--lh-relaxed); margin-block: 0 1em; color: inherit; }

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

/* Forms - placeholder */
::placeholder { color: var(--gray-500); opacity: 1; }

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

/* Flex helpers */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.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; }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* Grid helpers */
.grid { display: grid; }
.grid-center { display: grid; place-items: center; }
.grid-auto-fit { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--space-6); }

/* Gap utilities */
.gap-xs { gap: var(--space-2); }
.gap-sm { gap: var(--space-3); }
.gap-md { gap: var(--space-5); }
.gap-lg { gap: var(--space-8); }
.gap-xl { gap: var(--space-12); }

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

/* Accent gradient helper for vibrant moments */
.bg-accent-gradient { background-image: var(--gradient-primary); color: #fff; }
.text-gradient { background: var(--gradient-primary); -webkit-background-clip: text; background-clip: text; color: transparent; }
.shadow-glow-primary { box-shadow: var(--shadow-glow-primary); }

/* ==========================================
   Components
   ========================================== */
/* Buttons */
.btn {
  --btn-bg: var(--color-primary);
  --btn-bg-hover: var(--color-primary-hover);
  --btn-color: #ffffff;
  --btn-border: transparent;

  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 0.625rem 1rem; /* 10px 16px */
  border-radius: var(--radius-pill);
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-color);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--easing-standard), color var(--duration-fast) var(--easing-standard), border-color var(--duration-fast) var(--easing-standard), box-shadow var(--duration-fast) var(--easing-standard), transform var(--duration-fast) var(--easing-standard);
  text-decoration: none;
}
.btn:hover { background: var(--btn-bg-hover); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: var(--focus-outline-width) solid var(--focus-outline-color); outline-offset: var(--focus-outline-offset); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; }

/* Button variants */
.btn--primary { --btn-bg: var(--color-primary); --btn-bg-hover: var(--color-primary-hover); --btn-color: #ffffff; }
.btn--success { --btn-bg: var(--color-success); --btn-bg-hover: var(--color-success-hover); --btn-color: #ffffff; }
.btn--warning { --btn-bg: var(--color-warning); --btn-bg-hover: var(--color-warning-hover); --btn-color: #111827; }
.btn--danger { --btn-bg: var(--color-danger); --btn-bg-hover: var(--color-danger-hover); --btn-color: #ffffff; }
.btn--outline { --btn-bg: transparent; --btn-bg-hover: rgba(0,0,0,0.04); --btn-color: var(--color-text); --btn-border: var(--gray-300); }
.btn--ghost { --btn-bg: transparent; --btn-bg-hover: rgba(139, 92, 246, 0.12); --btn-color: #fff; --btn-border: transparent; }
.btn.is-gradient { background-image: var(--gradient-primary); }

/* Inputs */
.input, input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="url"], input[type="search"], input[type="number"], select, textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  background-color: var(--gray-0);
  color: var(--color-text);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--duration-fast) var(--easing-standard), box-shadow var(--duration-fast) var(--easing-standard), background-color var(--duration-fast) var(--easing-standard);
}
.input:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: var(--focus-outline-width) solid var(--focus-outline-color);
  outline-offset: var(--focus-outline-offset);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm), 0 0 0 3px rgba(139, 92, 246, 0.15);
}
.input:disabled,
input:disabled,
select:disabled,
textarea:disabled { background-color: var(--gray-100); cursor: not-allowed; }

/* Form field grouping */
.field { display: grid; gap: var(--space-2); }
.label, label { font-size: var(--fs-sm); color: var(--color-muted); }
.help-text { font-size: var(--fs-xs); color: var(--color-muted); }

/* Card */
.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-md);
  padding: var(--space-6);
}
.card--interactive { transition: transform var(--duration-fast) var(--easing-standard), box-shadow var(--duration-fast) var(--easing-standard); }
.card--interactive:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* Badges / chips (lightweight utility for community vibe) */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.badge--primary { background: rgba(139, 92, 246, 0.12); color: var(--color-primary); }

/* ==========================================
   Accessibility & Motion
   ========================================== */
:focus-visible { outline: var(--focus-outline-width) solid var(--focus-outline-color); outline-offset: var(--focus-outline-offset); }

/* Respect reduced motion beyond reset */
@media (prefers-reduced-motion: reduce) {
  .btn, .card--interactive { transition: none !important; }
}

/* Theming helpers (optional) */
.theme-light { color-scheme: light; }
.theme-dark { color-scheme: dark; }

/* ==========================================
   Header & Footer styles (from home.css)
   ========================================== */

/* Accessibility: skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: top var(--duration-fast) var(--easing-standard);
  z-index: 1000;
}
.skip-link:focus {
  top: 8px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: color-mix(in oklab, var(--color-surface) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--gray-200);
}
.header-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: var(--space-4);
  padding-block: var(--space-4);
}
.brand-link {
  font-weight: 800;
  font-size: var(--fs-xl);
  color: var(--color-text);
  letter-spacing: -0.02em;
}

/* Primary nav */
.menu-toggle {
  display: none;
  border: 1px solid var(--gray-300);
  background: var(--gray-0);
  border-radius: var(--radius-md);
  padding: 10px;
  line-height: 0;
}
.menu-toggle__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  margin: 4px 0;
  border-radius: 2px;
}
.primary-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}
.nav-list {
  display: flex;
  gap: var(--space-5);
  list-style: none;
  padding: 0;
  margin: 0;
}
.nav-list a {
  color: var(--color-text);
  font-weight: 600;
}
.nav-list a:hover {
  text-decoration: underline;
}
.nav-list .cta-link {
  color: var(--color-primary);
}
.site-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: min(420px, 50vw);
}
.site-search input {
  min-width: 0;
}

@media (max-width: 960px) {
  .menu-toggle {
    display: inline-flex;
    justify-self: end;
    flex-direction: column;
  }
  .primary-nav {
    position: fixed;
    inset: 64px 0 auto 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--gray-200);
    padding: var(--space-5) var(--container-pad);
    flex-direction: column;
    gap: var(--space-5);
    transform: translateY(-150%);
    transition: transform var(--duration-normal) var(--easing-standard);
  }
  .primary-nav.open {
    transform: translateY(0);
  }
  .nav-list {
    flex-direction: column;
    gap: var(--space-3);
  }
  .site-search {
    width: 100%;
    min-width: 0;
  }
}

/* Footer */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--gray-200);
  margin-top: var(--space-10);
}
.footer-grid {
  display: grid;
  gap: var(--space-8);
  padding-block: var(--space-8);
  grid-template-columns: 1.2fr 1fr 1fr;
}
.footer-title {
  margin-bottom: var(--space-3);
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-2);
}
.footer-base {
  border-top: 1px solid var(--gray-200);
  padding-block: var(--space-5);
  color: var(--color-muted);
}
@media (max-width: 960px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* Cookie consent */
.cookie-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: var(--color-surface);
  border-top: 1px solid var(--gray-200);
  box-shadow: var(--shadow-md);
}
.cookie-consent__inner {
  display: grid;
  gap: var(--space-4);
  align-items: center;
  grid-template-columns: 1fr auto;
  padding-block: var(--space-4);
}
.cookie-consent__text {
  margin: 0;
}
.cookie-consent__actions {
  display: flex;
  gap: var(--space-3);
}
@media (max-width: 720px) {
  .cookie-consent__inner {
    grid-template-columns: 1fr;
  }
}
