/* ── 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: #ffffff;
    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, 0.35, 1.0) infinite;
}

.loader-ring::after {
    border-right-color: #a6d9f7;
    border-bottom-color: #a6d9f7;
    animation: spinRing 1.1s cubic-bezier(0.65, 0.0, 0.35, 1.0) 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 0;
}

.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 0;
    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 bar (neo style) ── */
.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: #ffffff;
    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;
}

.neo-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #1e1e2a;
}

.neo-btn i {
    margin-right: 0.4rem;
}

/* ── 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 0;
    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 0;
}

p,
li {
    font-size: 1.05rem;
    color: #1e1e2a;
}

.text-muted {
    color: #3d3d52;
}

/* ── divider ── */
.neo-divider {
    width: 100%;
    height: 4px;
    background: #1e1e2a;
    border-radius: 10px;
    margin: 1.5rem 0 1.8rem 0;
}

/* ── lists ── */
.neo-list {
    list-style: none;
    padding: 0;
    margin: 0.8rem 0 0.2rem 0;
}

.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>');
}

/* ── grid for 2-col layout ── */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@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;
    }
}

/* ── badge / meta ── */
.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 ── */
.footer-note {
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 1.5rem 0 0.5rem 0;
    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;
}

/* ── utility ── */
.mt-1 {
    margin-top: 1rem;
}
.mb-0 {
    margin-bottom: 0;
}
.flex-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* small screens fine-tuning */
@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;
    }
}

/* ── additional style for the back button ── */
.back-btn {
    background: #e0d6c8;
    font-size: 0.8rem;
    padding: 0.3rem 1.2rem;
    box-shadow: 3px 3px 0 #1e1e2a;
    border-width: 3px;
    margin-left: 0.2rem;
}
.back-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 #1e1e2a;
}
.back-btn i {
    margin-right: 0.3rem;
}

/* ── tools grid ── */
.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%;
}

.tools-grid .tool-card h3 {
    font-size: 1.1rem;
    margin: 0 0 0.3rem 0;
}

.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;
}

@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

/* ── SCROLL REVEAL ANIMATION ── */
.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);
}

/* cascade delay for tool cards — applied via JS,
   but we keep a small base delay so they don't all pop at once */
.tool-card.scroll-reveal {
    transition-delay: 0.05s;
}