/*
 * style.css
 * PassGeneratorTool.online
 *
 * Complete design system and component styles.
 * One file — no build step needed for deployment.
 *
 * TABLE OF CONTENTS
 * ─────────────────
 *  1. CSS Custom Properties (Design Tokens)
 *  2. CSS Reset & Base
 *  3. Typography
 *  4. Layout Utilities
 *  5. Skip Link (accessibility)
 *  6. Header & Navigation
 *  7. Hero Section
 *  8. Password Generator Card
 *  9. Strength Meter
 * 10. Tool Grid & Tool Cards
 * 11. Trust Badges
 * 12. How-It-Works Section
 * 13. FAQ Accordion
 * 14. Guide Cards
 * 15. Breadcrumbs
 * 16. Page Layout (inner pages)
 * 17. Buttons
 * 18. Form Controls
 * 19. Footer
 * 20. 404 Page
 * 21. Utility Classes
 * 22. Responsive Breakpoints
 * 23. Reduced Motion
 */

/* ═══════════════════════════════════════════════════════════════
   1. CSS CUSTOM PROPERTIES — DESIGN TOKENS
   ═══════════════════════════════════════════════════════════════ */
:root {
  /* — Background — */
  --bg-page:    #07111f;
  --bg-surface: #0c1929;
  --bg-card:    #0f1e35;
  --bg-card-2:  #132340;
  --bg-input:   #0a1628;
  --bg-hover:   #182e50;

  /* — Borders — */
  --border:       #1a2f52;
  --border-light: #1e3660;
  --border-focus: #4a80ff;

  /* — Brand / Primary — */
  --primary:       #4a80ff;
  --primary-light: #6699ff;
  --primary-dark:  #2c5ee8;
  --primary-glow:  rgba(74, 128, 255, 0.18);
  --primary-10:    rgba(74, 128, 255, 0.1);

  /* — Secondary / Accent — */
  --accent:      #00d8f0;
  --accent-glow: rgba(0, 216, 240, 0.12);

  /* — Text — */
  --text:         #e0eaff;
  --text-2:       #a0b5d8;
  --text-muted:   #5c7498;
  --text-on-dark: #ffffff;

  /* — Status — */
  --success: #34d399;
  --warning: #fbbf24;
  --error:   #f87171;
  --info:    #60a5fa;

  /* — Strength Levels — */
  --s1: #f87171; /* Very Weak  */
  --s2: #fb923c; /* Weak       */
  --s3: #facc15; /* Fair       */
  --s4: #86efac; /* Strong     */
  --s5: #4ade80; /* Very Strong */

  /* — Typography — */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
               'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code',
               'Consolas', 'Courier New', monospace;

  /* — Font Sizes (fluid scale) — */
  --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 */

  /* — Spacing — */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;

  /* — Border Radius — */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-full: 9999px;

  /* — Shadows — */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.35);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.45);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 24px var(--primary-glow);

  /* — Transitions — */
  --t-fast: 0.15s ease;
  --t-base: 0.2s ease;
  --t-slow: 0.3s ease;

  /* — Layout — */
  --max-w:        1200px;
  --max-w-narrow: 720px;
  --header-h:     64px;
  --section-gap:  var(--sp-20);
}

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

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

ul, ol { list-style: none; }

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--text); text-decoration: underline; }
a:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
  border-radius: 3px;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
}
button:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
}

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

code, pre { font-family: var(--font-mono); }
pre { white-space: pre-wrap; word-break: break-word; }

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

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

/* ═══════════════════════════════════════════════════════════════
   3. TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-on-dark);
  letter-spacing: -0.02em;
}

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

p { max-width: 68ch; }

.lead {
  font-size: var(--text-lg);
  color: var(--text-2);
  max-width: 56ch;
}

/* ═══════════════════════════════════════════════════════════════
   5. SKIP LINK
   ═══════════════════════════════════════════════════════════════ */
.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: var(--sp-4);
  z-index: 9999;
  padding: var(--sp-2) var(--sp-4);
  background: var(--primary);
  color: #fff;
  border-radius: var(--r-md);
  font-weight: 600;
  transform: translateY(-200%);
  transition: transform var(--t-base);
}
.skip-link:focus { transform: translateY(0); }

