/* Ultimate Free Tools — brand overrides on top of Tailwind Play CDN. */

:root {
	--uft-brand-500: #7C5CFC;
	--uft-brand-600: #6D46F5;
	--uft-brand-900: #241A5C;
	--uft-mint-500: #10E0A0;
	--uft-ink-950: #0B0B14;
	--uft-surface: #FAFAF7;
	--uft-gradient-brand: linear-gradient(135deg, #7C5CFC 0%, #6D46F5 45%, #4326A6 100%);
	--uft-gradient-shine: linear-gradient(135deg, #8B72FF 0%, #10E0A0 100%);
	--uft-shadow-brand: 0 20px 60px -20px rgba(109,70,245,0.35);
	--uft-shadow-soft:  0 8px 30px -12px rgba(11,11,20,0.10);
	--uft-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html, body { background: var(--uft-surface); overflow-x: hidden; max-width: 100%; }
body { font-family: 'Inter', ui-sans-serif, system-ui, sans-serif; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4,.font-display { font-family: 'Space Grotesk', 'Inter', ui-sans-serif, system-ui; letter-spacing: -0.015em; text-wrap: balance; overflow-wrap: anywhere; }
p, li, dd, dt, span, a, blockquote { overflow-wrap: anywhere; }
p { text-wrap: pretty; }
img, video, iframe, canvas, svg { max-width: 100%; height: auto; }
pre, code { max-width: 100%; overflow-x: auto; word-wrap: break-word; white-space: pre-wrap; }
table { max-width: 100%; }
.uft-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }


/* Fluid hero H1 — smoother than Tailwind's step jump */
.uft-hero-title { font-size: clamp(2.25rem, 5.2vw + 0.5rem, 4.5rem); line-height: 1.02; letter-spacing: -0.03em; }

/* Selection */
::selection { background: rgba(124,92,252,0.25); color: #12121F; }

/* Global focus-visible only — keep native :focus outline for assistive tech
   (screen-reader / keyboard users still get a visible ring without hiding
   default focus for mouse users on custom widgets). */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
	outline: none;
	box-shadow: 0 0 0 2px var(--uft-surface), 0 0 0 4px rgba(124,92,252,0.55);
	border-radius: 0.5rem;
}

/* Nav menu fallback */
#uft-main a { text-decoration: none; }
header nav ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 1.5rem; }
header nav ul li a { color: rgb(75 85 99); font-size: 0.875rem; font-weight: 500; }
header nav ul li a:hover { color: var(--uft-ink-950); }

/* Animated underline for primary nav links */
header nav a[class*="rounded-lg"] { position: relative; }
header nav a[class*="rounded-lg"]::after {
	content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px; border-radius: 2px;
	background: var(--uft-gradient-brand); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--uft-ease);
}
header nav a[class*="rounded-lg"]:hover::after { transform: scaleX(1); }

/* Line clamp fallbacks */
.line-clamp-1 { display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical; overflow:hidden; }
.line-clamp-2 { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.line-clamp-3 { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }

/* Fullscreen embed */
.uft-embed.is-fullscreen { position: fixed !important; inset: 0 !important; z-index: 100 !important; border-radius: 0 !important; }
.uft-embed.is-fullscreen iframe { height: 100vh !important; min-height: 0 !important; }

/* Prose fallback */
.prose h2 { font-family: 'Space Grotesk', sans-serif; font-size: 1.6rem; font-weight: 600; margin-top: 1.75rem; margin-bottom: 0.75rem; letter-spacing:-0.01em;}
.prose h3 { font-family: 'Space Grotesk', sans-serif; font-size: 1.2rem; font-weight: 600; margin-top: 1.25rem; margin-bottom: 0.5rem; }
.prose p  { margin: 0.85rem 0; line-height: 1.75; color:#374151;}
.prose ul { list-style: disc; padding-left: 1.25rem; margin: 0.85rem 0; color:#374151;}
.prose a  { color: var(--uft-brand-600); text-decoration: underline; text-underline-offset: 3px;}

/* Brand utilities */
.uft-gradient-text {
	background: var(--uft-gradient-brand);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}
.uft-mark {
	background: var(--uft-gradient-brand);
	color:#fff;
	box-shadow: var(--uft-shadow-brand);
}

/* Unified card */
.uft-card {
	position: relative;
	background: #fff;
	border: 1px solid rgba(17,17,31,0.06);
	border-radius: 1.25rem;
	transition: transform .3s var(--uft-ease), box-shadow .3s var(--uft-ease);
}
.uft-card::after {
	content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
	box-shadow: 0 0 0 1px transparent inset; transition: box-shadow .3s var(--uft-ease);
}
.uft-card:hover {
	box-shadow: var(--uft-shadow-brand);
	transform: translateY(-3px);
}
.uft-card:hover::after { box-shadow: 0 0 0 1px rgba(124,92,252,0.45) inset; }

/* Free badge */
.uft-badge-free {
	display:inline-flex; align-items:center; gap:0.25rem;
	background: rgba(16,224,160,0.12);
	color: #0B8F69;
	font-weight:600; font-size:11px; text-transform:uppercase; letter-spacing:0.08em;
	padding: 3px 8px; border-radius: 999px;
}

/* Header scroll state */
header.uft-header { transition: box-shadow .25s ease, background-color .25s ease, border-color .25s ease, backdrop-filter .25s ease; }
header.uft-header.is-scrolled {
	box-shadow: var(--uft-shadow-soft);
	background-color: rgba(255,255,255,0.85) !important;
	backdrop-filter: saturate(1.4) blur(14px);
	-webkit-backdrop-filter: saturate(1.4) blur(14px);
}

/* Mobile drawer */
.uft-drawer { transform: translateX(100%); transition: transform .35s var(--uft-ease); }
.uft-drawer.is-open { transform: translateX(0); }
.uft-drawer-backdrop { opacity: 0; pointer-events:none; transition: opacity .3s ease; }
.uft-drawer-backdrop.is-open { opacity: 1; pointer-events:auto; }

/* Command palette */
.uft-cmdk-backdrop { background: rgba(11,11,20,0.55); backdrop-filter: blur(6px); }

/* Footer glow (repositioned for mobile so it does not clip) */
.uft-footer-glow {
	position:absolute; right:-6rem; top:-8rem; width:24rem; height:24rem; border-radius:9999px;
	background: radial-gradient(closest-side, rgba(124,92,252,0.32), transparent 70%);
	filter: blur(24px); pointer-events:none;
}
@media (min-width: 768px) {
	.uft-footer-glow { right:-10rem; top:-10rem; width:32rem; height:32rem; }
}

/* Category tile color rotation */
.uft-tile-0 { background: linear-gradient(135deg,#EEE9FF,#DED3FF); color:#5B34D6; }
.uft-tile-1 { background: linear-gradient(135deg,#E1FBF1,#BFF3DE); color:#0B8F69; }
.uft-tile-2 { background: linear-gradient(135deg,#FFE8F0,#FFD0DE); color:#B6316B; }
.uft-tile-3 { background: linear-gradient(135deg,#FFF3D9,#FFE0A8); color:#8A5A00; }

/* Kbd */
.uft-kbd {
	font-family: 'Space Grotesk', sans-serif;
	font-size: 11px;
	padding: 2px 6px;
	border-radius: 6px;
	background: rgba(17,17,31,0.06);
	color:#4B5563;
	border: 1px solid rgba(17,17,31,0.08);
	border-bottom-width: 2px;
}

/* Sticky mobile bottom nav */
.uft-mobile-nav { position: fixed !important; left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important; z-index: 9999; box-shadow: 0 -6px 24px -12px rgba(11,11,20,0.15); padding-bottom: env(safe-area-inset-bottom); transform: translateZ(0); will-change: transform; }
.uft-mobile-nav a, .uft-mobile-nav button { text-decoration: none; transition: color .2s ease, transform .2s ease; }
.uft-mobile-nav a:active, .uft-mobile-nav button:active { transform: scale(0.94); }
.uft-mobile-nav a.is-active { color: var(--uft-brand-600); }
.uft-mobile-nav a.is-active svg { color: var(--uft-brand-600); }

/* Logo: keep tight on small screens */
@media (max-width: 480px) {
	.uft-mark { width: 2rem; height: 2rem; border-radius: 0.6rem; }
}

/* Scroll-reveal (progressively enhanced by main.js) */
.uft-reveal { opacity: 0; transform: translateY(10px); transition: opacity .6s var(--uft-ease), transform .6s var(--uft-ease); will-change: opacity, transform; }
.uft-reveal.is-visible { opacity: 1; transform: none; }

/* Dismissible announcement */
.uft-announce { display: flex; }
.uft-announce.is-dismissed { display: none; }

/* Respect user preferences */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
	.uft-reveal { opacity: 1; transform: none; }
}

/* Ad slots: neutral placeholder until real ad code is injected */
.uft-ad { background-image: repeating-linear-gradient(45deg, rgba(0,0,0,0.02) 0 6px, transparent 6px 12px); }
.uft-ad:has(ins), .uft-ad:has(iframe), .uft-ad:has(script) { background-image: none; border-style: none; }

/* Blog article TOC active state */
.uft-toc a.is-active { color: var(--uft-brand-600); border-left-color: var(--uft-brand-600); font-weight: 600; }
.uft-article { scroll-margin-top: 100px; }
.uft-article h2, .uft-article h3 { scroll-margin-top: 100px; }
.uft-article h2 { position: relative; }
.uft-article h2::before { content: ""; position: absolute; left: -1rem; top: 0.6em; width: 4px; height: 1.2rem; border-radius: 4px; background: var(--uft-gradient-brand); opacity: 0.85; }
@media (max-width: 640px) { .uft-article h2::before { display: none; } }

/* Skip link — visible on keyboard focus, jumps past hero + TOC to article body */
.uft-skip-link {
	position: fixed;
	top: 0.75rem;
	left: 0.75rem;
	z-index: 100;
	background: var(--uft-ink-950);
	color: #fff;
	font-weight: 600;
	font-size: 0.875rem;
	padding: 0.625rem 1rem;
	border-radius: 0.75rem;
	box-shadow: var(--uft-shadow-brand);
	transform: translateY(-150%);
	transition: transform .2s var(--uft-ease);
	text-decoration: none;
}
.uft-skip-link:focus,
.uft-skip-link:focus-visible {
	transform: translateY(0);
	outline: none;
	box-shadow: 0 0 0 3px rgba(124,92,252,0.55), var(--uft-shadow-brand);
}

/* ============================================================
   Modern polish + accessibility (v1.6)
   ============================================================ */

/* Fluid safe-area padding for edge-to-edge devices */
:root {
	--uft-safe-x: max(1rem, env(safe-area-inset-left));
	--uft-radius-lg: 1.25rem;
}

/* Prefer dynamic viewport units where supported (avoids mobile URL-bar jump) */
@supports (height: 100dvh) {
	.min-h-screen { min-height: 100dvh; }
	.h-screen { height: 100dvh; }
}

/* Sanity: never let media overflow its container */
img, svg, video, canvas, iframe { max-width: 100%; }
img, video { height: auto; }

/* Native form controls inherit brand accent */
:root { accent-color: var(--uft-brand-600); caret-color: var(--uft-brand-600); }

/* Higher-contrast body text (was drifting close to WCAG AA floor) */
body { color: #1F2230; }

/* Card: crisper focus-visible ring for keyboard users + smoother reduced-motion */
.uft-card:focus-visible,
.uft-card:focus-within:not(:focus:not(:focus-visible)) {
	box-shadow: 0 0 0 3px rgba(124,92,252,0.35), var(--uft-shadow-brand);
	transform: translateY(-3px);
	outline: none;
}
.uft-card h3 { text-wrap: balance; }
@media (prefers-reduced-motion: reduce) {
	.uft-card:hover, .uft-card:focus-within { transform: none; }
}

/* Reduce hover motion on touch devices (they never truly "hover") */
@media (hover: none) {
	.uft-card:hover { transform: none; box-shadow: var(--uft-shadow-soft); }
	.uft-card:hover::after { box-shadow: none; }
}

/* Ensure primary tap targets meet 44×44 on mobile bottom nav */
.uft-mobile-nav a,
.uft-mobile-nav button { min-height: 44px; }
.uft-mobile-nav a:focus-visible,
.uft-mobile-nav button:focus-visible { color: var(--uft-brand-600); }

/* Back-to-top: subtle lift, respects reduced motion */
.uft-to-top { transition: transform .2s var(--uft-ease), box-shadow .25s var(--uft-ease), color .2s ease, border-color .2s ease; }
.uft-to-top:hover { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .uft-to-top:hover { transform: none; } }

/* Subtle custom scrollbars — only on non-touch, opts out of macOS overlay */
@media (hover: hover) {
	* { scrollbar-width: thin; scrollbar-color: rgba(17,17,31,0.25) transparent; }
	*::-webkit-scrollbar { width: 10px; height: 10px; }
	*::-webkit-scrollbar-thumb { background: rgba(17,17,31,0.22); border: 2px solid transparent; background-clip: padding-box; border-radius: 999px; }
	*::-webkit-scrollbar-thumb:hover { background: rgba(124,92,252,0.55); background-clip: padding-box; border: 2px solid transparent; }
}

/* High-contrast mode: keep essential ring visible */
@media (forced-colors: active) {
	:where(a, button, input, textarea, select, [tabindex]):focus-visible {
		outline: 2px solid CanvasText;
		box-shadow: none;
	}
	.uft-card { border-color: CanvasText; }
}

/* aria-current styling for nav (JS marks the active link) */
header nav a[aria-current="page"],
.uft-drawer nav a[aria-current="page"] {
	color: var(--uft-ink-950);
	background: rgba(124,92,252,0.08);
}
.uft-mobile-nav a[aria-current="page"] { color: var(--uft-brand-600); }
.uft-mobile-nav a[aria-current="page"] svg { color: var(--uft-brand-600); }

/* Print: strip chrome, keep readable content */
@media print {
	.uft-header, .uft-mobile-nav, .uft-to-top,
	aside, [data-uft-cmdk-overlay], [data-uft-drawer],
	[data-uft-drawer-backdrop], .uft-ad, .uft-announce { display: none !important; }
	body { background: #fff !important; color: #000 !important; }
	a { color: #000 !important; text-decoration: underline; }
	.uft-card { box-shadow: none !important; border: 1px solid #ccc !important; }
}

/* ============================================================
   Dark mode (v1.6) — html.dark switches surfaces + text
   ============================================================ */
html.dark {
	--uft-surface: #0B0B14;
	--uft-surface-muted: #12121F;
	--uft-ink-950: #F5F5F7;
	color-scheme: dark;
}
html.dark body { background: #0B0B14; color: #E6E6EC; }
html.dark ::selection { background: rgba(124,92,252,0.55); color: #fff; }

/* Surfaces */
html.dark .bg-white,
html.dark .bg-white\/75,
html.dark .bg-white\/85,
html.dark .bg-white\/95 { background-color: #12121F !important; }
html.dark .bg-gray-50,
html.dark .bg-gray-50\/40,
html.dark .bg-gray-50\/60 { background-color: #1B1B2E !important; }
html.dark .bg-surface { background-color: #0B0B14 !important; }
html.dark .bg-surface-muted { background-color: #12121F !important; }
html.dark .bg-black\/5 { background-color: rgba(255,255,255,0.06) !important; }
html.dark .bg-brand-100 { background-color: rgba(124,92,252,0.18) !important; }
html.dark .bg-brand-100\/70 { background-color: rgba(124,92,252,0.14) !important; }
html.dark .bg-ink-950 { background-color: #05050A !important; }

/* Text scale — WCAG-safe contrasts on dark surfaces */
html.dark .text-ink-950,
html.dark .text-gray-900 { color: #F5F5F7 !important; }
html.dark .text-gray-800 { color: #E4E4EA !important; }
html.dark .text-gray-700 { color: #CFCFD8 !important; }
html.dark .text-gray-600 { color: #B4B4C0 !important; }
html.dark .text-gray-500 { color: #9A9AA8 !important; }
html.dark .text-gray-400 { color: #7B7B8A !important; }
html.dark .text-gray-300 { color: #5A5A6A !important; }
html.dark .text-brand-700 { color: #AA98FF !important; }
html.dark .text-brand-600 { color: #8B72FF !important; }

/* Borders */
html.dark .border-gray-100,
html.dark .border-gray-200,
html.dark .border-black\/5,
html.dark .border-black\/10 { border-color: rgba(255,255,255,0.08) !important; }
html.dark .border-brand-300 { border-color: rgba(139,114,255,0.4) !important; }

/* Card shell */
html.dark .uft-card { background: #12121F; border-color: rgba(255,255,255,0.06); }
html.dark .uft-card:hover::after { box-shadow: 0 0 0 1px rgba(139,114,255,0.55) inset; }

/* Header + drawer */
html.dark header.uft-header { background-color: rgba(11,11,20,0.75) !important; border-bottom-color: rgba(255,255,255,0.06); }
html.dark header.uft-header.is-scrolled { background-color: rgba(11,11,20,0.85) !important; }
html.dark .uft-drawer { background: #12121F; }
html.dark .uft-mobile-nav { background-color: rgba(11,11,20,0.92) !important; border-top-color: rgba(255,255,255,0.08); }

/* Chips + kbd */
html.dark .uft-kbd { background: rgba(255,255,255,0.08); color: #CFCFD8; border-color: rgba(255,255,255,0.10); }
html.dark .uft-badge-free { background: rgba(16,224,160,0.14); color: #6EE7B7; }

/* Tile rotation — lower saturation on dark */
html.dark .uft-tile-0 { background: linear-gradient(135deg,#2A1E5E,#1F1748); color:#C9BAFF; }
html.dark .uft-tile-1 { background: linear-gradient(135deg,#0F3A2C,#0A2A20); color:#7EEDC1; }
html.dark .uft-tile-2 { background: linear-gradient(135deg,#3A1A26,#26111A); color:#FFB4CF; }
html.dark .uft-tile-3 { background: linear-gradient(135deg,#3A2A0D,#251A08); color:#F7D48A; }

/* Prose */
html.dark .prose p { color: #CFCFD8; }
html.dark .prose ul { color: #CFCFD8; }
html.dark .prose a { color: #AA98FF; }
html.dark .prose h2, html.dark .prose h3 { color: #F5F5F7; }

/* Inputs */
html.dark input, html.dark textarea, html.dark select {
	background-color: #1B1B2E; color: #F5F5F7; border-color: rgba(255,255,255,0.10);
}
html.dark input::placeholder, html.dark textarea::placeholder { color: #7B7B8A; }

/* Iframe embed shell */
html.dark .uft-embed { background: #12121F; border-color: rgba(255,255,255,0.06); }
html.dark [data-uft-embed-frame] { background: #12121F !important; }
html.dark [data-uft-facade] { background: linear-gradient(135deg, rgba(124,92,252,0.10), #12121F 60%, #12121F) !important; }

/* Theme toggle button icon swap */
html.dark [data-uft-theme-toggle] [data-icon="sun"] { display: inline; }
html.dark [data-uft-theme-toggle] [data-icon="moon"] { display: none; }
html:not(.dark) [data-uft-theme-toggle] [data-icon="sun"] { display: none; }
html:not(.dark) [data-uft-theme-toggle] [data-icon="moon"] { display: inline; }

/* ============================================================
   Toasts (v1.6)
   ============================================================ */
.uft-toast-root {
	position: fixed;
	right: 1rem;
	bottom: calc(env(safe-area-inset-bottom, 0px) + 5rem);
	z-index: 60;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	pointer-events: none;
	max-width: min(22rem, calc(100vw - 2rem));
}
@media (min-width: 768px) { .uft-toast-root { bottom: 1.25rem; } }
.uft-toast {
	pointer-events: auto;
	display: flex;
	align-items: flex-start;
	gap: 0.625rem;
	padding: 0.75rem 0.875rem;
	border-radius: 0.875rem;
	background: #fff;
	color: #12121F;
	font-size: 0.875rem;
	line-height: 1.35;
	border: 1px solid rgba(17,17,31,0.08);
	box-shadow: var(--uft-shadow-soft), 0 12px 32px -18px rgba(11,11,20,0.35);
	transform: translateY(8px) scale(0.98);
	opacity: 0;
	transition: transform .28s var(--uft-ease), opacity .28s var(--uft-ease);
}
.uft-toast.is-visible { transform: translateY(0) scale(1); opacity: 1; }
.uft-toast.is-leaving { transform: translateY(6px) scale(0.98); opacity: 0; }
.uft-toast__icon { flex: 0 0 auto; width: 1.15rem; height: 1.15rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; }
.uft-toast--success .uft-toast__icon { background: rgba(16,224,160,0.15); color: #0B8F69; }
.uft-toast--error   .uft-toast__icon { background: rgba(244,63,94,0.14); color: #C41E44; }
.uft-toast--info    .uft-toast__icon { background: rgba(124,92,252,0.14); color: var(--uft-brand-600); }
html.dark .uft-toast { background: #1B1B2E; color: #F5F5F7; border-color: rgba(255,255,255,0.08); }
html.dark .uft-toast--success .uft-toast__icon { color: #6EE7B7; }
html.dark .uft-toast--error   .uft-toast__icon { color: #FCA5A5; }
html.dark .uft-toast--info    .uft-toast__icon { color: #AA98FF; }
@media (prefers-reduced-motion: reduce) {
	.uft-toast { transition-duration: 0.001ms; }
}



/* Favorite button active state on tool page */
.uft-fav-btn.is-active {
	color: #e11d48;
	border-color: rgba(225,29,72,.35);
	background: #fff5f6;
}
.uft-fav-btn.is-active svg { fill: currentColor; }

/* ============================================================
   Wave 1 additions: skeleton loader, stagger reveal, empty state
   ============================================================ */

/* Skeleton loader — apply to any block; add .uft-skeleton-text for a single line */
.uft-skeleton {
	position: relative;
	overflow: hidden;
	background: linear-gradient(90deg, rgba(17,17,31,0.05) 0%, rgba(17,17,31,0.09) 50%, rgba(17,17,31,0.05) 100%);
	background-size: 200% 100%;
	animation: uft-skeleton-shimmer 1.4s var(--uft-ease) infinite;
	border-radius: 0.75rem;
	color: transparent !important;
	user-select: none;
	pointer-events: none;
}
.uft-skeleton * { visibility: hidden; }
.uft-skeleton-text { display: inline-block; min-width: 6ch; height: 0.9em; border-radius: 4px; }
@keyframes uft-skeleton-shimmer {
	0%   { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}
html.dark .uft-skeleton {
	background: linear-gradient(90deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.10) 50%, rgba(255,255,255,0.05) 100%);
	background-size: 200% 100%;
}
@media (prefers-reduced-motion: reduce) {
	.uft-skeleton { animation: none; background: rgba(17,17,31,0.06); }
	html.dark .uft-skeleton { background: rgba(255,255,255,0.06); }
}

/* Stagger reveal — cascade children of a .uft-reveal-stagger container */
.uft-reveal-stagger > * { opacity: 0; transform: translateY(12px); transition: opacity .55s var(--uft-ease), transform .55s var(--uft-ease); }
.uft-reveal-stagger.is-visible > *          { opacity: 1; transform: none; }
.uft-reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0ms; }
.uft-reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 60ms; }
.uft-reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 120ms; }
.uft-reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 180ms; }
.uft-reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 240ms; }
.uft-reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 300ms; }
.uft-reveal-stagger.is-visible > *:nth-child(n+7) { transition-delay: 360ms; }
@media (prefers-reduced-motion: reduce) {
	.uft-reveal-stagger > * { opacity: 1; transform: none; transition: none; }
}

/* Empty state partial */
.uft-empty {
	text-align: center;
	padding: 3rem 1.5rem;
	border: 1px dashed rgba(17,17,31,0.12);
	border-radius: 1.5rem;
	background: #fff;
}
.uft-empty__icon {
	display: inline-flex;
	width: 3.25rem;
	height: 3.25rem;
	align-items: center;
	justify-content: center;
	border-radius: 1rem;
	background: linear-gradient(135deg, rgba(124,92,252,0.14), rgba(16,224,160,0.14));
	color: var(--uft-brand-600);
	margin-bottom: 1rem;
}
.uft-empty__title { font-family: 'Space Grotesk', sans-serif; font-size: 1.25rem; font-weight: 600; color: var(--uft-ink-950); }
.uft-empty__desc  { margin-top: 0.5rem; font-size: 0.9rem; color: #556; max-width: 32rem; margin-left: auto; margin-right: auto; line-height: 1.6; }
.uft-empty__actions { margin-top: 1.5rem; display: inline-flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
html.dark .uft-empty { background: #12121F; border-color: rgba(255,255,255,0.10); }
html.dark .uft-empty__desc { color: #B4B4C0; }

/* Tool-card rating row spacing */
.uft-card .uft-card-rating { min-height: 1rem; }


/* =========================================================
   Modernization + A11y + Mobile pass (Space Grotesk / Indigo+Mint locked)
   ========================================================= */

/* --- A11y: bump low-contrast utility text to WCAG AA on light surfaces --- */
:where(section, main, article) .text-gray-500 { color: #52525e; }
:where(section, main, article) .text-gray-600 { color: #43434d; }
html.dark :where(section, main, article) .text-gray-500 { color: #B4B4C0; }
html.dark :where(section, main, article) .text-gray-600 { color: #C6C6CF; }

/* --- A11y: guarantee 44×44 tap target on primary controls --- */
button, [role="button"], .uft-card, .uft-btn, header nav a, [data-uft-tab],
[data-uft-announce-dismiss] { min-height: 2.75rem; }
@media (max-width: 640px) {
	.uft-card { padding: 1.125rem; }
}

/* Stretched-link cards: the whole card is clickable via .uft-card-link, but
   real interactive controls (fav / compare / rating jump) sit above it via
   z-index. Keep hover/focus styling on the article itself so the whole tile
   still reacts to keyboard focus. */
.uft-card > .uft-card-link { text-decoration: none; }
.uft-card:has(.uft-card-link:focus-visible) {
	box-shadow: 0 0 0 3px rgba(124,92,252,0.35), var(--uft-shadow-brand);
	transform: translateY(-3px);
	outline: none;
}
.uft-card .uft-card-actions,
.uft-card .uft-card-actions-slot,
.uft-card .uft-card-rating { position: relative; z-index: 30; }
.uft-card .uft-card-actions-slot { position: absolute; }
/* Rating widget wraps decorative SVGs — let clicks fall through to the
   stretched link, except on the real button inside. */
.uft-card .uft-card-rating { pointer-events: none; }
.uft-card .uft-card-rating [data-uft-rate-jump],
.uft-card .uft-card-rating button { pointer-events: auto; }
/* Icon-only pill buttons need square min */
button[aria-label]:not(:has(span:not([aria-hidden]))) { min-width: 2.75rem; }

/* --- A11y: stronger focus ring, works on light + dark + brand surfaces --- */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
	outline: 2px solid transparent;
	outline-offset: 2px;
	box-shadow:
		0 0 0 2px var(--uft-surface),
		0 0 0 4px var(--uft-brand-500),
		0 0 0 6px rgba(124,92,252,0.25);
	border-radius: 0.625rem;
}
html.dark :where(a, button, input, textarea, select, [tabindex]):focus-visible {
	box-shadow:
		0 0 0 2px #0B0B14,
		0 0 0 4px #8B72FF,
		0 0 0 6px rgba(139,114,255,0.30);
}
/* Focus ring inside dark hero / ink surfaces */
.bg-ink-950 :where(a, button, input, textarea, select):focus-visible,
.uft-announce :where(a, button):focus-visible {
	box-shadow: 0 0 0 2px #0B0B14, 0 0 0 4px var(--uft-mint-500);
}

/* --- Modernization: refined glass utility (Chrome-safe, no manual -webkit-) --- */
.uft-glass {
	background: color-mix(in oklab, white 78%, transparent);
	backdrop-filter: blur(14px) saturate(160%);
	border: 1px solid color-mix(in oklab, var(--uft-ink-950) 6%, transparent);
}
html.dark .uft-glass {
	background: color-mix(in oklab, #12121F 72%, transparent);
	border-color: rgba(255,255,255,0.08);
}
.uft-header {
	backdrop-filter: blur(18px) saturate(180%);
	background: color-mix(in oklab, white 72%, transparent);
	transition: background .3s var(--uft-ease), box-shadow .3s var(--uft-ease);
}
html.dark .uft-header { background: color-mix(in oklab, #0B0B14 74%, transparent); border-color: rgba(255,255,255,0.06); }
.uft-header.is-scrolled { box-shadow: 0 8px 24px -18px rgba(11,11,20,0.30); background: color-mix(in oklab, white 86%, transparent); }
html.dark .uft-header.is-scrolled { background: color-mix(in oklab, #0B0B14 88%, transparent); }

/* --- Density & rhythm: consistent section spacing, tighter on mobile --- */
@media (max-width: 640px) {
	section.py-16, section.py-20 { padding-top: 3rem; padding-bottom: 3rem; }
	section.py-24 { padding-top: 3.5rem; padding-bottom: 3.5rem; }
	.uft-hero-title { letter-spacing: -0.028em; }
}

/* --- Mobile: card grid & hero form breathing room --- */
@media (max-width: 640px) {
	form[data-uft-search] input[type="search"] { padding-top: 1rem; padding-bottom: 1rem; font-size: 1rem; }
	form[data-uft-search] .uft-kbd { display: none !important; }
	form[data-uft-search] button[type="submit"] { padding-left: 0.9rem; padding-right: 0.9rem; }
	header nav[aria-label="Primary"] a { padding: 0.5rem 0.6rem; }
}

/* --- Modernization: card lift refinement + gradient ring on hover --- */
.uft-card { transition: transform .35s var(--uft-ease), box-shadow .35s var(--uft-ease), border-color .35s var(--uft-ease); }
.uft-card:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -22px rgba(11,11,20,0.18); }
@media (prefers-reduced-motion: reduce) { .uft-card:hover { transform: none; } }

/* --- Density: uniform section header spacing helper --- */
.uft-section-h { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 2rem; }
.uft-section-h .eyebrow { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--uft-brand-600); }
.uft-section-h h2 { font-size: clamp(1.7rem, 2.4vw + 0.4rem, 2.4rem); line-height: 1.1; }

/* --- A11y: prefers-contrast tune --- */
@media (prefers-contrast: more) {
	.uft-card { border-color: rgba(11,11,20,0.35); }
	:where(section, main, article) .text-gray-500,
	:where(section, main, article) .text-gray-600 { color: #1a1a24; }
}

/* --- A11y: visible skip-link on focus, not just tabbed --- */
a[href="#uft-main"]:focus,
a[href="#uft-main"]:focus-visible {
	position: fixed; top: .5rem; left: .5rem; z-index: 60;
	background: var(--uft-brand-600); color: #fff; padding: .625rem 1rem;
	border-radius: .5rem; font-weight: 600; text-decoration: none;
	box-shadow: 0 8px 24px -8px rgba(109,70,245,0.55);
}

/* --- Mobile: filter/sort toolbar (Wave 2) horizontal scroll instead of clip --- */
.uft-filter-bar { overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.uft-filter-bar > * { scroll-snap-align: start; }

/* --- Tabular numerals for stats/ranks (density) --- */
.tabular-nums, [class*="tabular"] { font-variant-numeric: tabular-nums; }
