/* ---------- Hero ---------- */
.hero { background: radial-gradient(1200px 500px at 80% -10%, color-mix(in srgb, var(--brand) 18%, transparent), transparent), var(--bg); padding: 64px 0 48px; }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero-copy .badge {
    display: inline-block; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand);
    padding: 6px 14px; border-radius: 999px; font-size: .8rem; font-weight: 600; margin-bottom: 18px;
}
.hero-copy h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); line-height: 1.05; letter-spacing: -.03em; }
.hero-sub { color: var(--text-muted); font-size: 1.1rem; margin: 18px 0 26px; max-width: 520px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 32px; margin-top: 34px; }
.hero-stats strong { font-size: 1.8rem; display: block; color: var(--brand); }
.hero-stats span { color: var(--text-muted); font-size: .85rem; }

.hero-card { position: relative; aspect-ratio: 1; max-width: 360px; margin: 0 auto; width: 100%; }
.hero-card-glow { position: absolute; inset: 10%; background: radial-gradient(circle at 30% 30%, var(--brand), transparent 60%), radial-gradient(circle at 70% 70%, var(--accent), transparent 60%); filter: blur(40px); opacity: .5; border-radius: 40%; }
.hero-tile {
    position: absolute; width: 38%; height: 38%; border-radius: 18px; display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: #fff; box-shadow: var(--shadow-lg); backdrop-filter: blur(2px);
    animation: float 6s ease-in-out infinite;
}
.t1 { top: 6%; left: 8%; background: var(--brand); }
.t2 { top: 12%; right: 6%; background: var(--cyan); animation-delay: .5s; }
.t3 { bottom: 22%; left: 4%; background: var(--accent); animation-delay: 1s; }
.t4 { bottom: 8%; right: 10%; background: var(--emerald); animation-delay: 1.5s; }
.t5 { bottom: 40%; left: 40%; background: var(--warning); animation-delay: 2s; }
.t6 { top: 42%; right: 30%; background: #ef4444; animation-delay: 2.5s; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

/* ---------- Tool grid / cards ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.tool-card {
    display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.tool-icon {
    width: 42px; height: 42px; border-radius: 11px; background: color-mix(in srgb, var(--brand) 14%, transparent);
    display: inline-flex; align-items: center; justify-content: center; color: var(--brand); font-size: 1.2rem;
    margin-bottom: 6px;
}
.tool-icon .fg-icon { width: 22px; height: 22px; }
.tool-name { font-weight: 700; font-size: 1rem; }
.tool-desc { color: var(--text-muted); font-size: .85rem; }

/* ---------- Category grid ---------- */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.category-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px;
    box-shadow: var(--shadow-sm); transition: transform .12s ease, box-shadow .2s ease;
}
.category-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.category-icon {
    width: 54px; height: 54px; border-radius: 14px; background: linear-gradient(135deg, var(--brand), var(--accent));
    color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 14px;
}
.category-icon .fg-icon { width: 28px; height: 28px; }
.category-card h3 { font-size: 1.2rem; }
.category-card p { color: var(--text-muted); font-size: .9rem; margin: 8px 0 14px; }
.category-count { color: var(--brand); font-weight: 600; font-size: .85rem; }