/* ═══════════════════════════════════════════════════════════════
   6. HEADER & NAVIGATION
   ═══════════════════════════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(7, 17, 31, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-6);
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-8);
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
  flex-shrink: 0;
}
.site-logo:hover { text-decoration: none; }

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.logo-text {
  font-weight: 800;
  font-size: var(--text-lg);
  color: var(--text-on-dark);
  letter-spacing: -0.03em;
}
.logo-text span { color: var(--primary); }

/* Primary Nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  flex: 1;
}

/* Nav items with dropdowns */
.nav-has-dropdown {
  position: relative;
}

.nav-dropdown-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-2);
  background: none;
  transition: color var(--t-fast), background var(--t-fast);
  white-space: nowrap;
}
.nav-dropdown-btn::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform var(--t-fast);
  margin-top: 1px;
}
.nav-has-dropdown.is-open .nav-dropdown-btn::after { transform: rotate(180deg); }
.nav-dropdown-btn:hover, .nav-has-dropdown.is-open .nav-dropdown-btn {
  color: var(--text);
  background: var(--primary-10);
}

/* Simple nav links (no dropdown) */
.nav-link {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: color var(--t-fast), background var(--t-fast);
  white-space: nowrap;
}
.nav-link:hover, .nav-link.is-active, .nav-link[aria-current="page"] {
  color: var(--text);
  background: var(--primary-10);
  text-decoration: none;
}

/* Dropdown panel */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-2);
  display: none;
  z-index: 200;
}
.nav-has-dropdown.is-open .nav-dropdown { display: block; }

.nav-dropdown a {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
  color: var(--text-2);
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-dropdown a:hover, .nav-dropdown a[aria-current="page"] {
  background: var(--primary-10);
  color: var(--text);
  text-decoration: none;
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  gap: 5px;
  border-radius: var(--r-sm);
  background: none;
  border: 1px solid var(--border);
  margin-left: auto;
  flex-shrink: 0;
  transition: background var(--t-fast);
}
.nav-toggle:hover { background: var(--bg-hover); }
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: transform var(--t-base), opacity var(--t-base);
  transform-origin: center;
}
.nav-toggle.is-open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Overlay for mobile nav */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}

/* ═══════════════════════════════════════════════════════════════
   7. HERO SECTION
   ═══════════════════════════════════════════════════════════════ */
.hero {
  padding: var(--sp-16) var(--sp-6) var(--sp-8);
  text-align: center;
  max-width: var(--max-w);
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  background: var(--primary-10);
  border: 1px solid rgba(74,128,255,0.3);
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-4);
}

.hero h1 {
  font-size: clamp(var(--text-4xl), 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: var(--sp-4);
  background: linear-gradient(135deg, #fff 0%, #a0c4ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: var(--text-lg);
  color: var(--text-2);
  max-width: 52ch;
  margin: 0 auto var(--sp-8);
  line-height: 1.65;
}

/* ═══════════════════════════════════════════════════════════════
   8. PASSWORD GENERATOR CARD
   ═══════════════════════════════════════════════════════════════ */
.generator-section {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.generator-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(74,128,255,0.06);
  position: relative;
  overflow: hidden;
}

/* Subtle top gradient glow */
.generator-card::before {
  content: '';
  position: absolute;
  inset-x: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.5;
}

/* — Password Output — */
.password-output {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-6);
  transition: border-color var(--t-base);
}
.password-output:focus-within { border-color: var(--border-focus); }

#password-display {
  flex: 1;
  font-family: var(--font-mono);
  font-size: clamp(var(--text-base), 2vw, var(--text-xl));
  font-weight: 500;
  color: var(--text);
  word-break: break-all;
  line-height: 1.4;
  min-height: 1.5em;
  letter-spacing: 0.03em;
  user-select: all;
  cursor: text;
}

.output-actions {
  display: flex;
  gap: var(--sp-2);
  flex-shrink: 0;
}

/* — Strength Meter (inside card) — */
.strength-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.strength-bar-wrap {
  position: relative;
  height: 6px;
  background: var(--bg-input);
  border-radius: var(--r-full);
  overflow: hidden;
}
.strength-bar-fill {
  height: 100%;
  width: 0;
  border-radius: var(--r-full);
  transition: width var(--t-slow), background-color var(--t-slow);
}

.strength-info {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--text-sm);
  white-space: nowrap;
  flex-shrink: 0;
}

