/* ==========================================================================
   FuelMyLift.com — Design System
   "Linear meets Nike Training Club"
   Dark, premium, purposeful fitness toolkit.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. FONTS
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');

/* --------------------------------------------------------------------------
   1. CUSTOM PROPERTIES (DESIGN TOKENS)
   -------------------------------------------------------------------------- */
:root {
  /* — Palette — */
  --bg:             #0a0a0a;
  --bg-rgb:         10, 10, 10;
  --surface:        #111111;
  --surface-2:      #1a1a1a;
  --surface-3:      #222222;
  --border:         #2a2a2a;
  --border-hover:   #3a3a3a;
  --text:           #e8e5e0;
  --text-secondary: #999999;
  --text-muted:     #666666;
  --text-inverse:   #0a0a0a;

  /* — Category Accents — */
  --accent-lime:    #c8ff2e;
  --accent-orange:  #ff6b35;
  --accent-violet:  #b18cfe;
  --accent-cyan:    #00e5c7;
  --accent-rose:    #ff4d6d;
  --accent-gold:    #ffc832;
  --accent-blue:    #64b4ff;

  /* — Active accent (overridden per category via data-category) — */
  --accent:         #c8ff2e;
  --accent-glow:    color-mix(in srgb, var(--accent) 25%, transparent);
  --accent-subtle:  color-mix(in srgb, var(--accent) 10%, transparent);

  /* — Semantic — */
  --success:  #22c55e;
  --warning:  #fbbf24;
  --error:    #ef4444;
  --info:     #3b82f6;

  /* — Typography — */
  --font-display: 'Bebas Neue', 'Impact', system-ui, sans-serif;
  --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg:   1.125rem;   /* 18px */
  --text-xl:   1.25rem;    /* 20px */
  --text-2xl:  1.5rem;     /* 24px */
  --text-3xl:  1.875rem;   /* 30px */
  --text-4xl:  2.25rem;    /* 36px */
  --text-5xl:  3rem;       /* 48px */
  --text-6xl:  3.75rem;    /* 60px */
  --text-7xl:  4.5rem;     /* 72px */

  --leading-none:   1;
  --leading-tight:  1.15;
  --leading-snug:   1.3;
  --leading-normal: 1.6;

  --tracking-tighter: -0.05em;
  --tracking-tight:   -0.025em;
  --tracking-wide:     0.05em;
  --tracking-wider:    0.1em;

  /* — Spacing — */
  --space-1:  0.25rem;   /* 4px  */
  --space-2:  0.5rem;    /* 8px  */
  --space-3:  0.75rem;   /* 12px */
  --space-4:  1rem;      /* 16px */
  --space-5:  1.25rem;   /* 20px */
  --space-6:  1.5rem;    /* 24px */
  --space-8:  2rem;      /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */
  --space-24: 6rem;      /* 96px */

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

  /* — Borders — */
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  24px;
  --radius-full: 9999px;

  /* — Shadows — */
  --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md:  0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg:  0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-xl:  0 16px 48px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 30px var(--accent-glow);

  /* — Transitions — */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:    cubic-bezier(0.7, 0, 0.84, 0);
  --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
  --duration-fast:   120ms;
  --duration-normal: 200ms;
  --duration-slow:   400ms;

  /* — Z-Index Scale — */
  --z-base:    1;
  --z-above:   10;
  --z-sticky:  100;
  --z-header:  200;
  --z-overlay: 500;
  --z-modal:   1000;
  --z-toast:   1500;
}

/* --------------------------------------------------------------------------
   2. CATEGORY ACCENT OVERRIDES
   -------------------------------------------------------------------------- */
body[data-category="body"]        { --accent: var(--accent-lime);   }
body[data-category="nutrition"]   { --accent: var(--accent-orange); }
body[data-category="strength"]    { --accent: var(--accent-violet); }
body[data-category="cardio"]      { --accent: var(--accent-cyan);   }
body[data-category="lifestyle"]   { --accent: var(--accent-rose);   }
body[data-category="progress"]    { --accent: var(--accent-gold);   }
body[data-category="flexibility"] { --accent: var(--accent-blue);   }

/* --------------------------------------------------------------------------
   3. CSS RESET
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  tab-size: 4;
  font-size: 16px;
}

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

ol, ul {
  list-style: none;
  padding: 0;
}

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

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

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

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

legend {
  padding: 0;
}

summary {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

details > summary::-webkit-details-marker {
  display: none;
}

details > summary {
  list-style: none;
}

::selection {
  background: var(--accent);
  color: var(--text-inverse);
}

/* --------------------------------------------------------------------------
   4. BASE / BODY
   -------------------------------------------------------------------------- */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-normal);
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
}

/* SVG noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: var(--z-toast);
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* --------------------------------------------------------------------------
   5. TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6,
.heading {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text);
}

h1, .h1 { font-size: var(--text-5xl); }
h2, .h2 { font-size: var(--text-4xl); }
h3, .h3 { font-size: var(--text-3xl); }
h4, .h4 { font-size: var(--text-2xl); }
h5, .h5 { font-size: var(--text-xl);  }
h6, .h6 { font-size: var(--text-lg);  }

@media (min-width: 768px) {
  h1, .h1 { font-size: var(--text-6xl); }
  h2, .h2 { font-size: var(--text-5xl); }
  h3, .h3 { font-size: var(--text-4xl); }
}

@media (min-width: 1024px) {
  h1, .h1 { font-size: var(--text-7xl); }
  h2, .h2 { font-size: var(--text-6xl); }
}

p {
  line-height: var(--leading-normal);
  color: var(--text-secondary);
}

p + p {
  margin-top: var(--space-4);
}

strong, b {
  font-weight: 600;
}

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

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

.text-mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   6. LINKS
   -------------------------------------------------------------------------- */
a:not(.btn):not(.card):not(.nav-link):not(.tool-card) {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 2px;
  transition: text-decoration-color var(--duration-fast) var(--ease-smooth);
}

a:not(.btn):not(.card):not(.nav-link):not(.tool-card):hover {
  text-decoration-color: var(--accent);
}

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

.container--sm  { max-width: var(--container-sm);  }
.container--md  { max-width: var(--container-md);  }
.container--lg  { max-width: var(--container-lg);  }
.container--xl  { max-width: var(--container-xl);  }
.container--2xl { max-width: var(--container-2xl); }

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

@media (min-width: 1024px) {
  .container { padding-inline: var(--space-8); }
}

.section {
  padding-block: var(--space-12);
}

@media (min-width: 768px) {
  .section { padding-block: var(--space-16); }
}

@media (min-width: 1024px) {
  .section { padding-block: var(--space-20); }
}

/* --------------------------------------------------------------------------
   8. SITE HEADER / NAV
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(var(--bg-rgb), 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .site-header__inner { height: 72px; }
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
}

.logo:hover {
  color: var(--accent);
}

.logo__icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

/* Primary nav */
.primary-nav {
  display: none;
  align-items: center;
  gap: var(--space-1);
}

@media (min-width: 768px) {
  .primary-nav { display: flex; }
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition:
    color var(--duration-fast) var(--ease-smooth),
    background var(--duration-fast) var(--ease-smooth);
  min-height: 44px;
  text-decoration: none;
}

.nav-link:hover,
.nav-link--active {
  color: var(--text);
  background: var(--surface);
}

.nav-link--active {
  color: var(--accent);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: color var(--duration-fast) var(--ease-smooth);
}

.mobile-menu-toggle:hover {
  color: var(--text);
}

@media (min-width: 768px) {
  .mobile-menu-toggle { display: none; }
}

/* Mobile nav panel */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 64px 0 0 0;
  z-index: var(--z-overlay);
  background: rgba(var(--bg-rgb), 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: var(--space-6) var(--space-4);
  overflow-y: auto;
}

.mobile-nav--open {
  display: block;
  animation: fade-in var(--duration-normal) var(--ease-out);
}

.mobile-nav .nav-link {
  display: flex;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-lg);
  border-radius: var(--radius-lg);
}

/* Header actions (search toggle, etc.) */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* --------------------------------------------------------------------------
   9. HERO SECTION
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding-top: var(--space-16);
  padding-bottom: var(--space-12);
  text-align: center;
  overflow: hidden;
}

@media (min-width: 768px) {
  .hero {
    padding-top: var(--space-20);
    padding-bottom: var(--space-16);
  }
}

@media (min-width: 1024px) {
  .hero {
    padding-top: var(--space-24);
    padding-bottom: var(--space-20);
  }
}

/* Radial glow behind hero */
.hero::before {
  content: '';
  position: absolute;
  top: -30%;
  left: 50%;
  translate: -50% 0;
  width: 800px;
  height: 600px;
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--accent) 12%, transparent) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

.hero__content {
  position: relative;
  z-index: var(--z-base);
  max-width: 800px;
  margin-inline: auto;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  margin-bottom: var(--space-6);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-subtle);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: var(--radius-full);
}

.hero__title {
  margin-bottom: var(--space-6);
  font-size: var(--text-5xl);
  line-height: var(--leading-none);
}

