/* Playfair Display — classic serif for headings */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700&display=swap');

/* =========================================================
   AI ToolHub - style.css
   HOW TO CHANGE THE THEME: edit the colors in the two blocks
   directly below (":root" = light mode, dark mode block after).
   Fonts load from Google Fonts in each page's <head> with
   &display=swap, which gives the "font-display: swap" behavior.
   ========================================================= */

/* ---------- 1. COLORS & SETTINGS (LIGHT MODE — Classic Theme) ---------- */
:root {
  --color-primary: #1E3A5F;        /* deep navy — buttons, links */
  --color-primary-hover: #162D4A;
  --color-accent: #C8942A;         /* warm gold — highlights & star */
  --color-bg: #FAF7F0;             /* warm ivory page background */
  --color-surface: #FFFDF7;        /* warm white — cards */
  --color-surface-alt: #F2EBD9;    /* warm cream — alternating sections */
  --color-text: #1A1A2E;           /* near-black with a navy tint */
  --color-text-muted: #5C5547;
  --color-border: #D9CCBA;
  --color-link: #1E3A5F;
  --color-star: #C8942A;

  /* Badge colors: background + text */
  --badge-cat-bg: #E0F4EF;     --badge-cat-text: #145C47;
  --badge-free-bg: #E4F5E4;    --badge-free-text: #1A5C2E;
  --badge-freemium-bg: #EAE8F5; --badge-freemium-text: #3C2A7A;
  --badge-paid-bg: #F5EDDF;    --badge-paid-text: #6B4A1A;

  --shadow-sm: 0 1px 4px rgba(30, 20, 5, 0.09);
  --shadow-md: 0 6px 24px rgba(30, 20, 5, 0.15);
  --radius: 12px;
  --radius-sm: 6px;
  --max-width: 1120px;

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-heading: "Playfair Display", Georgia, "Times New Roman", serif;
}

/* ---------- 2. DARK MODE COLORS (Classic) ---------- */
:root[data-theme="dark"] {
  --color-primary: #4A7FC0;
  --color-primary-hover: #5B90D1;
  --color-accent: #D4A843;
  --color-bg: #0F1319;
  --color-surface: #171E2A;
  --color-surface-alt: #1E2B3C;
  --color-text: #E8DDD0;
  --color-text-muted: #9A8E7E;
  --color-border: #2C3A4E;
  --color-link: #7AAAD8;
  --color-star: #D4A843;

  --badge-cat-bg: #0F3A2D;     --badge-cat-text: #7DDFC4;
  --badge-free-bg: #0F3A1F;    --badge-free-text: #7DDFA0;
  --badge-freemium-bg: #1E1A50; --badge-freemium-text: #B8A8F5;
  --badge-paid-bg: #4A2E10;    --badge-paid-text: #F5C880;

  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.50);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.55);
}

/* ---------- 3. RESET & BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;               /* safety: no sideways scroll on phones */
}
img, svg { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.25;
  margin: 0 0 0.6em;
  font-weight: 600;
}
h1 { font-size: clamp(1.9rem, 5vw, 2.9rem); }
h2 { font-size: clamp(1.45rem, 3.5vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--color-link); }
a:hover { text-decoration: none; }
ul, ol { padding-left: 1.3em; margin: 0 0 1em; }
.muted { color: var(--color-text-muted); }

/* Visible focus for keyboard users */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip link (jumps past the menu) */
.skip-link {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--color-primary); color: #fff;
  padding: 0.6rem 1rem; border-radius: var(--radius-sm);
  z-index: 200; text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- 4. LAYOUT HELPERS ---------- */
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 1rem; }
.section { padding: 3rem 0; }
.section--alt { background: var(--color-surface-alt); }
.section__head { margin-bottom: 1.5rem; }
.section__head p { color: var(--color-text-muted); margin: 0; }
.section__head--row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 0.5rem 1rem; }