.strength-label-text {
  font-weight: 600;
  min-width: 80px;
  text-align: right;
}
.strength-1 { color: var(--s1); }
.strength-2 { color: var(--s2); }
.strength-3 { color: var(--s3); }
.strength-4 { color: var(--s4); }
.strength-5 { color: var(--s5); }

.strength-bits {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

/* — Options Section — */
.options-section { margin-bottom: var(--sp-6); }

.options-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: var(--sp-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Length slider */
.length-control {
  margin-bottom: var(--sp-5);
}

.length-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-2);
}

.length-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-2);
}

.length-value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--primary-light);
  background: var(--primary-10);
  padding: 2px var(--sp-2);
  border-radius: var(--r-sm);
  min-width: 40px;
  text-align: center;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--border);
  border-radius: var(--r-full);
  outline: none;
  cursor: pointer;
  transition: background var(--t-fast);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 0 2px var(--primary);
  cursor: pointer;
  transition: box-shadow var(--t-fast), transform var(--t-fast);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 0 2px var(--primary);
  cursor: pointer;
}
input[type="range"]:focus-visible { outline: 2px solid var(--border-focus); }

/* Checkboxes grid */
.char-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
}

.option-toggle {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  user-select: none;
  transition: border-color var(--t-fast), background var(--t-fast);
  font-size: var(--text-sm);
  color: var(--text-2);
}
.option-toggle:hover {
  border-color: var(--primary);
  background: var(--primary-10);
}
.option-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}
.option-toggle input:checked + span { color: var(--text); }

/* Advanced toggle */
.advanced-toggle-btn {
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  width: 100%;
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: center;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
  margin-top: var(--sp-3);
}
.advanced-toggle-btn:hover {
  color: var(--text-2);
  border-color: var(--primary);
  background: var(--primary-10);
}

.advanced-panel {
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.advanced-panel label {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-2);
  margin-bottom: var(--sp-1);
}

.advanced-panel input[type="text"] {
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: var(--text-sm);
  transition: border-color var(--t-fast);
}
.advanced-panel input[type="text"]:focus {
  outline: none;
  border-color: var(--border-focus);
}

/* — Generate CTA area — */
.generate-area {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}

/* — Composition Stats — */
.comp-stats {
  display: flex;
  gap: var(--sp-4);
  justify-content: center;
  flex-wrap: wrap;
  padding: var(--sp-4);
  background: var(--bg-input);
  border-radius: var(--r-md);
  margin-top: var(--sp-4);
  font-size: var(--text-xs);
}
.comp-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
}
.comp-stat-value {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--primary-light);
}
.comp-stat-label { color: var(--text-muted); }

/* — Privacy Note — */
.privacy-note {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-5);
  padding: var(--sp-3) var(--sp-4);
  background: rgba(0, 216, 240, 0.06);
  border: 1px solid rgba(0, 216, 240, 0.2);
  border-radius: var(--r-md);
  font-size: var(--text-xs);
  color: var(--text-2);
  line-height: 1.5;
}
.privacy-note .lock-icon {
  flex-shrink: 0;
  font-size: var(--text-base);
}

/* — Crack Time inside card — */
.crack-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) 0;
  font-size: var(--text-xs);
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: var(--sp-2);
}
.crack-time-value {
  font-family: var(--font-mono);
  color: var(--text-2);
  font-weight: 600;
}

/* — Bulk Section — */
.bulk-toggle-btn {
  margin-top: var(--sp-3);
  width: 100%;
  padding: var(--sp-2) var(--sp-4);
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: all var(--t-fast);
}
.bulk-toggle-btn:hover {
  color: var(--text-2);
  border-color: var(--border-light);
  background: var(--bg-hover);
}

.bulk-section {
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.bulk-controls {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}

.bulk-controls label {
  font-size: var(--text-sm);
  color: var(--text-2);
}

.bulk-controls input[type="number"] {
  width: 70px;
  padding: var(--sp-1) var(--sp-2);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: var(--text-sm);
  text-align: center;
}

.bulk-list {
  max-height: 300px;
  overflow-y: auto;
  border-radius: var(--r-sm);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.bulk-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--border);
  gap: var(--sp-3);
}
.bulk-list li:last-child { border-bottom: none; }
.bulk-list .bulk-password {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text);
  word-break: break-all;
}

