:root {
    --page-background:
        linear-gradient(rgba(72, 240, 219, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(72, 240, 219, 0.05) 1px, transparent 1px),
        linear-gradient(135deg, rgba(2, 3, 5, 0.98) 0%, rgba(6, 10, 15, 0.96) 50%, rgba(2, 3, 5, 0.99) 100%);
    --page-background-size: 40px 40px, 40px 40px, auto;
    --scanline-opacity: 0.45;
    --topbar-hover-shadow: none;
    --glitch-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    --glitch-overlay: linear-gradient(45deg, rgba(72, 240, 219, 0.08), transparent 40%, rgba(255, 111, 168, 0.08));
    --glitch-opacity: 1;
    --glitch-filter: none;
    --glitch-transition: all 0.4s ease;
    --glitch-hover-opacity: var(--glitch-opacity);
    --glitch-hover-filter: var(--glitch-filter);
    --glitch-hover-transform: none;
    --glitch-hover-animation: none;
    --hero-thumb-width: 220px;
    --hero-thumb-height: auto;
    --hero-thumb-aspect: 16 / 9;
    --hero-thumb-radius: 2px;
    --hero-thumb-border: 1px solid rgba(255, 255, 255, 0.2);
    --hero-thumb-shadow: 0 0 20px rgba(255, 255, 255, 0.08);
    --hero-thumb-margin-bottom: 1.5rem;
    --hero-thumb-img-filter: none;
    --hero-thumb-img-hover-filter: var(--hero-thumb-img-filter);
    --footer-bg: rgba(2, 3, 5, 0.9);
    --footer-color: rgba(227, 236, 247, 0.5);
    --footer-size: 0.75rem;
    --footer-spacing: normal;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg-ink, #020305);
    color: var(--fg-main, #f3f7fc);
    font-family: var(--sans, sans-serif);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    background-image: var(--page-background);
    background-size: var(--page-background-size);
    background-attachment: fixed;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.01) 0, rgba(255, 255, 255, 0.01) 1px, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0) 3px);
    opacity: var(--scanline-opacity);
}

h1,
h2,
h3,
p {
    margin: 0;
}

.shell {
    width: min(1500px, calc(100% - 2rem));
    margin: 2rem auto 4rem;
    position: relative;
    z-index: 10;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.4rem;
    border: 1px solid var(--line);
    background: rgba(5, 9, 14, 0.8);
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.1rem;
    color: var(--fg-soft);
    backdrop-filter: blur(10px);
}

.topbar a {
    color: var(--cyan);
    text-decoration: none;
    border: 1px solid var(--cyan);
    padding: 0.3rem 0.8rem;
    transition: all 0.2s;
}

.topbar a:hover {
    background: var(--cyan);
    color: #000;
    box-shadow: var(--topbar-hover-shadow);
}

.glitch-visual {
    position: relative;
    border: 1px solid var(--line);
    margin: 2rem 0;
    background: #000;
    overflow: hidden;
    box-shadow: var(--glitch-shadow);
    isolation: isolate;
}

.glitch-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--glitch-overlay);
    mix-blend-mode: overlay;
    z-index: 2;
    pointer-events: none;
}

.glitch-visual img {
    width: 100%;
    height: auto;
    display: block;
    opacity: var(--glitch-opacity);
    filter: var(--glitch-filter);
    transition: var(--glitch-transition);
}

.glitch-visual:hover img {
    opacity: var(--glitch-hover-opacity);
    filter: var(--glitch-hover-filter);
    transform: var(--glitch-hover-transform);
    animation: var(--glitch-hover-animation);
}

.visual-meta {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.8rem 1rem;
    background: linear-gradient(0deg, rgba(2, 3, 5, 0.95) 0%, transparent 100%);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 3;
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--cyan);
    letter-spacing: 0.1em;
}

.visual-meta .tag {
    background: var(--cyan);
    color: #000;
    padding: 0.15rem 0.5rem;
    font-weight: bold;
}

.hero-thumb {
    width: var(--hero-thumb-width);
    height: var(--hero-thumb-height);
    aspect-ratio: var(--hero-thumb-aspect);
    display: block;
    overflow: hidden;
    border: var(--hero-thumb-border);
    box-shadow: var(--hero-thumb-shadow);
    position: relative;
    border-radius: var(--hero-thumb-radius);
    margin-bottom: var(--hero-thumb-margin-bottom);
}

.hero-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9);
    pointer-events: none;
}

.hero-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: var(--hero-thumb-img-filter);
    transition: filter 0.4s ease;
}

.hero-thumb:hover img {
    filter: var(--hero-thumb-img-hover-filter);
}

.panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 3, 5, 0.8);
    backdrop-filter: blur(5px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 900;
}

.panel-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

.slide-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(600px, 100vw);
    height: 100vh;
    background: rgba(5, 9, 14, 0.98);
    border-left: 2px solid var(--rose);
    z-index: 1000;
    transition: right 0.5s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
}

.slide-panel.is-open {
    right: 0;
}

.slide-header {
    padding: 2rem;
    border-bottom: 1px dashed rgba(255, 111, 168, 0.4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 111, 168, 0.05);
}

.slide-header h3 {
    margin: 0;
    font-family: var(--mono);
    color: var(--rose);
    font-size: 0.9rem;
    letter-spacing: 0.2em;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--fg-main);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 0.5rem;
}

.slide-content {
    padding: 3rem 2.5rem;
    overflow-y: auto;
    flex-grow: 1;
    font-family: var(--serif);
}

.slide-content p {
    font-size: 1.05rem;
    line-height: 2.2;
    color: rgba(240, 245, 255, 0.85);
    margin-bottom: 2rem;
    text-align: justify;
}

.slide-content strong {
    color: var(--cyan);
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
    padding: 1.4rem 1.6rem;
    border: 1px solid var(--line);
    background: var(--footer-bg);
    font-family: var(--mono);
    font-size: var(--footer-size);
    color: var(--footer-color);
    letter-spacing: var(--footer-spacing);
}

.footer span {
    color: var(--cyan);
}