/* Classic gold underline on section h2 and page-title h1 */
.section__head h2::after {
  content: ''; display: block;
  width: 2.5rem; height: 3px;
  background: var(--color-accent);
  margin-top: 0.5rem; border-radius: 2px;
}
.page-title h1::after {
  content: ''; display: block;
  width: 3.5rem; height: 3px;
  background: var(--color-accent);
  margin-top: 0.6rem; border-radius: 2px;
}
.grid { display: grid; gap: 1.1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- 5. BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.7rem 1.25rem; border-radius: 999px;
  font: 600 0.95rem var(--font-body);
  text-decoration: none; cursor: pointer;
  border: 2px solid transparent;
  position: relative; overflow: hidden;    /* required for ripple */
  letter-spacing: 0.03em;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-hover); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn--ghost { background: transparent; color: var(--color-link); border-color: var(--color-border); }
.btn--ghost:hover { border-color: var(--color-primary); color: var(--color-primary); transform: translateY(-2px); }
.btn--sm { padding: 0.5rem 1rem; font-size: 0.875rem; }
.btn--lg { padding: 0.9rem 1.7rem; font-size: 1.05rem; }

/* Press-down click effect — scales button on :active for visible tactile feedback */
.btn:active {
  transform: scale(0.97) !important;
  transition: transform 120ms ease-out !important;
  box-shadow: none !important;
}
/* Ghost buttons need a dark ripple (white ripple is invisible on light bg) */
.btn--ghost .btn-ripple { background: rgba(30, 58, 95, 0.14); }
:root[data-theme="dark"] .btn--ghost .btn-ripple { background: rgba(122, 170, 216, 0.22); }

/* ---------- 6. HEADER & NAVIGATION ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.logo-link { display: inline-flex; align-items: center; }
.logo-link img { height: 36px; width: auto; }

.nav-wrap { display: flex; align-items: center; gap: 0.5rem; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.25rem; }
.site-nav a {
  display: block; padding: 0.5rem 0.85rem; border-radius: 999px;
  color: var(--color-text); text-decoration: none; font-weight: 500;
}
.site-nav a:hover { background: var(--color-surface-alt); }
.site-nav a[aria-current="page"] { background: var(--color-primary); color: #fff; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface); color: var(--color-text); cursor: pointer;
}
.icon-btn:hover { background: var(--color-surface-alt); }
.icon-btn svg { width: 20px; height: 20px; }
/* Show the sun in dark mode, the moon in light mode */
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.menu-toggle { display: none; }

/* Mobile menu */
@media (max-width: 767px) {
  .menu-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 0.5rem 1rem 1rem;
    display: none;
    box-shadow: var(--shadow-md);
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { padding: 0.75rem 1rem; border-radius: var(--radius-sm); }
}

/* ---------- 7. HERO & SEARCH ---------- */
.hero {
  padding: 4.5rem 0 4rem; text-align: center;
  background: linear-gradient(165deg, var(--color-surface) 0%, var(--color-surface-alt) 100%);
  border-bottom: 3px solid var(--color-accent);
}
.hero p.lead { max-width: 640px; margin: 0 auto 1.5rem; color: var(--color-text-muted); font-size: 1.1rem; }
.search-form {
  display: flex; max-width: 620px; margin: 0 auto;
  background: var(--color-surface); border: 2px solid var(--color-border);
  border-radius: 999px; padding: 0.3rem; box-shadow: var(--shadow-sm);
}
.search-form:focus-within { border-color: var(--color-primary); }
.search-form input {
  flex: 1; min-width: 0; border: 0; background: transparent;
  padding: 0.6rem 1rem; font: inherit; color: var(--color-text);
}
.search-form input:focus { outline: none; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 1rem; }
.chip {
  padding: 0.35rem 0.9rem; border-radius: 999px; font-size: 0.875rem;
  background: var(--color-surface); border: 1px solid var(--color-border);
  color: var(--color-text); text-decoration: none;
}
.chip:hover { border-color: var(--color-primary); color: var(--color-link); }

/* ---------- 8. CARDS ---------- */
.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-left-width: 3px;              /* thicker left accent border */
  border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow-sm);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-left-color 0.28s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-left-color: var(--color-accent); }