/* ═══════════════════════════════════════════════════════════════
   10. TOOL GRID & TOOL CARDS
   ═══════════════════════════════════════════════════════════════ */
.section {
  padding: var(--section-gap) var(--sp-6);
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-header {
  margin-bottom: var(--sp-10);
  text-align: center;
}
.section-header h2 {
  margin-bottom: var(--sp-3);
}
.section-header p {
  color: var(--text-2);
  margin: 0 auto;
}

.section-divider {
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: var(--r-full);
  margin: var(--sp-4) auto 0;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-5);
}

.tool-grid--3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tool-grid--2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

.tool-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.tool-card::after {
  content: '';
  position: absolute;
  inset-x: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-base);
}
.tool-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--primary-10);
  transform: translateY(-2px);
  text-decoration: none;
}
.tool-card:hover::after { transform: scaleX(1); }

.tool-card-icon {
  width: 44px;
  height: 44px;
  background: var(--primary-10);
  border: 1px solid rgba(74,128,255,0.25);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-4);
  flex-shrink: 0;
}
.tool-card-icon svg { width: 22px; height: 22px; color: var(--primary-light); }

.tool-card-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-on-dark);
  margin-bottom: var(--sp-2);
  line-height: 1.3;
}

.tool-card-desc {
  font-size: var(--text-sm);
  color: var(--text-2);
  line-height: 1.6;
  flex: 1;
}

.tool-card-arrow {
  align-self: flex-start;
  margin-top: var(--sp-4);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  transition: gap var(--t-fast);
}
.tool-card:hover .tool-card-arrow { gap: var(--sp-2); }

/* ═══════════════════════════════════════════════════════════════
   11. TRUST BADGES
   ═══════════════════════════════════════════════════════════════ */
.trust-section {
  padding: var(--sp-12) var(--sp-6);
  max-width: var(--max-w);
  margin: 0 auto;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-4);
}

.trust-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-5);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.trust-icon {
  font-size: var(--text-2xl);
  line-height: 1;
  flex-shrink: 0;
}

.trust-item h3 {
  font-size: var(--text-base);
  margin-bottom: var(--sp-1);
}
.trust-item p {
  font-size: var(--text-sm);
  color: var(--text-2);
}

/* ═══════════════════════════════════════════════════════════════
   12. HOW IT WORKS
   ═══════════════════════════════════════════════════════════════ */
.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-6);
  counter-reset: steps;
}

.how-step {
  position: relative;
  padding: var(--sp-6);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  counter-increment: steps;
}

.how-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: var(--sp-3);
}

.how-step h3 {
  font-size: var(--text-base);
  margin-bottom: var(--sp-2);
}
.how-step p {
  font-size: var(--text-sm);
  color: var(--text-2);
}

/* ═══════════════════════════════════════════════════════════════
   13. FAQ ACCORDION
   ═══════════════════════════════════════════════════════════════ */
.faq-section {
  max-width: var(--max-w-narrow);
  margin: 0 auto;
  padding: var(--section-gap) var(--sp-6);
}

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

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color var(--t-base);
}
.faq-item.is-open { border-color: var(--border-light); }

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-6);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-on-dark);
  text-align: left;
  background: none;
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast);
  gap: var(--sp-4);
}
.faq-question:hover { background: var(--bg-hover); }

.faq-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform var(--t-base), color var(--t-base);
}
.faq-item.is-open .faq-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.faq-answer {
  padding: 0 var(--sp-6) var(--sp-5);
  font-size: var(--text-sm);
  color: var(--text-2);
  line-height: 1.75;
}
.faq-answer p + p { margin-top: var(--sp-3); }
.faq-answer a { color: var(--primary-light); }
.faq-answer a:hover { color: var(--text); }

/* ═══════════════════════════════════════════════════════════════
   14. GUIDE CARDS
   ═══════════════════════════════════════════════════════════════ */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-5);
}

.guide-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  text-decoration: none;
  transition: border-color var(--t-base), transform var(--t-base), box-shadow var(--t-base);
}
.guide-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.guide-tag {
  display: inline-block;
  padding: 2px var(--sp-2);
  background: var(--primary-10);
  border-radius: var(--r-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-3);
}

