/* civvy.tech — global styles */

/* reset + css variables */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Brand colours */
  --c-bg:           #060b18;
  --c-hero-start:   #060b18;
  --c-hero-end:     #0a1f3a;
  --c-glow:         #00c6ff;
  --c-glow-2:       #0072ff;
  --c-surface:      #0d1b2e;
  --c-surface-2:    #111f35;
  --c-border:       rgba(0, 198, 255, 0.12);
  --c-text:         #e8f0fe;
  --c-text-muted:   #7a90b5;
  --c-accent:       #00c6ff;
  --c-accent-2:     #0072ff;
  --c-white:        #ffffff;

  /* Typography */
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Spacing */
  --section-pad: 80px 24px;
  --card-radius:  16px;

  /* Transitions */
  --ease: cubic-bezier(.25, .8, .25, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; }
ul { list-style: none; }

/* helper classes */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

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

/* scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--c-bg); }
::-webkit-scrollbar-thumb { background: var(--c-surface-2); border-radius: 3px; }

/* --- nav header --- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(6, 11, 24, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--c-border);
  transition: background 0.3s var(--ease);
}

.site-header.scrolled {
  background: rgba(6, 11, 24, 0.95);
}

/* Inner bar */
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 0;
}

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, var(--c-glow), var(--c-glow-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  flex-shrink: 0;
}
.logo span { opacity: 0.7; font-weight: 400; }

/* Primary nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 32px;
  flex: 1;
}

.nav-link {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-text-muted);
  transition: color 0.18s, background 0.18s;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--c-text);
  background: rgba(255,255,255,0.05);
}

.nav-link.active {
  color: var(--c-accent);
  background: rgba(0, 198, 255, 0.08);
}

/* Dropdown wrapper */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-text-muted);
  cursor: pointer;
  transition: color 0.18s, background 0.18s;
  white-space: nowrap;
  background: none;
  border: none;
  font-family: var(--font-sans);
}

.nav-dropdown-toggle:hover,
.nav-dropdown.open .nav-dropdown-toggle {
  color: var(--c-text);
  background: rgba(255,255,255,0.05);
}

.nav-dropdown-chevron {
  font-size: 0.65rem;
  transition: transform 0.2s;
  display: inline-block;
  opacity: 0.6;
}
.nav-dropdown.open .nav-dropdown-chevron { transform: rotate(180deg); }

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 200px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.55);
  display: none;
  z-index: 200;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-text-muted);
  transition: color 0.15s, background 0.15s;
}
.nav-dropdown-item:hover {
  color: var(--c-text);
  background: rgba(0, 198, 255, 0.07);
}
.nav-dropdown-item span { font-size: 1rem; }

/* Right-side CTA group */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-action-link {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-text-muted);
  transition: color 0.18s, background 0.18s;
  white-space: nowrap;
}
.nav-action-link:hover {
  color: var(--c-text);
  background: rgba(255,255,255,0.05);
}

.nav-cta-btn {
  padding: 8px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--c-glow), var(--c-glow-2));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-sans);
  border: none;
  cursor: pointer;
  transition: opacity 0.18s, transform 0.15s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.nav-cta-btn:hover { opacity: 0.86; transform: translateY(-1px); }

/* Mobile hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--c-text-muted);
  transition: transform 0.25s, opacity 0.25s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile drawer */
.nav-mobile-drawer {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--c-border);
  background: rgba(6, 11, 24, 0.97);
}
.nav-mobile-drawer.open { display: flex; }

.nav-mobile-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--c-text-muted);
  transition: color 0.15s, background 0.15s;
}
.nav-mobile-link:hover {
  color: var(--c-text);
  background: rgba(255,255,255,0.05);
}
.nav-mobile-divider {
  height: 1px;
  background: var(--c-border);
  margin: 6px 0;
}

/* --- hero --- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  overflow: hidden;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0, 114, 255, 0.18) 0%, transparent 70%),
              radial-gradient(ellipse 50% 40% at 70% 50%, rgba(0, 198, 255, 0.08) 0%, transparent 60%),
              linear-gradient(180deg, var(--c-hero-start) 0%, var(--c-hero-end) 100%);
}

/* Animated grid overlay */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 198, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 198, 255, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, black 0%, transparent 75%);
  pointer-events: none;
}

