/* ════════════════════════════════════════════════════════════════
   AN Apothecary's Garden · Fairy Edition v6.0
   Bioluminescent botanical landing — modern web standards edition
   - View Transitions API
   - OKLCH color science
   - Container queries
   - Scroll-driven animations
   - :has() selectors
   - Animation composition
   ════════════════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS — OKLCH for perceptual uniformity ────────── */
:root {
    --ac:  #86efac;
    --ac2: #fbbf24;
    --ac3: #a78bfa;

    /* Default theme: APOTHECARY (deep green night) */
    --bg:        oklch(0.18 0.02 150);
    --bg-deep:   oklch(0.13 0.02 150);
    --s0:        oklch(0.16 0.02 150);
    --s1:        oklch(0.20 0.02 150);
    --s2:        oklch(0.24 0.02 150);
    --s3:        oklch(0.30 0.02 150);
    --s-bloom:   oklch(0.22 0.04 150);
    --tp:        oklch(0.95 0.02 110);
    --ts:        oklch(0.72 0.04 130);
    --tm:        oklch(0.50 0.04 130);

    --ff-d:  'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --ff-b:  'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --ff-m:  'DM Mono', 'Courier New', monospace;

    --r-card: 14px;
    --r-pill: 40px;

    /* Easing curves */
    --ease:    cubic-bezier(0.16, 1, 0.3, 1);
    --spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-in: cubic-bezier(0.7, 0, 0.84, 0);

    /* Glow color (HSL for runtime tuning) */
    --glow: 0 0 30px oklch(from var(--ac) 0.85 calc(c * 0.8) h / 0.4);
}

/* ── THEME: DAWN ─────────────────────────────────────────────── */
#anig-root[data-theme="dawn"] {
    --bg:      oklch(0.96 0.02 80);
    --bg-deep: oklch(0.92 0.04 70);
    --s0:      oklch(1.00 0 0);
    --s1:      oklch(0.96 0.02 75);
    --s2:      oklch(0.92 0.03 70);
    --s3:      oklch(0.88 0.04 65);
    --s-bloom: oklch(0.94 0.05 65);
    --tp:      oklch(0.20 0.02 60);
    --ts:      oklch(0.40 0.03 60);
    --tm:      oklch(0.62 0.03 60);
}

/* ── THEME: MIDNIGHT (cosmic violet) ─────────────────────────── */
#anig-root[data-theme="midnight"] {
    --bg:      oklch(0.14 0.04 290);
    --bg-deep: oklch(0.10 0.04 290);
    --s0:      oklch(0.13 0.04 290);
    --s1:      oklch(0.18 0.05 290);
    --s2:      oklch(0.22 0.06 290);
    --s3:      oklch(0.28 0.07 290);
    --s-bloom: oklch(0.22 0.08 290);
    --tp:      oklch(0.96 0.02 280);
    --ts:      oklch(0.72 0.05 280);
    --tm:      oklch(0.50 0.05 280);
}

/* ── THEME: HERBARIUM (parchment day) ────────────────────────── */
#anig-root[data-theme="herbarium"] {
    --bg:      #f5f0e6;
    --bg-deep: #ebe4d3;
    --s0:      #fffdf7;
    --s1:      #f2ebd8;
    --s2:      #e8dec4;
    --s3:      #ddd1b1;
    --s-bloom: #ede4cb;
    --tp:      #2a2515;
    --ts:      #5a4f35;
    --tm:      #8a7d5e;
    --ac:      #4a7c59;
    --ac2:     #b8860b;
    --ac3:     #8b6914;
}

/* ════════════════════════════════════════════════════════════════
   GLOBAL RESET (scoped to plugin)
   ════════════════════════════════════════════════════════════════ */
#anig-root *,
#anig-root *::before,
#anig-root *::after { box-sizing: border-box; }

#anig-root {
    font-family: var(--ff-b);
    background: var(--bg);
    color: var(--tp);
    padding: 0 0 140px;
    width: 100%;
    position: relative;
    min-height: 100vh;
    container-type: inline-size;     /* container queries on the root */
    container-name: anig-root;

    /* Subtle paper texture via repeating noise */
    background-image:
        radial-gradient(ellipse 70% 40% at 15% 0%, oklch(from var(--ac) 0.3 0.1 h / 0.10) 0%, transparent 60%),
        radial-gradient(ellipse 50% 30% at 85% 100%, oklch(from var(--ac2) 0.4 0.1 h / 0.07) 0%, transparent 65%),
        radial-gradient(ellipse 60% 40% at 50% 50%, oklch(from var(--ac3) 0.3 0.1 h / 0.04) 0%, transparent 70%),
        var(--bg);
    background-attachment: fixed;
}

/* Film grain texture */
#anig-root::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.025;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    background-size: 200px;
}

/* ════════════════════════════════════════════════════════════════
   FIREFLY PARTICLE LAYER (global)
   ════════════════════════════════════════════════════════════════ */