.tool-card { display: flex; flex-direction: column; gap: 0.75rem; }
.tool-card__top { display: flex; gap: 0.85rem; align-items: center; }
.tool-card__name { margin: 0 0 0.35rem; font-size: 1.1rem; }
.tool-card__name a { color: var(--color-text); text-decoration: none; }
.tool-card__name a:hover { color: var(--color-link); }
.tool-card p { margin: 0; color: var(--color-text-muted); font-size: 0.95rem; }
.tool-card .tool-card__strength { color: var(--color-text); font-size: 0.88rem; }
.tool-logo { width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0; object-fit: contain; padding: 4px; background: #fff; border: 1px solid var(--color-border); }
.card__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: auto; padding-top: 0.25rem; }

.rating { color: var(--color-star) !important; font-weight: 600; font-size: 0.9rem !important; }
.rating span { color: var(--color-text-muted); font-weight: 400; }

.category-card { display: block; text-decoration: none; color: var(--color-text); }
.category-card__icon { font-size: 1.8rem; line-height: 1; margin-bottom: 0.5rem; }
.category-card h3 { margin-bottom: 0.25rem; }
.category-card p { margin: 0; color: var(--color-text-muted); font-size: 0.9rem; }
.category-card .count { color: var(--color-link); font-weight: 600; font-size: 0.85rem; }

