/* ==========================================================================
   AIFindr — AI Tools Directory & Reviews Template
   File: assets/css/style.css
   Phase 1 — Design System, Header, Hero, Tool Card, Footer, Theme Modes
   --------------------------------------------------------------------------
   TABLE OF CONTENTS
   1.  Design Tokens (dark default + light theme)
   2.  Base & Reset
   3.  Typography
   4.  Layout Primitives (container, sections, grids)
   5.  Components
       5.1  Buttons
       5.2  Badges
       5.3  Eyebrow / Section Headings
       5.4  Icon Buttons
       5.5  Header & Navigation (desktop + mobile drawer)
       5.6  Hero & Search
       5.7  Chips (popular searches)
       5.8  AI Tool Card
   6.  Footer
   7.  Utilities & Helpers
   8.  Accessibility & Motion Preferences
   ========================================================================== */


/* ==========================================================================
   1. DESIGN TOKENS
   Dark mode is the default theme. [data-theme="light"] overrides below.
   ========================================================================== */

:root {
  /* Color — surfaces */
  --bg: #0B0D12;                 /* page background */
  --bg-soft: #0F131B;            /* alt background (footer, hovers) */
  --card: #131722;               /* card background */
  --card-soft: #171C29;          /* nested / hover surface */

  /* Color — text */
  --text: #F5F7FA;               /* primary text */
  --text-2: #98A2B3;             /* secondary text */

  /* Color — brand */
  /* [QA] Primary deepened from #7C5CFC → #6D4FE8 so white button/tab labels
     and primary-colored text meet WCAG AA (5.3:1 / ~4.9:1). */
  --primary: #764FF0;            /* fills/buttons - white label 5.07:1 */
  --primary-strong: #8E73FF;     /* hover state */
  --link: #8E73FF;               /* primary-as-text on dark cards, 5.15:1 */
  --primary-soft: rgba(118, 79, 240, 0.14);
  --secondary: #20D6C7;
  --secondary-soft: rgba(32, 214, 199, 0.12);

  /* Color — semantic */
  --star: #F5B54A;
  --danger: #F97066;
  --success: #32D583;

  /* Color — lines & effects */
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --header-bg: rgba(11, 13, 18, 0.82);
  --hover-border: rgba(118, 79, 240, 0.45);
  --ring: rgba(118, 79, 240, 0.55);
  --grid-dot: rgba(255, 255, 255, 0.05);
  --orb-a: rgba(124, 92, 252, 0.20);
  --orb-b: rgba(32, 214, 199, 0.13);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 10px 30px -12px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.65);

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Radii */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  /* Layout */
  --container-w: 1220px;
  --header-h: 68px;
}

/* ---- Light theme overrides ---------------------------------------------- */
[data-theme="light"] {
  --bg: #F6F7FB;
  --bg-soft: #EEF0F7;
  --card: #FFFFFF;
  --card-soft: #F8F9FD;

  --text: #12161F;
  --text-2: #5B6577;

  --primary: #6742EC;            /* deepened for contrast on white */
  --primary-strong: #5733D6;
  --link: #6742EC;               /* [QA] primary-as-text token */
  --primary-soft: rgba(103, 66, 236, 0.09);
  /* [QA] Deepened from #0FA396 for WCAG AA on white (5.47:1) */
  --secondary: #0F766E;
  --secondary-soft: rgba(15, 163, 150, 0.10);

  /* [QA] Semantic accents deepened in light mode for AA on white:
     star #B45309 = 5.02:1 · danger #D92D20 = 4.83:1 */
  --star: #B45309;
  --danger: #D92D20;
  --success: #32D583;

  --border: rgba(15, 22, 40, 0.10);
  --border-strong: rgba(15, 22, 40, 0.17);
  --header-bg: rgba(255, 255, 255, 0.85);
  --hover-border: rgba(103, 66, 236, 0.38);
  --ring: rgba(103, 66, 236, 0.45);
  --grid-dot: rgba(15, 22, 40, 0.06);
  --orb-a: rgba(124, 92, 252, 0.13);
  --orb-b: rgba(32, 214, 199, 0.12);

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 10px 30px -14px rgba(16, 24, 40, 0.16);
  --shadow-lg: 0 24px 60px -24px rgba(16, 24, 40, 0.22);
}


/* ==========================================================================
   2. BASE & RESET
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
  overflow-x: clip;                       /* safety net vs horizontal scroll */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

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

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

button {
  background: none;
  border: 0;
  cursor: pointer;
}

ul[class],
ol[class] {
  list-style: none;
}

::selection {
  background: var(--primary);
  color: #FFFFFF;
}

/* Subtle themed scrollbar */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--r-pill);
  border: 3px solid var(--bg);
}


/* ==========================================================================
   3. TYPOGRAPHY SCALE
   Fluid sizes keep hierarchy consistent from 320px to 1440px+.
   ========================================================================== */

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 { font-size: clamp(2.35rem, 5.4vw, 3.9rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.55rem, 3vw, 2.1rem); }
h3 { font-size: 1.125rem; }

p  { font-size: 1rem; }
small, .text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }


/* ==========================================================================
   4. LAYOUT PRIMITIVES
   ========================================================================== */

.container {
  width: min(100% - 40px, var(--container-w));
  margin-inline: auto;
}

.section {
  padding-block: clamp(64px, 8vw, 100px);
}

.grid {
  display: grid;
  gap: var(--sp-5);
}

/* Responsive card grid: min() guard prevents overflow at 320px */
.grid--tools {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
}


/* ==========================================================================
   5. COMPONENTS
   ==========================================================================

   ---- 5.1 Buttons -------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 13px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 8px 22px -10px var(--ring);
}
.btn--primary:hover {
  background: var(--primary-strong);
}

.btn--ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn--ghost:hover {
  border-color: var(--link);
  color: var(--link);
  background: var(--primary-soft);
}

.btn--sm {
  padding: 10px 16px;
  font-size: 0.875rem;
  border-radius: var(--r-sm);
}

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

/* Text link with arrow (section "view all" links) */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--link);
  font-weight: 600;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.link-arrow svg {
  transition: transform 0.18s ease;
}
.link-arrow:hover svg {
  transform: translateX(3px);
}