#anig-fireflies {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}
.anig-firefly {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: oklch(0.92 0.16 95);
    box-shadow:
        0 0 6px oklch(0.92 0.16 95 / 0.9),
        0 0 14px oklch(0.92 0.16 95 / 0.5),
        0 0 24px oklch(0.92 0.16 95 / 0.25);
    will-change: transform, opacity;
}
@keyframes ff-drift-1 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.7; }
    25%      { transform: translate(60px, -40px) scale(1.2); opacity: 1; }
    50%      { transform: translate(30px, -90px) scale(0.7); opacity: 0.4; }
    75%      { transform: translate(-30px, -50px) scale(1); opacity: 0.9; }
}
@keyframes ff-drift-2 {
    0%, 100% { transform: translate(0, 0) scale(0.8); opacity: 0.6; }
    33%      { transform: translate(-50px, 30px) scale(1.1); opacity: 1; }
    66%      { transform: translate(40px, 70px) scale(0.9); opacity: 0.5; }
}
@keyframes ff-drift-3 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.85; }
    50%      { transform: translate(70px, -30px) scale(1.3); opacity: 0.3; }
}

/* ════════════════════════════════════════════════════════════════
   CURSOR AURA
   ════════════════════════════════════════════════════════════════ */
#anig-cursor {
    position: fixed;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    opacity: 0;
    background: radial-gradient(circle, oklch(from var(--ac) 0.85 calc(c * 0.6) h / 0.18), transparent 70%);
    mix-blend-mode: screen;
    will-change: left, top;
}
#anig-cursor.show { opacity: 1; }

@media (hover: none) {
    #anig-cursor { display: none; }
}

/* ════════════════════════════════════════════════════════════════
   READING PROGRESS BAR — uses scroll-timeline (modern browsers)
   ════════════════════════════════════════════════════════════════ */
@supports (animation-timeline: scroll()) {
    @keyframes anig-scroll-progress {
        0%   { width: 0%; }
        100% { width: 100%; }
    }
    #anig-progress {
        position: fixed;
        top: 0;
        left: 0;
        height: 3px;
        background: linear-gradient(90deg, var(--ac), var(--ac2));
        z-index: 99999;
        box-shadow: 0 0 12px var(--ac);
        animation: anig-scroll-progress linear;
        animation-timeline: scroll();
    }
}
/* Fallback for browsers without scroll-timeline */
@supports not (animation-timeline: scroll()) {
    #anig-progress {
        position: fixed;
        top: 0;
        left: 0;
        height: 3px;
        width: 0%;
        background: linear-gradient(90deg, var(--ac), var(--ac2));
        z-index: 99999;
        transition: width 80ms linear;
        box-shadow: 0 0 12px var(--ac);
    }
}

/* ════════════════════════════════════════════════════════════════
   HEADER
   ════════════════════════════════════════════════════════════════ */
.anig-topbar {
    position: relative;
    z-index: 10;
    padding: 32px 48px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--ff-m);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--tm);
}
.anig-topbar-l {
    display: flex;
    align-items: center;
    gap: 10px;
}
.anig-pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ac);
    box-shadow: 0 0 8px var(--ac);
    animation: pulse 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.2); }
}
.anig-topbar-r {
    display: flex;
    align-items: center;
    gap: 12px;
}
.anig-search-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 16px 7px 14px;
    border: 0.5px solid color-mix(in oklch, var(--tp) 15%, transparent);
    border-radius: var(--r-pill);
    color: var(--ts);
    background: var(--s1);
    font-family: var(--ff-b);
    font-size: 11px;
    letter-spacing: normal;
    text-transform: none;
    cursor: pointer;
    transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.anig-search-trigger:hover {
    background: var(--s2);
    border-color: color-mix(in oklch, var(--tp) 25%, transparent);
}
.anig-search-trigger kbd {
    background: var(--s2);
    border: 0.5px solid color-mix(in oklch, var(--tp) 18%, transparent);
    border-radius: 4px;
    padding: 2px 7px;
    font-family: var(--ff-m);
    font-size: 10px;
    color: var(--tm);
    margin-left: 4px;
}
.anig-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 0.5px solid color-mix(in oklch, var(--tp) 15%, transparent);
    background: var(--s1);
    color: var(--ts);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--spring);
}
.anig-icon-btn:hover {
    background: var(--ac);
    color: oklch(0.15 0.02 150);
    transform: scale(1.1);
}
.anig-icon-btn.has-items::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--ac2);
    border-radius: 50%;
    border: 2px solid var(--bg);
}

/* ════════════════════════════════════════════════════════════════
   HERO SECTION — the main spectacle
   ════════════════════════════════════════════════════════════════ */
.anig-hero {
    position: relative;
    z-index: 5;
    padding: 80px 48px 64px;
    text-align: center;
}

/* Decorative botanical vines in corners */
.anig-vine {
    position: absolute;
    pointer-events: none;
    color: var(--ac);
    opacity: 0.4;
    z-index: 1;
}
.anig-vine-tl { top: 32px; left: 32px; width: 200px; height: 200px; }
.anig-vine-tr { top: 32px; right: 32px; width: 200px; height: 200px; transform: scaleX(-1); }

.anig-eyebrow {
    font-family: var(--ff-m);
    font-size: 10px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--ac);
    margin-bottom: 24px;
    display: inline-flex;
    align-items: center;
    gap: 14px;
}
.anig-eyebrow::before,
.anig-eyebrow::after {
    content: '';
    width: 28px;
    height: 0.5px;
    background: var(--ac);
    opacity: 0.5;
}

.anig-headline {
    font-family: var(--ff-d);
    font-size: clamp(48px, 8vw, 96px);
    font-weight: 400;
    line-height: 0.98;
    letter-spacing: -0.025em;
    color: var(--tp);
    margin: 0 auto 24px;
    max-width: 14ch;
}
.anig-headline em {
    font-style: italic;
    color: var(--ac);
    font-weight: 300;
    position: relative;
    display: inline-block;
}
/* Subtle underline flourish on the italic word */
.anig-headline em::after {
    content: '';
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: -2px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--ac), transparent);
    opacity: 0.5;
}

.anig-subhead {
    font-family: var(--ff-d);
    font-style: italic;
    font-size: clamp(17px, 1.6vw, 21px);
    font-weight: 300;
    line-height: 1.5;
    color: var(--ts);
    max-width: 52ch;
    margin: 0 auto 32px;
}

/* Stats row */
.anig-stats {
    display: flex;
    justify-content: center;
    gap: 0;
    margin: 0 auto;
    flex-wrap: wrap;
}
.anig-stat {
    padding: 0 28px;
    border-right: 0.5px solid color-mix(in oklch, var(--tp) 12%, transparent);
}
.anig-stat:last-child { border-right: none; }
.anig-stat-n {
    font-family: var(--ff-d);
    font-size: 32px;
    font-weight: 400;
    line-height: 1;
    color: var(--ac2);
    font-style: italic;
    letter-spacing: -0.02em;
}
.anig-stat-l {
    font-family: var(--ff-m);
    font-size: 9px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--tm);
    margin-top: 6px;
}

/* ════════════════════════════════════════════════════════════════
   CATEGORY TABS
   ════════════════════════════════════════════════════════════════ */
.anig-tabs {
    position: relative;
    z-index: 4;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 16px 48px 36px;
    -ms-overflow-style: none;
}
.anig-tabs::-webkit-scrollbar { display: none; }
.anig-tab {
    flex-shrink: 0;
    font-family: var(--ff-b);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: var(--r-pill);
    background: var(--s1);
    border: 0.5px solid color-mix(in oklch, var(--tp) 12%, transparent);
    color: var(--ts);
    cursor: pointer;
    transition:
        background 0.2s var(--ease),
        color 0.2s var(--ease),
        border-color 0.2s var(--ease),
        transform 0.2s var(--spring);
    white-space: nowrap;
    appearance: none;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.anig-tab:hover {
    background: var(--s2);
    color: var(--tp);
    transform: translateY(-1px);
}
.anig-tab.is-on {
    background: var(--ac);
    border-color: var(--ac);
    color: oklch(0.15 0.02 150);
    font-weight: 600;
    box-shadow: 0 0 24px oklch(from var(--ac) l c h / 0.3);
}
.anig-tab .anig-sigil {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}
.anig-tab-n { opacity: 0.5; font-size: 0.82em; margin-left: 4px; }

/* ════════════════════════════════════════════════════════════════
   TRENDING STRIP
   ════════════════════════════════════════════════════════════════ */
.anig-trending {
    position: relative;
    z-index: 3;
    padding: 0 48px 48px;
}
.anig-trending-hd {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}
.anig-trending-flame { color: var(--ac2); display: flex; }
.anig-trending-label {
    font-family: var(--ff-d);
    font-style: italic;
    font-size: 16px;
    font-weight: 500;
    color: var(--tp);
    letter-spacing: -0.005em;
}
.anig-trending-window {
    font-family: var(--ff-m);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--tm);
    margin-left: auto;
}
.anig-trending-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scrollbar-width: none;
    cursor: grab;
    user-select: none;
    -ms-overflow-style: none;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}