@media (min-width: 768px) {
  .hero__title { font-size: var(--text-6xl); }
}

@media (min-width: 1024px) {
  .hero__title { font-size: var(--text-7xl); }
}

.hero__subtitle {
  max-width: 560px;
  margin-inline: auto;
  margin-bottom: var(--space-8);
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}

/* --------------------------------------------------------------------------
   10. STATS BAR
   -------------------------------------------------------------------------- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  max-width: 600px;
  margin-inline: auto;
  margin-top: var(--space-10);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
}

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

.stat-item__value {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  letter-spacing: var(--tracking-wide);
  color: var(--accent);
  line-height: var(--leading-none);
}

@media (min-width: 768px) {
  .stat-item__value { font-size: var(--text-4xl); }
}

.stat-item__label {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   11. SEARCH BAR
   -------------------------------------------------------------------------- */
.search-bar {
  position: relative;
  max-width: 480px;
  margin-inline: auto;
}

.search-bar__icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  translate: 0 -50%;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-bar__input {
  width: 100%;
  height: 48px;
  padding: 0 var(--space-4) 0 calc(var(--space-4) + 18px + var(--space-3));
  font-size: var(--text-sm);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  transition:
    border-color var(--duration-fast) var(--ease-smooth),
    box-shadow var(--duration-fast) var(--ease-smooth);
}

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

.search-bar__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-bar__kbd {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  translate: 0 -50%;
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  line-height: 1;
}

/* Search results dropdown */
.search-results {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  z-index: var(--z-overlay);
  display: none;
}

.search-results--open {
  display: block;
  animation: fade-in var(--duration-fast) var(--ease-out);
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: background var(--duration-fast) var(--ease-smooth);
  min-height: 44px;
}

.search-result-item:hover,
.search-result-item--active {
  background: var(--surface-2);
  color: var(--text);
}

/* --------------------------------------------------------------------------
   12. CARDS (TOOL CARDS)
   -------------------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .card-grid { gap: var(--space-5); }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition:
    translate var(--duration-slow) var(--ease-out),
    border-color var(--duration-normal) var(--ease-smooth),
    box-shadow var(--duration-normal) var(--ease-smooth);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}

.card:hover {
  translate: 0 -4px;
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
}

.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Accent stripe on top edge */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-smooth);
}

.card:hover::before {
  opacity: 1;
}

.card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: var(--space-4);
  font-size: var(--text-2xl);
  background: var(--accent-subtle);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.card__title {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  line-height: var(--leading-snug);
  color: var(--text);
  margin-bottom: var(--space-2);
}

.card__description {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--leading-normal);
  flex: 1;
}

.card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.card__tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-subtle);
  border-radius: var(--radius-sm);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

/* Tool card variant (links) */
.tool-card {
  text-decoration: none;
  color: inherit;
}

/* --------------------------------------------------------------------------
   13. CATEGORY SECTIONS
   -------------------------------------------------------------------------- */
.category-section {
  position: relative;
}

.category-section + .category-section {
  margin-top: var(--space-4);
}

/* Radial glow behind category header */
.category-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.category-header::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -40px;
  translate: 0 -50%;
  width: 200px;
  height: 200px;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--accent) 8%, transparent) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

.category-header__icon {
  position: relative;
  z-index: var(--z-base);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  font-size: var(--text-2xl);
  background: var(--accent-subtle);
  border: 1px solid color-mix(in srgb, var(--accent) 15%, transparent);
  border-radius: var(--radius-lg);
  flex-shrink: 0;
}

.category-header__text {
  position: relative;
  z-index: var(--z-base);
}

.category-header__title {
  font-family: var(--font-body);
  font-size: var(--text-xl);
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  line-height: var(--leading-tight);
  color: var(--text);
}

.category-header__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding-inline: var(--space-2);
  margin-left: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-subtle);
  border-radius: var(--radius-full);
  line-height: 1;
  vertical-align: middle;
}

.category-header__subtitle {
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Category accent color overrides for cards within section */
.category-section[data-accent="lime"]        { --accent: var(--accent-lime);   }
.category-section[data-accent="orange"]      { --accent: var(--accent-orange); }
.category-section[data-accent="violet"]      { --accent: var(--accent-violet); }
.category-section[data-accent="cyan"]        { --accent: var(--accent-cyan);   }
.category-section[data-accent="rose"]        { --accent: var(--accent-rose);   }
.category-section[data-accent="gold"]        { --accent: var(--accent-gold);   }
.category-section[data-accent="blue"]        { --accent: var(--accent-blue);   }

/* --------------------------------------------------------------------------
   14. TOOL PAGE LAYOUT
   -------------------------------------------------------------------------- */

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding-block: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-smooth);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.breadcrumb a:hover {
  color: var(--text);
}

