/*
Theme Name: NEON VOID
Theme URI: https://blog.alanandr.eu
Author: Alan Andreu
Author URI: https://alanandr.eu
Description: Custom Theme based on HTML and CSS, in compliance with SEO best practices. Cyber-Organic / Neon Void variant.
Version: 2.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: my-own-theme
*/

:root {
    --void: #05060a;
    --void-soft: #0a0d12;
    --panel: rgba(13, 21, 18, 0.78);
    --panel-solid: #0d1512;
    --panel-violet: rgba(22, 14, 28, 0.82);
    --line: #1c3a2f;
    --line-violet: #3d1f57;
    --neon: #39ff88;
    --neon-dim: #1f8f52;
    --neon-soft: rgba(57, 255, 136, 0.35);
    --violet: #6d3fa0;
    --violet-soft: rgba(109, 63, 160, 0.45);
    --magenta: #ff2fd0;
    --cyan: #2ff0ff;
    --tide: #2fb6e0;
    --tide-dim: #1a6f8c;
    --tide-soft: rgba(47, 182, 224, 0.35);
    --line-tide: #163a49;
    --text: #e9f5ec;
    --text-dim: #9fb3ab;

    --font-display: 'Space Grotesk', 'Arial', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

* {
    font-family: var(--font-display);
    transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: var(--void);
    background-image:
        radial-gradient(circle at 15% 0%, rgba(57, 255, 136, 0.06), transparent 40%),
        radial-gradient(circle at 85% 10%, rgba(109, 63, 160, 0.10), transparent 45%);
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--neon); text-decoration: none; }

aside a:hover { color: #d8c4f0; }

.icon {
    margin: 0;
    width: 22px;
    height: 22px;
    margin-right: 10px;
    vertical-align: middle;
    filter: drop-shadow(0 0 3px var(--neon-soft));
}

/* ---------- Header ---------- */

body > header {
    display: flex;
    position: relative;
    width: 100%;
    height: 400px;
    padding: 10px;
    background-image:
        linear-gradient(180deg, rgba(5, 6, 10, 0.55) 0%, rgba(5, 6, 10, 0.85) 100%),
        url(assets/img/blog_bg.jpg);
    background-size: cover;
    background-position: center;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--text);
    font-size: 24px;
    font-weight: 700;
    overflow: hidden;
}

/* faint scanlines over the hero, very low opacity so it never fights legibility */
body > header::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        0deg,
        rgba(255, 255, 255, 0.02),
        rgba(255, 255, 255, 0.02) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
}




body > header nav {
    width: auto;
    display: flex;
    align-items: center;
    position: absolute;
    padding: 6px 11px;
    top: 20px;
    left: 20px;
    background-color: rgba(5, 6, 10, 0.55);
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 400;
    font-family: var(--font-mono);
    opacity: 0.6;
    z-index: 2;
}

body > header nav:hover {
    opacity: 1;
    background-color: rgba(5, 6, 10, 0.85);
    border-color: var(--neon);
    box-shadow: 0 0 12px var(--neon-soft);
}

body > header nav img {
    width: 13px;
    height: 13px;
    flex: none;
    margin-right: 6px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

body > header nav:hover img {
    filter: drop-shadow(0 0 3px var(--neon-soft));
}

body > header nav p { display: inline; }

body > header nav a:hover {
    color: var(--text);
    text-shadow: 0 0 0.4px currentColor, 0 0 0.4px currentColor;
}

body > header img { max-width: 80%; height: auto; z-index: 2; position: relative; }

/* subtle white glow on the logo, following its actual transparent
   silhouette (drop-shadow), fading in smoothly on hover */
body > header a[aria-current="blog"] img {
    filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0));
    transition: filter 0.7s ease;
}

body > header a[aria-current="blog"]:hover img {
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.55));
}

/* rising bioluminescent particles, drifting up through the header */
.header-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.header-particles span {
    position: absolute;
    bottom: -14px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--neon);
    box-shadow: 0 0 6px var(--neon-soft);
    opacity: 0;
    animation: particle-rise linear infinite;
}

.header-particles span:nth-child(3n) {
    background: var(--violet);
    box-shadow: 0 0 6px var(--violet-soft);
}

.header-particles span:nth-child(1) { left: 5%;  width: 3px; height: 3px; animation-duration: 16s; animation-delay: 0s; }
.header-particles span:nth-child(2) { left: 15%; width: 4px; height: 4px; animation-duration: 21s; animation-delay: 3s; }
.header-particles span:nth-child(3) { left: 25%; width: 2px; height: 2px; animation-duration: 13s; animation-delay: 6s; }
.header-particles span:nth-child(4) { left: 38%; width: 5px; height: 5px; animation-duration: 24s; animation-delay: 1s; }
.header-particles span:nth-child(5) { left: 50%; width: 3px; height: 3px; animation-duration: 18s; animation-delay: 8s; }
.header-particles span:nth-child(6) { left: 62%; width: 4px; height: 4px; animation-duration: 15s; animation-delay: 4s; }
.header-particles span:nth-child(7) { left: 72%; width: 2px; height: 2px; animation-duration: 22s; animation-delay: 10s; }
.header-particles span:nth-child(8) { left: 82%; width: 3px; height: 3px; animation-duration: 17s; animation-delay: 2s; }
.header-particles span:nth-child(9) { left: 90%; width: 4px; height: 4px; animation-duration: 20s; animation-delay: 7s; }
.header-particles span:nth-child(10) { left: 96%; width: 2px; height: 2px; animation-duration: 14s; animation-delay: 5s; }

@keyframes particle-rise {
    0%   { transform: translateY(0); opacity: 0; }
    12%  { opacity: 0.65; }
    85%  { opacity: 0.35; }
    100% { transform: translateY(-360px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .header-particles { display: none; }
}

/* ---------- Footer ---------- */

body > footer {
    padding: 26px 20px;
    background-color: var(--void);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 13px;
    text-align: center;
}

.footer-copy {
    margin: 0 0 10px 0;
    font-family: var(--font-display);
    font-size: 14px;
}

.footer-rule {
    max-width: 240px;
    margin: 0 auto 18px auto;
}

.footer-legal-links {
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.75;
}

.footer-legal-links a,
.footer-legal-links .footer-cookie-settings {
    color: var(--neon-dim);
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    text-transform: uppercase;
    letter-spacing: inherit;
    cursor: pointer;
}

.footer-legal-links a:hover,
.footer-legal-links .footer-cookie-settings:hover {
    color: var(--neon);
}

.footer-legal-links span {
    margin: 0 8px;
    color: var(--line);
}

/* ---------- Main layout ---------- */

main {
    display: flex;
    justify-content: center;
    background-color: var(--void-soft);
    padding-top: 30px;
    padding-bottom: 42px;
}

main > section {
    width: 60%;
    max-width: 800px;
    margin-right: 20px;
}

main > aside {
    width: 20%;
    max-width: 300px;
    text-align: center;
}

section > article {
    padding: 12px;
    margin-bottom: 24px;
    color: var(--text);
    background: var(--panel);
    backdrop-filter: blur(6px);
    border: 1px solid var(--line);
    border-radius: 4px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    text-align: justify;
}

section > article:hover {
    border-color: var(--neon-dim);
}

/* ---------- Article content (Gutenberg blocks) ---------- */

section > article h2 { color: var(--neon); font-size: 1.7rem; margin: 2.2em 0 0.6em 0; text-shadow: 0 0 12px var(--neon-soft); }
section > article h3 { color: var(--text); font-size: 1.2rem; margin: 1.6em 0 0.5em 0; padding-left: 10px; border-left: 3px solid var(--neon-dim); }
section > article h3:hover { animation: accent-blink 1.2s ease-in-out infinite; }
section > article h4 { color: var(--text); font-size: 1.05rem; margin: 1.4em 0 0.4em 0; }
section > article h5 { color: var(--text-dim); font-size: 0.95rem; margin: 1.2em 0 0.4em 0; text-transform: uppercase; letter-spacing: 0.04em; }
section > article h6 { color: var(--text-dim); font-size: 0.85rem; margin: 1.1em 0 0.4em 0; font-family: var(--font-mono); }

/* :not(.post-categories) evita que estas reglas de listas de contenido
   afecten a la etiqueta de categoría del post, que también es un <ul>
   dentro de <article> pero no es contenido de Gutenberg. */
section > article ul:not(.post-categories), section > article ol { margin: 1em 0; padding-left: 1.4em; }

section > article ul:not(.post-categories) { list-style: none; padding-left: 0; }
section > article ul:not(.post-categories) li { padding-left: 1.4em; position: relative; margin-bottom: 6px; }
section > article ul:not(.post-categories) li::before,
section > article ul:not(.post-categories) li::after {
    content: "";
    position: absolute;
    left: 6px; top: 0.85em;
    width: 6px; height: 6px;
    border-radius: 50%;
}
section > article ul:not(.post-categories) li::before {
    background: var(--neon);
    box-shadow: 0 0 6px var(--neon-soft);
    transform: translate(-50%, -50%);
}
section > article ul:not(.post-categories) li::after {
    border: 1px solid var(--neon-dim);
    opacity: 0;
    animation: signal-ping-li 2.6s ease-out infinite;
    pointer-events: none;
}

section > article ol {
    list-style: none;
    padding-left: 0;
    margin: 1em 0;
    counter-reset: ol-counter;
}
section > article ol li {
    counter-increment: ol-counter;
    position: relative;
    padding-left: 28px;
    margin-bottom: 10px;
    min-height: 20px;
    display: flex;
    align-items: center;
}
section > article ol li::before {
    content: counter(ol-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--neon-dim);
    color: var(--void);
    -webkit-text-stroke: 0.5px var(--void);
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
section > article ol li:hover::before { background: var(--neon); }

section > article blockquote {
    border-left: 3px solid var(--neon-dim);
    background: var(--void);
    padding: 10px 16px;
    margin: 1.2em 0;
    font-style: italic;
    color: var(--text-dim);
    border-radius: 0 4px 4px 0;
}
section > article blockquote:hover { animation: accent-blink 1.2s ease-in-out infinite; }
section > article blockquote cite { display: block; margin-top: 6px; font-size: 0.8rem; color: var(--neon-dim); font-style: normal; }

.wp-block-pullquote { text-align: center; margin: 2em 0; padding: 20px 24px; background: var(--panel-violet); border-top: 1px solid var(--line-violet); border-bottom: 1px solid var(--line-violet); }
.wp-block-pullquote:hover { border-color: var(--violet); }
.wp-block-pullquote blockquote { border: none; background: transparent; padding: 0; margin: 0; font-style: normal; color: inherit; }
.wp-block-pullquote p { font-size: 1.3rem; color: var(--violet); font-weight: 700; margin: 0; }

.wp-block-buttons { margin: 1.6em 0; text-align: center; }
.wp-block-button__link { display: inline-block; background: var(--neon-dim); color: var(--void); border: 1px solid var(--neon); padding: 11px 24px; border-radius: 20px; font-family: var(--font-mono); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; text-decoration: none; box-shadow: 0 0 14px var(--neon-soft); }
.wp-block-button__link:hover { background: var(--neon); box-shadow: 0 0 24px var(--neon-soft); }

code { font-family: var(--font-mono); background: var(--void); color: var(--tide); padding: 2px 6px; border-radius: 3px; font-size: 0.88em; }

pre.wp-block-preformatted { background: var(--void); border: 1px solid var(--line); border-radius: 4px; padding: 14px; overflow-x: auto; margin: 1.2em 0; color: var(--text); }
pre.wp-block-preformatted:hover { border-color: var(--neon); }

/* Bloque de código: estilo ventana de terminal Mac/Linux */
pre.wp-block-code {
    background: #0d0d0d;
    border: 1px solid #1c1c1c;
    border-radius: 8px;
    padding: 0;
    margin: 1.4em 0;
    overflow: hidden;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
}
pre.wp-block-code:hover {
    background: #080808;
}
pre.wp-block-code::before {
    content: "";
    display: block;
    height: 24px;
    background-color: #1e1e1e;
    border-bottom: 1px solid #050505;
    background-image:
        radial-gradient(circle 4px at 16px 12px, #ff5f56 99%, transparent 100%),
        radial-gradient(circle 4px at 30px 12px, #ffbd2e 99%, transparent 100%),
        radial-gradient(circle 4px at 44px 12px, #27c93f 99%, transparent 100%);
    background-repeat: no-repeat;
}
pre.wp-block-code code {
    display: block;
    padding: 18px 20px;
    background: transparent;
    color: #d4d4d4;
    font-size: 0.88rem;
    line-height: 1.65;
    overflow-x: auto;
}

.wp-block-columns { display: flex; gap: 24px; margin: 1.4em 0; }
.wp-block-column { flex: 1; background: var(--panel-violet); border-left: 3px solid var(--neon-dim); padding: 16px; border-radius: 0 6px 6px 0; }
.wp-block-column:hover { animation: accent-blink 1.2s ease-in-out infinite; background: rgba(28, 18, 36, 0.85); }

/* Bloque "details" (notas desplegables) — verde también en reposo */
details.wp-block-details {
    border: 1px solid var(--neon-dim);
    border-radius: 10px;
    padding: 10px 14px;
    margin: 1.2em 0;
    background-color: var(--void);
}
details.wp-block-details[open] { border-color: var(--neon); box-shadow: 0 0 12px var(--neon-soft); }
details.wp-block-details summary {
    cursor: pointer;
    color: var(--neon);
    font-weight: 700;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    list-style: none;
    position: relative;
    padding-left: 20px;
}
details.wp-block-details summary::-webkit-details-marker { display: none; }
details.wp-block-details summary::before {
    content: "";
    position: absolute;
    left: 6px; top: 50%;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--neon);
    box-shadow: 0 0 6px var(--neon-soft);
    transform: translate(-50%, -50%);
}
details.wp-block-details summary::after {
    content: "";
    position: absolute;
    left: 6px; top: 50%;
    width: 6px; height: 6px;
    border-radius: 50%;
    border: 1px solid var(--neon);
    opacity: 0;
    animation: signal-ping-li 2.6s ease-out infinite;
    pointer-events: none;
}
details.wp-block-details[open] summary::after {
    animation: none;
    opacity: 0;
}

.wp-block-group {
    border: 1px solid var(--line-violet);
    border-radius: 8px;
    padding: 16px 18px;
    margin: 1.4em 0;
    background: linear-gradient(135deg, rgba(31, 143, 82, 0.18), rgba(109, 63, 160, 0.2), rgba(31, 143, 82, 0.18));
    background-size: 200% 200%;
    animation: notes-gradient-shift 8s ease-in-out infinite;
}
.wp-block-group:hover { border-color: var(--violet); }

/* Verso/poesía — tipografía mono cursiva */
pre.wp-block-verse {
    font-family: var(--font-mono);
    font-style: italic;
    color: var(--neon);
    background: var(--void);
    padding: 10px 16px;
    border-left: 3px solid var(--line-violet);
    white-space: pre-wrap;
    font-size: 0.95rem;
    margin: 1.4em 0;
}
pre.wp-block-verse:hover { animation: accent-blink-violet 1.2s ease-in-out infinite; }

figure.wp-block-image {
    width: fit-content;
    max-width: 100%;
    margin: 1.4em auto;
    background: var(--void);
    border: 1px solid var(--line-violet);
    border-radius: 10px;
    padding: 10px;
}
figure.wp-block-embed {
    margin: 1.4em 0;
    background: var(--void);
    border: 1px solid var(--line-violet);
    border-radius: 10px;
    padding: 10px;
}
/* Vídeos embebidos (YouTube, Vimeo, etc.) a ancho completo, en formato
   16:9 responsive — así el iframe que genera WordPress al pegar la URL
   se ajusta siempre al ancho del artículo sin deformarse. */
.wp-block-embed__wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: inherit;
}
.wp-block-embed__wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}
/* La imagen conserva su tamaño natural (nunca se estira) y solo se
   reduce si no cabe en el ancho del artículo — el contenedor se ajusta
   a ella, no al revés. */
figure.wp-block-image img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}
figcaption {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--line-violet);
    text-align: center;
    padding: 10px 4px 2px 4px;
    overflow-wrap: break-word;
    width: 0;
    min-width: 100%;
}
figure.wp-block-image:hover,
figure.wp-block-embed:hover {
    border-color: var(--violet);
}
figure.wp-block-image:hover figcaption,
figure.wp-block-embed:hover figcaption {
    color: var(--violet);
}

@keyframes signal-ping-li {
    0%   { transform: translate(-50%, -50%) scale(0.4); opacity: 0.7; }
    70%  { transform: translate(-50%, -50%) scale(2.2); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; }
}
@keyframes accent-blink {
    0%, 100% { border-left-color: var(--neon-dim); }
    50% { border-left-color: var(--neon); }
}
@keyframes accent-blink-violet {
    0%, 100% { border-left-color: var(--line-violet); }
    50% { border-left-color: var(--violet); }
}
@keyframes notes-gradient-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@media (prefers-reduced-motion: reduce) {
    section > article h3:hover,
    section > article blockquote:hover,
    .wp-block-column:hover,
    pre.wp-block-verse:hover {
        animation: none;
    }
    section > article ul:not(.post-categories) li::after,
    details.wp-block-details summary::after {
        animation: none;
        opacity: 0;
    }
    .wp-block-group {
        animation: none;
        background-position: 0% 50%;
    }
}

aside > section {
    padding: 12px;
    margin-bottom: 24px;
    color: var(--text);
    background: var(--panel-violet);
    backdrop-filter: blur(6px);
    border: 1px solid var(--line-violet);
    border-radius: 4px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    text-align: justify;
}

aside > section:hover {
    border-color: var(--violet);
}

/* Cut-corner "circuit board" header treatment, distinct from the rounded
   panels below it, to give the post header its own visual rank */
.post-title-label {
    text-align: center;
    margin-bottom: 16px;
}

.post-title-label .eyebrow {
    margin: 0 0 4px 0;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    color: var(--neon-dim);
}

.post-title-label h1 {
    justify-content: center;
    color: var(--neon);
}

.post-title-label h1 a {
    color: var(--neon);
}

.title-rule {
    display: block;
    height: 1px;
    width: 100%;
    margin-top: 10px;
    background-image: linear-gradient(90deg, transparent, var(--neon) 50%, transparent);
    transform-origin: center;
    animation: title-rule-breathe 3.6s ease-in-out infinite;
}

@keyframes title-rule-breathe {
    0%, 100% { transform: scaleX(0.5); opacity: 0.4; }
    50%      { transform: scaleX(1); opacity: 0.85; }
}

@media (prefers-reduced-motion: reduce) {
    .title-rule { animation: none; transform: scaleX(1); opacity: 0.55; }
}

section > header {
    min-height: 42px;
    padding: 10px 16px;
    justify-content: flex-start;
    background-color: #211533;
    border: 1px solid #3d1f57;
    border-left: 4px solid var(--violet);
    border-radius: 4px;
    clip-path: none;
    color: #d8c4f0;
    margin-bottom: 12px;
}

section > header h1 { color: #d8c4f0; }

.post-category {
    margin: 0;
    padding: 5px;
    border-radius: 4px;
    background-color: var(--void-soft);
    width: fit-content;

    ul {
        list-style-type: none;
        padding: 0;
        margin: 0;
        text-align: left;
    }

    .tilt {
        background-color: #060907;
        border: 1px solid var(--cat-color, var(--line));
        border-radius: 3px;
        width: max-content;
        display: inline-flex;
        padding: 5px 8px;
        gap: 5px;
        font-family: var(--font-mono);
        font-size: 0.75rem;
        font-weight: 600;
        letter-spacing: 0.02em;

        a {
            text-decoration: none;
            color: var(--cat-color, var(--text));
        }

        &:hover {
            border-color: var(--cat-color, var(--neon));
            box-shadow: 0 0 8px var(--cat-color, var(--neon-soft));
        }
    }
}

/* ---------- Category colors ----------
   Maps a WordPress category slug to its own accent color via
   --cat-color, which .tilt above reads with a fallback. To add a
   new category, just add one line here: .tilt.cat-<slug> { --cat-color: #hex; }
   Categories with no entry keep the default green/white look. */
.tilt.cat-science              { --cat-color: #2fb6e0; }
.tilt.cat-technology           { --cat-color: #39ff88; }
.tilt.cat-linguistics          { --cat-color: #d8c4f0; }
.tilt.cat-personal-development { --cat-color: #ff2fd0; }

header > h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-size: 1.15rem;
    line-height: 1.3;
    margin: 0;
    padding: 0;
    text-align: center;
    position: relative;
}

section > header h1 {
    justify-content: flex-start;
    text-align: left;
}

/* ---------- Glitch title effect (post headings) ----------
   Subtle, hover-only chromatic split using the same text via
   data-text, so it works on real post titles, not images. */
.glitch-title {
    position: relative;
    display: inline-block;
}

.glitch-title::before,
.glitch-title::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    overflow: hidden;
    background: inherit;
}

.glitch-title:hover::before {
    opacity: 0.7;
    color: var(--cyan);
    transform: translate(-1.5px, -0.5px);
    animation: glitch-jitter 0.5s steps(2, end) infinite;
}

.glitch-title:hover::after {
    opacity: 0.7;
    color: var(--magenta);
    transform: translate(1.5px, 0.5px);
    animation: glitch-jitter 0.6s steps(2, end) infinite reverse;
}

@keyframes glitch-jitter {
    0%   { transform: translate(-1.5px, -0.5px); }
    50%  { transform: translate(1.5px, 0.5px); }
    100% { transform: translate(-1px, 0.5px); }
}

@media (prefers-reduced-motion: reduce) {
    .glitch-title:hover::before,
    .glitch-title:hover::after { animation: none; }
}

/* ---------- Shimmer title effect (sidebar headings) ----------
   A lilac sweep of light across the text on hover, distinct from
   the chromatic glitch used on article titles. */
.shimmer-title {
    background-image: linear-gradient(100deg, #d8c4f0 30%, #ffffff 50%, #d8c4f0 70%);
    background-size: 250% auto;
    background-position: 200% center;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #d8c4f0;
}

section > header:hover .shimmer-title {
    animation: shimmer-sweep 2.6s ease-in-out infinite;
}

@keyframes shimmer-sweep {
    0%   { background-position: 200% center; }
    50%  { background-position: -50% center; }
    100% { background-position: 200% center; }
}

@media (prefers-reduced-motion: reduce) {
    section > header:hover .shimmer-title { animation: none; background-position: -50% center; }
}

/* ---------- Sidebar ---------- */

.profile-frame {
    position: relative;
    width: 68%;
    max-width: 200px;
    aspect-ratio: 1 / 1;
    margin: 0 auto 24px auto;
}

.profile-frame::before {
    content: "";
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--violet), var(--neon), var(--violet));
    animation: profile-ring-spin 8s linear infinite;
}

.profile-frame::after {
    content: "";
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--violet-soft) 0%, transparent 70%);
    opacity: 0.5;
    animation: profile-glow-pulse 4s ease-in-out infinite;
    pointer-events: none;
}

.profile-frame img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--void);
    box-sizing: border-box;
    margin: 0;
}

@keyframes profile-ring-spin {
    to { transform: rotate(360deg); }
}

@keyframes profile-glow-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.65; }
}

@media (prefers-reduced-motion: reduce) {
    .profile-frame::before { animation: none; }
    .profile-frame::after { animation: none; opacity: 0.45; }
}

aside > section ul {
    margin: 0;
    padding: 0;
    list-style: none;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

aside > section ul > li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px dotted rgba(109, 63, 160, 0.35);
}

.count-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-dim);
    background: rgba(109, 63, 160, 0.15);
    border: 1px solid rgba(109, 63, 160, 0.4);
    border-radius: 3px;
    padding: 1px 6px;
    min-width: 1.4em;
    text-align: center;
}

aside > section ul > li:hover .count-badge {
    color: #d8c4f0;
    border-color: var(--violet);
}

aside > section ul > li:first-child { padding-top: 0; }

aside > section ul > li:last-child { padding-bottom: 0; border-bottom: none; }

aside p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ---------- Read more / meta ---------- */

section > article > p + a {
    display: inline-block;
    margin-top: 6px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--neon);
}

section > article > p + a:hover {
    text-shadow: 0 0 8px var(--neon-soft);
}

article > footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

article > footer div.date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
}

article > footer div a {
    margin-top: 0;
    width: auto;
    background-color: var(--panel-solid);
    border: 1px solid var(--neon-dim);
    border-radius: 4px;
    display: inline-block;
    color: var(--neon);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 10px;
}

article > footer div a:hover {
    box-shadow: 0 0 12px var(--neon-soft);
    border-color: var(--neon);
}

.separator {
    width: 60%;
    margin: 20px auto 30px auto;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.signal-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--neon-dim) 50%, transparent);
    opacity: 0.8;
}

.signal-node {
    position: relative;
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--neon);
    box-shadow: 0 0 6px var(--neon-soft);
}

.signal-node::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid var(--neon-dim);
    opacity: 0;
    animation: signal-ping 2.6s ease-out infinite;
}

@keyframes signal-ping {
    0%   { transform: scale(0.4); opacity: 0.7; }
    70%  { transform: scale(2.2); opacity: 0; }
    100% { transform: scale(2.2); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .signal-node::before { animation: none; opacity: 0; }
}

.comments { float: right; }

/* ---------- Comment form ---------- */

.publish-comment {
    width: 100%;
    background: var(--panel-violet);
    backdrop-filter: blur(6px);
    border: 1px solid var(--line-violet);
    border-radius: 6px;
    margin-bottom: 30px;
    padding: 22px 26px;
}
.publish-comment:hover { border-color: var(--violet); }

.publish-comment header { text-align: center; }

.publish-comment .pc-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--violet);
    margin: 0 0 6px 0;
}

.publish-comment header h1 { color: var(--text); font-size: 1.25rem; margin: 0; }

.publish-comment .pc-rule {
    display: block;
    height: 1px;
    width: 100%;
    margin: 16px 0 22px 0;
    background-image: linear-gradient(90deg, transparent, var(--violet) 50%, transparent);
    transform-origin: center;
    animation: title-rule-breathe 3.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .publish-comment .pc-rule { animation: none; opacity: 0.55; }
}

.publish-comment form {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.publish-comment .pc-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid var(--line-violet);
    border-radius: 10px;
    padding: 10px 14px;
    background-color: var(--void);
}
.publish-comment .pc-field:focus-within { border-color: var(--neon); box-shadow: 0 0 12px var(--neon-soft); }
.publish-comment .pc-field:focus-within label { color: var(--neon); }

.publish-comment label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--violet);
}
.publish-comment label::before { content: "> "; opacity: 0.7; }

.publish-comment input[type="text"],
.publish-comment textarea {
    width: 100%;
    color: var(--text);
    resize: vertical;
    font-size: 0.95rem;
    background: transparent;
    border: none;
    padding: 2px 0 0 0;
}

.publish-comment input[type="text"]:focus,
.publish-comment textarea:focus { outline: none; }

.comment-submit {
    align-self: flex-end;
    margin-top: 4px;
    background-color: transparent;
    color: var(--neon);
    padding: 10px 22px;
    border: 1px solid var(--neon-dim);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    text-transform: uppercase;
    font-family: var(--font-mono);
    font-weight: 700;
    letter-spacing: 0.06em;
}

.comment-submit:hover {
    border-color: var(--neon);
    background-color: var(--neon-dim);
    color: var(--void);
    box-shadow: 0 0 16px var(--neon-soft);
}

/* ---------- Comments list ---------- */

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--neon-dim);
    margin: 0 0 18px 4px;
    cursor: default;
}
.section-title:hover { color: var(--neon); }
.section-title .count {
    background: var(--panel-solid);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 0.75rem;
    color: var(--text-dim);
    cursor: default;
}
.section-title .count:hover { border-color: var(--neon-dim); }

.comments-list {
    list-style: none;
    margin: 0 auto;
    padding: 0;

    li { margin: 0 0 10px 0; }
    li:last-child { margin-bottom: 0; }
    ul.children { list-style: none; margin: 0; padding: 0; }
}

.c-card {
    background-color: var(--panel-solid);
    border: 1px solid var(--line);
    border-left: 2px solid var(--neon-dim);
    border-radius: 4px;
    overflow: hidden;
}
.c-card:hover { border-color: var(--neon); }
.c-card:hover .c-eyebrow { color: var(--neon); }

.c-head {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 9px 14px;
    background-color: var(--void);
    border-radius: 3px 3px 0 0;
    flex-wrap: wrap;
    gap: 6px;
}

.c-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    color: var(--neon-dim);
}

.c-name { color: var(--text); font-weight: 700; margin-left: 6px; }

.c-break { flex-basis: 0; width: 0; height: 0; }

.c-date {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--neon-dim);
    background-color: transparent;
    border: 1px solid var(--neon-dim);
    border-radius: 10px;
    padding: 2px 8px;
}

.c-card:hover .c-date { background-color: var(--neon-dim); color: var(--void); }

.c-body {
    padding: 14px;
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--text);
}
.c-body p { margin: 0; }
.c-body p + p { margin-top: 1em; }

.c-reply {
    margin-left: 28px;
    margin-top: 14px;
    background-color: #0a161c;
    border-color: var(--line-tide);
    border-left-color: var(--tide-dim);
}
.c-reply .c-eyebrow { color: var(--tide-dim); }
.c-reply .c-date { color: var(--tide-dim); border-color: var(--tide-dim); }

.c-card.c-reply:hover { border-color: var(--tide); }
.c-card.c-reply:hover .c-eyebrow { color: var(--tide); }
.c-card.c-reply:hover .c-date { background-color: var(--tide-dim); color: var(--void); }

@media (max-width: 600px) {
    .c-head { row-gap: 0; }
    .c-date { margin-left: 0; margin-top: 4px; }
    .c-break { flex-basis: 100%; }
}

/* ---------- Pagination ---------- */

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 2rem 0;
}

.pagination ul {
    display: flex;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination li {
    margin: 0;
    background-color: var(--panel-solid);
    border: 1px solid var(--tide-dim);
    color: var(--tide);
    font-family: var(--font-mono);
    font-weight: 600;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 4px;
}

.pagination li:hover {
    background: var(--tide-dim);
    color: var(--void);
    box-shadow: 0 0 14px var(--tide-soft);
}

.pagination .disabled {
    background-color: transparent;
    border: 1px solid var(--line-tide);
    color: var(--text-dim);
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .disabled:hover {
    background: transparent;
    box-shadow: none;
}

/* ---------- Responsive ---------- */

@media screen and (max-width: 1080px) {
    main { flex-direction: column; align-items: center; }
    main > section,
    main > aside { width: 90%; margin: 0; }
    main > aside { margin-top: 32px; }
    aside { max-width: 60%; }
    .profile-frame { width: 50%; max-width: 200px; }
}

/* Visible keyboard focus across the theme */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--neon);
    outline-offset: 2px;
}

/* Language Switcher (custom dropdown) */
body > header .language-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 150px;
    z-index: 20;
}

body > header .lang-select-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    background-color: rgba(5, 6, 10, 0.55);
    color: var(--neon-dim);
    border: 1px solid transparent;
    padding: 6px 11px;
    font-size: 11px;
    font-family: var(--font-mono);
    cursor: pointer;
    border-radius: 6px;
    margin: 0;
    transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

body > header .lang-select-toggle:hover,
body > header .lang-select-toggle[aria-expanded="true"] {
    color: var(--neon);
    border-color: var(--neon);
    background-color: rgba(5, 6, 10, 0.85);
    box-shadow: 0 0 12px var(--neon-soft);
}

body > header .lang-select-toggle[aria-expanded="true"] {
    border-radius: 6px 6px 0 0;
    border-bottom-color: transparent;
    box-shadow: none;
}

body > header .lang-chevron {
    font-size: 9px;
    font-family: var(--font-mono);
    transition: transform 0.25s ease;
}

body > header .lang-current {
    font-family: var(--font-mono);
}

body > header .lang-select-toggle[aria-expanded="true"] .lang-chevron {
    transform: rotate(180deg);
}

body > header .lang-select-list {
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    box-sizing: border-box;
    list-style: none;
    margin: 0;
    padding: 6px;
    background-color: rgba(5, 6, 10, 0.85);
    border: 1px solid var(--neon);
    border-top: none;
    border-radius: 0 0 8px 8px;
    z-index: 10;
}

body > header .lang-select-list li {
    margin: 0;
    padding: 0;
    list-style: none;
}

body > header .lang-select-list a {
    display: block;
    padding: 7px 10px;
    color: var(--text-dim);
    font-size: 11px;
    font-family: var(--font-mono);
    text-decoration: none;
    border-radius: 4px;
    background-color: transparent;
    transition: background-color 0.2s ease, color 0.2s ease;
}

body > header .lang-select-list a:hover {
    background-color: var(--neon);
    color: var(--void);
}

/* Cookie preferences modal */
.cookie-modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(5, 6, 10, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.cookie-modal-backdrop[hidden] {
    display: none;
}

.cookie-modal {
    max-width: 460px;
    width: 100%;
    background-color: var(--void-soft);
    border: 1px solid var(--neon);
    border-radius: 8px;
    padding: 24px;
    box-sizing: border-box;
}

.cookie-modal h2 {
    margin: 0 0 14px 0;
    color: var(--neon);
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 0.06em;
}

.cookie-modal p {
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.6;
    margin: 0 0 16px 0;
}

.cookie-modal-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-dim);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 18px;
}

#cookie-status-text {
    color: var(--neon);
}

.cookie-modal-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cookie-modal-clear,
.cookie-modal-close {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    background-color: transparent;
    transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.cookie-modal-clear {
    border: 1px solid var(--neon);
    color: var(--neon);
}

.cookie-modal-clear:hover {
    background-color: var(--neon);
    color: var(--void);
}

.cookie-modal-close {
    border: 1px solid var(--line);
    color: var(--text-dim);
}

.cookie-modal-close:hover {
    border-color: var(--text-dim);
    color: var(--text);
}
