/* =========================================
   UtilityHub Design System
   utilityhub.space — style.css
   Dark-mode-first, OKLCH palette, Geist font
   ========================================= */

/* --- Google Fonts: Geist --- */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

/* =========================================
   1. DESIGN TOKENS (CSS Custom Properties)
   ========================================= */
:root {
  /* --- Colour: Dark theme (default) --- */
  --bg-base:        oklch(10% 0 0);          /* #0f0f0f */
  --bg-surface:     oklch(14% 0 0);          /* #1a1a1a */
  --bg-elevated:    oklch(18% 0 0);          /* #242424 */
  --bg-input:       oklch(16% 0 0);
  --border:         oklch(22% 0 0);
  --border-subtle:  oklch(18% 0 0);

  --accent:         oklch(45% 0.08 195);     /* teal ~#01696f */
  --accent-hover:   oklch(52% 0.09 195);
  --accent-muted:   oklch(45% 0.08 195 / 15%);

  --text-primary:   oklch(85% 0.005 60);     /* warm #cdccca */
  --text-secondary: oklch(65% 0.005 60);
  --text-muted:     oklch(45% 0.005 60);
  --text-inverse:   oklch(10% 0 0);

  --success:        oklch(65% 0.12 145);
  --warning:        oklch(75% 0.14 70);
  --error:          oklch(60% 0.18 25);
  --info:           oklch(60% 0.10 220);

  /* --- Spacing (4px base) --- */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;
  --sp-24: 96px;

  /* --- Typography Scale (clamp, mobile-first) --- */
  --text-xs:   clamp(0.7rem,  1.5vw, 0.75rem);
  --text-sm:   clamp(0.8rem,  2vw,   0.875rem);
  --text-base: clamp(0.9rem,  2.5vw, 1rem);
  --text-md:   clamp(1rem,    3vw,   1.125rem);
  --text-lg:   clamp(1.1rem,  3.5vw, 1.25rem);
  --text-xl:   clamp(1.2rem,  4vw,   1.5rem);
  --text-2xl:  clamp(1.4rem,  5vw,   2rem);
  --text-3xl:  clamp(1.8rem,  6vw,   2.5rem);
  --text-4xl:  clamp(2.2rem,  8vw,   3.5rem);

  --font-body:  'Geist', 'Inter', system-ui, sans-serif;
  --font-mono:  'Geist Mono', 'Fira Code', monospace;

  --leading-tight:  1.2;
  --leading-normal: 1.6;
  --leading-loose:  1.8;

  /* --- Border radius --- */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-full: 9999px;

  /* --- Shadows (dark surface) --- */
  --shadow-sm:  0 1px 3px oklch(0% 0 0 / 40%);
  --shadow-md:  0 4px 12px oklch(0% 0 0 / 50%);
  --shadow-lg:  0 8px 32px oklch(0% 0 0 / 60%);
  --shadow-glow: 0 0 20px oklch(45% 0.08 195 / 20%);

  /* --- Layout --- */
  --max-content: 960px;
  --max-tool:    720px;
  --nav-height:  60px;

  /* --- Transitions --- */
  --transition-fast:   150ms ease;
  --transition-normal: 250ms ease;
}

/* --- Light Theme Override --- */
[data-theme="light"] {
  --bg-base:        oklch(98% 0 0);
  --bg-surface:     oklch(96% 0 0);
  --bg-elevated:    oklch(100% 0 0);
  --bg-input:       oklch(100% 0 0);
  --border:         oklch(88% 0 0);
  --border-subtle:  oklch(93% 0 0);

  --accent:         oklch(40% 0.09 195);
  --accent-hover:   oklch(35% 0.09 195);
  --accent-muted:   oklch(40% 0.09 195 / 10%);

  --text-primary:   oklch(15% 0.005 240);
  --text-secondary: oklch(35% 0.005 240);
  --text-muted:     oklch(55% 0.005 240);
  --text-inverse:   oklch(98% 0 0);

  --shadow-sm:  0 1px 3px oklch(0% 0 0 / 10%);
  --shadow-md:  0 4px 12px oklch(0% 0 0 / 15%);
  --shadow-lg:  0 8px 32px oklch(0% 0 0 / 20%);
  --shadow-glow: 0 0 20px oklch(40% 0.09 195 / 15%);
}