/* Glowing orb */
.hero::after {
  content: "";
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 198, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
  animation: pulse 6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; }
  50%       { transform: translateX(-50%) scale(1.15); opacity: 0.7; }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--c-border);
  background: rgba(0, 198, 255, 0.06);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 28px;
  position: relative;
}

.hero-badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-accent);
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -2px;
  max-width: 820px;
  position: relative;
  margin-bottom: 24px;
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--c-glow) 20%, var(--c-glow-2) 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.22rem);
  color: var(--c-text-muted);
  max-width: 540px;
  margin-bottom: 48px;
  position: relative;
}

/* Search bar */
.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
}

.search-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-text-muted);
  pointer-events: none;
  font-size: 1.1rem;
}

#hero-search {
  width: 100%;
  padding: 20px 70px 20px 54px;
  font-size: 1.05rem;
  font-family: var(--font-sans);
  background: rgba(13, 27, 46, 0.8);
  border: 1.5px solid var(--c-border);
  border-radius: 999px;
  color: var(--c-text);
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
}

#hero-search::placeholder { color: var(--c-text-muted); }

#hero-search:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 4px rgba(0, 198, 255, 0.12), 0 8px 32px rgba(0, 0, 0, 0.4);
}

.search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, var(--c-glow), var(--c-glow-2));
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.search-btn:hover  { opacity: 0.88; transform: translateY(-50%) scale(1.04); }
.search-btn:active { transform: translateY(-50%) scale(0.97); }

/* Inline search suggestions */
#live-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0; right: 0;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 16px;
  overflow: hidden;
  z-index: 50;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  display: none;
}

#live-results.open { display: block; }

.live-result-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
  border: none;
  background: transparent;
  width: 100%;
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

.live-result-item:hover, .live-result-item:focus {
  background: rgba(0, 198, 255, 0.06);
  outline: none;
}

.live-result-icon { font-size: 1.3rem; flex-shrink: 0; }

.live-result-info { text-align: left; }

.live-result-name { font-weight: 600; }

.live-result-cat {
  font-size: 0.78rem;
  color: var(--c-text-muted);
  margin-top: 1px;
}

.live-no-result {
  padding: 18px 20px;
  color: var(--c-text-muted);
  font-size: 0.9rem;
  text-align: center;
}

.hero-hint {
  margin-top: 22px;
  font-size: 0.82rem;
  color: var(--c-text-muted);
  position: relative;
}

.hero-hint kbd {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: 5px;
  padding: 1px 7px;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  color: var(--c-text-muted);
}

/* --- genre nav bar --- */
.genre-nav {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  padding: 20px 24px;
  position: sticky;
  top: 64px;
  z-index: 90;
  backdrop-filter: blur(12px);
}

.genre-nav .container {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.genre-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1.5px solid var(--c-border);
  background: rgba(13, 27, 46, 0.6);
  color: var(--c-text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.22s var(--ease);
  white-space: nowrap;
}

.genre-pill:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
  background: rgba(0, 198, 255, 0.07);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 198, 255, 0.1);
}

.genre-pill.active {
  border-color: var(--c-accent);
  background: linear-gradient(135deg, rgba(0, 198, 255, 0.15), rgba(0, 114, 255, 0.1));
  color: var(--c-accent);
}

/* --- tools section --- */
.tools-section {
  padding: var(--section-pad);
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 36px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.5px;
}

.section-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-accent);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: gap 0.15s;
}
.section-link:hover { gap: 9px; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* tool card */
.tool-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--card-radius);
  padding: 28px 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.22s;
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 198, 255, 0.04) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.22s;
  pointer-events: none;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 198, 255, 0.18);
  border-color: rgba(0, 198, 255, 0.3);
}
.tool-card:hover::before { opacity: 1; }

.card-icon {
  font-size: 2rem;
  line-height: 1;
  display: block;
  margin-bottom: 4px;
}

.card-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--c-white);
}

.card-desc {
  font-size: 0.875rem;
  color: var(--c-text-muted);
  flex: 1;
  line-height: 1.55;
}

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--c-accent);
  transition: gap 0.15s;
}
.card-cta:hover { gap: 10px; }

.card-category-badge {
  position: absolute;
  top: 20px; right: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  padding: 3px 10px;
  border-radius: 999px;
}