.breadcrumb__sep {
  color: var(--text-muted);
  opacity: 0.5;
  user-select: none;
}

.breadcrumb__current {
  color: var(--text-secondary);
}

/* Tool header */
.tool-header {
  position: relative;
  padding-top: var(--space-4);
  padding-bottom: var(--space-8);
  overflow: hidden;
}

/* Glow behind tool header */
.tool-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  translate: -50% 0;
  width: 600px;
  height: 400px;
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--accent) 8%, transparent) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

.tool-header__content {
  position: relative;
  z-index: var(--z-base);
}

.tool-header__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: var(--space-4);
  font-size: var(--text-3xl);
  background: var(--accent-subtle);
  border: 1px solid color-mix(in srgb, var(--accent) 15%, transparent);
  border-radius: var(--radius-xl);
}

.tool-header__title {
  margin-bottom: var(--space-3);
  font-size: var(--text-4xl);
}

@media (min-width: 768px) {
  .tool-header__title { font-size: var(--text-5xl); }
}

.tool-header__description {
  max-width: 640px;
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

/* Tool body */
.tool-body {
  display: grid;
  gap: var(--space-6);
  padding-bottom: var(--space-12);
}

@media (min-width: 768px) {
  .tool-body {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
}

/* Single-column tool body */
.tool-body--single {
  grid-template-columns: 1fr;
  max-width: var(--container-md);
}

/* Tool input panel */
.tool-inputs {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.tool-inputs__section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.tool-inputs__section-title {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-muted);
}

/* Tool results panel */
.tool-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Results card */
.result-card {
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.result-card--highlight {
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  background: color-mix(in srgb, var(--accent) 3%, var(--surface));
}

.result-label {
  display: block;
  margin-bottom: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
}

.result-value {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  letter-spacing: var(--tracking-wide);
  line-height: var(--leading-none);
  color: var(--text);
}

@media (min-width: 768px) {
  .result-value { font-size: var(--text-5xl); }
}

.result-value--accent {
  color: var(--accent);
}

.result-value--sm {
  font-size: var(--text-2xl);
}

.result-unit {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  margin-left: var(--space-1);
}

.result-note {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Results grid (multiple results side by side) */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
}

/* Color-coded category badges inside results */
.result-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-full);
  line-height: var(--leading-snug);
}

.result-badge--underweight  { color: var(--accent-blue);   background: color-mix(in srgb, var(--accent-blue) 12%, transparent);   }
.result-badge--normal       { color: var(--accent-lime);   background: color-mix(in srgb, var(--accent-lime) 12%, transparent);   }
.result-badge--overweight   { color: var(--accent-orange); background: color-mix(in srgb, var(--accent-orange) 12%, transparent); }
.result-badge--obese        { color: var(--accent-rose);   background: color-mix(in srgb, var(--accent-rose) 12%, transparent);   }
.result-badge--success      { color: var(--success);       background: color-mix(in srgb, var(--success) 12%, transparent);       }
.result-badge--warning      { color: var(--warning);       background: color-mix(in srgb, var(--warning) 12%, transparent);       }
.result-badge--error        { color: var(--error);         background: color-mix(in srgb, var(--error) 12%, transparent);         }

/* --------------------------------------------------------------------------
   15. BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  border-radius: var(--radius-lg);
  min-height: 44px;
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-smooth),
    color var(--duration-fast) var(--ease-smooth),
    border-color var(--duration-fast) var(--ease-smooth),
    box-shadow var(--duration-fast) var(--ease-smooth),
    translate var(--duration-fast) var(--ease-smooth),
    opacity var(--duration-fast) var(--ease-smooth);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active:not(:disabled) {
  translate: 0 1px;
}

.btn:disabled,
.btn--disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Primary */
.btn--primary {
  color: var(--text-inverse);
  background: var(--accent);
}

.btn--primary:hover {
  background: color-mix(in srgb, var(--accent) 85%, white);
  box-shadow: var(--shadow-glow);
}

/* Ghost / outline */
.btn--ghost {
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-hover);
}