/* ---- 5.2 Badges --------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge--free {
  color: var(--secondary);
  background: var(--secondary-soft);
  border-color: rgba(32, 214, 199, 0.25);
}

.badge--freemium {
  color: var(--link);
  background: var(--primary-soft);
  border-color: rgba(124, 92, 252, 0.32);
}

.badge--paid {
  color: var(--text-2);
  background: transparent;
  border-color: var(--border-strong);
}

/* ---- 5.3 Eyebrow / Section headings ------------------------------------- */

.eyebrow {
  display: inline-block;
  margin-bottom: var(--sp-3);
  color: var(--secondary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-5);
  margin-bottom: var(--sp-7);
}

.section-sub {
  margin-top: var(--sp-3);
  max-width: 54ch;
  color: var(--text-2);
}

@media (max-width: 720px) {
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---- 5.4 Icon buttons (search toggle, theme toggle) ---------------------- */

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  color: var(--text-2);
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}
.icon-btn:hover {
  color: var(--text);
  background: var(--bg-soft);
  border-color: var(--border);
}
.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* Show the icon for the theme you would switch TO */
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }


/* ==========================================================================
   5.5 HEADER & NAVIGATION
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background-color 0.25s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  height: var(--header-h);
}

/* Brand / logo lockup */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand svg {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

/* Desktop nav — centered between logo and actions */
.site-nav {
  margin-inline: auto;
}
.site-nav ul {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: inline-block;
  padding: 8px 13px;
  border-radius: var(--r-sm);
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.18s ease, background-color 0.18s ease;
}
.site-nav a:hover {
  color: var(--text);
  background: var(--bg-soft);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: auto;
}

/* Compact nav between 1024–1180px so links never collide with actions */
@media (max-width: 1180px) {
  .site-nav a {
    padding: 8px 9px;
    font-size: 0.88rem;
  }
}

/* Hamburger (hidden on desktop) */
.burger {
  display: none;
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.burger span {
  position: absolute;
  left: 11px;
  right: 11px;
  top: calc(50% - 4px);
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.25s ease, top 0.25s ease;
}
.burger span:last-child {
  top: calc(50% + 2px);
}
.burger[aria-expanded="true"] span:first-child {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}
.burger[aria-expanded="true"] span:last-child {
  top: 50%;
  transform: translateY(-50%) rotate(-45deg);
}

/* Mobile drawer */
.nav-drawer {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: var(--sp-4) var(--sp-5) var(--sp-6);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.nav-drawer.is-open {
  display: block;
  animation: drawer-in 0.18s ease both;
}
@keyframes drawer-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.nav-drawer ul li a {
  display: block;
  padding: 13px 4px;
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
}
.nav-drawer ul li a:hover {
  color: var(--text);
}
.nav-drawer .btn {
  margin-top: var(--sp-5);
}

@media (max-width: 1023.98px) {
  .site-nav { display: none; }
  .burger { display: block; }
}
@media (min-width: 1024px) {
  .nav-drawer { display: none !important; }
}
/* Submit Tool moves to the drawer on very small screens */
@media (max-width: 559.98px) {
  .nav-actions > .btn--submit { display: none; }
}


/* ==========================================================================
   5.6 HERO & SEARCH
   ========================================================================== */

.hero {
  position: relative;
  overflow: clip;
  padding-block: clamp(72px, 10vw, 116px) clamp(64px, 8vw, 96px);
  text-align: center;
  border-bottom: 1px solid var(--border);
}

/* Dot grid, faded towards edges */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(62% 68% at 50% 8%, #000, transparent);
  mask-image: radial-gradient(62% 68% at 50% 8%, #000, transparent);
  pointer-events: none;
}

/* Soft ambient orbs — static, GPU-cheap, no animation */
.hero__deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.orb {
  position: absolute;
  width: 560px;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(90px);
}
.orb--a {
  top: -200px;
  left: 50%;
  margin-left: -520px;
  background: var(--orb-a);
}
.orb--b {
  top: -140px;
  left: 50%;
  margin-left: -40px;
  background: var(--orb-b);
}

.hero__inner {
  position: relative;
  z-index: 1;
}

.hero__sub {
  margin: var(--sp-5) auto 0;
  max-width: 58ch;
  font-size: clamp(1rem, 1.5vw, 1.175rem);
  line-height: 1.65;
  color: var(--text-2);
}

/* Gradient accent on part of the headline (single restrained use) */
.text-accent {
  color: var(--primary);
}
@supports ((-webkit-background-clip: text)) {
  .text-accent {
    background: linear-gradient(92deg, var(--primary-strong), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

/* Large search bar */
.search {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  max-width: 640px;
  margin: var(--sp-7) auto 0;
  padding: 7px 7px 7px 18px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-md);
  transition: border-color 0.18s ease, box-shadow 0.18s ease,
              background-color 0.25s ease;
}
.search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring), var(--shadow-md);
}
.search__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-2);
}
.search input {
  flex: 1;
  min-width: 0;                    /* allows proper shrink inside flex row */
  padding-block: 11px;
  background: none;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 1rem;
}
.search input::placeholder {
  color: var(--text-2);
}
.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.search .btn {
  border-radius: var(--r-pill);
  padding-inline: 26px;
}
@media (max-width: 420px) {
  .search .btn {
    padding-inline: 18px;
  }
}

/* Live region for demo search feedback */
.search__hint {
  min-height: 1.5em;
  margin-top: var(--sp-4);
  font-size: 0.875rem;
  color: var(--secondary);
}


/* ==========================================================================
   5.7 CHIPS — popular searches under hero search
   ========================================================================== */

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: var(--sp-5);
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 17px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 500;
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease;
}
.chip:hover {
  color: var(--text);
  border-color: var(--primary);
  background: var(--primary-soft);
}


/* ==========================================================================
   5.8 AI TOOL CARD — the reusable directory card component
   ========================================================================== */

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.25s ease;
}
.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--hover-border);
  box-shadow: var(--shadow-md);
}