/* =========================================
   2. RESET & BASE
   ========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--bg-base);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--accent-hover); text-decoration: underline; }

h1, h2, h3, h4 {
  line-height: var(--leading-tight);
  font-weight: 600;
  color: var(--text-primary);
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

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

code, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--accent);
}

pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  overflow-x: auto;
  line-height: 1.6;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--sp-8) 0;
}

/* =========================================
   3. LAYOUT
   ========================================= */
.container {
  width: 100%;
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.tool-container {
  width: 100%;
  max-width: var(--max-tool);
  margin: 0 auto;
}

main {
  padding-top: var(--nav-height);
  min-height: calc(100dvh - var(--nav-height));
}

.section { padding: var(--sp-16) 0; }
.section-sm { padding: var(--sp-10) 0; }

/* =========================================
   4. NAVIGATION
   ========================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: oklch(from var(--bg-base) l c h / 90%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 600;
  font-size: var(--text-md);
  color: var(--text-primary);
  text-decoration: none;
}
.nav__logo:hover { color: var(--text-primary); text-decoration: none; }
.nav__logo svg { color: var(--accent); }

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  list-style: none;
}

.nav__links a {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color var(--transition-fast);
}
.nav__links a:hover, .nav__links a.active { color: var(--text-primary); text-decoration: none; }

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

.nav__theme-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  font-size: 16px;
}
.nav__theme-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--accent);
}

.nav__hamburger {
  display: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.nav__hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
  transition: all var(--transition-fast);
}

@media (max-width: 680px) {
  .nav__links { display: none; }
  .nav__links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: var(--sp-6);
    gap: var(--sp-4);
  }
  .nav__hamburger { display: flex; }
}

/* =========================================
   5. HERO
   ========================================= */
.hero {
  padding: var(--sp-24) 0 var(--sp-16);
  text-align: center;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--accent);
  background: var(--accent-muted);
  border: 1px solid var(--accent);
  border-radius: var(--radius-full);
  padding: var(--sp-1) var(--sp-4);
  margin-bottom: var(--sp-6);
  font-weight: 500;
}

.hero__title {
  font-size: var(--text-4xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-5);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.hero__title em {
  font-style: normal;
  color: var(--accent);
}

.hero__subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto var(--sp-8);
  line-height: var(--leading-loose);
}

.hero__stats {
  display: flex;
  justify-content: center;
  gap: var(--sp-8);
  flex-wrap: wrap;
}

.hero__stat {
  text-align: center;
}
.hero__stat-number {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
}
.hero__stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* =========================================
   6. TOOL GRID
   ========================================= */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-4);
}

.tool-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  text-decoration: none;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-muted), transparent);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.tool-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
  text-decoration: none;
}
.tool-card:hover::before { opacity: 1; }

.tool-card__icon {
  width: 40px;
  height: 40px;
  background: var(--accent-muted);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: var(--sp-4);
  position: relative;
}

.tool-card__title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
  position: relative;
}

.tool-card__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-loose);
  flex: 1;
  position: relative;
}

.tool-card__arrow {
  margin-top: var(--sp-4);
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  position: relative;
}

/* Category section headings */
.category-section { margin-bottom: var(--sp-12); }

.category-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.category-header__icon {
  width: 32px;
  height: 32px;
  background: var(--accent-muted);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.category-header__title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}

/* =========================================
   7. TOOL PAGE LAYOUT
   ========================================= */