/* Outline accent */
.btn--outline {
  color: var(--accent);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

.btn--outline:hover {
  background: var(--accent-subtle);
  border-color: var(--accent);
}

/* Secondary / subtle */
.btn--secondary {
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.btn--secondary:hover {
  background: var(--surface-3);
  border-color: var(--border-hover);
}

/* Danger */
.btn--danger {
  color: #fff;
  background: var(--error);
}

.btn--danger:hover {
  background: color-mix(in srgb, var(--error) 85%, white);
}

/* Sizes */
.btn--sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  min-height: 36px;
  border-radius: var(--radius-md);
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  min-height: 52px;
  border-radius: var(--radius-xl);
}

/* Full-width */
.btn--block {
  width: 100%;
}

/* Icon-only */
.btn--icon {
  width: 44px;
  height: 44px;
  padding: 0;
}

.btn--icon.btn--sm {
  width: 36px;
  height: 36px;
}

/* Button group */
.btn-group {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   16. FORM ELEMENTS
   -------------------------------------------------------------------------- */

/* Form group */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.form-label--required::after {
  content: ' *';
  color: var(--accent-rose);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--error);
}

/* Text inputs, number inputs, textareas */
.input,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="date"],
textarea {
  width: 100%;
  height: 48px;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition:
    border-color var(--duration-fast) var(--ease-smooth),
    box-shadow var(--duration-fast) var(--ease-smooth);
  min-height: 44px;
}

textarea {
  height: auto;
  min-height: 100px;
  resize: vertical;
}

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

.input:hover,
input:hover,
textarea:hover {
  border-color: var(--border-hover);
}

.input:focus,
input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input--error,
.input:invalid:not(:placeholder-shown) {
  border-color: var(--error);
}

.input--error:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--error) 25%, transparent);
}

/* Select */
.select,
select {
  width: 100%;
  height: 48px;
  padding: var(--space-3) var(--space-4);
  padding-right: var(--space-10);
  font-size: var(--text-base);
  color: var(--text);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  background-size: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition:
    border-color var(--duration-fast) var(--ease-smooth),
    box-shadow var(--duration-fast) var(--ease-smooth);
  min-height: 44px;
}

.select:hover,
select:hover {
  border-color: var(--border-hover);
}

.select:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

select option {
  background: var(--surface);
  color: var(--text);
}

/* Input with unit suffix */
.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group .input,
.input-group input {
  padding-right: var(--space-12);
}

.input-group__suffix {
  position: absolute;
  right: var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  pointer-events: none;
}

.input-group__prefix {
  position: absolute;
  left: var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  pointer-events: none;
}

.input-group--prefix .input,
.input-group--prefix input {
  padding-left: var(--space-10);
}

/* Inline input row */
.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

@media (min-width: 768px) {
  .input-row--3 {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* Radio group */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.radio-option {
  position: relative;
}

.radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-option__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition:
    color var(--duration-fast) var(--ease-smooth),
    background var(--duration-fast) var(--ease-smooth),
    border-color var(--duration-fast) var(--ease-smooth);
  min-height: 44px;
  user-select: none;
}

.radio-option__label:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.radio-option input[type="radio"]:checked + .radio-option__label {
  color: var(--text-inverse);
  background: var(--accent);
  border-color: var(--accent);
}

.radio-option input[type="radio"]:focus-visible + .radio-option__label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Checkbox */
.checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  cursor: pointer;
  user-select: none;
}

.checkbox input[type="checkbox"] {
  position: relative;
  width: 20px;
  height: 20px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background var(--duration-fast) var(--ease-smooth),
    border-color var(--duration-fast) var(--ease-smooth);
}

.checkbox input[type="checkbox"]:hover {
  border-color: var(--border-hover);
}

.checkbox input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 6px;
  width: 5px;
  height: 10px;
  border: 2px solid var(--text-inverse);
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.checkbox input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.checkbox__label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* Range slider */
.range-slider {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

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

.range-slider__value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
}

input[type="range"] {
  width: 100%;
  height: 6px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface-3);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  background: var(--accent);
  border-radius: 50%;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent);
  cursor: pointer;
  transition: box-shadow var(--duration-fast) var(--ease-smooth);
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: var(--accent);
  border-radius: 50%;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent);
  cursor: pointer;
  transition: box-shadow var(--duration-fast) var(--ease-smooth);
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px var(--accent-glow);
}

input[type="range"]:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  min-height: 44px;
  user-select: none;
}

.toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle__track {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  transition:
    background var(--duration-fast) var(--ease-smooth),
    border-color var(--duration-fast) var(--ease-smooth);
  flex-shrink: 0;
}

.toggle__track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--text-muted);
  border-radius: 50%;
  transition:
    translate var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-smooth);
}

.toggle input:checked + .toggle__track {
  background: var(--accent-subtle);
  border-color: var(--accent);
}