.guide-card h3 {
  font-size: var(--text-base);
  color: var(--text-on-dark);
  margin-bottom: var(--sp-2);
  line-height: 1.35;
  flex: 1;
}

.guide-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--sp-4);
}

/* ═══════════════════════════════════════════════════════════════
   15. BREADCRUMBS
   ═══════════════════════════════════════════════════════════════ */
.breadcrumbs {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-6) 0;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.breadcrumb-list a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--t-fast);
}
.breadcrumb-list a:hover { color: var(--text-2); }

.breadcrumb-sep {
  color: var(--border-light);
  user-select: none;
}

.breadcrumb-current { color: var(--text-2); }

/* ═══════════════════════════════════════════════════════════════
   16. PAGE LAYOUT (inner pages)
   ═══════════════════════════════════════════════════════════════ */
.page-hero {
  padding: var(--sp-12) var(--sp-6) var(--sp-8);
  max-width: var(--max-w);
  margin: 0 auto;
}

.page-hero h1 { margin-bottom: var(--sp-3); }

.page-hero .lead {
  font-size: var(--text-lg);
  color: var(--text-2);
  max-width: 56ch;
}

.page-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-6) var(--section-gap);
}

.page-content h2 { margin-top: var(--sp-10); margin-bottom: var(--sp-4); }
.page-content h3 { margin-top: var(--sp-6); margin-bottom: var(--sp-3); }
.page-content p  { margin-bottom: var(--sp-4); color: var(--text-2); }
.page-content ul, .page-content ol { padding-left: var(--sp-6); margin-bottom: var(--sp-4); }
.page-content ul { list-style: disc; }
.page-content ol { list-style: decimal; }
.page-content li { margin-bottom: var(--sp-2); color: var(--text-2); font-size: var(--text-base); }
.page-content a { color: var(--primary-light); }

/* Article layout */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--sp-12);
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-6) var(--section-gap);
  align-items: start;
}

.article-body h2 { margin-top: var(--sp-10); margin-bottom: var(--sp-4); }
.article-body h3 { margin-top: var(--sp-6); margin-bottom: var(--sp-3); }
.article-body p  { margin-bottom: var(--sp-4); color: var(--text-2); line-height: 1.75; }
.article-body ul, .article-body ol { padding-left: var(--sp-6); margin-bottom: var(--sp-4); }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: var(--sp-2); color: var(--text-2); }

.article-sidebar {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-6));
}

/* Callout boxes */
.callout {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-md);
  margin: var(--sp-6) 0;
  display: flex;
  gap: var(--sp-3);
  font-size: var(--text-sm);
  line-height: 1.65;
}
.callout-icon { font-size: var(--text-lg); flex-shrink: 0; }
.callout--info {
  background: rgba(96,165,250,0.08);
  border-left: 3px solid var(--info);
}
.callout--warning {
  background: rgba(251,191,36,0.08);
  border-left: 3px solid var(--warning);
}
.callout--success {
  background: rgba(52,211,153,0.08);
  border-left: 3px solid var(--success);
}

/* Data table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  margin: var(--sp-6) 0;
}
.data-table th {
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-card-2);
  color: var(--text);
  font-weight: 600;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-hover); }

/* Code blocks */
.code-block {
  background: #0a1220;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  margin: var(--sp-6) 0;
}
.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-2) var(--sp-4);
  background: var(--bg-card-2);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.code-block pre {
  padding: var(--sp-5);
  overflow-x: auto;
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--text-2);
}
.code-block code { color: #a5f3fc; }

/* ═══════════════════════════════════════════════════════════════
   17. BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast),
              border-color var(--t-fast), box-shadow var(--t-fast),
              transform var(--t-fast);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

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

/* Primary */
.btn--primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(74,128,255,0.3);
}
.btn--primary:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
  box-shadow: 0 4px 16px rgba(74,128,255,0.4);
  transform: translateY(-1px);
  text-decoration: none;
  color: #fff;
}
.btn--primary:active { transform: translateY(0); }

/* Large primary */
.btn--lg {
  padding: var(--sp-4) var(--sp-8);
  font-size: var(--text-base);
  border-radius: var(--r-lg);
  flex: 1;
}

/* Secondary */
.btn--secondary {
  background: var(--bg-card-2);
  color: var(--text-2);
  border-color: var(--border);
}
.btn--secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
  color: var(--text);
  text-decoration: none;
}