.anig-trending-track::-webkit-scrollbar { display: none; }
.anig-trending-track.grabbing { cursor: grabbing; }
.anig-tcard {
    flex-shrink: 0;
    display: flex;
    gap: 12px;
    align-items: center;
    background: var(--s1);
    border: 0.5px solid color-mix(in oklch, var(--tp) 10%, transparent);
    border-radius: var(--r-card);
    padding: 12px 16px 12px 12px;
    text-decoration: none;
    color: inherit;
    min-width: 240px;
    max-width: 280px;
    position: relative;
    overflow: hidden;
    transition: background 0.2s var(--ease), transform 0.3s var(--ease), border-color 0.2s var(--ease);
}
.anig-tcard::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 0% 50%, color-mix(in oklch, var(--cc) 20%, transparent), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}
.anig-tcard:hover {
    background: var(--s2);
    border-color: color-mix(in oklch, var(--cc) 30%, var(--s3));
    transform: translateY(-3px);
}
.anig-tcard:hover::before { opacity: 1; }
.anig-tcard-img {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    background: var(--s2);
}
.anig-tcard-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s var(--ease);
}
.anig-tcard:hover .anig-tcard-img img { transform: scale(1.08); }
.anig-tcard-n {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    font-family: var(--ff-d);
    font-size: 22px;
    font-weight: 700;
    color: white;
    text-align: center;
    background: linear-gradient(to top, oklch(0 0 0 / 0.8), transparent);
    line-height: 1.6;
    padding-bottom: 2px;
}
.anig-tcard-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    position: relative;
}
.anig-tcard-cat {
    font-family: var(--ff-m);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cc);
}
.anig-tcard-title {
    font-family: var(--ff-d);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--tp);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.anig-tcard-views {
    font-family: var(--ff-m);
    font-size: 9px;
    color: var(--tm);
}

/* ════════════════════════════════════════════════════════════════
   HEROES
   ════════════════════════════════════════════════════════════════ */
.anig-heroes {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 20px;
    padding: 0 48px 16px;
}
.anig-heroes-1 { grid-template-columns: 1fr; }
.anig-heroes-2 { grid-template-columns: 1.5fr 1fr; }
.anig-heroes-3 { grid-template-columns: 1.4fr 1fr 1fr; }

/* ── SECTION DIVIDER ─────────────────────────────────────────── */
.anig-section-label {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 36px 48px 28px;
}
.anig-section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, color-mix(in oklch, var(--tp) 18%, transparent), transparent);
}
.anig-section-txt {
    font-family: var(--ff-d);
    font-style: italic;
    font-size: 15px;
    font-weight: 400;
    color: var(--tm);
    white-space: nowrap;
}

/* ════════════════════════════════════════════════════════════════
   GRID — uses container queries for responsive
   ════════════════════════════════════════════════════════════════ */
.anig-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 22px;
    padding: 0 48px;
}
@container anig-root (min-width: 900px)  { .anig-grid { grid-template-columns: repeat(4, 1fr); } }
@container anig-root (min-width: 1200px) { .anig-grid { grid-template-columns: repeat(5, 1fr); } }
@container anig-root (min-width: 1600px) { .anig-grid { grid-template-columns: repeat(6, 1fr); } }

/* ════════════════════════════════════════════════════════════════
   CARD BASE
   ════════════════════════════════════════════════════════════════ */
.anig-card {
    position: relative;
    background: var(--s1);
    border-radius: var(--r-card);
    overflow: hidden;
    cursor: pointer;
    isolation: isolate;
    transition:
        transform 0.4s var(--ease),
        box-shadow 0.4s var(--ease),
        background 0.2s var(--ease);
    will-change: transform;
}
/* Inner border ring */
.anig-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--r-card);
    box-shadow: inset 0 0 0 0.5px color-mix(in oklch, var(--tp) 10%, transparent);
    pointer-events: none;
    z-index: 10;
    transition: box-shadow 0.3s var(--ease);
}
.anig-card:hover::after {
    box-shadow: inset 0 0 0 0.5px color-mix(in oklch, var(--cc, var(--ac)) 50%, transparent);
}
.anig-card:hover {
    transform: translateY(-8px);
    box-shadow:
        0 30px 80px oklch(0 0 0 / 0.5),
        0 12px 28px oklch(0 0 0 / 0.35);
}

/* IMAGE BLOCK */
.anig-card-imgwrap {
    position: relative;
    aspect-ratio: 4/5;
    overflow: hidden;
    border-radius: var(--r-card) var(--r-card) 0 0;
    background: var(--s2);
    display: block;
}
.anig-hero .anig-card-imgwrap { aspect-ratio: 16/10; }

.anig-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s var(--ease), filter 0.4s var(--ease);
    position: relative;
    z-index: 1;
    filter: saturate(0.85) brightness(0.92);
}
.anig-card:hover .anig-card-img {
    transform: scale(1.08);
    filter: saturate(1) brightness(1);
}

/* Image scrim */
.anig-card-scrim {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(
        180deg,
        transparent 30%,
        oklch(0.10 0.02 150 / 0.45) 70%,
        oklch(0.08 0.02 150 / 0.85) 100%
    );
    transition: opacity 0.3s var(--ease);
}

/* Arrow pip */
.anig-card-arrow {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ac);
    color: oklch(0.15 0.02 150);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(12px) scale(0.7) rotate(-45deg);
    transition:
        opacity 0.3s var(--ease),
        transform 0.4s var(--spring);
    box-shadow:
        0 8px 24px oklch(0 0 0 / 0.4),
        0 0 24px oklch(from var(--ac) l c h / 0.4);
    z-index: 5;
    pointer-events: none;
}
.anig-card:hover .anig-card-arrow {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
}

/* Per-card firefly cluster (hero only) */
.anig-firefly-cluster {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
}
.anig-fly {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: oklch(0.92 0.16 95);
    box-shadow:
        0 0 8px oklch(0.92 0.16 95 / 0.9),
        0 0 18px oklch(0.92 0.16 95 / 0.5);
}
.anig-fly-a { top: 22%; left: 18%; animation: ff-drift-1 7s ease-in-out infinite; }
.anig-fly-b { top: 40%; left: 65%; animation: ff-drift-2 9s ease-in-out infinite; animation-delay: -2s; }
.anig-fly-c { top: 65%; left: 38%; animation: ff-drift-3 11s ease-in-out infinite; animation-delay: -4s; background: var(--ac); box-shadow: 0 0 8px var(--ac), 0 0 18px color-mix(in oklch, var(--ac) 50%, transparent); }

/* Hero featured badge */
.anig-hero-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--ac2);
    color: oklch(0.15 0.04 80);
    font-family: var(--ff-m);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    padding: 5px 11px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 5;
    box-shadow: 0 4px 14px oklch(from var(--ac2) l c h / 0.3);
}

/* View badge */
.anig-views-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: oklch(0 0 0 / 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: oklch(1 0 0 / 0.92);
    font-family: var(--ff-m);
    font-size: 10px;
    padding: 4px 9px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 5;
    letter-spacing: 0.04em;
}

/* CARD BODY */
.anig-card-body {
    position: relative;
    padding: 14px 18px 18px;
}
.anig-hero-body { padding: 24px 28px 28px; }

/* Category pill — sigil + name */
.anig-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--ff-m);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--cc, var(--ac));
    text-decoration: none;
    margin-bottom: 9px;
    padding: 3px 0;
    transition: color 0.2s var(--ease);
}
.anig-cat-pill .anig-sigil {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}
.anig-hero-body .anig-cat-pill .anig-sigil {
    width: 13px;
    height: 13px;
}
.anig-cat-pill::after {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--cc, var(--ac));
    margin-left: 4px;
    box-shadow: 0 0 6px var(--cc, var(--ac));
}
.anig-cat-pill:hover { color: var(--tp); }

.anig-card-title {
    font-family: var(--ff-d);
    font-size: 17px;
    font-weight: 500;
    line-height: 1.22;
    margin: 6px 0 10px;
    color: var(--tp);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.005em;
}
.anig-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s var(--ease);
}
.anig-card-title a:hover { color: var(--ac); }

.anig-hero-title {
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 500;
    line-height: 1.08;
    -webkit-line-clamp: 3;
    letter-spacing: -0.018em;
    margin-bottom: 14px;
}

.anig-card-exc {
    font-family: var(--ff-d);
    font-style: italic;
    font-size: 15px;
    font-weight: 300;
    line-height: 1.55;
    color: var(--ts);
    margin: 0 0 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 90%;
}

.anig-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--ff-b);
    font-size: 11px;
    color: var(--tm);
}
.anig-sep { opacity: 0.35; }
.anig-rt {
    display: flex;
    align-items: center;
    gap: 4px;
}
.anig-bm-btn {
    background: none;
    border: none;
    color: var(--tm);
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
    display: flex;
    align-items: center;
    line-height: 1;
    transition: color 0.2s var(--ease), transform 0.2s var(--spring);
}
.anig-bm-btn:hover { color: var(--ac); transform: scale(1.2); }
.anig-bm-btn.saved { color: var(--ac); }
.anig-bm-btn.saved svg { fill: var(--ac); }

/* GLOW AURA — radiates per category color on hover */
.anig-glow-aura {
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--r-card) + 2px);
    background: transparent;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.3s var(--ease);
    box-shadow: 0 0 0 0 var(--cc, var(--ac));
}
.anig-card:hover .anig-glow-aura {
    opacity: 1;
    box-shadow: 0 0 50px -10px color-mix(in oklch, var(--cc, var(--ac)) 60%, transparent);
}

/* Bottom flourish line */
.anig-card-bottom-line {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cc, var(--ac)), transparent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.4s var(--ease);
    z-index: 5;
}
.anig-card:hover .anig-card-bottom-line { transform: scaleX(1); }

/* ════════════════════════════════════════════════════════════════
   SCROLL-DRIVEN ENTRANCE
   ════════════════════════════════════════════════════════════════ */
@supports (animation-timeline: view()) {
    .anig-grid .anig-card {
        animation: anig-card-reveal linear;
        animation-timeline: view();
        animation-range: entry 0% entry 60%;
    }
    @keyframes anig-card-reveal {
        from { opacity: 0; transform: translateY(40px) scale(0.96); }
        to   { opacity: 1; transform: translateY(0) scale(1); }
    }
}
@supports not (animation-timeline: view()) {
    @keyframes anig-card-in {
        from { opacity: 0; transform: translateY(28px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    .anig-card:not(.anig-skel) {
        animation: anig-card-in 0.55s var(--ease) both;
    }
    .anig-heroes .anig-card:nth-child(1) { animation-delay:   0ms; }
    .anig-heroes .anig-card:nth-child(2) { animation-delay:  90ms; }
    .anig-heroes .anig-card:nth-child(3) { animation-delay: 180ms; }
    .anig-grid .anig-card:nth-child(1)  { animation-delay:  80ms; }
    .anig-grid .anig-card:nth-child(2)  { animation-delay: 110ms; }
    .anig-grid .anig-card:nth-child(3)  { animation-delay: 140ms; }
    .anig-grid .anig-card:nth-child(4)  { animation-delay: 170ms; }
    .anig-grid .anig-card:nth-child(5)  { animation-delay: 200ms; }
    .anig-grid .anig-card:nth-child(6)  { animation-delay: 230ms; }
    .anig-grid .anig-card:nth-child(7)  { animation-delay: 260ms; }
    .anig-grid .anig-card:nth-child(8)  { animation-delay: 290ms; }
    .anig-grid .anig-card:nth-child(n+9) { animation-delay: 320ms; }
}

/* ════════════════════════════════════════════════════════════════
   VIEW TRANSITIONS API — smooth morphing during filter
   ════════════════════════════════════════════════════════════════ */
@view-transition {
    navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.4s;
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ════════════════════════════════════════════════════════════════
   SKELETON
   ════════════════════════════════════════════════════════════════ */
@keyframes anig-shim {
    0%   { background-position: -800px 0; }
    100% { background-position:  800px 0; }
}
.anig-sk {
    background: linear-gradient(90deg, var(--s2) 25%, var(--s3) 50%, var(--s2) 75%);
    background-size: 1600px 100%;
    animation: anig-shim 1.4s infinite linear;
    border-radius: 4px;
}
.anig-skel .anig-card-imgwrap { aspect-ratio: 4/5; border-radius: var(--r-card) var(--r-card) 0 0; }
.anig-sk-pill { height: 11px; width: 60px; margin-bottom: 9px; border-radius: 40px; }
.anig-sk-l    { height: 13px; margin-bottom: 5px; }
.anig-sk-la   { width: 90%; }
.anig-sk-lb   { width: 62%; }
.anig-sk-meta { height: 10px; width: 86px; margin-top: 8px; }
.anig-skel { pointer-events: none; animation: none !important; }

/* ════════════════════════════════════════════════════════════════
   FULL-SCREEN SEARCH
   ════════════════════════════════════════════════════════════════ */
#anig-search {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: oklch(from var(--bg-deep) 0.06 c h / 0.92);
    backdrop-filter: blur(32px) saturate(1.4);
    -webkit-backdrop-filter: blur(32px) saturate(1.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 80px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease);
}
#anig-search.open {
    opacity: 1;
    pointer-events: all;
}
.anig-search-wrap {
    width: 100%;
    max-width: 720px;
    padding: 0 24px;
    position: relative;
}
.anig-search-input {
    width: 100%;
    background: oklch(1 0 0 / 0.08);
    border: 1.5px solid oklch(1 0 0 / 0.12);
    border-radius: 16px;
    padding: 20px 60px 20px 56px;
    font-family: var(--ff-d);
    font-size: 22px;
    font-weight: 400;
    color: white;
    outline: none;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
    box-sizing: border-box;
    caret-color: var(--ac);
}
.anig-search-input:focus {
    border-color: var(--ac);
    background: oklch(1 0 0 / 0.11);
    box-shadow: 0 0 0 4px color-mix(in oklch, var(--ac) 18%, transparent);
}
.anig-search-input::placeholder { color: oklch(1 0 0 / 0.32); font-style: italic; }
.anig-search-icon {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    color: oklch(1 0 0 / 0.4);
    pointer-events: none;
}
.anig-search-esc {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    background: oklch(1 0 0 / 0.08);
    border: 0.5px solid oklch(1 0 0 / 0.14);
    border-radius: 6px;
    padding: 3px 9px;
    font-family: var(--ff-m);
    font-size: 11px;
    color: oklch(1 0 0 / 0.5);
    cursor: pointer;
    transition: background 0.2s var(--ease);
}
.anig-search-esc:hover { background: oklch(1 0 0 / 0.16); color: white; }
.anig-search-results-wrap {
    width: 100%;
    max-width: 720px;
    padding: 12px 24px 0;
    max-height: 60vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: oklch(1 0 0 / 0.15) transparent;
}
.anig-sr {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    background: oklch(1 0 0 / 0.04);
    border: 0.5px solid oklch(1 0 0 / 0.08);
    margin-bottom: 8px;
    transition: background 0.2s var(--ease), transform 0.2s var(--spring);
}
.anig-sr:hover {
    background: oklch(1 0 0 / 0.10);
    transform: translateX(4px);
}
.anig-sr-img {
    flex-shrink: 0;
    width: 60px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    background: oklch(1 0 0 / 0.08);
}
.anig-sr-img img { width: 100%; height: 100%; object-fit: cover; }
.anig-sr-body { flex: 1; min-width: 0; }
.anig-sr-cat {
    font-family: var(--ff-m);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
}
.anig-sr-cat .anig-sigil { width: 11px; height: 11px; }
.anig-sr-title {
    font-family: var(--ff-d);
    font-size: 16px;
    font-weight: 500;
    color: white;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.anig-sr-title mark {
    background: color-mix(in oklch, var(--ac) 30%, transparent);
    color: var(--ac);
    border-radius: 2px;
    padding: 0 3px;
    font-style: normal;
}
.anig-sr-meta {
    font-size: 11px;
    color: oklch(1 0 0 / 0.4);
    margin-top: 3px;
}
.anig-search-empty {
    text-align: center;
    color: oklch(1 0 0 / 0.3);
    font-family: var(--ff-d);
    font-style: italic;
    font-size: 16px;
    padding: 48px;
}
.anig-search-hint {
    text-align: center;
    font-family: var(--ff-m);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: oklch(1 0 0 / 0.22);
    margin-top: 24px;
}

/* ════════════════════════════════════════════════════════════════
   BOOKMARKS DRAWER
   ════════════════════════════════════════════════════════════════ */
#anig-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    height: 100vh;
    background: var(--s0);
    border-left: 0.5px solid var(--s2);
    z-index: 8000;
    display: flex;
    flex-direction: column;
    transition: right 0.5s var(--ease);
    box-shadow: -16px 0 60px oklch(0 0 0 / 0.5);
}
#anig-drawer.open { right: 0; }
.anig-drawer-hd {
    display: flex;
    align-items: center;
    padding: 22px 24px;
    border-bottom: 0.5px solid var(--s2);
    flex-shrink: 0;
    gap: 10px;
}
.anig-drawer-title {
    font-family: var(--ff-d);
    font-style: italic;
    font-size: 20px;
    font-weight: 500;
    color: var(--tp);
    flex: 1;
}
.anig-drawer-cnt { font-family: var(--ff-m); font-size: 11px; color: var(--ac); }
.anig-drawer-close {
    background: none;
    border: none;
    color: var(--ts);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s var(--ease);
}
.anig-drawer-close:hover { color: var(--tp); }
.anig-drawer-list { flex: 1; overflow-y: auto; padding: 12px; }
.anig-bm-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    margin-bottom: 6px;
    background: var(--s1);
    border: 0.5px solid var(--s2);
    transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.anig-bm-item:hover { background: var(--s2); transform: translateX(4px); }
.anig-bm-thumb {
    flex-shrink: 0;
    width: 56px;
    height: 42px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--s2);
}
.anig-bm-thumb img { width: 100%; height: 100%; object-fit: cover; }
.anig-bm-info { flex: 1; min-width: 0; }
.anig-bm-title {
    font-family: var(--ff-d);
    font-size: 14px;
    font-weight: 500;
    color: var(--tp);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.anig-bm-date {
    font-family: var(--ff-m);
    font-size: 10px;
    color: var(--tm);
    margin-top: 3px;
    display: block;
}
.anig-bm-del {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--tm);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s var(--ease);
}
.anig-bm-del:hover { color: oklch(0.65 0.20 25); }
.anig-drawer-ft {
    padding: 18px 24px;
    border-top: 0.5px solid var(--s2);
    flex-shrink: 0;
}
.anig-drawer-clear {
    background: transparent;
    border: 0.5px solid var(--s3);
    border-radius: 8px;
    color: var(--tm);
    font-family: var(--ff-b);
    font-size: 13px;
    padding: 9px 16px;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.anig-drawer-clear:hover {
    background: oklch(0.50 0.20 25);
    border-color: oklch(0.50 0.20 25);
    color: white;
}
.anig-drawer-empty {
    text-align: center;
    color: var(--tm);
    padding: 56px 20px;
    font-size: 14px;
    line-height: 1.7;
    font-family: var(--ff-d);
    font-style: italic;
}
.anig-drawer-empty-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 12px;
    opacity: 0.4;
}

/* ════════════════════════════════════════════════════════════════
   TOAST
   ════════════════════════════════════════════════════════════════ */
#anig-toasts {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9900;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.anig-toast {
    background: var(--s1);
    border: 0.5px solid var(--s3);
    border-left: 3px solid var(--ac);
    border-radius: 10px;
    padding: 12px 18px;
    font-family: var(--ff-d);
    font-style: italic;
    font-size: 14px;
    color: var(--tp);
    min-width: 220px;
    max-width: 320px;
    box-shadow: 0 12px 36px oklch(0 0 0 / 0.5);
    animation: anig-toast-in 0.3s var(--spring) both;
    pointer-events: all;
}
.anig-toast.err { border-left-color: oklch(0.65 0.20 25); }
@keyframes anig-toast-in {
    from { opacity: 0; transform: translateX(28px) scale(0.95); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes anig-toast-out {
    to { opacity: 0; transform: translateX(28px) scale(0.95); }
}

/* ════════════════════════════════════════════════════════════════
   BACK TO TOP
   ════════════════════════════════════════════════════════════════ */
#anig-top {
    position: fixed;
    bottom: 28px;
    left: 28px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--s2);
    border: 0.5px solid var(--s3);
    color: var(--ts);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 8000;
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px);
    transition: opacity 0.4s var(--ease), transform 0.5s var(--spring), background 0.2s var(--ease), color 0.2s var(--ease);
    box-shadow: 0 6px 24px oklch(0 0 0 / 0.4);
}
#anig-top.show {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}
#anig-top:hover {
    background: var(--ac);
    border-color: var(--ac);
    color: oklch(0.15 0.02 150);
}