.tool-card__head {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

/* Logo placeholder tile — swap --tile per tool or replace it with a real image element later */
.tool-logo {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  border-radius: 13px;
  background: var(--tile, var(--primary));
  color: #FFFFFF;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.tool-card__name {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.tool-card__cats {
  margin-top: 3px;
  font-size: 0.8rem;
  color: var(--text-2);
}

.tool-card__desc {
  color: var(--text-2);
  font-size: 0.93rem;
  line-height: 1.55;
}

.tool-card__foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: auto;                 /* pins footer for equal card heights */
  padding-top: var(--sp-4);
  border-top: 1px dashed var(--border);
}

.rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  font-weight: 700;
}
.rating svg {
  width: 15px;
  height: 15px;
  color: var(--star);
}

.tool-card__foot .btn {
  margin-left: auto;
}

.tool-card__foot .badge {
  min-width: 4.8rem;
  text-align: center;
}


/* Anchor targets clear the sticky header */
[id] {
  scroll-margin-top: calc(var(--header-h) + 20px);
}

/* ---- 5.9 Popular Categories --------------------------------------------- */

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 255px), 1fr));
  gap: var(--sp-4);
}

.cat-card {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.25s ease;
}
.cat-card:hover {
  transform: translateY(-3px);
  border-color: var(--hover-border);
  box-shadow: var(--shadow-md);
}

.cat-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--primary);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.cat-card:hover .cat-icon {
  background: var(--primary);
  color: #FFFFFF;
}
.cat-icon svg {
  width: 20px;
  height: 20px;
}

.cat-card__name {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}
.cat-card__count {
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--text-2);
}

/* ---- 5.10 Tabs + Ranked Tool Lists (Best of 2026) ------------------------ */

.tabs {
  display: flex;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  padding: 5px;
  margin-bottom: var(--sp-6);
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
}
.tab {
  padding: 9px 19px;
  border-radius: var(--r-pill);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.tab:hover {
  color: var(--text);
}
.tab.is-active {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 6px 16px -8px var(--ring);
}

.tab-panel:not([hidden]) {
  animation: fade-up 0.28s ease both;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

.rank-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  padding: 18px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.25s ease;
}
.rank-card:hover {
  transform: translateY(-2px);
  border-color: var(--hover-border);
  box-shadow: var(--shadow-md);
}

.rank-card__main {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex: 1;
  min-width: 0;
}

.rank-num {
  width: 40px;
  flex-shrink: 0;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-2);
  letter-spacing: -0.02em;
}
/* Podium styling for ranks 1–3 */
.rank-card--podium .rank-num {
  background: linear-gradient(135deg, var(--primary-strong), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.rank-card__body {
  min-width: 0;
}
.rank-card__body h3 {
  font-size: 1.02rem;
}
.rank-card__body .tool-card__cats {
  margin-top: 2px;
}
.rank-card__desc {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 0.88rem;
}

.rank-card__side {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

@media (max-width: 760px) {
  .rank-card {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-4);
  }
  /* Indent the action row so it aligns under the body text */
  .rank-card__side {
    padding-left: 56px;
    flex-wrap: wrap;
  }
}

/* Generic two-line clamp helper */
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- 5.11 Deals ----------------------------------------------------------- */

.badge--deal {
  color: var(--danger);
  background: rgba(249, 112, 102, 0.12);
  border-color: rgba(249, 112, 102, 0.32);
}

.deal-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-5);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.25s ease;
}
.deal-card:hover {
  transform: translateY(-3px);
  border-color: var(--hover-border);
  box-shadow: var(--shadow-md);
}

.price-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding-block: 4px;
  min-height: 1.5em;
}
.price-old {
  color: var(--text-2);
  font-size: 0.92rem;
}
.price-new {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.price-per {
  color: var(--text-2);
  font-size: 0.85rem;
}

.deal-card .btn {
  margin-top: auto;
}

/* ---- 5.12 AI Tools by Category (directory index) -------------------------- */

.cat-index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
  gap: var(--sp-5);
}

.cat-group {
  padding: var(--sp-5);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: background-color 0.25s ease, border-color 0.2s ease;
}

.cat-group__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding-bottom: var(--sp-4);
  margin-bottom: var(--sp-2);
}
.cat-group__head .cat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}
.cat-group__head h3 {
  flex: 1;
  font-size: 1rem;
}
.cat-group ul li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-block: 10px;
  border-bottom: 1px dashed var(--border);
}
.cat-group ul li:last-child {
  border-bottom: 0;
}
.cat-group ul li > a {
  font-size: 0.93rem;
  font-weight: 500;
  transition: color 0.18s ease;
}
.cat-group ul li > a:hover {
  color: var(--link);
}

.mini-rating {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  flex-shrink: 0;
}
.mini-rating svg {
  width: 12px;
  height: 12px;
  color: var(--star);
}

.cat-group .link-arrow {
  margin-top: var(--sp-4);
  font-size: 0.88rem;
}

/* Chips aligned left (used after the category index) */
.chips--start {
  justify-content: flex-start;
  margin-top: var(--sp-5);
}

/* ---- 5.13 Comparison CTA --------------------------------------------------- */

.compare-cta {
  position: relative;
  overflow: clip;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
  padding: clamp(28px, 5vw, 52px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  transition: background-color 0.25s ease;
}
.compare-cta::before {
  content: "";
  position: absolute;
  top: -160px;
  right: -80px;
  width: 420px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--orb-a);
  filter: blur(90px);
  pointer-events: none;
}