/* Ghost */
.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn--ghost:hover {
  background: var(--primary-10);
  color: var(--primary-light);
  border-color: var(--primary);
  text-decoration: none;
}

/* Small */
.btn--sm {
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--text-xs);
  border-radius: var(--r-sm);
}

/* Icon-only (copy, regenerate) */
.btn--icon {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
}

/* Copied state */
.btn--copied {
  background: var(--success) !important;
  border-color: var(--success) !important;
  color: #fff !important;
}

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

/* ═══════════════════════════════════════════════════════════════
   18. FORM CONTROLS
   ═══════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: var(--sp-5); }

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: var(--sp-2);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: var(--text-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(74,128,255,0.15);
}
.form-input::placeholder { color: var(--text-muted); }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%235c7498' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
  cursor: pointer;
}

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

/* Password input (for checker pages) */
.password-input-wrap {
  position: relative;
}
.password-input-wrap .form-input {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  padding-right: 120px;
}
.password-input-actions {
  position: absolute;
  right: var(--sp-2);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: var(--sp-1);
}

/* ═══════════════════════════════════════════════════════════════
   19. FOOTER
   ═══════════════════════════════════════════════════════════════ */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  margin-top: var(--section-gap);
}

.footer-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp-16) var(--sp-6) var(--sp-12);
  display: grid;
  grid-template-columns: 240px repeat(4, 1fr);
  gap: var(--sp-10);
  align-items: start;
}

.footer-brand .site-logo {
  margin-bottom: var(--sp-4);
}

.footer-tagline {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: var(--sp-4);
}

.footer-privacy-note {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--success);
  background: rgba(52,211,153,0.06);
  border: 1px solid rgba(52,211,153,0.2);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-3);
}

.footer-col h4 {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--sp-4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.footer-col ul { display: flex; flex-direction: column; gap: var(--sp-2); }

.footer-col a {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--t-fast);
}
.footer-col a:hover { color: var(--text-2); text-decoration: none; }

.footer-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-6);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.footer-bottom-text {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.footer-legal-links {
  display: flex;
  gap: var(--sp-5);
}
.footer-legal-links a {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--t-fast);
}
.footer-legal-links a:hover { color: var(--text-2); }

/* Scroll to top */
#scroll-top {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: 50;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  box-shadow: var(--shadow-md);
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
#scroll-top:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════════════
   20. 404 PAGE
   ═══════════════════════════════════════════════════════════════ */
.error-page {
  min-height: calc(100vh - var(--header-h) - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-16) var(--sp-6);
}

.error-code {
  font-size: 8rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--sp-4);
  letter-spacing: -0.05em;
}

.error-title { font-size: var(--text-3xl); margin-bottom: var(--sp-4); }
.error-desc  { color: var(--text-2); margin: 0 auto var(--sp-8); max-width: 44ch; }

.error-tools {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  justify-content: center;
  margin-top: var(--sp-6);
}

/* ═══════════════════════════════════════════════════════════════
   21. UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}
.container--narrow { max-width: var(--max-w-narrow); }

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
}
.badge--primary { background: var(--primary-10); color: var(--primary-light); }
.badge--success { background: rgba(52,211,153,0.1); color: var(--success); }
.badge--warning { background: rgba(251,191,36,0.1); color: var(--warning); }

/* Divider with label */
.divider-label {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: var(--sp-6) 0;
}
.divider-label::before, .divider-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ═══════════════════════════════════════════════════════════════
   22. RESPONSIVE BREAKPOINTS — MOBILE FIRST
   ═══════════════════════════════════════════════════════════════ */

/* ── 320-374px: very small mobile ── */
@media (max-width: 374px) {
  :root { --sp-6: 1rem; }
  .char-options-grid { grid-template-columns: 1fr; }
  .generate-area { flex-direction: column; }
  .generator-card { padding: var(--sp-5); }
}