/* category dividers */
.category-group { margin-bottom: 72px; }
.category-group:last-child { margin-bottom: 0; }

/* --- search results page --- */
.search-page-hero {
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(0, 114, 255, 0.14) 0%, transparent 65%),
              var(--c-bg);
  padding: 100px 24px 60px;
  text-align: center;
  border-bottom: 1px solid var(--c-border);
}

.search-page-hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 10px;
}

.search-page-hero h1 .query-text {
  color: var(--c-accent);
}

.result-count {
  font-size: 0.9rem;
  color: var(--c-text-muted);
  margin-bottom: 32px;
}

/* Inline search bar on search page */
.search-page-bar {
  display: flex;
  max-width: 540px;
  margin: 0 auto;
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: 999px;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.search-page-bar:focus-within {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 4px rgba(0, 198, 255, 0.1);
}

#search-page-input {
  flex: 1;
  padding: 14px 20px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--c-text);
  font-size: 1rem;
  font-family: var(--font-sans);
}
#search-page-input::placeholder { color: var(--c-text-muted); }

#search-page-btn {
  padding: 0 24px;
  background: linear-gradient(135deg, var(--c-glow), var(--c-glow-2));
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.2s;
  font-family: var(--font-sans);
}
#search-page-btn:hover { opacity: 0.88; }

.results-container {
  padding: var(--section-pad);
}

/* No results */
.no-results {
  text-align: center;
  padding: 80px 24px;
}

.no-results-icon {
  font-size: 3.5rem;
  margin-bottom: 20px;
  display: block;
}

.no-results h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.no-results p {
  color: var(--c-text-muted);
  max-width: 360px;
  margin: 0 auto 30px;
  line-height: 1.6;
}

.no-results-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.suggestion-chip {
  padding: 8px 18px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--c-text-muted);
  cursor: pointer;
  transition: all 0.18s;
}
.suggestion-chip:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
  background: rgba(0, 198, 255, 0.06);
}

/* Results grid label */
.results-label {
  font-size: 0.85rem;
  color: var(--c-text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

/* --- footer --- */
.site-footer {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  padding: 40px 24px;
  text-align: center;
}

.footer-logo {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--c-glow), var(--c-glow-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.footer-tagline {
  font-size: 0.875rem;
  color: var(--c-text-muted);
  margin-bottom: 24px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-bottom: 28px;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--c-text-muted);
  transition: color 0.18s;
}
.footer-links a:hover { color: var(--c-accent); }

.footer-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  justify-content: center;
  margin-top: -8px;
  margin-bottom: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--c-border);
}
.footer-tools a {
  font-size: 0.78rem;
  color: var(--c-text-muted);
  opacity: 0.75;
  transition: color 0.18s, opacity 0.18s;
}
.footer-tools a:hover { color: var(--c-accent); opacity: 1; }

/* --- FAQ section --- */
.faq-section {
  padding: 72px 24px;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
}
.faq-inner {
  max-width: 780px;
  margin: 0 auto;
}
.faq-heading {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: 10px;
}
.faq-subhead {
  text-align: center;
  color: var(--c-text-muted);
  font-size: .9rem;
  margin-bottom: 36px;
}
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.faq-item {
  border: 1px solid var(--c-border);
  border-radius: 12px;
  background: var(--c-surface-2);
  overflow: hidden;
  transition: border-color .2s;
}
.faq-item[open] {
  border-color: rgba(0,198,255,.35);
}
.faq-question {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--c-text);
  user-select: none;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
  content: "+";
  flex-shrink: 0;
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--c-accent);
  transition: transform .2s;
}
.faq-item[open] .faq-question::after {
  content: "\2212";
}
.faq-answer {
  padding: 14px 20px 16px;
  color: var(--c-text-muted);
  font-size: .875rem;
  line-height: 1.7;
  border-top: 1px solid var(--c-border);
}
.faq-answer p { margin: 0; }
.faq-answer a {
  color: var(--c-accent);
  text-decoration: underline;
  text-decoration-color: rgba(0,198,255,.35);
  text-underline-offset: 3px;
}
.faq-answer a:hover { color: var(--c-glow-2); }

.footer-copy {
  font-size: 0.8rem;
  color: var(--c-text-muted);
  opacity: 0.6;
}