.compare-cta__body {
  position: relative;
  max-width: 56ch;
}
.compare-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}

.compare-tiles {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-shrink: 0;
}
.compare-tiles .tool-logo {
  width: 58px;
  height: 58px;
  border-radius: 15px;
  font-size: 1.35rem;
}
.vs {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-2);
}

@media (max-width: 880px) {
  .compare-cta {
    flex-direction: column;
    text-align: center;
  }
  .compare-cta__actions {
    justify-content: center;
  }
}

/* ---- 5.14 Reviews ---------------------------------------------------------- */

.stars {
  display: inline-flex;
  gap: 3px;
}
.stars svg {
  width: 15px;
  height: 15px;
  color: var(--border-strong);      /* "empty" star */
}
.stars .is-on {
  color: var(--star);
}

.badge--choice {
  color: var(--star);
  background: rgba(245, 181, 74, 0.12);
  border-color: rgba(245, 181, 74, 0.32);
}
.badge--choice svg {
  width: 12px;
  height: 12px;
}

.review-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-5);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.25s ease;
}
.review-card:hover {
  transform: translateY(-3px);
  border-color: var(--hover-border);
  box-shadow: var(--shadow-md);
}
.review-card .link-arrow {
  margin-top: auto;
  font-size: 0.88rem;
}

.rating-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rating-value {
  font-size: 0.88rem;
  font-weight: 700;
}

/* ---- 5.15 Blog Preview Cards ----------------------------------------------- */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr));
  gap: var(--sp-5);
}

.blog-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.25s ease;
}
.blog-card:hover {
  transform: translateY(-3px);
  border-color: var(--hover-border);
  box-shadow: var(--shadow-md);
}

/* Copyright-free image placeholder: layered gradients + dots + icon.
   Replace with real lazy-loaded image covers if you add real artwork. */
.blog-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background:
    radial-gradient(var(--grid-dot) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(135deg, var(--primary-soft), var(--secondary-soft)),
    var(--card-soft);
  color: var(--primary);
}
.blog-thumb svg {
  width: 44px;
  height: 44px;
  opacity: 0.55;
}
.blog-thumb .badge {
  position: absolute;
  left: 14px;
  bottom: 14px;
  background: var(--card);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.blog-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  padding: var(--sp-5);
}
.blog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
}
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 0.8rem;
}
.meta-item svg {
  width: 14px;
  height: 14px;
}
.blog-body h3 {
  font-size: 1.05rem;
}
.blog-body > p {
  color: var(--text-2);
  font-size: 0.9rem;
}

.author-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: var(--sp-4);
  border-top: 1px dashed var(--border);
}
.author-name {
  font-size: 0.85rem;
  font-weight: 600;
}
.author-role {
  font-size: 0.75rem;
  color: var(--text-2);
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--tile, var(--primary));
  color: #000000;
  font-size: 0.72rem;
  font-weight: 700;
}

/* ---- 5.16 Newsletter -------------------------------------------------------- */

.newsletter-card {
  position: relative;
  overflow: clip;
  max-width: 880px;
  margin-inline: auto;
  padding: clamp(36px, 6vw, 64px) clamp(24px, 5vw, 56px);
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 26px;
  transition: background-color 0.25s ease;
}
.newsletter-card::before,
.newsletter-card::after {
  content: "";
  position: absolute;
  width: 380px;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}
.newsletter-card::before {
  top: -200px;
  left: -120px;
  background: var(--orb-a);
}
.newsletter-card::after {
  bottom: -220px;
  right: -120px;
  background: var(--orb-b);
}

.newsletter-card > * {
  position: relative;
}
.newsletter-sub {
  max-width: 46ch;
  margin: var(--sp-4) auto 0;
  color: var(--text-2);
}

.newsletter-form {
  display: flex;
  gap: var(--sp-2);
  max-width: 480px;
  margin: var(--sp-6) auto 0;
  padding: 7px;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.newsletter-form:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}
.newsletter-form input {
  flex: 1;
  min-width: 0;
  padding-block: 11px;
  padding-inline: 18px;
  background: none;
  border: 0;
  outline: none;
}
.newsletter-form input::placeholder {
  color: var(--text-2);
}
.newsletter-form .btn {
  border-radius: var(--r-pill);
  padding-inline: 24px;
}
@media (max-width: 420px) {
  .newsletter-form .btn {
    padding-inline: 16px;
  }
}

.newsletter-note {
  margin-top: var(--sp-4);
  font-size: 0.8rem;
  color: var(--text-2);
}
.newsletter-msg {
  min-height: 1.4em;
  margin-top: var(--sp-3);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--secondary);
}


/* ---- 5.17 Inner Pages & Tools Directory ---------------------------------- */

/* Current page indicator in navigation */
.site-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--bg-soft);
}

/* Breadcrumbs */
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  font-size: 0.85rem;
  color: var(--text-2);
}
.breadcrumb li {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.breadcrumb li + li::before {
  content: "/";
  opacity: 0.5;
}
.breadcrumb a {
  transition: color 0.18s ease;
}
.breadcrumb a:hover {
  color: var(--link);
}
.breadcrumb [aria-current="page"] {
  color: var(--text);
  font-weight: 500;
}

/* Compact page header for inner pages */
.page-head {
  padding-block: clamp(36px, 5vw, 56px) clamp(24px, 3vw, 32px);
}
.page-head h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
}
.page-head .page-sub {
  max-width: 62ch;
  margin-top: var(--sp-3);
  color: var(--text-2);
}

/* Full-width variant of the hero search for directory pages */
.search--wide {
  max-width: 100%;
  margin-top: var(--sp-6);
}

/* Section variant that hugs the header above it */
.section--flush {
  padding-top: 0;
}