/* ════════════════════════════════════════════════════════════════
   SENTINEL & END STATE
   ════════════════════════════════════════════════════════════════ */
#anig-sentinel {
    height: 100px;
    visibility: hidden;
    display: block;
    position: relative;
    z-index: 2;
}
.anig-end {
    text-align: center;
    padding: 64px 20px;
    position: relative;
    z-index: 2;
}
.anig-end-symbol {
    font-family: var(--ff-d);
    font-size: 48px;
    color: var(--ac);
    opacity: 0.4;
    line-height: 1;
    display: block;
    margin-bottom: 12px;
}
.anig-end-text {
    font-family: var(--ff-d);
    font-style: italic;
    font-size: 16px;
    color: var(--ac);
    opacity: 0.7;
}

/* ════════════════════════════════════════════════════════════════
   INLINE SEARCH SHORTCODE
   ════════════════════════════════════════════════════════════════ */
.anig-search-inline { position: relative; margin: 16px 0; }
.anig-search-field-inline {
    width: 100%;
    background: var(--s1);
    border: 0.5px solid var(--s3);
    color: var(--tp);
    border-radius: var(--r-pill);
    padding: 12px 22px;
    font-family: var(--ff-d);
    font-style: italic;
    font-size: 15px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.anig-search-field-inline:focus {
    border-color: var(--ac);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--ac) 18%, transparent);
}
.anig-search-results-inline {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--s0);
    border: 0.5px solid var(--s2);
    border-radius: var(--r-card);
    z-index: 100;
    max-height: 380px;
    overflow-y: auto;
    box-shadow: 0 16px 48px oklch(0 0 0 / 0.4);
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════ */
@container anig-root (max-width: 1024px) {
    .anig-heroes-3 { grid-template-columns: 1.3fr 1fr; }
    .anig-heroes-3 .anig-card:nth-child(3) { display: none; }
}
@container anig-root (max-width: 900px) {
    .anig-topbar, .anig-hero, .anig-tabs, .anig-trending,
    .anig-heroes, .anig-section-label, .anig-grid {
        padding-left: 24px;
        padding-right: 24px;
    }
    .anig-heroes-2, .anig-heroes-3 { grid-template-columns: 1fr; }
    .anig-heroes-2 .anig-card:nth-child(2),
    .anig-heroes-3 .anig-card:nth-child(n+2) { display: none; }
    .anig-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .anig-hero { padding-top: 56px; padding-bottom: 48px; }
    .anig-hero-title { font-size: 22px; }
    .anig-stats { gap: 0; }
    .anig-stat { padding: 0 18px; }
    .anig-vine { display: none; }
    #anig-drawer { width: 100%; right: -100%; }
}
@container anig-root (max-width: 600px) {
    .anig-grid { grid-template-columns: 1fr; }
    .anig-tcard { min-width: 200px; }
    #anig-toasts { left: 16px; right: 16px; bottom: 16px; }
    .anig-toast { max-width: 100%; }
    .anig-search-trigger { display: none; }
}

/* ── REDUCE MOTION ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .anig-card, .anig-card-img, .anig-card-bottom-line,
    .anig-card-arrow, .anig-mesh-orb, .anig-firefly,
    .anig-fly, .anig-pulse-dot { transition: none !important; animation: none !important; }
    .anig-sk { animation: none !important; background: var(--s2); }
}

/* ── PRINT ────────────────────────────────────────────────────── */
@media print {
    #anig-search, #anig-drawer, #anig-toasts,
    #anig-progress, #anig-top, #anig-fireflies,
    #anig-cursor { display: none !important; }
    #anig-root::before { display: none; }
}