.toggle input:checked + .toggle__track::after {
  translate: 20px 0;
  background: var(--accent);
}

.toggle input:focus-visible + .toggle__track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.toggle__label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   17. ACCORDION (details/summary)
   -------------------------------------------------------------------------- */
.accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.accordion + .accordion {
  margin-top: var(--space-2);
}

.accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  min-height: 48px;
  transition: background var(--duration-fast) var(--ease-smooth);
}

.accordion__trigger:hover {
  background: var(--surface-2);
}

.accordion__trigger::after {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform var(--duration-normal) var(--ease-out);
  flex-shrink: 0;
  margin-left: var(--space-4);
}

details[open] > .accordion__trigger::after {
  transform: rotate(-135deg);
}

.accordion__body {
  padding: 0 var(--space-5) var(--space-5);
  background: var(--surface);
}

.accordion__body p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

.accordion__body p + p {
  margin-top: var(--space-3);
}

/* Grouped accordion (stacked) */
.accordion-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.accordion-group .accordion {
  margin-top: 0;
}

/* Info section on tool pages */
.tool-info {
  margin-top: var(--space-8);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
}

.tool-info__title {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  margin-bottom: var(--space-4);
  color: var(--text);
}

/* --------------------------------------------------------------------------
   18. CIRCULAR TIMER
   -------------------------------------------------------------------------- */
.timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
}

.timer__circle {
  position: relative;
  width: 220px;
  height: 220px;
}

@media (min-width: 768px) {
  .timer__circle {
    width: 280px;
    height: 280px;
  }
}

.timer__svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer__track {
  fill: none;
  stroke: var(--surface-3);
  stroke-width: 6;
}

.timer__progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

.timer__display {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.timer__time {
  font-family: var(--font-display);
  font-size: var(--text-6xl);
  letter-spacing: var(--tracking-wide);
  color: var(--text);
  line-height: 1;
}

@media (min-width: 768px) {
  .timer__time { font-size: var(--text-7xl); }
}

.timer__label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.timer__controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.timer__presets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}

/* --------------------------------------------------------------------------
   19. CHART CONTAINER
   -------------------------------------------------------------------------- */
.chart-container {
  position: relative;
  width: 100%;
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.chart-container__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.chart-container__title {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-muted);
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 250px;
}

@media (min-width: 768px) {
  .chart-wrapper { height: 300px; }
}

.chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

/* --------------------------------------------------------------------------
   20. RELATED TOOLS
   -------------------------------------------------------------------------- */
.related-tools {
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
}

.related-tools__title {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  margin-bottom: var(--space-6);
  color: var(--text);
}

.related-tools__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
}