.tool-page-header {
  padding: var(--sp-12) 0 var(--sp-8);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.breadcrumb__sep { color: var(--border); }
.breadcrumb__current { color: var(--text-secondary); }

.tool-page-header h1 {
  font-size: var(--text-3xl);
  margin-bottom: var(--sp-4);
  letter-spacing: -0.02em;
}

.tool-page-header .intro {
  font-size: var(--text-md);
  color: var(--text-secondary);
  max-width: 600px;
  line-height: var(--leading-loose);
}

/* Tool Panel */
.tool-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--sp-8);
  margin: var(--sp-8) 0;
}

.tool-panel__section {
  margin-bottom: var(--sp-6);
}
.tool-panel__section:last-child { margin-bottom: 0; }

.tool-panel__label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
  display: block;
}

/* Drop zone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-12) var(--sp-8);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  background: var(--bg-input);
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-muted);
}
.dropzone__icon { font-size: 32px; margin-bottom: var(--sp-3); }
.dropzone__title {
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
}
.dropzone__sub {
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.dropzone input[type="file"] { display: none; }

/* Output area */
.tool-output {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  animation: fadeIn 300ms ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tool-output__preview {
  width: 100%;
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-4);
  max-height: 400px;
  object-fit: contain;
  background: repeating-conic-gradient(
    oklch(20% 0 0) 0% 25%, oklch(15% 0 0) 0% 50%
  ) 0 0 / 16px 16px;
}

.tool-stats {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--text-sm);
}

.stat-pill--success { border-color: var(--success); color: var(--success); }
.stat-pill--warning { border-color: var(--warning); color: var(--warning); }

/* Loading state */
.tool-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-12);
  color: var(--text-muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================
   8. FORM ELEMENTS
   ========================================= */
.input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
  outline: none;
}

.input:focus { border-color: var(--accent); }
.input:hover { border-color: var(--accent); }
.input::placeholder { color: var(--text-muted); }

.input--mono { font-family: var(--font-mono); font-size: var(--text-sm); }
.textarea { resize: vertical; min-height: 120px; line-height: var(--leading-loose); }

.input-row {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-end;
}
.input-row .input { flex: 1; }

/* Range slider */
.slider-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

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

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.slider-value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent);
  min-width: 36px;
  text-align: right;
}

/* Toggle */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  cursor: pointer;
}

.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.toggle::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-fast);
}

input[type="checkbox"]:checked + .toggle,
.toggle.on {
  background: var(--accent);
}
input[type="checkbox"]:checked + .toggle::after,
.toggle.on::after {
  transform: translateX(18px);
}
input[type="checkbox"] { display: none; }

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

/* Select */
select.input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: var(--sp-10);
  -webkit-appearance: none;
  appearance: none;
}

/* =========================================
   9. BUTTONS
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: white;
}
.btn--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
  color: white;
  text-decoration: none;
}

.btn--secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn--secondary:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  text-decoration: none;
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn--ghost:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  text-decoration: none;
}

.btn--danger {
  background: var(--error);
  color: white;
}

.btn--lg {
  padding: var(--sp-4) var(--sp-8);
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}

.btn--sm {
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-xs);
}

.btn--full { width: 100%; }

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

.btn-group {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

/* =========================================
   10. AD SLOTS
   ========================================= */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.ad-slot--header { width: 100%; min-height: 90px; margin-bottom: var(--sp-8); }
.ad-slot--below-tool { width: 100%; min-height: 250px; margin-top: var(--sp-8); }
.ad-slot--sidebar { width: 300px; min-height: 600px; flex-shrink: 0; }

/* =========================================
   11. FAQ SECTION
   ========================================= */
.faq { margin: var(--sp-12) 0; }

.faq__title {
  font-size: var(--text-xl);
  margin-bottom: var(--sp-6);
}

.faq__item {
  border-bottom: 1px solid var(--border);
}

.faq__question {
  width: 100%;
  background: none;
  border: none;
  padding: var(--sp-5) 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  text-align: left;
  transition: color var(--transition-fast);
}
.faq__question:hover { color: var(--accent); }