/* ── Up to 767px: all mobile ── */
@media (max-width: 767px) {
  :root {
    --section-gap: var(--sp-16);
  }

  /* Header */
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: var(--bg-surface);
    flex-direction: column;
    gap: var(--sp-2);
    padding: var(--sp-6);
    overflow-y: auto;
    z-index: 100;
    border-top: 1px solid var(--border);
  }
  .site-nav.nav-open { display: flex; }
  .nav-has-dropdown { width: 100%; }
  .nav-dropdown-btn { width: 100%; justify-content: space-between; padding: var(--sp-3) var(--sp-4); }
  .nav-dropdown {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    background: var(--bg-input);
    border-radius: var(--r-md);
    margin-top: var(--sp-2);
    padding: var(--sp-2);
  }
  .nav-has-dropdown.is-open .nav-dropdown { display: block; }
  .nav-link { width: 100%; padding: var(--sp-3) var(--sp-4); }

  /* Hero */
  .hero { padding: var(--sp-10) var(--sp-4) var(--sp-6); }

  /* Generator */
  .generator-section { padding: 0 var(--sp-4); }
  .generator-card { padding: var(--sp-5); border-radius: var(--r-lg); }
  .password-output { padding: var(--sp-3) var(--sp-4); }
  #password-display { font-size: var(--text-base); }
  .char-options-grid { grid-template-columns: 1fr; }
  .output-actions { flex-direction: column; gap: var(--sp-1); }
  .strength-row { grid-template-columns: 1fr; }
  .strength-info { justify-content: flex-start; }
  .generate-area { flex-direction: column; }
  .comp-stats { gap: var(--sp-3); }

  /* Sections */
  .section { padding: var(--sp-12) var(--sp-4); }
  .faq-section { padding: var(--sp-12) var(--sp-4); }
  .trust-section { padding: var(--sp-8) var(--sp-4); }
  .page-hero { padding: var(--sp-8) var(--sp-4) var(--sp-6); }
  .page-content { padding: 0 var(--sp-4) var(--sp-12); }

  /* Footer */
  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-8);
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
  .footer-bottom { flex-direction: column; text-align: center; }

  /* Article */
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { position: static; }

  /* Error */
  .error-code { font-size: 5rem; }
  .error-tools { flex-direction: column; align-items: center; }

  /* Trust */
  .trust-grid { grid-template-columns: 1fr; }

  /* How it works */
  .how-grid { grid-template-columns: 1fr; }

  /* Scroll top */
  #scroll-top { bottom: var(--sp-4); right: var(--sp-4); }
}

/* ── 768px+: tablet ── */
@media (min-width: 768px) {
  .char-options-grid { grid-template-columns: 1fr 1fr; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .guide-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── 1024px+: desktop ── */
@media (min-width: 1024px) {
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
  .guide-grid { grid-template-columns: repeat(3, 1fr); }
  .trust-grid { grid-template-columns: repeat(4, 1fr); }
  .how-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── 1280px+: wide desktop ── */
@media (min-width: 1280px) {
  .footer-main { grid-template-columns: 260px repeat(4, 1fr); }
}

/* ── 1440px+: large desktop ── */
@media (min-width: 1440px) {
  :root { --max-w: 1280px; }
}

/* ═══════════════════════════════════════════════════════════════
   23. 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;
  }
  .strength-bar-fill { transition: none; }
}

/* High contrast mode support */
@media (forced-colors: active) {
  .btn--primary { border: 2px solid ButtonText; }
  .tool-card { border: 2px solid ButtonText; }
  .strength-bar-fill { forced-color-adjust: none; }
}

/* ═══════════════════════════════════════════════════════════════
   24. CHARACTER-COUNT BADGE & QUICK-LENGTH PRESETS
   (used on the homepage and other pages targeting a specific
   password length, e.g. the "12 character" cluster)
   ═══════════════════════════════════════════════════════════════ */
.char-count-badge {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3); border-radius: var(--r-full);
  background: rgba(74,128,255,0.1); border: 1px solid rgba(74,128,255,0.3);
  font-size: var(--text-sm); font-weight: 700; color: var(--primary-light);
  margin-bottom: var(--sp-3);
}
.quick-length-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-4); }
.quick-length-btn {
  padding: var(--sp-1) var(--sp-3); border-radius: var(--r-full); border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-2); font-size: var(--text-sm); font-weight: 600;
  cursor: pointer; transition: all var(--t-fast);
}
.quick-length-btn:hover { border-color: var(--primary); color: var(--text); }
.quick-length-btn[aria-current="true"] {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.preset-note {
  font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--sp-2); line-height: 1.6;
}