/* --------------------------------------------------------------------------
   21. SITE FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  padding-block: var(--space-12);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

@media (min-width: 768px) {
  .site-footer__inner {
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-12);
  }
}

.site-footer__brand p {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-muted);
  max-width: 300px;
}

.site-footer__heading {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.site-footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.site-footer__links a {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-smooth);
  padding-block: var(--space-1);
}

.site-footer__links a:hover {
  color: var(--text);
}

.site-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}

.site-footer__copy {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.site-footer__social {
  display: flex;
  gap: var(--space-3);
}

.site-footer__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  transition: color var(--duration-fast) var(--ease-smooth);
}

.site-footer__social a:hover {
  color: var(--text);
}

/* --------------------------------------------------------------------------
   22. ANIMATIONS & KEYFRAMES
   -------------------------------------------------------------------------- */
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fade-up {
  from {
    opacity: 0;
    translate: 0 16px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes fade-down {
  from {
    opacity: 0;
    translate: 0 -16px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    translate: 20px 0;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes scale-in {
  from {
    opacity: 0;
    scale: 0.95;
  }
  to {
    opacity: 1;
    scale: 1;
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

@keyframes spin {
  from { rotate: 0deg; }
  to   { rotate: 360deg; }
}

/* Staggered reveal classes */
.reveal {
  opacity: 0;
  animation: fade-up var(--duration-slow) var(--ease-out) forwards;
}

.reveal--delay-1 { animation-delay: 80ms;  }
.reveal--delay-2 { animation-delay: 160ms; }
.reveal--delay-3 { animation-delay: 240ms; }
.reveal--delay-4 { animation-delay: 320ms; }
.reveal--delay-5 { animation-delay: 400ms; }
.reveal--delay-6 { animation-delay: 480ms; }
.reveal--delay-7 { animation-delay: 560ms; }
.reveal--delay-8 { animation-delay: 640ms; }

/* Scroll-triggered (add .is-visible via JS Intersection Observer) */
.scroll-reveal {
  opacity: 0;
  translate: 0 24px;
  transition:
    opacity 0.6s var(--ease-out),
    translate 0.6s var(--ease-out);
}

.scroll-reveal.is-visible {
  opacity: 1;
  translate: 0 0;
}

/* Stagger children via CSS custom property */
.stagger-children > * {
  opacity: 0;
  translate: 0 16px;
  transition:
    opacity 0.4s var(--ease-out),
    translate 0.4s var(--ease-out);
}

.stagger-children.is-visible > *:nth-child(1)  { transition-delay: 0ms;   }
.stagger-children.is-visible > *:nth-child(2)  { transition-delay: 60ms;  }
.stagger-children.is-visible > *:nth-child(3)  { transition-delay: 120ms; }
.stagger-children.is-visible > *:nth-child(4)  { transition-delay: 180ms; }
.stagger-children.is-visible > *:nth-child(5)  { transition-delay: 240ms; }
.stagger-children.is-visible > *:nth-child(6)  { transition-delay: 300ms; }
.stagger-children.is-visible > *:nth-child(7)  { transition-delay: 360ms; }
.stagger-children.is-visible > *:nth-child(8)  { transition-delay: 420ms; }
.stagger-children.is-visible > *:nth-child(9)  { transition-delay: 480ms; }
.stagger-children.is-visible > *:nth-child(10) { transition-delay: 540ms; }
.stagger-children.is-visible > *:nth-child(11) { transition-delay: 600ms; }
.stagger-children.is-visible > *:nth-child(12) { transition-delay: 660ms; }

.stagger-children.is-visible > * {
  opacity: 1;
  translate: 0 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .scroll-reveal,
  .stagger-children > * {
    opacity: 1;
    translate: 0 0;
  }
}

/* --------------------------------------------------------------------------
   23. TABLES
   -------------------------------------------------------------------------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.table {
  width: 100%;
  font-size: var(--text-sm);
  text-align: left;
}

.table th {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: var(--space-3) var(--space-4);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background: var(--surface);
}

/* --------------------------------------------------------------------------
   24. BADGES / TAGS / PILLS
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  line-height: 1;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge--accent {
  color: var(--text-inverse);
  background: var(--accent);
}

.badge--subtle {
  color: var(--accent);
  background: var(--accent-subtle);
}

.badge--outline {
  color: var(--accent);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

.badge--muted {
  color: var(--text-muted);
  background: var(--surface-2);
}

/* Category-colored badges */
.badge--lime    { --accent: var(--accent-lime);   color: var(--accent-lime);   background: color-mix(in srgb, var(--accent-lime) 12%, transparent);   }
.badge--orange  { --accent: var(--accent-orange); color: var(--accent-orange); background: color-mix(in srgb, var(--accent-orange) 12%, transparent); }
.badge--violet  { --accent: var(--accent-violet); color: var(--accent-violet); background: color-mix(in srgb, var(--accent-violet) 12%, transparent); }
.badge--cyan    { --accent: var(--accent-cyan);   color: var(--accent-cyan);   background: color-mix(in srgb, var(--accent-cyan) 12%, transparent);   }
.badge--rose    { --accent: var(--accent-rose);   color: var(--accent-rose);   background: color-mix(in srgb, var(--accent-rose) 12%, transparent);   }
.badge--gold    { --accent: var(--accent-gold);   color: var(--accent-gold);   background: color-mix(in srgb, var(--accent-gold) 12%, transparent);   }
.badge--blue    { --accent: var(--accent-blue);   color: var(--accent-blue);   background: color-mix(in srgb, var(--accent-blue) 12%, transparent);   }

/* --------------------------------------------------------------------------
   25. TOAST / NOTIFICATION
   -------------------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  animation: slide-in-right var(--duration-slow) var(--ease-out);
}

.toast--success { border-left: 3px solid var(--success); }
.toast--warning { border-left: 3px solid var(--warning); }
.toast--error   { border-left: 3px solid var(--error);   }

/* --------------------------------------------------------------------------
   26. LOADING / SKELETON
   -------------------------------------------------------------------------- */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-2) 25%,
    var(--surface-3) 50%,
    var(--surface-2) 75%
  );
  background-size: 200% 100%;
  animation: pulse 2s ease-in-out infinite;
  border-radius: var(--radius-md);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* --------------------------------------------------------------------------
   27. DIVIDERS
   -------------------------------------------------------------------------- */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  border: none;
}

.divider--accent {
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent),
    transparent
  );
  opacity: 0.3;
}

/* --------------------------------------------------------------------------
   28. PROGRESS BAR
   -------------------------------------------------------------------------- */
.progress {
  width: 100%;
  height: 8px;
  background: var(--surface-3);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width var(--duration-slow) var(--ease-out);
}

.progress--sm { height: 4px; }
.progress--lg { height: 12px; }

/* --------------------------------------------------------------------------
   29. TOOLTIP
   -------------------------------------------------------------------------- */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  translate: -50% 0;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease-smooth);
  z-index: var(--z-above);
}