/* Category chip scroller */
.chips-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
.chip-btn {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 8px 17px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease;
}
.chip-btn:hover {
  color: var(--text);
  border-color: var(--primary);
}
.chip-btn[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 6px 16px -8px var(--ring);
}

/* Toolbar row under the filters */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}
.toolbar .tabs {
  margin-bottom: 0;
}

/* Styled native selects */
.select {
  position: relative;
  display: inline-flex;
}
.select select {
  appearance: none;
  -webkit-appearance: none;
  padding: 10px 38px 10px 14px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease,
              background-color 0.25s ease;
}
.select select:hover {
  border-color: var(--primary);
}
.select > svg {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-2);
}

.results-meta {
  margin-left: auto;
  color: var(--text-2);
  font-size: 0.88rem;
}

/* Directory grid — exact 3 / 2 / 1 columns */
.grid--dir {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-5);
}
@media (max-width: 1024px) {
  .grid--dir {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 680px) {
  .grid--dir {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar .tabs {
    width: 100%;
  }
  .select,
  .select select {
    width: 100%;
  }
  .results-meta {
    margin-left: 0;
    order: -1; /* count first on mobile */
  }
}

/* Pagination */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: clamp(40px, 6vw, 56px);
}
.pager__btn {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding-inline: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 0.92rem;
  font-weight: 600;
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease;
}
.pager__btn:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--primary);
}
.pager__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.pager__num.is-current {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 6px 16px -8px var(--ring);
}
.pager__dots {
  color: var(--text-2);
  padding-inline: 2px;
}

/* Empty state */
.empty-state {
  padding: clamp(48px, 7vw, 72px) var(--sp-5);
  text-align: center;
  background: var(--card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
}
.empty-state__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto var(--sp-5);
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
}
.empty-state__icon svg {
  width: 28px;
  height: 28px;
}
.empty-state p {
  max-width: 44ch;
  margin: var(--sp-3) auto 0;
  color: var(--text-2);
}
.empty-state .btn {
  margin-top: var(--sp-5);
}


/* ---- 5.18 Tool Details Page ---------------------------------------------- */

/* Content + sidebar shell. The sidebar element is placed after the article element in the DOM, so it
   naturally stacks BELOW the content on mobile. */
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: var(--sp-6);
  align-items: start;
}
@media (max-width: 1023.98px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }
}

/* Tool hero card */
.tool-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-5);
  padding: clamp(24px, 4vw, 34px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: background-color 0.25s ease;
}
.tool-hero__logo {
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  border-radius: 18px;
  font-size: 1.9rem;
}
.tool-hero__body {
  flex: 1;
  min-width: 230px;
}
.tool-hero h1 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
}
.tool-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
  font-size: 0.9rem;
  color: var(--text-2);
}
.tool-hero__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 180px;
}
@media (max-width: 560px) {
  .tool-hero__actions {
    width: 100%;
  }
}

/* Article sections */
.section-block {
  margin-top: clamp(40px, 6vw, 60px);
}
.section-block[aria-labelledby="related-h"] {
  margin-bottom: clamp(40px, 6vw, 60px);
}
.section-block > h2 {
  margin-bottom: var(--sp-5);
}
.lede {
  color: var(--text-2);
  line-height: 1.7;
}

/* Key features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: var(--sp-3);
}
.feature-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: background-color 0.25s ease;
}
.feature-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--success);
}
.feature-item p {
  font-size: 0.9rem;
}

/* Pricing tiers */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: var(--sp-4);
}
.tier {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px 22px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: background-color 0.25s ease;
}
.tier.is-popular {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-md);
}
.tier > .badge {
  position: absolute;
  top: 14px;
  right: 14px;
  left: auto;
  transform: none;
}
.tier h3 {
  font-size: 0.98rem;
}
.tier-price {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.tier-period {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-2);
}
.tier ul {
  display: grid;
  gap: 9px;
  margin-top: var(--sp-3);
}
.tier li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.88rem;
  color: var(--text-2);
}
.tier li svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 4px;
  color: var(--secondary);
}
.tier .btn {
  margin-top: var(--sp-4);
}

/* Pros & cons */
.procons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--sp-4);
}
.pc-card {
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: background-color 0.25s ease;
}
.pc-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--sp-4);
  font-size: 1rem;
}
.pc-card h3 svg {
  width: 18px;
  height: 18px;
}
.pc-card--pros h3 svg { color: var(--success); }
.pc-card--cons h3 svg { color: var(--danger); }
.pc-card ul {
  display: grid;
  gap: 10px;
}
.pc-card li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.9rem;
  color: var(--text-2);
}
.pc-card li svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  margin-top: 4px;
}

/* Editor's rating */
.score-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-6);
  align-items: center;
  padding: 26px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: background-color 0.25s ease;
}
.score-badge {
  padding-right: var(--sp-6);
  text-align: center;
  border-right: 1px dashed var(--border);
}
.score-num {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--primary-strong), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.score-cap {
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-2);
}
.score-bars {
  display: grid;
  gap: var(--sp-4);
  min-width: 0;
}
.bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 42px;
  gap: var(--sp-3);
  align-items: center;
  font-size: 0.85rem;
}
.bar-row .lbl {
  color: var(--text-2);
}
.bar-row .val {
  font-weight: 700;
  text-align: right;
}
.bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
}
.bar-fill {
  height: 100%;
  width: var(--w, 50%);
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}
.score-note {
  grid-column: 1 / -1;
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--text-2);
}
@media (max-width: 720px) {
  .score-wrap {
    grid-template-columns: 1fr;
  }
  .score-badge {
    padding-right: 0;
    padding-bottom: var(--sp-5);
    border-right: 0;
    border-bottom: 1px dashed var(--border);
  }
  .bar-row {
    grid-template-columns: 90px 1fr 38px;
  }
}