/* ---------- Mega menu ---------- */
.mega-menu { background: color-mix(in srgb, var(--surface) 96%, transparent); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg); backdrop-filter: blur(8px); }
.mega-inner { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px 22px; padding: 24px 20px; }
.mega-col { min-width: 0; }
.mega-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.mega-head:hover .mega-title { color: var(--accent); }
.mega-icon { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.mega-icon .fg-icon { width: 19px; height: 19px; }
.mega-title { font-weight: 700; font-size: .95rem; color: var(--text); transition: color .15s ease; }
.mega-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.mega-list a { display: block; color: var(--text-muted); font-size: .88rem; padding: 6px 8px; border-radius: var(--radius-sm); transition: color .15s ease, background .15s ease; }
.mega-list a:hover { color: var(--text); background: var(--bg-alt); }
.mega-more { margin-top: 4px; }
.mega-more a { color: var(--brand) !important; font-weight: 600; }
.mega-more a:hover { background: color-mix(in srgb, var(--brand) 10%, transparent) !important; }

/* ---------- Privacy band ---------- */
.privacy-band { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.privacy-item { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.privacy-ic { font-size: 1.6rem; }
.privacy-item h3 { font-size: 1.05rem; }
.privacy-item p { color: var(--text-muted); font-size: .9rem; }

/* ---------- QR generator / reader ---------- */
.setting-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.setting-row .setting-group { flex: 1; min-width: 120px; }
.setting-check { display: flex; align-items: center; gap: 7px; font-size: .85rem; color: var(--text-muted); margin-top: 6px; }
.setting-check input { width: auto; }
.qr-actions { display: flex; gap: 10px; margin: 4px 0 14px; }
.qr-preview { margin-top: 8px; padding: 14px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); min-height: 40px; }
.qr-preview:empty { display: none; }

.qr-reader-result { margin-top: 12px; padding: 18px; background: color-mix(in srgb, var(--brand) 6%, var(--surface)); border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--border)); border-radius: var(--radius); }
.qr-reader-result[hidden] { display: none; }
.qr-result-type { font-weight: 700; color: var(--brand); font-size: .95rem; margin-bottom: 10px; }
.qr-result-text { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; font-family: var(--mono); font-size: .9rem; color: var(--text); white-space: pre-wrap; word-break: break-all; max-height: 260px; overflow: auto; }
.qr-result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* ---------- Search modal ---------- */
.search-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.search-modal[hidden] { display: none; }
.search-backdrop { position: absolute; inset: 0; background: rgba(8,10,22,.55); backdrop-filter: blur(3px); }
.search-panel { position: relative; width: min(620px, 92vw); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.search-field { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.search-field input { flex: 1; border: none; background: none; color: var(--text); font-size: 1.05rem; outline: none; }
.search-field kbd { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 5px; padding: 2px 7px; font-size: .75rem; }
.search-results { max-height: 50vh; overflow-y: auto; padding: 8px; }
.search-empty { color: var(--text-faint); padding: 18px; text-align: center; }
.search-result { display: block; padding: 12px 14px; border-radius: var(--radius-sm); }
.search-result:hover, .search-result.active { background: var(--bg-alt); }
.search-result .sr-name { font-weight: 600; }
.search-result .sr-cat { font-size: .8rem; color: var(--text-muted); }
.search-result .sr-desc { font-size: .82rem; color: var(--text-muted); }

/* ---------- Chips & filters ---------- */
.tool-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { background: var(--bg-alt); border: 1px solid var(--border); color: var(--text-muted); padding: 7px 14px; border-radius: 999px; font-size: .85rem; font-weight: 500; }
.chip:hover { color: var(--text); }
.chip.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.tool-list-search { width: 100%; max-width: 360px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); margin-bottom: 28px; }
.category-block { margin-top: 36px; }
.category-block[hidden] { display: none; }
.category-block-title { font-size: 1.3rem; margin-bottom: 18px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

/* ---------- Breadcrumbs & FAQ ---------- */
.breadcrumbs { color: var(--text-faint); font-size: .85rem; margin-bottom: 18px; display: flex; gap: 8px; align-items: center; }
.breadcrumbs a:hover { color: var(--text); }
.breadcrumbs span[aria-current] { color: var(--text-muted); }
.faq-block { margin-top: 44px; }
.faq-block h2 { font-size: 1.4rem; margin-bottom: 16px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 16px; margin-bottom: 10px; background: var(--surface); }
.faq-item summary { cursor: pointer; font-weight: 600; padding: 12px 0; }
.faq-item p { color: var(--text-muted); padding: 0 0 14px; }

/* ---------- Prose (pages) ---------- */
.prose { max-width: 760px; }
.prose h1 { font-size: 2.2rem; letter-spacing: -.03em; margin-bottom: 16px; }
.prose h2 { font-size: 1.4rem; margin: 28px 0 10px; }
.prose p { color: var(--text-muted); margin-bottom: 14px; }
.prose ul { color: var(--text-muted); margin: 0 0 14px 22px; }
.prose li { margin-bottom: 6px; }
.cta-line { margin-top: 22px; }

@media (max-width: 980px) { .hero-inner { grid-template-columns: 1fr; } .hero-card { display: none; } .mega-inner { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .privacy-band { grid-template-columns: 1fr; } .mega-inner { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .hero-stats { gap: 20px; } .mega-inner { grid-template-columns: 1fr; } }