/* ---------- 9. BADGES ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.badge {
  display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600;
}
.badge--cat { background: var(--badge-cat-bg); color: var(--badge-cat-text); }
.badge--free { background: var(--badge-free-bg); color: var(--badge-free-text); }
.badge--freemium { background: var(--badge-freemium-bg); color: var(--badge-freemium-text); }
.badge--paid { background: var(--badge-paid-bg); color: var(--badge-paid-text); }

/* ---------- 10. TOOLS PAGE FILTERS ---------- */
.filters { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
.filters .search-form { max-width: none; margin: 0 0 1rem; border-radius: var(--radius-sm); }
.filter-group { margin-bottom: 0.9rem; }
.filter-group__label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 0.4rem; color: var(--color-text-muted); }
.filter-buttons { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.filter-btn {
  padding: 0.35rem 0.85rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--color-border); background: var(--color-surface);
  color: var(--color-text); font: 500 0.875rem var(--font-body);
}
.filter-btn:hover { border-color: var(--color-primary); }
.filter-btn[aria-pressed="true"] { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.filters__row { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: end; justify-content: space-between; }
.select {
  padding: 0.5rem 0.75rem; border-radius: var(--radius-sm);
  border: 1px solid var(--color-border); background: var(--color-surface);
  color: var(--color-text); font: inherit;
}
.results-count { font-weight: 600; margin: 0 0 1rem; }
.no-results { text-align: center; padding: 2.5rem 1rem; background: var(--color-surface); border: 1px dashed var(--color-border); border-radius: var(--radius); }
[hidden] { display: none !important; }

/* ---------- 11. TOOL REVIEW PAGES ---------- */
.breadcrumb { font-size: 0.875rem; padding: 1rem 0 0; color: var(--color-text-muted); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: 0.4rem; color: var(--color-border); }
.tool-hero { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; padding: 1.5rem 0; }
.tool-hero .tool-logo { width: 80px; height: 80px; border-radius: 18px; }
.tool-hero h1 { margin-bottom: 0.4rem; font-size: clamp(1.7rem, 4.5vw, 2.4rem); }
.tool-hero__cta { margin-left: auto; text-align: right; }
@media (max-width: 640px) { .tool-hero__cta { margin-left: 0; text-align: left; width: 100%; } }
.disclosure-note { font-size: 0.8rem; color: var(--color-text-muted); margin: 0.4rem 0 0; }
.content-block { margin-bottom: 2rem; }
.check-list { list-style: none; padding: 0; }
.check-list li { padding-left: 1.6rem; position: relative; margin-bottom: 0.4rem; }
.check-list li::before { content: "\2713"; position: absolute; left: 0; color: var(--color-accent); font-weight: 700; }
.pros-cons { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .pros-cons { grid-template-columns: 1fr 1fr; } }
.pros-cons h3 { margin-bottom: 0.5rem; }
.pros-cons .cons li::before { content: "\2715"; color: #DC2626; }
.callout {
  background: var(--color-surface-alt); border-left: 4px solid var(--color-accent);
  padding: 1rem 1.25rem; border-radius: var(--radius-sm); margin-bottom: 1.5rem;
}
.callout p:last-child { margin-bottom: 0; }
.notice { font-size: 0.875rem; color: var(--color-text-muted); border-top: 1px solid var(--color-border); padding-top: 0.75rem; }

/* FAQ (uses <details> so it works without JavaScript) */
.faq details { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 0.85rem 1rem; margin-bottom: 0.6rem; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 0.6rem 0 0; color: var(--color-text-muted); }

/* ---------- 12. ARTICLE (BLOG) & CONTENT PAGES ---------- */
.prose { max-width: 760px; }
.prose h2 { margin-top: 2rem; }
.prose h3 { margin-top: 1.5rem; }
.article-meta { color: var(--color-text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.25rem 0; border: 1px solid var(--color-border); border-radius: var(--radius-sm); }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 0.92rem; background: var(--color-surface); }
th, td { padding: 0.65rem 0.85rem; text-align: left; border-bottom: 1px solid var(--color-border); vertical-align: top; }
th { background: var(--color-surface-alt); font-family: var(--font-heading); font-size: 0.85rem; }
tr:last-child td { border-bottom: 0; }
.page-title { padding: 2.5rem 0 1rem; }

/* ---------- 13. FORMS ---------- */
.form { max-width: 560px; }
.form-field { margin-bottom: 1rem; }
.form-field label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.92rem; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; padding: 0.7rem 0.9rem; border-radius: var(--radius-sm);
  border: 1px solid var(--color-border); background: var(--color-surface);
  color: var(--color-text); font: inherit;
}
.form-field textarea { min-height: 140px; resize: vertical; }
.form-field input[aria-invalid="true"], .form-field select[aria-invalid="true"], .form-field textarea[aria-invalid="true"] { border-color: #DC2626; }
.field-error { color: #DC2626; font-size: 0.85rem; margin: 0.3rem 0 0; min-height: 0; }
:root[data-theme="dark"] .field-error { color: #FCA5A5; }
.form-status { margin-top: 1rem; padding: 0.85rem 1rem; border-radius: var(--radius-sm); font-weight: 500; }
.form-status--success { background: var(--badge-free-bg); color: var(--badge-free-text); }
.form-status--error { background: #FEE2E2; color: #991B1B; }
:root[data-theme="dark"] .form-status--error { background: #7F1D1D; color: #FECACA; }
.honeypot { position: absolute; left: -9999px; height: 0; overflow: hidden; }  /* hidden spam trap */

.newsletter { text-align: center; }
.newsletter .form { margin: 0 auto; }
.newsletter-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.newsletter-row .form-field { flex: 1 1 220px; margin: 0; }

/* ---------- 14. TRUST POINTS ---------- */
.trust-point h3 { margin-bottom: 0.3rem; }
.trust-point p { margin: 0; color: var(--color-text-muted); }
.trust-icon { font-size: 1.7rem; margin-bottom: 0.5rem; }

/* ---------- 15. FOOTER ---------- */
.site-footer { background: var(--color-surface); border-top: 1px solid var(--color-border); padding: 2.5rem 0 1.5rem; margin-top: 2rem; }
.footer-grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h2 { font-size: 1rem; margin-bottom: 0.6rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.35rem; }
.site-footer a { color: var(--color-text-muted); }
.site-footer a:hover { color: var(--color-link); }
.footer-disclosure { font-size: 0.85rem; color: var(--color-text-muted); border-top: 1px solid var(--color-border); margin-top: 1.5rem; padding-top: 1rem; }
.footer-copy { font-size: 0.85rem; color: var(--color-text-muted); margin: 0.5rem 0 0; }

/* ---------- 16. BACK TO TOP BUTTON ---------- */
.back-to-top {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--color-primary); color: #fff; box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top svg { width: 22px; height: 22px; }

/* ---------- 17. 404 PAGE ---------- */
.error-page { text-align: center; padding: 4rem 0; }
.error-code { font-family: var(--font-heading); font-size: clamp(4rem, 15vw, 7rem); font-weight: 700; color: var(--color-primary); line-height: 1; margin: 0; }
.error-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin-top: 1.25rem; }

/* ---------- 18. RESPECT "REDUCE MOTION" ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card:hover, .btn:hover { transform: none; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .btn-ripple { display: none !important; }
.button-click-fade { display: none !important; }
}

/* ---------- 19. SCROLL REVEAL ----------
   JS adds .reveal to elements, then adds .is-visible when they
   enter the viewport. Elements start hidden and slide up into view. */
.reveal { opacity: 1; transform: none; }
.js-ready .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 460ms ease, transform 460ms ease;
}
.js-ready .reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* Stagger grid children on entry only; exit is instant so reset is invisible */
.grid > .reveal:nth-child(2) { transition-delay: 60ms; }
.grid > .reveal:nth-child(3) { transition-delay: 120ms; }
.grid > .reveal:nth-child(4) { transition-delay: 180ms; }

/* ---------- 20. BUTTON RIPPLE ----------
   A <span class="btn-ripple"> is injected by JS on click.
   The .btn base already has position:relative; overflow:hidden. */
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
  transform: scale(0);
  animation: ripple-expand 0.60s linear forwards;
  pointer-events: none;
}
@keyframes ripple-expand {
  to { transform: scale(4); opacity: 0; }
}

/* ---------- 21. HOMEPAGE POLISH ---------- */
.site-header {
  background: color-mix(in srgb, var(--color-surface) 88%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.site-header { transition: box-shadow 220ms ease; }
.site-header.is-scrolled { box-shadow: 0 5px 18px color-mix(in srgb, var(--color-text) 10%, transparent); }
.reading-progress { position: fixed; inset: 0 0 auto; z-index: 110; height: 3px; pointer-events: none; }
.reading-progress span {
  display: block; width: 100%; height: 100%; background: var(--color-accent);
  transform: scaleX(var(--reading-progress, 0%)); transform-origin: left center;
  transition: transform 100ms linear;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(4.5rem, 9vw, 7.5rem) 0 clamp(4rem, 7vw, 6rem);
  border-bottom: 0;
  background:
    radial-gradient(ellipse at 12% 20%, color-mix(in srgb, var(--color-accent) 17%, transparent), transparent 36%),
    radial-gradient(ellipse at 88% 8%, color-mix(in srgb, #14B8A6 15%, transparent), transparent 34%),
    linear-gradient(145deg, var(--color-surface) 0%, var(--color-surface-alt) 100%);
}
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(48vw, 620px);
  aspect-ratio: 1;
  right: -15%;
  bottom: -78%;
  border: 1px solid color-mix(in srgb, var(--color-primary) 15%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 0 44px color-mix(in srgb, var(--color-primary) 3%, transparent), 0 0 0 88px color-mix(in srgb, var(--color-primary) 2%, transparent);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.38rem 0.8rem;
  border: 1px solid color-mix(in srgb, var(--color-accent) 42%, var(--color-border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-surface) 76%, transparent);
  color: var(--color-text);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.035em;
  animation: hero-enter 650ms both;
}
.hero__eyebrow span { color: var(--color-accent); }
.hero h1 {
  max-width: 850px;
  margin: 0 auto 1rem;
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  letter-spacing: -0.045em;
  animation: hero-enter 700ms 70ms both;
}
.hero h1 span {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--color-accent) 75%, transparent);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.12em;
}
:root[data-theme="dark"] .hero h1 span { color: #9CC8FF; }
.hero p.lead {
  max-width: 680px;
  margin-bottom: 1.8rem;
  font-size: clamp(1rem, 2vw, 1.12rem);
  animation: hero-enter 700ms 140ms both;
}
.hero .search-form {
  max-width: 660px;
  padding: 0.38rem;
  border-width: 1px;
  box-shadow: 0 12px 35px color-mix(in srgb, var(--color-primary) 13%, transparent), var(--shadow-sm);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  animation: hero-enter 700ms 210ms both;
}
.hero .search-form:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 13%, transparent), 0 16px 38px color-mix(in srgb, var(--color-primary) 16%, transparent);
  transform: translateY(-2px);
}
.hero .search-form input { padding-left: 1.15rem; }
.hero .search-form .btn { min-width: 112px; }
.hero .chips { animation: hero-enter 700ms 280ms both; }
.chip { transition: transform 160ms ease, border-color 160ms ease, background 160ms ease; }
.chip:hover { transform: translateY(-2px); background: var(--color-surface); }

.category-card {
  position: relative;
  overflow: hidden;
  min-height: 205px;
  padding: 1.35rem;
  border-left-width: 1px;
  background: linear-gradient(145deg, var(--color-surface), color-mix(in srgb, var(--color-surface-alt) 46%, var(--color-surface)));
}
.category-card::after {
  content: "↗";
  position: absolute;
  right: 1.15rem;
  bottom: 1rem;
  color: var(--color-text-muted);
  font-size: 1.1rem;
  opacity: 0;
  transform: translate(-5px, 5px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.category-card:hover {
  border-color: color-mix(in srgb, var(--color-primary) 40%, var(--color-border));
  border-left-color: var(--color-accent);
  transform: translateY(-3px);
}
.category-card:hover::after { opacity: 1; transform: none; }
.category-card__icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.9rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--color-accent) 17%, var(--color-surface));
  font-size: 1.55rem;
  transition: transform 220ms ease, background 220ms ease;
}
.category-card:hover .category-card__icon {
  transform: scale(1.04);
  background: color-mix(in srgb, var(--color-accent) 27%, var(--color-surface));
}
.category-card h3 { padding-right: 1.2rem; }
.category-card p { margin-bottom: 0.55rem; }
.category-card .count {
  display: inline-block;
  padding: 0.14rem 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-primary) 9%, var(--color-surface));
  font-size: 0.78rem;
}
.trust-point { border-left-color: color-mix(in srgb, var(--color-accent) 65%, var(--color-border)); }
.trust-icon {
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 16px;
  background: color-mix(in srgb, var(--color-accent) 16%, var(--color-surface));
}
@keyframes hero-enter {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  .hero { padding-top: 4rem; }
  .hero .search-form { border-radius: 1.25rem; }
  .hero .search-form .btn { min-width: auto; padding-inline: 1rem; }
  .category-card { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__eyebrow, .hero h1, .hero p.lead, .hero .search-form, .hero .chips { animation: none; }
}

/* ---------- 22. SMOOTHER SCROLL AND BUTTON FEEDBACK ---------- */
.js-ready .reveal {
  transition: opacity 460ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 460ms cubic-bezier(0.22, 1, 0.36, 1);
}
.grid > .reveal:nth-child(2) { transition-delay: 60ms; }
.grid > .reveal:nth-child(3) { transition-delay: 120ms; }
.grid > .reveal:nth-child(4) { transition-delay: 180ms; }

.cards-updating .tool-card { animation: filter-card-enter 420ms ease both; }
.cards-updating .tool-card:nth-child(2) { animation-delay: 60ms; }
.cards-updating .tool-card:nth-child(3) { animation-delay: 120ms; }
.cards-updating .tool-card:nth-child(4) { animation-delay: 180ms; }
@keyframes filter-card-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

button, .btn { position: relative; overflow: hidden; isolation: isolate; }
button:active:not(:disabled), .btn:active {
  transform: scale(0.97);
  transition: transform 120ms ease-out;
}
.btn-ripple {
  z-index: 0;
  background: color-mix(in srgb, currentColor 20%, transparent);
  animation: ripple-expand 720ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.btn--primary .btn-ripple { background: rgba(255, 255, 255, 0.3); }
.button-click-fade {
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: inherit;
  background: currentColor;
  opacity: 0;
  pointer-events: none;
  animation: button-click-fade 400ms linear both;
}
@keyframes button-click-fade {
  0% { opacity: 0; animation-timing-function: ease-in; }
  50% { opacity: 0.28; animation-timing-function: ease-out; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  button:active, .btn:active { transform: none !important; transition: none !important; }
  .cards-updating .tool-card { animation: none !important; }
}

/* ---------- 23. PREMIUM MOTION LAYER ----------
   New decorative effects live here. Motion states are activated by the
   vanilla-JS enhancement class; without it, all page content stays visible. */
html.premium-motion .hero { background: transparent; }
.premium-hero-bg {
  position: absolute; inset: -12% 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse at 16% 30%, color-mix(in srgb, var(--color-accent) 15%, transparent), transparent 32%),
    linear-gradient(145deg, var(--color-surface), var(--color-surface-alt));
  will-change: transform;
}
.premium-hero-bg::before, .premium-hero-bg::after {
  content: ""; position: absolute; width: clamp(180px, 28vw, 360px); aspect-ratio: 1;
  border-radius: 50%; filter: blur(52px); opacity: .22; pointer-events: none;
  animation: premium-drift 21s ease-in-out infinite alternate;
}
.premium-hero-bg::before { top: 4%; left: 3%; background: #D8A33A; }
.premium-hero-bg::after { top: 28%; right: 5%; background: #38B7A5; animation-duration: 24s; animation-delay: -8s; }
@keyframes premium-drift { to { transform: translate3d(28px, -20px, 0) scale(1.08); } }
.premium-motion .hero .container { z-index: 2; }
.premium-motion .hero h1, .premium-motion .hero p.lead,
.premium-motion .hero .search-form, .premium-motion .hero .chips { animation: none; }
.premium-motion .hero h1 .premium-word {
  display: inline-block; color: inherit; text-decoration: none; opacity: 0;
  transform: translateY(18px); animation: premium-rise 460ms cubic-bezier(.2,.75,.25,1) forwards;
  animation-delay: var(--word-delay, 0ms);
}
@keyframes premium-rise { to { opacity: 1; transform: translateY(0); } }
.premium-motion .hero p.lead, .premium-motion .hero .search-form, .premium-motion .hero .chips {
  opacity: 0; transform: translateY(14px); animation: premium-rise 420ms ease forwards;
}
.premium-motion .hero p.lead { animation-delay: 420ms; }
.premium-motion .hero .search-form { animation-delay: 540ms; }
.premium-motion .hero .chips { animation-delay: 660ms; }
.premium-marquee {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 8px; overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.premium-marquee-track { display: flex; width: max-content; animation: premium-marquee 34s linear infinite; }
.premium-marquee:hover .premium-marquee-track, .premium-marquee:focus-within .premium-marquee-track { animation-play-state: paused; }
.premium-marquee-group { display: flex; align-items: center; gap: 2rem; padding: 0 1rem; }
.premium-logo-link { display: grid; place-items: center; width: 46px; height: 42px; opacity: .76; transition: opacity 180ms ease; }
.premium-logo-link:hover, .premium-marquee:hover .premium-logo-link { opacity: 1; }
.premium-logo-link img { display: block; max-width: 40px; max-height: 40px; object-fit: contain; }
@keyframes premium-marquee { to { transform: translateX(-50%); } }
html.premium-motion .premium-reveal {
  opacity: 0; filter: blur(2px); transform: translateY(24px);
  transition: opacity 500ms ease, transform 500ms cubic-bezier(.2,.75,.25,1), filter 500ms ease;
  transition-delay: var(--reveal-delay, 0ms);
}
html.premium-motion .premium-reveal.premium-seen { opacity: 1; filter: blur(0); transform: none; }
html.premium-motion .prose.reveal, html.premium-motion .prose .page-title.reveal {
  opacity: 1; filter: none; transform: none; transition: none;
}
.premium-hero-spotlight, .premium-card-spotlight {
  position: absolute; z-index: 1; display: block; width: 480px; height: 480px; left: 0; top: 0;
  border-radius: 50%; pointer-events: none; opacity: 0; transform: translate3d(-999px,-999px,0);
  background: radial-gradient(circle, rgba(255,255,255,.19), rgba(255,255,255,0) 68%);
  transition: opacity 220ms ease;
}
.hero:hover > .premium-hero-spotlight { opacity: 1; }
.card.premium-tilt-card { position: relative; transform-style: preserve-3d; }
.card.premium-tilt-card > :not(.premium-card-spotlight) { position: relative; z-index: 2; }
.card.premium-tilt-card .premium-card-spotlight { z-index: 1; width: 300px; height: 300px; }
.card.premium-tilt-card:hover { transform: perspective(900px) rotateX(var(--tilt-x,0deg)) rotateY(var(--tilt-y,0deg)) translateY(-2px); }
.card.premium-tilt-card:hover .premium-card-spotlight { opacity: 1; }
.btn--primary { translate: var(--mag-x,0px) var(--mag-y,0px); transition: translate 180ms ease, transform 150ms ease, background-color 180ms ease; }
.premium-ripple {
  position: absolute; z-index: 3; top: 0; left: 0; display: block; border-radius: 50%;
  pointer-events: none; opacity: .32; background: currentColor;
  animation: premium-ripple 560ms ease-out forwards;
}
@keyframes premium-ripple {
  from { transform: translate3d(var(--ripple-x),var(--ripple-y),0) scale(0); }
  to { transform: translate3d(var(--ripple-x),var(--ripple-y),0) scale(1); opacity: 0; }
}
/* Theme colors blend briefly while the existing data-theme toggle stays in control. */
body, .hero, .section--alt, .site-header, .site-nav a, .card, .search-form, .chip, .filter-btn,
.form-status, .filters, .footer, .icon-btn {
  transition-property: background-color, color, border-color;
  transition-duration: 300ms; transition-timing-function: ease;
}
.card { transition-property: background-color, color, border-color, transform, box-shadow; transition-duration: 300ms, 280ms, 300ms, 280ms, 280ms; }
.site-header { transition-property: background-color, color, border-color, box-shadow; transition-duration: 300ms,300ms,300ms,220ms; }
.theme-toggle { position: relative; }
.theme-toggle svg { position: absolute; transition: opacity 260ms ease, transform 320ms cubic-bezier(.2,.75,.25,1); }
.theme-toggle .icon-moon { display: block; opacity: 1; transform: rotate(0) scale(1); }
.theme-toggle .icon-sun { display: block; opacity: 0; transform: rotate(-80deg) scale(.65); }
:root[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(80deg) scale(.65); }
:root[data-theme="dark"] .theme-toggle .icon-sun { opacity: 1; transform: rotate(0) scale(1); }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
/* View Transitions are cross-page and only activate in supporting browsers. */
@view-transition { navigation: auto; }
@keyframes premium-page-out { to { opacity: 0; } }
@keyframes premium-page-in { from { opacity: 0; } to { opacity: 1; } }
::view-transition-old(root) { animation: premium-page-out 180ms ease both; }
::view-transition-new(root) { animation: premium-page-in 260ms ease both; }
.premium-confetti { position: fixed; inset: 0; z-index: 1200; width: 100vw; height: 100vh; pointer-events: none; }
html.premium-paused .premium-hero-bg::before, html.premium-paused .premium-hero-bg::after,
html.premium-paused .premium-marquee-track { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .premium-hero-bg::before, .premium-hero-bg::after, .premium-marquee-track, .premium-motion .hero *, .premium-reveal,
  .premium-ripple, .premium-confetti, ::view-transition-old(root), ::view-transition-new(root) {
    animation: none !important; transition: none !important; scroll-behavior: auto !important;
  }
  html.premium-motion .premium-reveal { opacity: 1 !important; filter: none !important; transform: none !important; }
  .premium-hero-spotlight, .premium-card-spotlight { display: none !important; }
  .premium-hero-bg { transform: none !important; }
  .card.premium-tilt-card:hover { transform: none !important; }
  .btn--primary { translate: none !important; }
}
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
