/* ── reset & base ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    background: #f7f2e9;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    padding: 2rem 1.5rem;
    color: #1e1e2a;
    line-height: 1.5;
    display: flex;
    justify-content: center;
}

/* ── LOADING OVERLAY ── */
#loader-overlay {
    position: fixed; inset: 0; z-index: 9999; background: #f7f2e9;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    opacity: 1; visibility: visible;
}
#loader-overlay.loaded { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-box {
    background: #fff; border: 5px solid #1e1e2a; border-radius: 28px;
    box-shadow: 14px 14px 0 #1e1e2a; padding: 2.5rem 3.5rem; text-align: center;
    max-width: 440px; width: 90%;
    animation: loaderPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transform: scale(0.8); opacity: 0;
}
@keyframes loaderPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.loader-ring {
    position: relative; width: 80px; height: 80px; margin: 0 auto 1.2rem auto;
}
.loader-ring::before, .loader-ring::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    border: 6px solid transparent;
}
.loader-ring::before {
    border-top-color: #ffb3c6; border-left-color: #ffb3c6;
    animation: spinRing 1.1s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
.loader-ring::after {
    border-right-color: #a6d9f7; border-bottom-color: #a6d9f7;
    animation: spinRing 1.1s cubic-bezier(0.65, 0, 0.35, 1) infinite reverse;
    width: 62px; height: 62px; top: 9px; left: 9px;
}
@keyframes spinRing {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.loader-dots { display: flex; justify-content: center; gap: 10px; margin: 0.8rem 0 0.4rem; }
.loader-dots span {
    width: 14px; height: 14px; background: #1e1e2a; border-radius: 50%;
    border: 2px solid #1e1e2a;
    animation: dotBounce 1.2s ease-in-out infinite; transform: scale(0.6);
}
.loader-dots span:nth-child(2) { animation-delay: 0.2s; background: #ffd966; }
.loader-dots span:nth-child(3) { animation-delay: 0.4s; background: #b7e4c7; }
.loader-dots span:nth-child(4) { animation-delay: 0.6s; background: #a6d9f7; }
.loader-dots span:nth-child(5) { animation-delay: 0.8s; background: #f7c5a0; }
@keyframes dotBounce {
    0%,100% { transform: scale(0.6); opacity: 0.4; }
    50% { transform: scale(1.2); opacity: 1; }
}
.loader-title { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; margin: 0.2rem 0 0.1rem; color: #1e1e2a; }
.loader-title span {
    background: #ffb3c6; padding: 0 0.3rem; border-radius: 12px;
    border: 3px solid #1e1e2a; display: inline-block;
}
.loader-sub { font-size: 0.85rem; font-weight: 600; color: #3d3d52; letter-spacing: 0.04em; text-transform: uppercase; margin-top: 0.1rem; }
.loader-sub .neo-tag {
    display: inline-block; background: #ffd966; border: 3px solid #1e1e2a;
    border-radius: 40px; padding: 0.1rem 1rem; font-weight: 700; font-size: 0.6rem;
    letter-spacing: 0.04em; text-transform: uppercase; color: #1e1e2a;
}
.loader-progress {
    width: 100%; height: 10px; background: #e5dfd4; border: 3px solid #1e1e2a;
    border-radius: 40px; margin-top: 1rem; overflow: hidden; position: relative;
}
.loader-progress-bar {
    height: 100%; width: 0%; background: #a6d9f7; border-radius: 40px;
    transition: width 0.2s ease; box-shadow: inset 0 2px 0 rgba(255,255,255,0.3);
}
.loader-progress-bar.fill { background: #b7e4c7; width: 100%; }

/* ── neobrutalism core ── */
.blog-wrap { max-width: 880px; width: 100%; }
.neo-card {
    background: #fff; border: 4px solid #1e1e2a; border-radius: 20px;
    box-shadow: 10px 10px 0 #1e1e2a; padding: 2rem 2.25rem; margin-bottom: 2.25rem;
    transition: box-shadow 0.15s ease;
}
.neo-card:hover { box-shadow: 12px 12px 0 #1e1e2a; }
.neo-tag {
    display: inline-block; background: #ffd966; border: 3px solid #1e1e2a;
    border-radius: 40px; padding: 0.2rem 1rem; font-weight: 700; font-size: 0.7rem;
    letter-spacing: 0.04em; text-transform: uppercase; color: #1e1e2a;
}
.neo-btn {
    display: inline-block; background: #a6d9f7; border: 3px solid #1e1e2a;
    border-radius: 60px; padding: 0.55rem 1.6rem; font-weight: 700; font-size: 0.9rem;
    color: #1e1e2a; text-decoration: none; box-shadow: 4px 4px 0 #1e1e2a;
    transition: all 0.1s ease; cursor: pointer;
}
.neo-btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 #1e1e2a; }
.neo-btn:disabled { opacity: 0.4; transform: none; box-shadow: 4px 4px 0 #1e1e2a; cursor: not-allowed; }

/* ── typography ── */
h1, h2, h3 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: 2.8rem; margin-bottom: 0.25rem; }
h1 span {
    background: #ffb3c6; padding: 0 0.3rem; border-radius: 12px;
    border: 3px solid #1e1e2a; display: inline-block;
}
.subhead {
    font-size: 1.2rem; font-weight: 500; color: #2d2d3f; margin-top: 0.2rem;
    display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
}
.subhead .neo-tag { font-size: 0.65rem; }
h2 { font-size: 2rem; margin: 0 0 0.5rem; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
h2 .neo-tag { font-size: 0.6rem; background: #b7e4c7; }
h3 { font-size: 1.3rem; margin: 0 0 0.3rem; }
p, li { font-size: 1.05rem; color: #1e1e2a; }
.text-muted { color: #3d3d52; }

.neo-divider {
    width: 100%; height: 4px; background: #1e1e2a; border-radius: 10px;
    margin: 1.5rem 0 1.8rem;
}

.neo-list { list-style: none; padding: 0; margin: 0.8rem 0 0.2rem; }
.neo-list li {
    padding: 0.6rem 0 0.6rem 2.2rem;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%231e1e2a" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>') left center no-repeat;
    background-size: 1.2rem; border-bottom: 2px solid #e5dfd4;
}
.neo-list li:last-child { border-bottom: 0; }
.neo-list--cross li {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%23d14c4c" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>');
}

.meta-row {
    display: flex; flex-wrap: wrap; gap: 0.8rem 1.6rem; margin-top: 0.6rem;
    font-size: 0.9rem; font-weight: 600; color: #2d2d3f;
}
.meta-row i { margin-right: 0.3rem; }

.footer-note {
    text-align: center; font-weight: 600; font-size: 0.95rem;
    padding: 1.5rem 0 0.5rem; border-top: 4px solid #1e1e2a; margin-top: 1rem;
}
.footer-note a { color: #1e1e2a; text-decoration: underline wavy #ffb3c6 3px; font-weight: 700; }
.footer-note i { color: #d14c4c; }

.flex-center { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

@media (max-width: 640px) {
    .two-col { grid-template-columns: 1fr; gap: 1.2rem; }
    h1 { font-size: 2.2rem; }
    .neo-card { padding: 1.5rem 1.2rem; }
    body { padding: 1rem 0.8rem; }
}
@media (max-width: 480px) {
    .neo-card { border-width: 3px; box-shadow: 6px 6px 0 #1e1e2a; padding: 1.2rem 1rem; }
    .neo-btn { padding: 0.4rem 1.2rem; font-size: 0.8rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.1rem; }
    p, li { font-size: 0.95rem; }
    .loader-box { padding: 2rem 1.5rem; }
    .loader-title { font-size: 1.6rem; }
    .loader-ring { width: 60px; height: 60px; }
    .loader-ring::after { width: 46px; height: 46px; top: 7px; left: 7px; }
}

/* ── tools grid (items) ── */
.tools-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 0.5rem;
}
.tools-grid .tool-card {
    background: #f0ebe0; border: 3px solid #1e1e2a; border-radius: 16px;
    padding: 1rem 1.2rem; display: flex; flex-direction: column; height: 100%;
    position: relative;
}
.tools-grid .tool-card h3 { font-size: 1.1rem; margin: 0 0 0.3rem; }
.tools-grid .tool-card p { font-size: 0.95rem; flex: 1; margin-bottom: 0.8rem; }
.tools-grid .tool-card a {
    font-weight: 700; color: #1e1e2a; text-decoration: underline wavy #a6d9f7 2px;
    margin-top: auto; align-self: flex-start;
}
.tools-grid .tool-card .item-badge {
    position: absolute; top: 0.6rem; right: 0.8rem;
    font-size: 0.55rem; font-weight: 700; text-transform: uppercase;
    padding: 0.1rem 0.7rem; border-radius: 30px; border: 2px solid #1e1e2a;
    background: #fff;
}
.tools-grid .tool-card .item-badge.preset { background: #b7e4c7; }
.tools-grid .tool-card .item-badge.music { background: #ffb3c6; }

@media (max-width: 768px) { .tools-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .tools-grid { grid-template-columns: 1fr; } }

/* ── SCROLL REVEAL ── */
.scroll-reveal {
    opacity: 0; transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.22,1,0.36,1), transform 0.8s cubic-bezier(0.22,1,0.36,1);
}
.scroll-reveal.revealed { opacity: 1; transform: translateY(0); }
.tool-card.scroll-reveal { transition-delay: 0.05s; }

/* ── SEARCH ── */
.search-bar {
    margin-bottom: 1.2rem; background: #fcf9f4; border: 3px solid #1e1e2a;
    border-radius: 16px; padding: 0.7rem 1.2rem;
}
.search-box {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
}
.search-box input {
    flex: 1; min-width: 180px; padding: 0.45rem 0.9rem;
    border: 3px solid #1e1e2a; border-radius: 40px; font-size: 0.9rem;
    background: #fff; font-weight: 500; outline: none;
}
.search-box input:focus { box-shadow: 0 0 0 3px #a6d9f7; }
.search-box .neo-btn {
    padding: 0.3rem 1.2rem; font-size: 0.8rem; box-shadow: 3px 3px 0 #1e1e2a;
    border-width: 3px;
}
.search-box .neo-btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 #1e1e2a; }

/* ── PAGINATION ── */
.pagination-bar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 0.8rem 1rem; margin-top: 1.2rem; background: #fcf9f4;
    border: 3px solid #1e1e2a; border-radius: 16px; padding: 0.7rem 1.2rem;
}
.pagination-controls {
    display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
}
.pagination-controls .neo-btn {
    padding: 0.3rem 0.8rem; font-size: 0.8rem; background: #e5dfd4;
    box-shadow: 3px 3px 0 #1e1e2a; border-width: 3px;
}
.pagination-controls .neo-btn:hover:not(:disabled) {
    transform: translate(-2px, -2px); box-shadow: 5px 5px 0 #1e1e2a;
}
.pagination-controls .neo-btn:disabled {
    opacity: 0.4; transform: none; box-shadow: 3px 3px 0 #1e1e2a; cursor: not-allowed;
}
#pageInfo { font-weight: 700; min-width: 70px; text-align: center; font-size: 0.9rem; }
#totalPagesInfo { font-size: 0.8rem; color: #3d3d52; font-weight: 500; }
#toolsContainer.loading { opacity: 0.5; pointer-events: none; transition: opacity 0.2s; }

@media (max-width: 480px) {
    .search-bar { padding: 0.7rem 0.8rem; }
    .search-box { flex-wrap: wrap; }
    .search-box input { min-width: 120px; width: 100%; }
    .search-box .neo-btn { flex: 1; min-width: 80px; text-align: center; }
    .pagination-bar { flex-direction: column; align-items: stretch; gap: 0.5rem; }
    .pagination-controls { justify-content: center; }
    #totalPagesInfo { text-align: center; }
}

/* ── SHARE TOAST ── */
.share-btn {
    display: inline-flex; align-items: center; gap: 0.3rem;
    background: #e0d6c8; border: 3px solid #1e1e2a; border-radius: 40px;
    padding: 0.2rem 1rem; font-weight: 700; font-size: 0.8rem;
    color: #1e1e2a; cursor: pointer; box-shadow: 3px 3px 0 #1e1e2a;
    transition: all 0.1s ease; font-family: inherit;
}
.share-btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 #1e1e2a; background: #ffd966; }
.share-toast {
    position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
    background: #1e1e2a; color: #fff; padding: 0.8rem 2rem; border-radius: 60px;
    border: 3px solid #ffd966; font-weight: 700; font-size: 0.95rem;
    box-shadow: 8px 8px 0 #1e1e2a; z-index: 999;
    opacity: 0; visibility: hidden;
    transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.share-toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }