/* ═══════════════════════════════════════════════════════════════════════════
   KODA CODEX SECTION — Phase 1 (Vitrine de conversion)
   ═══════════════════════════════════════════════════════════════════════════
   Architecture identique au Grimoire Terra (Jurassic OPS Terminal)
   Glassmorphic + CRT + Neon Accent — Holographic Data-Pads

   Shortcode  : [koda_codex_section world="terra" limit="4" show_locked="6"]
   Namespace  : .koda-codex-section (auto-contenu, pas de dépendance externe)
   ═══════════════════════════════════════════════════════════════════════════ */


/* ══════════════════════════════════════════
   1. DESIGN TOKENS (identiques grimoire-terra)
   ══════════════════════════════════════════ */

.koda-codex-section {
    /* Core Colors */
    --void: #010503;
    --deep: #030a06;
    --surface: #051208;
    --glass: rgba(5, 25, 15, 0.65);
    --glass-light: rgba(10, 40, 25, 0.45);
    --glass-dark: rgba(0, 10, 5, 0.8);

    /* Accent Colors */
    --neon: #00ff6a;
    --neon-dim: #00cc55;
    --neon-bright: #50ffaa;
    --amber: #ffb800;
    --amber-dim: #cc9500;
    --danger: #ff4757;
    --info: #00d4ff;

    /* Text */
    --text-primary: #d0f5d8;
    --text-secondary: #7ab888;
    --text-dim: #4a7a58;

    /* Glassmorphism */
    --blur-sm: blur(8px);
    --blur-md: blur(16px);
    --blur-lg: blur(24px);

    /* Glows */
    --glow-neon: 0 0 5px var(--neon), 0 0 10px var(--neon), 0 0 20px rgba(0, 255, 106, 0.4), 0 0 40px rgba(0, 255, 106, 0.2);
    --glow-amber: 0 0 5px var(--amber), 0 0 15px rgba(255, 184, 0, 0.4);
    --glow-soft: 0 0 20px rgba(0, 255, 106, 0.15);

    /* Typography */
    --font-display: 'Cinzel', 'Palatino', serif;
    --font-mono: 'Share Tech Mono', 'Consolas', monospace;

    /* Sizing */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;

    position: relative;
    font-family: var(--font-mono);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

.koda-codex-section *,
.koda-codex-section *::before,
.koda-codex-section *::after {
    box-sizing: border-box;
}

.koda-codex-section ::selection {
    background: var(--neon);
    color: var(--void);
}


/* ══════════════════════════════════════════
   2. TERMINAL BACKGROUND — CRT + GLASS
   ══════════════════════════════════════════ */

.koda-codex-section .codex-terminal-bg {
    position: relative;
    background:
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(0, 255, 106, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(255, 184, 0, 0.05) 0%, transparent 40%),
        linear-gradient(180deg, var(--deep) 0%, var(--void) 50%, #020805 100%);
    padding: 32px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 255, 106, 0.2);
    box-shadow:
        inset 0 0 100px rgba(0, 255, 106, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 0 80px rgba(0, 255, 106, 0.08),
        0 25px 80px rgba(0, 0, 0, 0.5);
}

/* Layer: Technical Grid */
.koda-codex-section .codex-terminal-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 255, 106, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 106, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    pointer-events: none;
    z-index: 0;
}

/* Layer: Animated Noise */
.koda-codex-section .codex-terminal-bg::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.8' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.025;
    animation: codexNoise 0.2s steps(4) infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes codexNoise {
    0%, 100% { transform: translate(0); }
    25% { transform: translate(-1px, 1px); }
    50% { transform: translate(1px, -1px); }
    75% { transform: translate(-1px, -1px); }
}


/* ══════════════════════════════════════════
   3. CRT EFFECT LAYERS
   ══════════════════════════════════════════ */

.koda-codex-section .codex-scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, transparent 0px, transparent 2px, rgba(0, 0, 0, 0.08) 2px, rgba(0, 0, 0, 0.08) 4px);
    pointer-events: none;
    z-index: 997;
}

.koda-codex-section .codex-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 0%, transparent 50%, rgba(0, 0, 0, 0.6) 100%);
    pointer-events: none;
    z-index: 998;
}

.koda-codex-section .codex-scanbeam {
    position: absolute;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 255, 106, 0.03) 50%, transparent 100%);
    animation: codexScanbeam 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 996;
}

@keyframes codexScanbeam {
    0%, 100% { top: -100px; }
    50% { top: calc(100% + 100px); }
}

.koda-codex-section .codex-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 995;
}

.koda-codex-section .codex-particles::before,
.koda-codex-section .codex-particles::after {
    content: '';
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--neon);
    border-radius: 50%;
    box-shadow: var(--glow-neon);
    animation: codexFloat 20s linear infinite;
    opacity: 0.6;
}

.koda-codex-section .codex-particles::before { left: 10%; animation-delay: 0s; }
.koda-codex-section .codex-particles::after  { left: 85%; animation-delay: -10s; }

@keyframes codexFloat {
    0%   { top: 100%; opacity: 0; transform: translateX(0); }
    10%  { opacity: 0.6; }
    90%  { opacity: 0.6; }
    100% { top: -5%; opacity: 0; transform: translateX(30px); }
}


/* ══════════════════════════════════════════
   4. CONTENT LAYER
   ══════════════════════════════════════════ */

.koda-codex-section .codex-content-layer {
    position: relative;
    z-index: 10;
}


/* ══════════════════════════════════════════
   5. GLASSMORPHIC PANEL BASE
   ══════════════════════════════════════════ */

.koda-codex-section .codex-glass {
    background: var(--glass);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border: 1px solid rgba(0, 255, 106, 0.15);
    border-radius: var(--radius-md);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2),
        0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

/* Shimmer effect */
.koda-codex-section .codex-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.03) 50%, transparent 100%);
    animation: codexShimmer 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes codexShimmer {
    0%, 100% { left: -100%; }
    50% { left: 150%; }
}


/* ══════════════════════════════════════════
   6. HEADER — HOLOGRAPHIC DISPLAY
   ══════════════════════════════════════════ */

.koda-codex-section .codex-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 24px;
    margin-bottom: 24px;
    background: var(--glass);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border: 1px solid rgba(0, 255, 106, 0.2);
    border-left: 3px solid var(--neon);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 10px 40px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(0, 255, 106, 0.1);
}

/* Top light bar */
.koda-codex-section .codex-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--neon), transparent 30%, transparent 70%, var(--amber));
}

/* Holographic flicker */
.koda-codex-section .codex-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 255, 106, 0.02) 0%, transparent 100%);
    animation: codexHoloFlicker 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes codexHoloFlicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
    52% { opacity: 1; }
    54% { opacity: 0.8; }
}

.koda-codex-section .codex-header__title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--neon);
    letter-spacing: 6px;
    margin: 0;
    text-transform: uppercase;
    text-shadow: var(--glow-neon);
}

.koda-codex-section .codex-header__sub {
    font-size: 0.65rem;
    color: var(--text-dim);
    letter-spacing: 4px;
    margin-top: 6px;
    opacity: 0.8;
}

.koda-codex-section .codex-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    background: rgba(0, 255, 106, 0.08);
    border: 1px solid rgba(0, 255, 106, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    color: var(--neon);
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(0, 255, 106, 0.5);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.koda-codex-section .codex-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--neon);
    border-radius: 50%;
    box-shadow: var(--glow-neon);
    animation: codexPulseDot 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes codexPulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}


/* ══════════════════════════════════════════
   7. GRID — Specimen cards
   ══════════════════════════════════════════ */

.koda-codex-section .codex-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}


/* ══════════════════════════════════════════
   8. SPECIMEN CARD — HOLOGRAPHIC DATA PAD
   ══════════════════════════════════════════ */

.koda-codex-section .codex-specimen-pad {
    background: var(--glass);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border: 1px solid rgba(0, 255, 106, 0.15);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 10px 40px rgba(0, 0, 0, 0.3);

    /* Stagger reveal */
    opacity: 0;
    animation: codexCardReveal 0.6s ease-out forwards;
}

/* Holographic edge glow */
.koda-codex-section .codex-specimen-pad::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    padding: 1px;
    background: linear-gradient(135deg, var(--neon) 0%, transparent 40%, transparent 60%, var(--amber) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.4;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

/* Scan line effect on hover */
.koda-codex-section .codex-specimen-pad::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, transparent, rgba(0, 255, 106, 0.05), transparent);
    transition: top 0.6s ease;
    pointer-events: none;
}

.koda-codex-section .codex-specimen-pad:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(0, 255, 106, 0.4);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(0, 255, 106, 0.15);
}

.koda-codex-section .codex-specimen-pad:hover::before { opacity: 0.8; }
.koda-codex-section .codex-specimen-pad:hover::after  { top: 100%; }

/* Stagger delays */
.koda-codex-section .codex-specimen-pad:nth-child(1)  { animation-delay: 0.1s; }
.koda-codex-section .codex-specimen-pad:nth-child(2)  { animation-delay: 0.2s; }
.koda-codex-section .codex-specimen-pad:nth-child(3)  { animation-delay: 0.3s; }
.koda-codex-section .codex-specimen-pad:nth-child(4)  { animation-delay: 0.4s; }
.koda-codex-section .codex-specimen-pad:nth-child(5)  { animation-delay: 0.5s; }
.koda-codex-section .codex-specimen-pad:nth-child(6)  { animation-delay: 0.6s; }
.koda-codex-section .codex-specimen-pad:nth-child(7)  { animation-delay: 0.7s; }
.koda-codex-section .codex-specimen-pad:nth-child(8)  { animation-delay: 0.8s; }
.koda-codex-section .codex-specimen-pad:nth-child(9)  { animation-delay: 0.9s; }
.koda-codex-section .codex-specimen-pad:nth-child(10) { animation-delay: 1.0s; }

@keyframes codexCardReveal {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: none; }
}


/* ── Chrome Top Bar ──────────────────────── */

.koda-codex-section .codex-pad__chrome-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
    border-bottom: 1px solid rgba(0, 255, 106, 0.1);
}

.koda-codex-section .codex-pad__led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--neon);
    box-shadow: var(--glow-neon);
    animation: codexLedPulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes codexLedPulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

.koda-codex-section .codex-pad__led--warning {
    background: var(--amber);
    box-shadow: var(--glow-amber);
}

.koda-codex-section .codex-pad__ref {
    font-size: 0.7rem;
    color: var(--amber);
    letter-spacing: 3px;
    font-weight: 600;
    text-shadow: var(--glow-amber);
}

.koda-codex-section .codex-pad__classification {
    font-size: 0.55rem;
    color: var(--text-dim);
    letter-spacing: 1px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-transform: uppercase;
}


/* ── Visual Scan Area ────────────────────── */

.koda-codex-section .codex-pad__visual {
    position: relative;
    height: 160px;
    background: linear-gradient(135deg, rgba(0, 20, 10, 0.8), rgba(0, 10, 5, 0.9));
    border: 1px solid rgba(0, 255, 106, 0.1);
    border-radius: var(--radius-sm);
    margin: 16px 16px 0;
    overflow: hidden;
}

/* Grid overlay */
.koda-codex-section .codex-pad__visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(0deg, rgba(0, 255, 106, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 106, 0.03) 1px, transparent 1px);
    background-size: 15px 15px;
    pointer-events: none;
    z-index: 2;
}

/* Corner brackets */
.koda-codex-section .codex-pad__visual::after {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid var(--neon);
    opacity: 0.3;
    clip-path: polygon(
        0 0, 20px 0, 20px 1px, 1px 1px, 1px 20px, 0 20px,
        0 calc(100% - 20px), 1px calc(100% - 20px), 1px calc(100% - 1px), 20px calc(100% - 1px), 20px 100%, 0 100%,
        100% 100%, 100% calc(100% - 20px), calc(100% - 1px) calc(100% - 20px), calc(100% - 1px) calc(100% - 1px), calc(100% - 20px) calc(100% - 1px), calc(100% - 20px) 100%,
        calc(100% - 20px) 0, calc(100% - 20px) 1px, calc(100% - 1px) 1px, calc(100% - 1px) 20px, 100% 20px, 100% 0
    );
    z-index: 3;
    pointer-events: none;
}

.koda-codex-section .codex-pad__visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) contrast(1.1) brightness(0.85);
    transition: all 0.5s ease;
}

.koda-codex-section .codex-pad__scan-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 100, 50, 0.3), rgba(0, 50, 25, 0.4));
    mix-blend-mode: color;
    transition: opacity 0.5s ease;
    z-index: 1;
}

.koda-codex-section .codex-specimen-pad:hover .codex-pad__visual img {
    filter: grayscale(0%) contrast(1) brightness(1);
    transform: scale(1.05);
}

.koda-codex-section .codex-specimen-pad:hover .codex-pad__scan-overlay {
    opacity: 0;
}

/* No-image state */
.koda-codex-section .codex-pad__visual .codex-pad__no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-dim);
    font-size: 0.65rem;
    letter-spacing: 3px;
    text-transform: uppercase;
}


/* ── Card Content (name + scientific + readout) ── */

.koda-codex-section .codex-pad__content {
    padding: 16px;
}

.koda-codex-section .codex-pad__name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0 0 4px;
}

.koda-codex-section .codex-pad__scientific {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--amber);
    margin: 0 0 14px;
    text-shadow: 0 0 10px rgba(255, 184, 0, 0.3);
}


/* ── Data Readout Grid ───────────────────── */

.koda-codex-section .codex-pad__readout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.koda-codex-section .codex-pad__data-row {
    padding: 8px 10px;
    background: rgba(0, 20, 10, 0.5);
    border-radius: var(--radius-sm);
    border-left: 2px solid rgba(0, 255, 106, 0.2);
    transition: all 0.3s ease;
}

.koda-codex-section .codex-pad__data-row:hover {
    background: rgba(0, 255, 106, 0.05);
    border-left-color: var(--neon);
}

.koda-codex-section .codex-pad__data-label {
    font-size: 0.55rem;
    color: var(--neon);
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.8;
    margin-bottom: 3px;
}

.koda-codex-section .codex-pad__data-value {
    font-size: 0.8rem;
    color: var(--text-primary);
}


/* ── Chrome Bottom Bar ───────────────────── */

.koda-codex-section .codex-pad__chrome-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.2), transparent);
    border-top: 1px solid rgba(0, 255, 106, 0.08);
}

.koda-codex-section .codex-pad__bracket {
    width: 12px;
    height: 12px;
    border: 1px solid var(--neon);
    opacity: 0.4;
    flex-shrink: 0;
}

.koda-codex-section .codex-pad__bracket--bl { border-right: none; border-top: none; }
.koda-codex-section .codex-pad__bracket--br { border-left: none; border-top: none; }


/* ══════════════════════════════════════════
   9. LOCKED CARD STATE
   ══════════════════════════════════════════ */

.koda-codex-section .codex-specimen-pad--locked {
    cursor: default;
    border-color: rgba(255, 184, 0, 0.15);
}

.koda-codex-section .codex-specimen-pad--locked:hover {
    transform: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 184, 0, 0.15);
}

.koda-codex-section .codex-specimen-pad--locked:hover::before { opacity: 0.4; }
.koda-codex-section .codex-specimen-pad--locked:hover::after  { top: -100%; }

.koda-codex-section .codex-specimen-pad--locked .codex-pad__visual img {
    filter: blur(8px) grayscale(80%) brightness(0.4);
}

.koda-codex-section .codex-specimen-pad--locked:hover .codex-pad__visual img {
    filter: blur(8px) grayscale(80%) brightness(0.4);
    transform: none;
}

.koda-codex-section .codex-specimen-pad--locked:hover .codex-pad__scan-overlay {
    opacity: 1;
}

.koda-codex-section .codex-specimen-pad--locked .codex-pad__content {
    filter: blur(3px);
    opacity: 0.3;
}

.koda-codex-section .codex-pad__lock-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    text-align: center;
    background: rgba(0, 5, 3, 0.4);
    pointer-events: auto;
}

.koda-codex-section .codex-pad__lock-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px dashed rgba(255, 184, 0, 0.5);
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--amber);
    background: rgba(0, 5, 3, 0.7);
    letter-spacing: 2px;
    text-shadow: var(--glow-amber);
}

.koda-codex-section .codex-pad__lock-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    max-width: 28ch;
}

.koda-codex-section .codex-pad__lock-text strong {
    color: var(--amber);
    text-shadow: 0 0 8px rgba(255, 184, 0, 0.3);
}


/* ══════════════════════════════════════════
   10. BUTTONS — HOLOGRAPHIC STYLE
   ══════════════════════════════════════════ */

.koda-codex-section .codex-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    background: rgba(0, 255, 106, 0.1);
    border: 1px solid var(--neon);
    border-radius: var(--radius-sm);
    color: var(--neon);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    text-shadow: 0 0 10px rgba(0, 255, 106, 0.4);
    text-decoration: none;
}

.koda-codex-section .codex-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--neon), var(--neon-dim));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.koda-codex-section .codex-btn:hover {
    color: var(--void);
    text-shadow: none;
    box-shadow: 0 0 30px rgba(0, 255, 106, 0.4);
    transform: translateY(-2px);
}

.koda-codex-section .codex-btn:hover::before { opacity: 1; }
.koda-codex-section .codex-btn:active { transform: translateY(0); }

/* Accent variant (amber — upgrade) */
.koda-codex-section .codex-btn--accent {
    background: rgba(255, 184, 0, 0.1);
    border-color: var(--amber);
    color: var(--amber);
    text-shadow: var(--glow-amber);
}

.koda-codex-section .codex-btn--accent::before {
    background: linear-gradient(135deg, var(--amber), var(--amber-dim));
}

.koda-codex-section .codex-btn--accent:hover {
    color: var(--void);
    box-shadow: 0 0 30px rgba(255, 184, 0, 0.4);
}

/* Disabled */
.koda-codex-section .codex-btn:disabled,
.koda-codex-section .codex-btn[disabled] {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}


/* ══════════════════════════════════════════
   11. CTA SECTION (bas de grille)
   ══════════════════════════════════════════ */

.koda-codex-section .codex-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 28px;
    text-align: center;
}

.koda-codex-section .codex-cta__remaining {
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0;
}


/* ══════════════════════════════════════════
   12. MODAL — CLASSIFIED FILE VIEWER
   ══════════════════════════════════════════ */

.koda-codex-section .codex-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.koda-codex-section .codex-modal.is-active {
    display: flex;
}

.koda-codex-section .codex-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 5, 3, 0.92);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
}

.koda-codex-section .codex-modal__card {
    position: relative;
    z-index: 2;
    background: var(--glass);
    backdrop-filter: var(--blur-lg);
    -webkit-backdrop-filter: var(--blur-lg);
    border: 1px solid rgba(0, 255, 106, 0.3);
    border-radius: var(--radius-lg);
    max-width: 650px;
    width: 100%;
    box-shadow:
        0 0 80px rgba(0, 255, 106, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: codexModalAppear 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

@keyframes codexModalAppear {
    0% { opacity: 0; transform: scale(0.9) translateY(-30px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.koda-codex-section .codex-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(90deg, rgba(0, 255, 106, 0.12), transparent);
    border-bottom: 1px solid rgba(0, 255, 106, 0.15);
    flex-shrink: 0;
}

.koda-codex-section .codex-modal__title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--neon);
    letter-spacing: 5px;
    text-transform: uppercase;
    margin: 0;
    text-shadow: var(--glow-neon);
}

.koda-codex-section .codex-modal__scientific {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--amber);
    margin: 4px 0 0;
    text-shadow: 0 0 10px rgba(255, 184, 0, 0.3);
}

.koda-codex-section .codex-modal__ref {
    font-size: 0.65rem;
    color: var(--text-dim);
    letter-spacing: 2px;
    margin: 6px 0 0;
}

.koda-codex-section .codex-modal__close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.3);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.koda-codex-section .codex-modal__close:hover {
    background: var(--danger);
    color: white;
}


/* ── Modal Body (scrollable) ─────────────── */

.koda-codex-section .codex-modal__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 24px;
}

/* Custom scrollbar */
.koda-codex-section .codex-modal__body::-webkit-scrollbar { width: 6px; }
.koda-codex-section .codex-modal__body::-webkit-scrollbar-track { background: transparent; }
.koda-codex-section .codex-modal__body::-webkit-scrollbar-thumb { background: var(--neon-dim); border-radius: 4px; }
.koda-codex-section .codex-modal__body::-webkit-scrollbar-thumb:hover { background: var(--neon); }


/* ── Modal Section Titles ────────────────── */

.koda-codex-section .codex-modal__section-title {
    font-family: var(--font-display);
    font-size: 0.8rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--neon);
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 255, 106, 0.15);
    text-shadow: var(--glow-soft);
}

.koda-codex-section .codex-modal__section-title:first-child { margin-top: 0; }


/* ── Modal Params Grid ───────────────────── */

.koda-codex-section .codex-modal__params-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.koda-codex-section .codex-modal__param {
    padding: 10px 12px;
    background: rgba(0, 20, 10, 0.5);
    border-radius: var(--radius-sm);
    border-left: 2px solid rgba(0, 255, 106, 0.2);
}

.koda-codex-section .codex-modal__param-label {
    display: block;
    font-size: 0.6rem;
    color: var(--neon);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 4px;
    font-weight: normal;
    opacity: 0.8;
}

.koda-codex-section .codex-modal__param-value {
    font-size: 0.85rem;
    color: var(--text-primary);
}


/* ── Modal Text Block ────────────────────── */

.koda-codex-section .codex-modal__text-block {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 10px;
}

.koda-codex-section .codex-modal__text-block strong {
    color: var(--neon);
    font-weight: normal;
    text-shadow: 0 0 8px rgba(0, 255, 106, 0.3);
}


/* ── Modal Alert ─────────────────────────── */

.koda-codex-section .codex-modal__alert {
    background: rgba(255, 71, 87, 0.08);
    border: 1px solid rgba(255, 71, 87, 0.3);
    border-left: 3px solid var(--danger);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 12px 14px;
    margin: 12px 0;
}

.koda-codex-section .codex-modal__alert-title {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--danger);
    margin: 0 0 6px;
}

.koda-codex-section .codex-modal__alert-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}


/* ── Modal Image ─────────────────────────── */

.koda-codex-section .codex-modal__hero-img {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 255, 106, 0.15);
    margin-bottom: 16px;
    filter: grayscale(30%) contrast(1.05) brightness(0.9);
}


/* ── Modal Loading ───────────────────────── */

.koda-codex-section .codex-modal__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--neon);
    text-shadow: var(--glow-soft);
    animation: codexLoadPulse 2s ease-in-out infinite;
}

@keyframes codexLoadPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}


/* ── Modal Footer ────────────────────────── */

.koda-codex-section .codex-modal__footer {
    flex-shrink: 0;
    padding: 12px 24px;
    border-top: 1px solid rgba(0, 255, 106, 0.1);
    text-align: center;
}

.koda-codex-section .codex-modal__stamp {
    font-family: var(--font-display);
    font-size: 9px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(0, 255, 106, 0.25);
    margin: 0;
}


/* ══════════════════════════════════════════
   13. RESPONSIVE
   ══════════════════════════════════════════ */

@media (max-width: 768px) {
    .koda-codex-section .codex-terminal-bg {
        padding: 16px;
    }

    .koda-codex-section .codex-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .koda-codex-section .codex-header__title {
        font-size: 1.1rem;
        letter-spacing: 4px;
    }

    .koda-codex-section .codex-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .koda-codex-section .codex-modal__params-grid {
        grid-template-columns: 1fr;
    }

    .koda-codex-section .codex-modal__card {
        max-height: 90vh;
    }
}


/* ══════════════════════════════════════════
   14. ACCESSIBILITY — Reduced Motion
   ══════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    .koda-codex-section .codex-specimen-pad {
        opacity: 1;
        animation: none;
    }

    .koda-codex-section .codex-scanbeam,
    .koda-codex-section .codex-particles::before,
    .koda-codex-section .codex-particles::after {
        animation: none;
    }

    .koda-codex-section .codex-terminal-bg::after {
        animation: none;
    }

    .koda-codex-section .codex-modal__card {
        animation: none;
    }

    .koda-codex-section .codex-modal__loading {
        animation: none;
        opacity: 0.6;
    }
}


/* ══════════════════════════════════════════
   15. ELEMENTOR COMPATIBILITY
   ══════════════════════════════════════════ */

.elementor-widget-shortcode .koda-codex-section,
.elementor-element .koda-codex-section {
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.elementor-widget-shortcode .koda-codex-section .codex-header__title,
.elementor-element .koda-codex-section .codex-header__title,
.elementor-widget-shortcode .koda-codex-section .codex-modal__title,
.elementor-element .koda-codex-section .codex-modal__title {
    font-family: var(--font-display);
}

/* ══════════════════════════════════════════
   BLOC "EN COURS DE CRÉATION" (page complète)
   Neutre, sobre — PAS l'esthétique terminal Terra.
   Surcharge la base .koda-codex-section (placée en fin de fichier).
   ══════════════════════════════════════════ */

.koda-codex-section--soon {
    background: #f5f5f4;
    color: #44403c;
    border: 1px dashed #d6d3d1;
    border-radius: 12px;
    padding: 40px 24px;
    margin: 24px 0;
    text-align: center;
    overflow: visible;
    box-shadow: none;
    min-height: 0;
}

.koda-codex-section--soon h2 {
    margin: 0 0 8px;
    font-size: 1.25rem;
    line-height: 1.3;
    color: #292524;
    text-transform: none;
    letter-spacing: normal;
    text-shadow: none;
}

.koda-codex-section--soon p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #78716c;
}

/* ══════════════════════════════════════════
   ACCORDÉONS IMBRIQUÉS (monde / ordre)
   Boutons style "terminal" (réutilise les tokens Terra : --neon, --glass, mono).
   ══════════════════════════════════════════ */

.koda-codex-section .codex-accordion__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 12px 0 0;
    padding: 12px 16px;
    background: var(--glass, rgba(5, 25, 15, 0.65));
    border: 1px solid var(--neon-dim, #00cc55);
    border-radius: 6px;
    color: var(--neon, #00ff6a);
    font-family: var(--font-mono, 'Share Tech Mono', monospace);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.koda-codex-section .codex-accordion__toggle:hover,
.koda-codex-section .codex-accordion__toggle:focus-visible {
    background: var(--glass-light, rgba(10, 40, 25, 0.45));
    box-shadow: 0 0 12px rgba(0, 255, 106, 0.25);
    outline: none;
}

.koda-codex-section .codex-accordion__toggle--monde {
    font-size: 1.05rem;
    border-color: var(--neon, #00ff6a);
}

.koda-codex-section .codex-accordion__count {
    opacity: 0.7;
    margin-left: 4px;
}

.koda-codex-section .codex-accordion__chevron {
    flex: 0 0 auto;
    width: 0;
    height: 0;
    border-left: 6px solid currentColor;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    transition: transform 0.2s ease;
}

.koda-codex-section .codex-accordion__toggle[aria-expanded="true"] .codex-accordion__chevron {
    transform: rotate(90deg);
}

/* Corps d'accordéon */
.koda-codex-section .codex-accordion__body {
    /* Perf 200+ fiches : saute le rendu hors-écran, cartes gardées dans le DOM. */
    content-visibility: auto;
    contain-intrinsic-size: 1px 600px;
}

.koda-codex-section .codex-accordion__body[hidden] {
    /* Replié : non peint, mais nœuds DOM conservés (recherche P2). */
    display: none;
}

.koda-codex-section .codex-accordion__body--ordre {
    padding: 12px 0 4px;
}

/* ══════════════════════════════════════════
   BARRE DE RECHERCHE (page complète [koda_codex_full])
   Style KODA générique — VOLONTAIREMENT hors esthétique terminal.
   Placée hors .koda-codex-section : n'hérite pas des tokens néon.
   ══════════════════════════════════════════ */

.koda-codex-full .koda-codex-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    max-width: 720px;
    margin: 0 auto 24px;
    padding: 0 16px;
}

.koda-codex-full .koda-codex-search__input {
    flex: 1 1 240px;
    min-width: 0;
    padding: 12px 16px;
    font-size: 1rem;
    line-height: 1.4;
    color: #1c1917;
    background: #ffffff;
    border: 1px solid #d6d3d1;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.koda-codex-full .koda-codex-search__input:focus {
    outline: none;
    border-color: #a8a29e;
    box-shadow: 0 0 0 3px rgba(120, 113, 108, 0.18);
}

.koda-codex-full .koda-codex-search__input::placeholder {
    color: #a8a29e;
}

.koda-codex-full .koda-codex-search__count {
    flex: 0 0 auto;
    font-size: 0.9rem;
    color: #78716c;
    white-space: nowrap;
}

/* États de filtrage (recherche) — masquage sans retirer du DOM */
.koda-codex-section .codex-specimen-pad.is-search-hidden,
.koda-codex-section .codex-accordion__toggle.is-search-hidden,
.koda-codex-section .codex-accordion__body.is-search-hidden {
    display: none;
}