/* --- category landing page --- */
.category-hero {
  position: relative;
  padding: 110px 24px 64px;
  text-align: center;
  overflow: hidden;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(0,114,255,0.15) 0%, transparent 65%),
              var(--c-bg);
  border-bottom: 1px solid var(--c-border);
}

.category-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,198,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,198,255,0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 0%, black 0%, transparent 80%);
  pointer-events: none;
}

.category-hero-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 16px;
  position: relative;
}

.category-hero h1 {
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -1.5px;
  margin-bottom: 14px;
  position: relative;
}

.category-hero p {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--c-text-muted);
  max-width: 500px;
  margin: 0 auto 24px;
  position: relative;
}

/* --- breadcrumb --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--c-text-muted);
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--c-text-muted);
  transition: color 0.15s;
}
.breadcrumb a:hover { color: var(--c-accent); }
.breadcrumb-sep { opacity: 0.4; }
.breadcrumb-current { color: var(--c-text); font-weight: 500; }

/* --- tool page hero --- */
.tool-hero {
  padding: 98px 24px 48px;
  background: radial-gradient(ellipse 65% 55% at 50% 0%, rgba(0,114,255,0.13) 0%, transparent 60%),
              var(--c-bg);
  border-bottom: 1px solid var(--c-border);
}

.tool-hero-inner {
  max-width: 800px;
  margin: 0 auto;
}

.tool-hero-top {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}

.tool-hero-emoji {
  font-size: 2.6rem;
  flex-shrink: 0;
  display: block;
}

.tool-hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.1;
}

.tool-hero-desc {
  font-size: 1rem;
  color: var(--c-text-muted);
  margin-bottom: 16px;
  line-height: 1.6;
}

/* --- tool interface panel --- */
.tool-page {
  padding: 48px 24px 80px;
}

.tool-panel {
  max-width: 760px;
  margin: 0 auto;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 20px;
  padding: 36px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.35);
}

.tool-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.tool-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group.full { grid-column: 1 / -1; }

.input-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tool-input,
.tool-select,
.tool-textarea {
  padding: 12px 16px;
  background: var(--c-surface-2);
  border: 1.5px solid var(--c-border);
  border-radius: 10px;
  color: var(--c-text);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.tool-input:focus,
.tool-select:focus,
.tool-textarea:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(0,198,255,0.1);
}

.tool-textarea {
  min-height: 130px;
  resize: vertical;
  font-family: "JetBrains Mono", "Fira Mono", monospace;
  font-size: 0.875rem;
  line-height: 1.5;
}

.tool-textarea.output-area {
  min-height: 160px;
  background: rgba(0,0,0,0.25);
  color: #a8e6cf;
  cursor: default;
}

.tool-select { cursor: pointer; }
.tool-select option { background: var(--c-surface); }

.calc-btn {
  width: 100%;
  margin-top: 8px;
  padding: 15px 24px;
  background: linear-gradient(135deg, var(--c-glow), var(--c-glow-2));
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: opacity 0.18s, transform 0.15s, box-shadow 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.calc-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0,198,255,0.28);
}
.calc-btn:active { transform: translateY(0); }

/* Result box */
.result-box {
  margin-top: 24px;
  background: linear-gradient(135deg, rgba(0,198,255,0.07), rgba(0,114,255,0.05));
  border: 1px solid rgba(0,198,255,0.22);
  border-radius: 14px;
  padding: 24px 28px;
}

.result-box[hidden] { display: none !important; }

.result-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 8px;
}

.result-value {
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--c-white);
  line-height: 1;
}

.result-unit {
  font-size: 1rem;
  font-weight: 500;
  color: var(--c-text-muted);
  margin-left: 6px;
}

.result-note {
  font-size: 0.82rem;
  color: var(--c-text-muted);
  margin-top: 8px;
  line-height: 1.5;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 4px;
}

.result-item {}
.result-item .result-value { font-size: clamp(1.4rem, 4vw, 2rem); }

/* Error state */
.error-msg {
  display: none;
  margin-top: 14px;
  padding: 12px 16px;
  background: rgba(255, 80, 80, 0.1);
  border: 1px solid rgba(255, 80, 80, 0.3);
  border-radius: 10px;
  color: #ff8080;
  font-size: 0.875rem;
}
.error-msg.visible { display: block; }