.faq__icon {
  font-size: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}
.faq__item.open .faq__icon { transform: rotate(45deg); color: var(--accent); }

.faq__answer {
  display: none;
  padding-bottom: var(--sp-5);
  color: var(--text-secondary);
  line-height: var(--leading-loose);
}
.faq__item.open .faq__answer { display: block; }

/* =========================================
   12. RELATED TOOLS
   ========================================= */
.related-tools { margin: var(--sp-10) 0; }
.related-tools__title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--sp-5);
}
.related-tools__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-3);
}
.related-tool-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
  text-decoration: none;
}
.related-tool-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* =========================================
   13. AFFILIATE BANNER
   ========================================= */
.affiliate-banner {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-6);
  margin: var(--sp-6) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.affiliate-banner__text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.affiliate-banner__disclaimer {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--sp-1);
}

/* =========================================
   14. BLOG
   ========================================= */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-6);
}

.blog-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  transition: all var(--transition-normal);
  text-decoration: none;
  display: block;
}
.blog-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}

.blog-card__category {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: var(--sp-3);
}

.blog-card__title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--sp-3);
  line-height: var(--leading-tight);
}

.blog-card__excerpt {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-loose);
  margin-bottom: var(--sp-4);
}

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

/* =========================================
   15. FOOTER
   ========================================= */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: var(--sp-12) 0 var(--sp-8);
  margin-top: var(--sp-20);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: var(--sp-8);
  margin-bottom: var(--sp-10);
}

.footer__brand-name {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.footer__brand-name svg { color: var(--accent); }

.footer__tagline {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--leading-loose);
  margin-bottom: var(--sp-4);
}

.footer__col-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--sp-4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.footer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.footer__links a {
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.footer__links a:hover { color: var(--accent); }

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

.footer__copy { font-size: var(--text-xs); color: var(--text-muted); }
.footer__legal { font-size: var(--text-xs); color: var(--text-muted); }
.footer__disclaimer {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-style: italic;
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-subtle);
}

@media (max-width: 768px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer__grid { grid-template-columns: 1fr; }
}

/* =========================================
   16. UTILITY CLASSES
   ========================================= */
.text-accent  { color: var(--accent); }
.text-muted   { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error   { color: var(--error); }
.text-mono    { font-family: var(--font-mono); }
.text-center  { text-align: center; }
.text-sm      { font-size: var(--text-sm); }

.hidden   { display: none !important; }
.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;
}

.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-sm      { gap: var(--sp-3); }
.gap-md      { gap: var(--sp-6); }
.mt-sm       { margin-top: var(--sp-4); }
.mt-md       { margin-top: var(--sp-8); }
.mb-sm       { margin-bottom: var(--sp-4); }
.mb-md       { margin-bottom: var(--sp-8); }

/* =========================================
   17. COLOUR PICKER SPECIFIC
   ========================================= */
.color-swatch {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  cursor: pointer;
}

.color-output-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--sp-3);
}

.color-format-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}
.color-format-card:hover { border-color: var(--accent); }
.color-format-card__label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-1);
}
.color-format-card__value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-primary);
}

/* =========================================
   18. RESPONSIVE TOOL PAGE
   ========================================= */
.tool-page-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--sp-8);
  align-items: start;
}

@media (max-width: 900px) {
  .tool-page-layout { grid-template-columns: 1fr; }
  .ad-slot--sidebar { display: none; }
}

/* =========================================
   19. PROGRESS BAR (for WASM loading)
   ========================================= */
.progress-bar-wrap {
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  height: 6px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: var(--radius-full);
  transition: width var(--transition-normal);
}

/* =========================================
   20. COPY FEEDBACK
   ========================================= */
.copy-btn {
  position: relative;
}
.copy-btn__tooltip {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: white;
  font-size: var(--text-xs);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}
.copy-btn.copied .copy-btn__tooltip { opacity: 1; }