/* Sidebar */
.side-stack {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  display: grid;
  gap: var(--sp-5);
}
@media (max-width: 1023.98px) {
  .side-stack {
    position: static;
  }
}
.side-card {
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: background-color 0.25s ease;
}
.side-title {
  margin-bottom: var(--sp-3);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.meta-list .meta-row {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-block: 11px;
  border-bottom: 1px dashed var(--border);
  font-size: 0.9rem;
}
.meta-list .meta-row:last-child {
  border-bottom: 0;
}
.meta-row dt {
  color: var(--text-2);
}
.meta-row dd {
  font-weight: 600;
  text-align: right;
}
.disclosure {
  margin-top: 10px;
  font-size: 0.75rem;
  text-align: center;
  color: var(--text-2);
}

/* FAQ accordion (accessible: button + aria-expanded + animated reveal) */
.acc {
  padding: 4px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: background-color 0.25s ease;
}
.acc-item + .acc-item {
  border-top: 1px dashed var(--border);
}
.acc-heading {
  margin: 0;
}
.acc-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  width: 100%;
  padding-block: 17px;
  text-align: left;
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--text);
  transition: color 0.18s ease;
}
.acc-trigger:hover {
  color: var(--link);
}
.acc-trigger svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-2);
  transition: transform 0.25s ease;
}
.acc-item.is-open .acc-trigger {
  color: var(--link);
}
.acc-item.is-open .acc-trigger svg {
  transform: rotate(180deg);
}
/* Animated open/close via grid-template-rows; visibility keeps the closed
   content out of the tab order and off screen readers. */
.acc-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s ease;
}
.acc-item.is-open .acc-panel {
  grid-template-rows: 1fr;
}
.acc-panel__inner {
  overflow: hidden;
  visibility: hidden;
  transition: visibility 0s 0.28s;
}
.acc-item.is-open .acc-panel__inner {
  visibility: visible;
  transition: visibility 0s 0s;
}
.acc-panel p {
  padding-bottom: 17px;
  color: var(--text-2);
  font-size: 0.92rem;
  line-height: 1.65;
}

/* Honest demo-content notice (used on reviews page & elsewhere) */
.demo-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: var(--sp-5);
  padding: 11px 15px;
  border: 1px solid rgba(124, 92, 252, 0.28);
  border-radius: 12px;
  background: var(--primary-soft);
  font-size: 0.85rem;
}
.demo-note svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--primary);
}

/* ---- 5.19 Reviews Page ----------------------------------------------------- */

.review-hero {
  position: relative;
  overflow: clip;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-5);
  padding: clamp(24px, 4vw, 36px);
  background: var(--card);
  border: 1px solid rgba(124, 92, 252, 0.35);
  border-radius: var(--r-lg);
  transition: background-color 0.25s ease;
}
.review-hero::before {
  content: "";
  position: absolute;
  top: -160px;
  right: -60px;
  width: 380px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--orb-a);
  filter: blur(90px);
  pointer-events: none;
}
.review-hero > * {
  position: relative;
}
.review-hero__logo {
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  border-radius: 16px;
  font-size: 1.6rem;
}
.review-hero__body {
  flex: 1;
  min-width: 250px;
}
.review-hero h2 {
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
  margin-top: var(--sp-2);
}
.review-hero__summary {
  margin-top: var(--sp-2);
  color: var(--text-2);
  font-size: 0.94rem;
}
.review-hero__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 170px;
}
@media (max-width: 560px) {
  .review-hero__actions {
    width: 100%;
  }
}

/* Compact search + count row for filterable archives */
.rev-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-4);
  margin-top: var(--sp-5);
}
.search--compact {
  flex: 1;
  min-width: 250px;
  max-width: 380px;
  margin: 0;
  padding: 4px 4px 4px 16px;
}
.search--compact input {
  padding-block: 9px;
}


/* ---- 5.20 Comparison Page -------------------------------------------------- */

/* Scroll container — intentional horizontal scrolling on small screens */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: background-color 0.25s ease;
}

.cmp-table {
  width: 100%;
  min-width: 660px;               /* forces tidy horizontal scroll on mobile */
  border-collapse: collapse;
  font-size: 0.92rem;
}
.cmp-table th,
.cmp-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px dashed var(--border);
}
.cmp-table thead th {
  padding-top: 20px;
  padding-bottom: 16px;
  vertical-align: top;
  border-bottom: 1px solid var(--border-strong);
}
.cmp-table tbody tr:last-child th,
.cmp-table tbody tr:last-child td {
  border-bottom: 0;
}
.cmp-table .row-label {
  width: 200px;
  font-weight: 600;
  color: var(--text);
}

/* Sticky first column while scrolling horizontally */
.cmp-sticky {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--card);
  box-shadow: inset -1px 0 0 var(--border);
}
.cmp-table thead .cmp-sticky {
  z-index: 3;
}

/* Per-column tool picker */
.cmp-head .select {
  width: 100%;
  margin-top: var(--sp-3);
}
.cmp-head .select select {
  width: 100%;
}

/* Value cells */
.cmp-val {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.cmp-yes { color: var(--success); }
.cmp-mid { color: var(--star); }
.cmp-no  { color: var(--text-2); opacity: 0.75; }
.cmp-val svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.cmp-note {
  margin-top: var(--sp-4);
  font-size: 0.82rem;
  color: var(--text-2);
}
.scroll-hint {
  display: none;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-2);
  text-align: right;
}
@media (max-width: 780px) {
  .scroll-hint {
    display: block;
  }
}

/* Enriched category cards (categories.html) */
.cat-card--lg {
  align-items: flex-start;
  padding: 20px;
}
.cat-card--lg .cat-icon {
  width: 48px;
  height: 48px;
  border-radius: 13px;
}
.cat-card__desc {
  margin-top: 3px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-2);
}
.cat-card--lg .btn {
  margin-left: auto;
  flex-shrink: 0;
  align-self: center;
}