[data-tooltip]:hover::after,
[data-tooltip]:focus::after {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   30. UTILITY CLASSES
   -------------------------------------------------------------------------- */

/* — Display — */
.hidden     { display: none !important; }
.block      { display: block; }
.inline     { display: inline; }
.flex       { display: flex; }
.inline-flex { display: inline-flex; }
.grid       { display: grid; }

/* — Flex utilities — */
.flex-col      { flex-direction: column; }
.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-end      { justify-content: flex-end; }
.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }

/* — Spacing — */
.mt-0  { margin-top: 0; }
.mt-2  { margin-top: var(--space-2); }
.mt-3  { margin-top: var(--space-3); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }

.mb-0  { margin-bottom: 0; }
.mb-2  { margin-bottom: var(--space-2); }
.mb-3  { margin-bottom: var(--space-3); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }

.mx-auto { margin-inline: auto; }

.p-0  { padding: 0; }
.p-2  { padding: var(--space-2); }
.p-3  { padding: var(--space-3); }
.p-4  { padding: var(--space-4); }
.p-5  { padding: var(--space-5); }
.p-6  { padding: var(--space-6); }
.p-8  { padding: var(--space-8); }

.px-4 { padding-inline: var(--space-4); }
.px-6 { padding-inline: var(--space-6); }
.py-4 { padding-block: var(--space-4); }
.py-6 { padding-block: var(--space-6); }
.py-8 { padding-block: var(--space-8); }

/* — Text alignment — */
.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* — Text sizes — */
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }

/* — Font weight — */
.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

/* — Colors — */
.text-primary   { color: var(--text); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }

/* — Width — */
.w-full { width: 100%; }
.max-w-sm  { max-width: var(--container-sm); }
.max-w-md  { max-width: var(--container-md); }
.max-w-lg  { max-width: var(--container-lg); }

/* — Overflow — */
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }

/* — Position — */
.relative { position: relative; }
.absolute { position: absolute; }
.sticky   { position: sticky; }

/* — Border — */
.border      { border: 1px solid var(--border); }
.border-t    { border-top: 1px solid var(--border); }
.border-b    { border-bottom: 1px solid var(--border); }
.rounded-lg  { border-radius: var(--radius-lg); }
.rounded-xl  { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* — Background — */
.bg-surface   { background: var(--surface); }
.bg-surface-2 { background: var(--surface-2); }

/* — Visibility helpers — */
.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;
}

/* — Truncation — */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   31. RESPONSIVE VISIBILITY
   -------------------------------------------------------------------------- */
.hide-mobile {
  display: none;
}

@media (min-width: 768px) {
  .hide-mobile  { display: revert; }
  .hide-tablet  { display: none; }
  .show-mobile  { display: none; }
}

@media (min-width: 1024px) {
  .hide-desktop { display: none; }
  .show-tablet  { display: none; }
}

/* --------------------------------------------------------------------------
   32. ACCESSIBILITY
   -------------------------------------------------------------------------- */

/* Visible focus ring for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Remove outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Skip to content link */
.skip-link {
  position: fixed;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-toast);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-inverse);
  background: var(--accent);
  border-radius: var(--radius-lg);
  transition: top var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
  top: var(--space-4);
}

/* Ensure minimum 44px touch targets on all interactive elements */
@media (pointer: coarse) {
  button,
  a,
  input,
  select,
  textarea,
  summary,
  [role="button"],
  [role="tab"],
  [role="menuitem"] {
    min-height: 44px;
    min-width: 44px;
  }
}

/* --------------------------------------------------------------------------
   33. PRINT STYLES
   -------------------------------------------------------------------------- */
@media print {
  body {
    background: #fff;
    color: #000;
  }

  body::before {
    display: none;
  }

  .site-header,
  .site-footer,
  .search-bar,
  .btn,
  .mobile-menu-toggle,
  .related-tools {
    display: none;
  }

  .card {
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  .result-value {
    color: #000;
  }

  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 0.8em;
    color: #666;
  }
}

/* ==========================================================================
   END — FuelMyLift.com Design System
   ========================================================================== */