/* Inline copy button */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 8px 18px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  color: var(--c-text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.15s;
}
.copy-btn:hover { border-color: var(--c-accent); color: var(--c-accent); }
.copy-btn.copied { border-color: #4ade80; color: #4ade80; }

/* Color swatches */
.color-swatch {
  width: 100%;
  height: 120px;
  border-radius: 12px;
  border: 1px solid var(--c-border);
  transition: background 0.2s;
  margin-bottom: 12px;
}

.color-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.color-dot {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
  border: 1px solid var(--c-border);
}

/* Regex highlight */
.regex-output {
  font-family: "JetBrains Mono", "Fira Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.7;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 16px;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 60px;
  margin-top: 4px;
}

.regex-output mark {
  background: rgba(0,198,255,0.35);
  color: #fff;
  border-radius: 3px;
  padding: 0 2px;
}

.match-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-accent);
  margin-top: 8px;
}

/* Flags row */
.flags-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.flag-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--c-text-muted);
  user-select: none;
}

.flag-toggle input[type="checkbox"] {
  accent-color: var(--c-accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* Section divider */
.tool-divider {
  height: 1px;
  background: var(--c-border);
  margin: 28px 0;
}

.tool-section-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: 16px;
}

/* EMI breakdown table */
.emi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.emi-table th, .emi-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--c-border);
}
.emi-table th {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}
.emi-table td { color: var(--c-text); }
.emi-table tr:last-child td { border-bottom: none; }

/* Range slider */
.range-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.range-wrap input[type="range"] {
  flex: 1;
  accent-color: var(--c-accent);
  cursor: pointer;
}
.range-val {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--c-text);
  min-width: 50px;
  text-align: right;
}

/* related tools strip */
.related-section {
  padding: 0 24px 72px;
}

.related-section .container {
  max-width: 760px;
}

/* --- scroll-in animations --- */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- responsive --- */
@media (max-width: 900px) {
  .nav-links, .nav-actions .nav-action-link { display: none; }
  .nav-cta-btn { display: none; }
  .nav-hamburger { display: flex; }
  .nav-inner { height: 58px; }
}

@media (max-width: 768px) {
  .hero { padding: 100px 20px 60px; }
  .hero h1 { letter-spacing: -1px; }

  .genre-nav { top: 58px; }
  .genre-nav .container { gap: 8px; }
  .genre-pill { padding: 8px 16px; font-size: 0.82rem; }

  .tools-grid { grid-template-columns: 1fr 1fr; }

  .search-page-hero { padding: 90px 20px 48px; }
}

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

  #hero-search { padding: 17px 60px 17px 48px; font-size: 0.95rem; }
  .search-btn { padding: 8px 16px; font-size: 0.82rem; }
}

/* ── SEO Article Section ── */
.seo-article {
  background: var(--c-bg);
  border-top: 1px solid var(--c-border);
  padding: 64px 24px 80px;
}
.seo-article-inner {
  max-width: 780px;
  margin: 0 auto;
}
.seo-article-inner h2 {
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  font-weight: 900;
  letter-spacing: -.03em;
  margin-bottom: 18px;
  color: var(--c-text);
}
.seo-article-inner h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 32px 0 10px;
  color: var(--c-text);
}
.seo-article-inner p {
  color: var(--c-text-muted);
  line-height: 1.85;
  margin-bottom: 14px;
  font-size: .95rem;
}
.seo-article-inner ul,
.seo-article-inner ol {
  color: var(--c-text-muted);
  line-height: 1.85;
  padding-left: 22px;
  margin-bottom: 16px;
  font-size: .95rem;
}
.seo-article-inner li { margin-bottom: 7px; }
.seo-article-inner strong { color: var(--c-text); font-weight: 600; }
.seo-article-inner a {
  color: var(--c-accent);
  text-decoration: underline;
  text-decoration-color: rgba(0,198,255,.35);
  text-underline-offset: 3px;
  transition: color .18s, text-decoration-color .18s;
}
.seo-article-inner a:hover {
  color: var(--c-glow-2);
  text-decoration-color: var(--c-glow-2);
}
.seo-article-inner code {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: .85rem;
  color: var(--c-text);
}