/* ---- 5.21 Blog, Article, Search & 404 ------------------------------------- */

/* Blog index: content + sidebar */
.blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--sp-6);
  align-items: start;
}
@media (max-width: 1023.98px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }
}

/* Featured post hero */
.post-hero {
  position: relative;
  overflow: clip;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5);
  padding: clamp(20px, 3vw, 30px);
  background: var(--card);
  border: 1px solid rgba(124, 92, 252, 0.35);
  border-radius: var(--r-lg);
  transition: background-color 0.25s ease;
}
.post-hero__thumb {
  width: min(340px, 100%);
  flex-shrink: 0;
  aspect-ratio: 16 / 10;
}
.post-hero__body {
  flex: 1;
  min-width: 270px;
  display: flex;
  flex-direction: column;
}
.post-hero h2 {
  margin-top: var(--sp-3);
  font-size: clamp(1.3rem, 2.4vw, 1.65rem);
}
.post-hero__excerpt {
  margin-top: var(--sp-3);
  color: var(--text-2);
  font-size: 0.94rem;
}
.post-hero .btn {
  margin-top: var(--sp-4);
  align-self: flex-start;
}

/* Sidebar widgets */
.widget + .widget {
  margin-top: var(--sp-5);
}
.pop-list .pop-item {
  display: flex;
  gap: var(--sp-3);
  padding-block: 13px;
  border-bottom: 1px dashed var(--border);
}
.pop-item:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}
.pop-num {
  width: 26px;
  flex-shrink: 0;
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-2);
}
.pop-item:nth-child(-n+3) .pop-num {
  background: linear-gradient(135deg, var(--primary-strong), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.pop-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
}
.pop-title a:hover {
  color: var(--link);
}
.pop-meta {
  margin-top: 3px;
  font-size: 0.75rem;
  color: var(--text-2);
}
.cat-list li {
  display: flex;
  align-items: center;
  justify-content:space-between;
  padding-block: 10px;
  border-bottom: 1px dashed var(--border);
}
.cat-list li:last-child {
  border-bottom: 0;
}
.cat-list a {
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.18s ease;
}
.cat-list a:hover {
  color: var(--link);
}
.cat-count {
  font-size: 0.78rem;
  color: var(--text-2);
}

/* Single post */
.article-header {
  max-width: 780px;
  margin: var(--sp-6) auto 0;
  text-align: center;
}
.article-header h1 {
  margin-top: var(--sp-4);
  font-size: clamp(1.85rem, 3.8vw, 3rem);
  letter-spacing: -0.03em;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  margin-top: var(--sp-5);
  color: var(--text-2);
  font-size: 0.88rem;
}
.article-meta .meta-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
}
.featured-img {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 7;
  margin-top: clamp(24px, 4vw, 36px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: clip;
  background:
    radial-gradient(var(--grid-dot) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(135deg, var(--primary-soft), var(--secondary-soft)),
    var(--card-soft);
  color: var(--primary);
}
.featured-img svg {
  width: 64px;
  height: 64px;
  opacity: 0.55;
}
.img-caption {
  margin-top: var(--sp-3);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-2);
}

/* Article prose */
.prose {
  margin-top: clamp(32px, 5vw, 48px);
  font-size: 1.02rem;
}
.prose p {
  margin-bottom: 1.15em;
  line-height: 1.78;
}
.prose h2 {
  margin: 2em 0 0.6em;
  font-size: 1.5rem;
}
.prose h3 {
  margin: 1.6em 0 0.5em;
  font-size: 1.17rem;
}
.prose ul {
  margin: 0 0 1.3em;
  padding-left: 22px;
}
.prose li {
  margin-bottom: 0.55em;
  line-height: 1.7;
}
.prose li::marker {
  color: var(--primary);
}
.prose a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose strong {
  color: var(--text);
}
.prose blockquote {
  margin: 1.6em 0;
  padding: 6px 0 6px 22px;
  border-left: 3px solid var(--primary);
  font-size: 1.06rem;
  line-height: 1.7;
}
.prose blockquote cite {
  display: block;
  margin-top: 8px;
  font-size: 0.82rem;
  font-style: normal;
  color: var(--text-2);
}

/* Table of contents */
.toc-list {
  counter-reset: toc;
}
.toc-list li {
  display: flex;
  gap: 8px;
}
.toc-list > li::before {
  counter-increment: toc;
  content: counter(toc) ".";
  color: var(--primary);
  font-weight: 700;
}
.toc-list a {
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text-2);
  transition: color 0.18s ease, background-color 0.18s ease;
}
.toc-list a:hover {
  color: var(--text);
  background: var(--bg-soft);
}

/* Reading progress bar (single-post only) */
#read-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  pointer-events: none;
}

