.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .6s ease, transform .6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: none;
}

/* Active sidebar link */
.toc-link {
    transition: color .2s, padding-left .2s;
}

.toc-link.active {
    color: #ffb42e;
    padding-left: 0.75rem;
}

.toc-link.active::before {
    opacity: 1;
}

.toc-link::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #ffb42e;
    margin-right: 0.5rem;
    opacity: 0;
    transition: opacity .2s;
    vertical-align: middle;
    margin-bottom: 2px;
}

/* Prose section heading underline */
.section-rule {
    border-bottom: 1px solid rgba(139, 94, 60, .15);
}

/* Numbered list custom */
.purpose-list {
    counter-reset: purpose;
}

.purpose-list li {
    counter-increment: purpose;
    position: relative;
    padding-left: 2.2rem;
}

.purpose-list li::before {
    content: counter(purpose, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 0;
    font-family: 'Jost', sans-serif;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: #ffb42e;
    line-height: 1.9;
}

/* Grain overlay */
.grain::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

/* Mobile TOC toggle */
#toc-mobile {
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s cubic-bezier(.4, 0, .2, 1);
}

#toc-mobile.open {
    max-height: 500px;
}

#toc-chevron {
    transition: transform .3s ease;
}

#toc-chevron.open {
    transform: rotate(180deg);
}