/* Author box */
.author-box {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-top: clamp(40px, 6vw, 56px);
  padding: var(--sp-5);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.author-box .avatar {
  width: 56px;
  height: 56px;
  font-size: 1rem;
}
.author-box p {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 0.9rem;
  max-width: 60ch;
}

/* Search page */
.search-hero {
  max-width: 720px;
  margin-inline: auto;
  padding-top: clamp(40px, 6vw, 72px);
  text-align: center;
}
.results-group {
  margin-top: clamp(36px, 5vw, 56px);
}
.results-group > h2 {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

/* 404 */
.error-hero {
  padding-block: clamp(72px, 11vw, 130px);
  text-align: center;
}
.error-code {
  font-size: clamp(5.5rem, 17vw, 10rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--primary-strong), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}


/* Thumbnail link wrapper keeps card corners clipped */
.blog-thumb-link {
  display: block;
}

/* On mobile, the article TOC moves ABOVE the prose */
@media (max-width: 1023.98px) {
  .detail-layout > .toc-aside {
    order: -1;
    margin-bottom: var(--sp-5);
    position: static;
  }
}


/* ---- 5.22 UI/UX Refinement Pass (Phase 7) ---------------------------------
   Micro-interactions, touch-safe hovers, skeleton loaders, back-to-top,
   form focus rings and small consistency helpers. All animation here is
   disabled automatically by the global prefers-reduced-motion rule in §8.
---------------------------------------------------------------------------- */

/* Pushed-right badges in card headers (replaces old inline styles) */
.deal-card .tool-card__head .badge,
.review-card .tool-card__head .badge {
  margin-left: auto;
}

/* Micro-lifts — hover-capable pointers only, so touch taps stay still */
@media (hover: hover) {
  .chip:hover,
  .chip-btn:not([aria-pressed="true"]):hover {
    transform: translateY(-1px);
  }
  .btn--primary:hover,
  .btn--ghost:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px -12px var(--ring);
  }
  .btn--primary:active,
  .btn--ghost:active {
    transform: translateY(1px);
    box-shadow: none;
  }
  .blog-card:hover .blog-thumb svg,
  .post-hero:hover .blog-thumb svg {
    transform: scale(1.06);
  }
}
.chip,
.chip-btn {
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease,
    transform 0.18s ease;
}
.blog-thumb svg {
  transition: transform 0.35s ease;
}
.btn--primary,
.btn--ghost {
  will-change: auto;
}

/* Touch devices: neutralise card hover lifts (avoids sticky-hover) */
@media (hover: none) {
  .tool-card:hover,
  .rank-card:hover,
  .deal-card:hover,
  .review-card:hover,
  .blog-card:hover,
  .cat-card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
    border-color: var(--border);
  }
}

/* Form controls: consistent focus treatment */
.select select:focus {
  border-color: var(--primary);
}
.select select:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 4px var(--ring);
}
.input-pill {
  width: 100%;
  padding: 11px 16px;
  font-size: 0.95rem;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.input-pill::placeholder {
  color: var(--text-2);
}
.input-pill:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

/* Mobile drawer: current-page emphasis */
.nav-drawer a[aria-current="page"] {
  color: var(--text);
}

/* Skeleton loaders (pre-JS placeholders; renderers overwrite them) */
.skel {
  display: block;
  background: var(--card-soft);
  border-radius: 8px;
  animation: skel-pulse 1.5s ease-in-out infinite;
}
@keyframes skel-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}
.skel-line {
  height: 12px;
  margin-block: 7px;
}
.w20 { width: 20%; }
.w25 { width: 25%; }
.w30 { width: 30%; }
.w40 { width: 40%; }
.w60 { width: 60%; }
.w75 { width: 75%; }
.skel-logo {
  width: 50px;
  height: 50px;
  border-radius: 13px;
  flex-shrink: 0;
}
.skel-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
}
.skel-btn {
  height: 36px;
  width: 92px;
  border-radius: 10px;
  margin-left: auto;
}
.skel-card {
  pointer-events: none;
}
.skel-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Back-to-top (button injected by main.js on every page) */
.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  color: var(--text-2);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s ease,
    color 0.18s ease,
    border-color 0.18s ease;
}
.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.to-top:hover {
  color: var(--link);
  border-color: var(--primary);
  transform: translateY(-2px);
}
.to-top svg {
  width: 20px;
  height: 20px;
}
@media (max-width: 480px) {
  .to-top {
    right: 12px;
    bottom: 12px;
  }
}


/* ---- 5.23 Support-page forms (submit-tool / contact) ---------------------- */

.form-card {
  max-width: 860px;
  margin-inline: auto;
  padding: clamp(24px, 4vw, 40px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: background-color 0.25s ease;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
}
.form-grid .field--full {
  grid-column: 1 / -1;
}
@media (max-width: 680px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field > label {
  font-size: 0.85rem;
  font-weight: 600;
}
textarea.input-pill {
  min-height: 130px;
  resize: vertical;
  border-radius: var(--r-md);
  line-height: 1.6;
}
select.input-pill {
  cursor: pointer;
}
.form-note {
  margin-top: var(--sp-3);
  font-size: 0.8rem;
  color: var(--text-2);
}
.demo-msg {
  min-height: 1.4em;
  margin-top: var(--sp-3);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--secondary);
}


/* ==========================================================================
   6. FOOTER
   ========================================================================== */

.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding-top: clamp(56px, 7vw, 84px);
  transition: background-color 0.25s ease;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1fr 1fr;
  gap: var(--sp-6);
}

.footer-brand .brand svg {
  width: 28px;
  height: 28px;
}
.footer-desc {
  margin-top: var(--sp-4);
  max-width: 36ch;
  color: var(--text-2);
  font-size: 0.92rem;
  line-height: 1.65;
}

.socials {
  display: flex;
  gap: 10px;
  margin-top: var(--sp-5);
}
.socials a {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-2);
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease;
}
.socials a:hover {
  color: var(--text);
  border-color: var(--primary);
  background: var(--primary-soft);
}
.socials svg {
  width: 17px;
  height: 17px;
}

.footer-title {
  margin-bottom: var(--sp-4);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text);
}

.footer-links li + li {
  margin-top: 11px;
}
.footer-links a {
  color: var(--text-2);
  font-size: 0.92rem;
  transition: color 0.18s ease;
}
.footer-links a:hover {
  color: var(--link);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: clamp(48px, 6vw, 72px);
  padding-block: var(--sp-5);
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.85rem;
}

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}
@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ==========================================================================
   7. UTILITIES & HELPERS
   ========================================================================== */

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


/* ==========================================================================
   8. ACCESSIBILITY & MOTION PREFERENCES
   ========================================================================== */

/* Skip link — visible only when focused via keyboard */
.skip-link {
  position: fixed;
  top: -60px;
  left: var(--sp-4);
  z-index: 100;
  padding: 11px 18px;
  background: var(--primary);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0;
}

/* Consistent keyboard focus ring */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
