/* ==========================================================================
   erhan.es — synthwave CRT workstation theme
   ========================================================================== */

/* Self-hosted fonts (latin subsets, SIL OFL — see fonts/LICENSE-fonts.txt) */
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url("../fonts/jetbrains-mono-latin-var.b636a65da4f0.woff2") format('woff2');
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/jetbrains-mono-italic-latin.e86486e7865c.woff2") format('woff2');
}
@font-face {
    font-family: 'VT323';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/vt323-latin.9cb03ff10174.woff2") format('woff2');
}

:root {
    /* rgb triplets — a palette only needs to override these + the hex tokens below */
    --bg-rgb: 11 6 24;
    --s1-rgb: 20 10 40;
    --s2-rgb: 28 14 54;
    --p-rgb: 211 107 255;
    --pm-rgb: 155 61 255;
    --muted-rgb: 185 154 214;
    --amber-rgb: 255 158 74;
    --green-rgb: 62 240 255;
    --red-rgb: 255 61 139;
    --cyan-rgb: 62 240 255;
    --pink-rgb: 255 61 196;

    /* surfaces */
    --bg: rgb(var(--bg-rgb));
    --bg-2: #10081f;
    --surface: rgb(var(--s1-rgb));
    --surface-2: rgb(var(--s2-rgb));
    --sidebar: #0d061c;

    /* lines */
    --border: #3a1f5c;
    --border-hi: #6a3a9a;

    /* text */
    --text: #f6e8ff;
    --text-hi: #ffffff;
    --muted: rgb(var(--muted-rgb));
    --faint: #8a68ab;

    /* phosphor purple */
    --purple: rgb(var(--p-rgb));          /* primary — synthwave magenta-violet */
    --purple-hi: #f0c4ff;
    --purple-mid: rgb(var(--pm-rgb));
    --purple-dark: #4a1a6e;
    --purple-glow: rgb(var(--p-rgb) / 0.45);

    /* secondary phosphors */
    --amber: rgb(var(--amber-rgb));
    --green: rgb(var(--green-rgb));
    --red: rgb(var(--red-rgb));
    --cyan: rgb(var(--cyan-rgb));
    --pink: rgb(var(--pink-rgb));

    /* legacy aliases (inline styles in older templates) */
    --violet: var(--purple);
    --teal: var(--green);
    --sidebar-dark: var(--bg);

    --font-mono: 'JetBrains Mono', 'DejaVu Sans Mono', Menlo, Consolas, monospace;
    --font-display: 'VT323', 'JetBrains Mono', monospace;

    --sysbar-h: 34px;
    --side-w: 272px;
    --glow: 0 0 6px var(--purple-glow), 0 0 18px rgb(var(--p-rgb) / 0.18);

    /* bootstrap */
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-body-font-family: var(--font-mono);
    --bs-border-color: var(--border);
    --bs-secondary-color: var(--muted);
    --bs-tertiary-bg: var(--surface-2);
    --bs-emphasis-color: var(--text-hi);
    --bs-primary: var(--purple);
    --bs-primary-rgb: 180, 140, 255;
    --bs-link-color: var(--purple);
    --bs-link-color-rgb: 180, 140, 255;
    --bs-link-hover-color: var(--purple-hi);
    --bs-border-radius: 0;
    --bs-border-radius-sm: 0;
    --bs-border-radius-lg: 0;
    --bs-border-radius-pill: 0;
}

[data-bs-theme=dark] {
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-border-color: var(--border);
    --bs-secondary-color: var(--muted);
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-mono);
    font-size: 15px;
    line-height: 1.65;
    color: var(--text);
    margin: 0;
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse 80% 60% at 70% -10%, rgb(var(--pm-rgb) / 0.22), transparent 60%),
        radial-gradient(ellipse 70% 40% at 50% 115%, rgb(var(--pink-rgb) / 0.10), transparent 60%),
        radial-gradient(ellipse 60% 50% at 0% 110%, rgb(var(--cyan-rgb) / 0.05), transparent 60%),
        radial-gradient(rgb(var(--p-rgb) / 0.07) 1px, transparent 1px);
    background-size: auto, auto, 22px 22px;
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--purple); color: var(--bg); }

/* ── CRT overlay: scanlines + vignette + flicker ── */
body::before,
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
}

body::before {
    background: repeating-linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0,
        rgba(0, 0, 0, 0) 2px,
        rgba(0, 0, 0, 0.22) 3px
    );
    will-change: opacity;
    animation: crt-flicker 6s steps(60) infinite;
}

@keyframes crt-flicker {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; }
    52% { opacity: 0.82; }
    54% { opacity: 1; }
}

body::after {
    background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

.crt-off body::before,
.crt-off body::after { display: none; }


/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--purple-dark) var(--bg); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--purple-dark); border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--purple-mid); }

a { color: var(--purple); text-decoration: none; transition: color 0.15s, text-shadow 0.15s; }
a:hover { color: var(--purple-hi); text-shadow: var(--glow); }

:focus-visible { outline: 2px dashed var(--amber); outline-offset: 3px; }

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--text-hi); font-weight: 600; }

hr { border-color: var(--border); opacity: 1; }

strong, b { color: var(--text-hi); }

small, .small { color: var(--muted); }

.text-muted { color: var(--muted) !important; }
.text-white { color: var(--text) !important; }
.form-text { color: var(--muted) !important; }
.lead { color: var(--text); }

.dim { color: var(--faint); }

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 10001;
    background: var(--purple); color: var(--bg); padding: 6px 12px;
}
.skip-link:focus { left: 8px; top: 8px; }

#menu-toggle { position: absolute; opacity: 0; pointer-events: none; }

/* ==========================================================================
   System bar (top)
   ========================================================================== */

.sysbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--sysbar-h);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 14px;
    background: linear-gradient(180deg, var(--surface-2), var(--bg-2));
    border-bottom: 1px solid var(--border-hi);
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--muted);
    text-transform: uppercase;
}

.sysbar-brand {
    font-family: var(--font-display);
    font-size: 22px;
    letter-spacing: 0.08em;
    color: var(--text-hi);
    line-height: 1;
    text-transform: none;
}
.sysbar-brand:hover { color: var(--text-hi); }
.sysbar-brand .logo-mark { color: var(--purple); text-shadow: var(--glow); }

.sysbar-item { white-space: nowrap; }
.sysbar-spacer { flex: 1; }

#sys-clock { color: var(--purple-hi); font-variant-numeric: tabular-nums; }

.led {
    display: inline-block; width: 7px; height: 7px; margin-right: 5px; vertical-align: 1px;
    background: var(--green); box-shadow: 0 0 8px var(--green);
    animation: led-blink 2.4s steps(1) infinite;
}
@keyframes led-blink { 0%, 90% { opacity: 1; } 95% { opacity: 0.25; } }

.sysbar-btn {
    font: inherit;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--border-hi);
    padding: 2px 8px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.sysbar-btn span { color: var(--green); }
.sysbar-btn[aria-pressed="false"] span { color: var(--faint); }
.sysbar-btn:hover { color: var(--text-hi); border-color: var(--purple); background: rgb(var(--p-rgb) / 0.08); }

#toggle-button { display: none; }

/* ==========================================================================
   Sidebar
   ========================================================================== */

.sidemenu {
    position: fixed;
    top: var(--sysbar-h); left: 0; bottom: 0;
    width: var(--side-w);
    z-index: 50;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 22px 18px 0;
    background:
        linear-gradient(180deg, rgb(var(--pm-rgb) / 0.08), transparent 40%),
        var(--sidebar);
    border-right: 1px solid var(--border-hi);
    box-shadow: 1px 0 0 rgba(0, 0, 0, 0.6), 8px 0 30px rgba(0, 0, 0, 0.35);
}

/* profile */
.hs-headline { text-align: center; padding-bottom: 18px; border-bottom: 1px dashed var(--border); }

.hs-headline .img-wrap {
    display: block;
    position: relative;
    width: 148px; height: 148px;
    margin: 0 auto;
    padding: 7px;
    border: 1px solid var(--border-hi);
    background:
        linear-gradient(var(--purple), var(--purple)) top left / 14px 2px,
        linear-gradient(var(--purple), var(--purple)) top left / 2px 14px,
        linear-gradient(var(--purple), var(--purple)) bottom right / 14px 2px,
        linear-gradient(var(--purple), var(--purple)) bottom right / 2px 14px,
        var(--bg);
    background-repeat: no-repeat;
    transition: box-shadow 0.25s;
}
.hs-headline .img-wrap::after {
    /* pixel-grid overlay on the portrait */
    content: '';
    position: absolute; inset: 7px;
    background:
        repeating-linear-gradient(0deg, rgb(var(--bg-rgb) / 0.35) 0 1px, transparent 1px 3px),
        linear-gradient(180deg, transparent 60%, rgb(var(--pm-rgb) / 0.25));
    pointer-events: none;
}
.hs-headline .img-wrap:hover { box-shadow: 0 0 24px rgb(var(--p-rgb) / 0.3); }
.hs-headline .img-wrap img { display: block; width: 132px; height: 132px; object-fit: cover; filter: saturate(1.1) contrast(1.05); }

.hs-headline .profile_info { margin-top: 14px; }
.hs-headline .profile_info h1 {
    font-family: var(--font-display);
    font-size: 46px;
    line-height: 1;
    letter-spacing: 0.18em;
    margin: 0 0 0 0.18em;
    font-weight: 400;
    color: var(--purple-hi);
    text-shadow: var(--glow);
}
.hs-headline .profile_info h1.glitching {
    text-shadow: -2px 0 var(--red), 2px 0 var(--cyan), var(--glow);
}
.profile-sub {
    margin: 6px 0 0;
    font-size: 10.5px;
    white-space: nowrap;
    color: var(--muted);
    letter-spacing: 0.04em;
}

.side-label {
    margin: 18px 4px 8px;
    font-size: 11px;
    color: var(--faint);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* nav */
.sidemenu nav { display: flex; flex-direction: column; gap: 2px; }

.sidemenu nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px 6px 8px;
    color: var(--muted);
    border: 1px solid transparent;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.sidemenu nav a .key {
    width: 22px; height: 22px;
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px;
    color: var(--faint);
    border: 1px solid var(--border);
    background: var(--bg);
    box-shadow: 0 2px 0 var(--border);
    transition: inherit;
}

.sidemenu nav a .menu_name {
    flex: 1;
    font-family: var(--font-display);
    font-size: 25px;
    line-height: 1.1;
    letter-spacing: 0.06em;
    text-transform: lowercase;
}
.sidemenu nav a .menu_name::before { content: '/'; color: var(--faint); margin-right: 1px; }

.sidemenu nav a .fa {
    font-size: 13px;
    width: 18px;
    text-align: center;
    color: var(--faint);
    transition: inherit;
}

.sidemenu nav a:hover {
    color: var(--text-hi);
    background: rgb(var(--p-rgb) / 0.07);
    border-color: var(--border);
    text-shadow: none;
}
.sidemenu nav a:hover .key { color: var(--purple-hi); border-color: var(--purple-mid); }
.sidemenu nav a:hover .fa { color: var(--purple); }

/* active section: inverse video like an old terminal selection */
.sidemenu nav a.active-sec {
    color: var(--bg);
    background: var(--purple);
    border-color: var(--purple);
    box-shadow: 0 0 18px rgb(var(--p-rgb) / 0.35);
}
.sidemenu nav a.active-sec .menu_name::before { content: '>'; color: var(--bg); }
.sidemenu nav a.active-sec .key { color: var(--bg); background: var(--purple-hi); border-color: var(--bg); box-shadow: none; }
.sidemenu nav a.active-sec .fa { color: var(--bg); }
.sidemenu nav a.active-sec .menu_name::after {
    content: '';
    display: inline-block;
    width: 0.5em; height: 0.85em;
    margin-left: 4px;
    vertical-align: -1px;
    background: var(--bg);
    
}
.sidemenu nav a.pressed .key { transform: translateY(2px); box-shadow: none; }

.menu-admin { margin-top: 10px; border-top: 1px dashed var(--border) !important; }
.menu-admin.active-sec { border-top-color: var(--purple) !important; }
.menu-logout .key { font-size: 12px !important; }

/* featured buttons */
.side-featured { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px; }

.featured-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    font-size: 15px;
    color: var(--muted);
    border: 1px solid var(--border);
    background: var(--bg);
    transition: color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.featured-btn:hover {
    color: var(--purple-hi);
    border-color: var(--purple);
    box-shadow: 0 0 12px rgb(var(--p-rgb) / 0.3);
    transform: translateY(-2px);
    text-shadow: none;
}

.side-footer {
    margin: auto -18px 0;
    padding: 10px 14px;
    display: flex; flex-wrap: wrap; justify-content: center; gap: 4px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}
.side-footer a {
    width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px; color: var(--faint);
}
.side-footer a:hover { color: var(--purple-hi); }

.menu-scrim { display: none; }

/* ==========================================================================
   Main / layout
   ========================================================================== */

.content-wrapper {
    margin-left: var(--side-w);
    padding: calc(var(--sysbar-h) + 18px) 22px 0;
    min-height: 100vh;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* breadcrumb = shell prompt */
#content-navbar {
    display: flex;
    align-items: stretch;
    min-height: 44px;
    margin-bottom: 16px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    font-size: 14px;
}
#content-navbar .home {
    width: 44px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted);
    border-right: 1px solid var(--border);
    background: var(--surface);
}
#content-navbar .home:hover { color: var(--purple-hi); }

.prompt {
    display: flex; align-items: center; flex-wrap: wrap;
    padding: 8px 14px;
    min-width: 0;
}
.prompt-user { color: var(--green); }
.prompt-colon { color: var(--faint); }
.prompt-dollar { color: var(--faint); margin: 0 8px 0 4px; }

#content-navbar .breadcrumb-area { display: inline-flex; min-width: 0; }
#content-navbar .breadcrumb-area ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
#content-navbar .breadcrumb-area li { display: inline-flex; color: var(--purple); }
#content-navbar .breadcrumb-area li > span:not(.sep) { color: var(--purple-hi); max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#content-navbar .breadcrumb-area li a { color: var(--purple); }
#content-navbar .breadcrumb-area li a:hover { color: var(--purple-hi); }
#content-navbar .breadcrumb-area .sep { color: var(--faint); }

.cursor {
    display: inline-block;
    width: 0.6em; height: 1.1em;
    background: var(--purple);
    box-shadow: var(--glow);
    
}
/* Blinking is driven by one shared JS timer toggling html.blink-off (2 style updates/s
   instead of a per-frame animation for every cursor). */
.blink-off .cursor,
.blink-off .content-title::after,
.blink-off .sidemenu nav a.active-sec .menu_name::after { opacity: 0; }

/* ── Panels ─────────────────────────────────────────── */
.content {
    position: relative;
    margin: 0 0 16px;
    background:
        linear-gradient(var(--purple), var(--purple)) top left / 12px 1px,
        linear-gradient(var(--purple), var(--purple)) top left / 1px 12px,
        linear-gradient(var(--purple), var(--purple)) top right / 12px 1px,
        linear-gradient(var(--purple), var(--purple)) top right / 1px 12px,
        linear-gradient(var(--purple), var(--purple)) bottom left / 12px 1px,
        linear-gradient(var(--purple), var(--purple)) bottom left / 1px 12px,
        linear-gradient(var(--purple), var(--purple)) bottom right / 12px 1px,
        linear-gradient(var(--purple), var(--purple)) bottom right / 1px 12px,
        linear-gradient(180deg, rgb(var(--s2-rgb) / 0.92), rgb(var(--s1-rgb) / 0.92));
    background-repeat: no-repeat;
    border: 1px solid var(--border);
    box-shadow: 0 14px 40px -18px rgba(0, 0, 0, 0.8);
    animation: boot-in 0.45s cubic-bezier(.2, .7, .2, 1) both;
}

.row > [class*=col] > .content { margin-bottom: 16px; }
.row.g-0 { --bs-gutter-x: 16px; }
.content.h-100 { height: calc(100% - 16px) !important; }

@keyframes boot-in {
    from { opacity: 0; transform: translateY(6px); clip-path: inset(0 0 100% 0); }
    to { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }
}

.content-wrapper > :nth-child(2) { animation-delay: 0.03s; }
.content-wrapper > :nth-child(3) { animation-delay: 0.08s; }
.content-wrapper > :nth-child(4) { animation-delay: 0.13s; }
.content-wrapper > :nth-child(5) { animation-delay: 0.18s; }
.content-wrapper > :nth-child(6) { animation-delay: 0.23s; }
.content-wrapper > :nth-child(n+7) { animation-delay: 0.28s; }

.content-hover { transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s; }
.content-hover:hover {
    border-color: var(--border-hi);
    transform: translateY(-2px);
    box-shadow: 0 0 0 1px rgb(var(--p-rgb) / 0.15), 0 18px 40px -16px rgb(var(--pm-rgb) / 0.35);
}

.hs-inner { padding: 20px 24px; }

/* panel headings: "▌ LATEST ARTICLES ─────────" */
.hs-inner h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: 0.05em;
    color: var(--purple-hi);
    text-shadow: 0 0 10px rgb(var(--p-rgb) / 0.3);
}
.hs-inner h2::before {
    content: '';
    width: 6px; height: 0.9em;
    flex-shrink: 0;
    background: var(--purple);
    box-shadow: var(--glow);
}
.hs-inner h2::after {
    content: '';
    flex: 1;
    min-width: 20px;
    height: 0;
    border-top: 1px dashed var(--border-hi);
}
.hs-inner h2 a { color: inherit; }
.hs-inner h2 .tilde { font-family: var(--font-mono); font-size: 0.75em; }
.hs-inner h2 a:hover { color: var(--text-hi); }

.hs-inner h3, .hs-inner h4, .content h3, .content h4 { color: var(--text-hi); margin-bottom: 8px; }
.hs-inner h1 { font-family: var(--font-display); font-weight: 400; font-size: 40px; letter-spacing: 0.03em; color: var(--text-hi); }

/* ── Page header (top-banner) = command line ── */
.top-banner {
    position: relative;
    padding: 26px 28px;
    background:
        linear-gradient(90deg, rgb(var(--pm-rgb) / 0.22), rgb(var(--pm-rgb) / 0.04) 55%, transparent),
        repeating-linear-gradient(-45deg, transparent 0 14px, rgb(var(--p-rgb) / 0.035) 14px 15px);
    overflow: hidden;
}
.top-banner::after {
    content: '';
    position: absolute; right: 18px; top: 18px;
    width: 54px; height: 10px;
    background:
        linear-gradient(90deg, var(--green) 0 10px, transparent 10px 22px, var(--amber) 22px 32px, transparent 32px 44px, var(--red) 44px 54px);
    opacity: 0.7;
}
.top-banner h1, .content-title {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(36px, 5vw, 58px);
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0.04em;
    color: var(--text-hi);
    text-shadow: var(--glow);
}
.content-title::before {
    content: '$ cd ~/';
    margin-right: 10px;
    font-family: var(--font-mono);
    font-size: 0.36em;
    letter-spacing: 0;
    color: var(--green);
    text-shadow: none;
}
.content-title::after {
    content: '';
    width: 0.45em; height: 0.8em;
    margin-left: 10px;
    align-self: center;
    background: var(--purple);
    box-shadow: var(--glow);
    
}
.top-banner p { color: var(--muted) !important; font-size: 14px !important; max-width: 70ch; }

/* ── Cover image (article detail) ── */
.hs-cover {
    position: relative;
    height: 380px;
    margin: 0 0 16px;
    display: flex; align-items: flex-end;
    background-color: var(--surface);
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border);
    overflow: hidden;
}
.hs-cover::before {
    content: '';
    position: absolute; inset: 0;
    background:
        repeating-linear-gradient(0deg, rgb(var(--bg-rgb) / 0.25) 0 1px, transparent 1px 3px),
        linear-gradient(180deg, rgb(var(--bg-rgb) / 0.1) 30%, rgb(var(--bg-rgb) / 0.95));
}
.hs-cover h1 {
    position: relative;
    margin: 0;
    padding: 24px 28px;
    width: 100%;
    font-family: var(--font-display);
    font-size: clamp(34px, 4.5vw, 56px);
    font-weight: 400;
    line-height: 1.05;
    color: var(--text-hi);
    text-shadow: var(--glow);
}

/* ── Article body ── */
.content-article { position: relative; max-width: 78ch; margin: 0 auto; font-size: 15.5px; line-height: 1.8; }
.content-article h1 { font-size: clamp(34px, 4vw, 48px); margin: 12px 0 8px; }
.content-article h2 { margin-top: 2em; }
.content-article h3 { margin-top: 1.6em; color: var(--purple-hi); }
.content-article h3::before { content: '### '; color: var(--faint); font-weight: 400; }
.content-article a { text-decoration: underline; text-decoration-color: var(--purple-dark); text-underline-offset: 3px; }
.content-article a:hover { text-decoration-color: var(--purple); }
.content-article img { max-width: 100%; height: auto; border: 1px solid var(--border-hi); }
.content-article ul { list-style: none; padding-left: 1.4em; }
.content-article ul > li::before { content: '▸'; color: var(--purple); margin-left: -1.2em; width: 1.2em; display: inline-block; }

/* ── Code ── */
code { color: var(--amber); font-family: var(--font-mono); font-size: 0.92em; }
:not(pre) > code { background: rgb(var(--amber-rgb) / 0.08); padding: 0.1em 0.35em; border: 1px solid rgb(var(--amber-rgb) / 0.15); }

pre {
    position: relative;
    display: block;
    margin: 1.4em 0;
    padding: 38px 18px 16px;
    white-space: pre-wrap;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border-hi);
    font-family: var(--font-mono);
    font-size: 13.5px;
    line-height: 1.6;
}
pre::before {
    content: '● ● ●   ~/snippet';
    position: absolute; top: 0; left: 0; right: 0;
    padding: 5px 12px;
    font-size: 11px;
    color: var(--faint);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    letter-spacing: 0.04em;
}
pre code, pre code.hljs { color: inherit; background: transparent !important; padding: 0 !important; border: 0; }

blockquote {
    margin: 1.5em 0;
    padding: 12px 18px;
    color: var(--muted);
    background: rgb(var(--p-rgb) / 0.05);
    border-left: 3px solid var(--purple);
}
blockquote p:last-child { margin-bottom: 0; }

/* ── TOC ── */
.toc {
    display: inline-block;
    margin-bottom: 20px;
    padding: 12px 18px 12px 4px;
    background: var(--bg);
    border: 1px solid var(--border-hi);
}
.toc::before { content: '// contents'; display: block; padding-left: 16px; font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; }
.toc ul { margin: 0; }
.toc li { padding: 2px 20px 2px 4px; }
.toc li::before { display: none !important; }
.toc li ul { padding-left: 14px; }

/* ==========================================================================
   Components
   ========================================================================== */

/* ── Buttons: [ LABEL ] ── */
.btn {
    --bs-btn-border-radius: 0;
    position: relative;
    font-family: var(--font-mono);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 8px 16px;
    border-width: 1px;
    transition: background 0.12s, color 0.12s, border-color 0.12s, box-shadow 0.12s, transform 0.08s;
}
.btn:active { transform: translate(1px, 1px); }
.btn::before { content: '['; margin-right: 6px; opacity: 0.55; font-weight: 400; }
.btn::after { content: ']'; margin-left: 6px; opacity: 0.55; font-weight: 400; }
.btn-sm { font-size: 11px; padding: 5px 10px; }
.btn-sm::before { margin-right: 4px; }
.btn-sm::after { margin-left: 4px; }
.btn-lg { font-size: 14px; padding: 11px 22px; }

.btn-primary {
    color: var(--bg);
    background: var(--purple);
    border-color: var(--purple);
    box-shadow: 0 0 0 0 transparent, 3px 3px 0 var(--purple-dark);
}
.btn-primary:hover, .btn-primary:focus-visible {
    color: var(--bg);
    background: var(--purple-hi);
    border-color: var(--purple-hi);
    box-shadow: 0 0 18px rgb(var(--p-rgb) / 0.45), 3px 3px 0 var(--purple-dark);
}
.btn-primary:active { box-shadow: none !important; }

.btn-outline-primary { color: var(--purple); border-color: var(--purple-dark); background: rgb(var(--p-rgb) / 0.04); }
.btn-outline-primary:hover, .btn-outline-primary:focus-visible { color: var(--bg); background: var(--purple); border-color: var(--purple); box-shadow: 0 0 14px rgb(var(--p-rgb) / 0.35); }

.btn-outline-secondary { color: var(--muted); border-color: var(--border-hi); }
.btn-outline-secondary:hover { color: var(--bg); background: var(--muted); border-color: var(--muted); }

.btn-outline-danger { color: var(--red); border-color: rgb(var(--red-rgb) / 0.45); }
.btn-outline-danger:hover { color: var(--bg); background: var(--red); border-color: var(--red); }

.btn-success { color: var(--bg); background: var(--green); border-color: var(--green); }
.btn-warning { color: var(--bg); background: var(--amber); border-color: var(--amber); }
.btn-danger { color: var(--bg); background: var(--red); border-color: var(--red); }
.btn-info { color: var(--bg); background: var(--cyan); border-color: var(--cyan); }
.btn-success:hover, .btn-warning:hover, .btn-danger:hover, .btn-info:hover { color: var(--bg); filter: brightness(1.1); }

/* ── Badges & pills ── */
.badge, .pill {
    display: inline-block;
    padding: 2px 8px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    line-height: 1.6;
    text-transform: uppercase;
    border-radius: 0;
    border: 1px solid currentColor;
    vertical-align: 1px;
}
.pill { color: var(--purple-hi); background: rgb(var(--p-rgb) / 0.1); border-color: var(--purple-dark); }
.pill::before { content: '#'; opacity: 0.6; }

.badge.bg-primary { background: rgb(var(--p-rgb) / 0.14) !important; color: var(--purple-hi); }
.badge.bg-success { background: rgb(var(--green-rgb) / 0.12) !important; color: var(--green); }
.badge.bg-warning { background: rgb(var(--amber-rgb) / 0.12) !important; color: var(--amber); }
.badge.bg-danger { background: rgb(var(--red-rgb) / 0.12) !important; color: var(--red); }
.badge.bg-info { background: rgb(var(--cyan-rgb) / 0.12) !important; color: var(--cyan); }
.badge.bg-secondary { background: rgb(var(--muted-rgb) / 0.12) !important; color: var(--muted); }

.article-date {
    display: inline-block;
    margin-right: 6px;
    font-size: 12px;
    color: var(--amber);
    letter-spacing: 0.04em;
}
.article-date::before { content: '▸ '; color: var(--faint); }

/* ── Forms ── */
.form-label, .content label:not(.form-check-label) {
    display: block;
    margin-bottom: 6px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.form-label::before, .content label:not(.form-check-label)::before { content: '> '; color: var(--purple); }
.form-check-label { color: var(--text); }

.form-control, .form-select {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text);
    background-color: var(--bg);
    border: 1px solid var(--border-hi);
    border-radius: 0;
    padding: 9px 12px;
    caret-color: var(--purple);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control::placeholder { color: var(--faint); }
.form-control:focus, .form-select:focus {
    color: var(--text);
    background-color: var(--bg);
    border-color: var(--purple);
    box-shadow: 0 0 0 1px var(--purple), 0 0 16px rgb(var(--p-rgb) / 0.25);
}
.form-check-input { border-radius: 0 !important; background-color: var(--bg); border: 1px solid var(--border-hi); }
.form-check-input:checked { background-color: var(--purple); border-color: var(--purple); }
.form-check-input:focus { box-shadow: 0 0 0 2px rgb(var(--p-rgb) / 0.3); border-color: var(--purple); }
.invalid-feedback, .errorlist { color: var(--red); font-size: 12.5px; }
.errorlist { list-style: none; padding: 0; }
.errorlist li::before { content: 'ERR: '; font-weight: 600; }

/* captcha image */
img.captcha { border: 1px solid var(--border-hi); margin: 0 10px 8px 0; image-rendering: pixelated; filter: invert(1) hue-rotate(200deg); }

/* ── Alerts ── */
.alert {
    border-radius: 0;
    border: 1px solid;
    border-left-width: 4px;
    font-size: 13.5px;
    background: var(--bg-2);
}
.alert-primary, .alert-info { color: var(--purple-hi); border-color: var(--purple-mid); background: rgb(var(--p-rgb) / 0.07); }
.alert-success { color: var(--green); border-color: var(--green); background: rgb(var(--green-rgb) / 0.06); }
.alert-warning { color: var(--amber); border-color: var(--amber); background: rgb(var(--amber-rgb) / 0.06); }
.alert-danger { color: var(--red); border-color: var(--red); background: rgb(var(--red-rgb) / 0.06); }

/* ── Cards ── */
.card {
    --bs-card-bg: var(--surface);
    --bs-card-border-color: var(--border);
    --bs-card-color: var(--text);
    border-radius: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.card-img-top { border-radius: 0; }
.card-title, .card h3, .card h4, .card h5, .card .h5, .card .h6 { color: var(--text-hi) !important; }
.card p, .card-text { color: var(--text); }
.card small { color: var(--muted); }
.card:hover,
.card.hover-shadow:hover,
.pixel-card:hover {
    border-color: var(--purple-mid) !important;
    box-shadow: 0 0 0 1px rgb(var(--p-rgb) / 0.15), 0 12px 30px -14px rgb(var(--pm-rgb) / 0.45) !important;
    transform: translateY(-2px);
}
.pixel-card { background: var(--bg-2) !important; border: 1px solid var(--border) !important; }

.stat-card {
    position: relative;
    background: var(--bg-2);
    border: 1px solid var(--border) !important;
    border-top-width: 3px !important;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -14px rgb(var(--pm-rgb) / 0.45); }
.stat-number {
    margin: 0 0 4px;
    font-family: var(--font-display);
    font-size: 54px;
    line-height: 1;
    color: var(--text-hi);
    text-shadow: var(--glow);
}
.stat-label {
    margin: 0;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ── Tables ── */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--border);
    --bs-table-striped-bg: rgb(var(--p-rgb) / 0.03);
    --bs-table-striped-color: var(--text);
    --bs-table-hover-bg: rgb(var(--p-rgb) / 0.06);
    font-size: 13.5px;
    border: 1px solid var(--border);
}
.table thead th {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--purple);
    border-bottom: 1px solid var(--purple-dark);
    background: var(--bg-2);
}
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover > * { background: rgb(var(--p-rgb) / 0.06); }

/* ── List groups ── */
.list-group { --bs-list-group-bg: var(--bg-2); --bs-list-group-border-color: var(--border); --bs-list-group-color: var(--text); border-radius: 0; }
.list-group-item {
    background: var(--bg-2);
    border-color: var(--border);
    color: var(--text);
    transition: background 0.12s, padding-left 0.15s, border-color 0.12s;
}
.list-group-item-action:hover, .list-group-item-action:focus {
    color: var(--text-hi);
    background: rgb(var(--p-rgb) / 0.08);
    padding-left: 1.4rem;
    box-shadow: inset 3px 0 0 var(--purple);
}

/* ── Pagination ── */
.pagination { gap: 4px; flex-wrap: wrap; }
.pagination .page-link {
    min-width: 36px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--border-hi);
    border-radius: 0 !important;
}
.pagination .page-link:hover { color: var(--bg); background: var(--purple); border-color: var(--purple); }
.pagination .active .page-link { color: var(--bg); background: var(--purple); border-color: var(--purple); box-shadow: 0 0 14px rgb(var(--p-rgb) / 0.4); }
.pagination .disabled .page-link { color: var(--faint); background: transparent; border-color: var(--border); }

/* ── Links page ── */
.link-title {
    margin-bottom: 2px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-hi);
}
.link-desc { margin: 0; font-size: 13px; color: var(--muted); }

.icon-box { width: 48px; height: 48px; border: 1px solid var(--border-hi); }

.featured-links-grid { display: flex; flex-wrap: wrap; }
.featured-link-card {
    padding: 18px 8px 14px;
    text-align: center;
    background: var(--bg-2);
    border: 1px solid var(--border);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.featured-link-card:hover {
    border-color: var(--purple);
    box-shadow: 0 0 18px rgb(var(--p-rgb) / 0.25);
    transform: translateY(-2px);
}
.featured-link-icon {
    height: 42px;
    margin-bottom: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8em;
    color: var(--muted);
    transition: color 0.15s, text-shadow 0.15s;
}
.featured-link-card:hover .featured-link-icon { color: var(--purple-hi); text-shadow: var(--glow); }
.featured-link-label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    word-break: break-word;
}

/* ── Misc ── */
.three-way { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.placeholder-thumb, .placeholder-thumb-sm {
    display: flex; align-items: center; justify-content: center;
    color: var(--faint);
    background:
        repeating-linear-gradient(45deg, transparent 0 5px, rgb(var(--p-rgb) / 0.05) 5px 6px),
        var(--bg);
    border: 1px dashed var(--border-hi);
}
.placeholder-thumb { width: 80px; height: 80px; font-size: 1.4em; }
.placeholder-thumb-sm { width: 60px; height: 60px; font-size: 1.1em; }

.rounded { border-radius: 0 !important; }
.img-fluid { border: 1px solid var(--border); }
.img-preview-sm { max-height: 100px; }
.opacity-25 { color: var(--purple); }

.markdownx .markdownx-preview { background: var(--bg) !important; color: var(--text) !important; border: 1px solid var(--border) !important; padding: 12px; }

/* admin bar */
.admin-bar { border-color: rgb(var(--green-rgb) / 0.25); }
.admin-bar .hs-inner { padding: 12px 20px; }
.admin-hello { margin: 0 !important; font-size: 22px !important; color: var(--green) !important; text-shadow: none !important; }
.admin-hello::before { background: var(--green) !important; box-shadow: 0 0 8px var(--green) !important; }
.admin-hello::after { display: none; }
.admin-tools { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

/* ── vim-style statusline ── */
.statusline {
    margin-top: auto;
    margin-bottom: 18px;
    display: flex;
    align-items: stretch;
    gap: 0;
    font-size: 12px;
    color: var(--muted);
    background: var(--bg-2);
    border: 1px solid var(--border);
}
.statusline > span { padding: 4px 12px; border-left: 1px solid var(--border); white-space: nowrap; }
.statusline .sl-mode { border-left: 0; color: var(--bg); background: var(--purple); font-weight: 800; letter-spacing: 0.08em; }
.statusline .sl-file { color: var(--text); overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.statusline .sl-spacer { flex: 1; padding: 0; }

/* ==========================================================================
   Home page
   ========================================================================== */

.ascii-logo {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    white-space: pre;
    font-family: 'JetBrains Mono', 'DejaVu Sans Mono', monospace;
    font-size: clamp(7px, 1.05vw, 15px);
    line-height: 1.05;
    color: var(--purple);
    background: linear-gradient(180deg, var(--amber) 0%, var(--pink) 38%, var(--purple) 68%, var(--purple-mid) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px rgb(var(--pink-rgb) / 0.45));
}
.ascii-logo::before { display: none; }

.neofetch { font-size: 13.5px; line-height: 1.75; min-width: 0; }
.neofetch .nf-head { color: var(--green); font-weight: 600; }
.neofetch .nf-head .at { color: var(--faint); }
.neofetch .nf-rule { color: var(--faint); letter-spacing: -0.05em; overflow: hidden; white-space: nowrap; }
.neofetch dl { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 12px; }
.neofetch dt { color: var(--purple); font-weight: 600; }
.neofetch dt::after { content: ':'; color: var(--faint); }
.neofetch dd { margin: 0; color: var(--text); }
.nf-swatches { display: flex; margin-top: 12px; }
.nf-swatches span { width: 26px; height: 14px; }

.boot-log {
    margin: 0;
    padding: 0;
    font-size: 13px;
    line-height: 1.75;
    color: var(--muted);
    list-style: none;
}
.boot-log li { opacity: 0; animation: line-in 0.01s forwards; }
.boot-log li:nth-child(1) { animation-delay: 0.35s; }
.boot-log li:nth-child(2) { animation-delay: 0.6s; }
.boot-log li:nth-child(3) { animation-delay: 0.85s; }
.boot-log li:nth-child(4) { animation-delay: 1.1s; }
.boot-log li:nth-child(5) { animation-delay: 1.35s; }
@keyframes line-in { to { opacity: 1; } }
.boot-log .ok { color: var(--green); }
.boot-log .warn { color: var(--amber); }
.boot-log .who { color: var(--text); }
kbd {
    padding: 0 5px;
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--purple-hi);
    background: var(--bg);
    border: 1px solid var(--border-hi);
    border-radius: 0;
    box-shadow: 0 2px 0 var(--border-hi);
}
.boot-log .cursor { vertical-align: -2px; margin-left: 4px; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ls -la style listings */
.ls { list-style: none; margin: 0; padding: 0; }
.ls-total { font-size: 12px; color: var(--faint); margin: -6px 0 10px; }
.ls-item {
    position: relative;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 12px 10px;
    margin: 0 -10px;
    border-top: 1px dashed var(--border);
    transition: background 0.12s;
}
.ls-item:first-child { border-top: 0; }
.ls-item:hover { background: rgb(var(--p-rgb) / 0.05); }
.ls-item:hover .ls-title a { color: var(--purple-hi); text-shadow: var(--glow); }
.ls-thumb { width: 54px; height: 54px; object-fit: cover; border: 1px solid var(--border-hi); display: block; }
.ls-thumb.placeholder-thumb-sm { display: flex; width: 54px; height: 54px; font-size: 1em; }
.ls-meta { font-size: 11.5px; color: var(--muted); letter-spacing: 0.02em; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.ls-meta .date { color: var(--amber); }
.ls-title { margin: 3px 0 2px; font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--text-hi); }
.ls-title a { color: var(--text-hi); }
.ls-title a::after { content: ''; position: absolute; inset: 0; } /* whole row clickable */
.ls-desc { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.55; }
.ls-desc p { margin: 0; }

.event-date {
    width: 54px; height: 54px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border: 1px solid var(--amber);
    color: var(--amber);
    background: rgb(var(--amber-rgb) / 0.06);
    line-height: 1;
}
.event-date .d { font-family: var(--font-display); font-size: 30px; }
.event-date .m { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }

.panel-more { display: inline-block; margin-top: 12px; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.panel-more::before { content: '→ '; }

.empty-state { text-align: center; padding: 50px 20px; }
.empty-state pre.ascii-logo { display: inline-block; text-align: left; font-size: 12px; }

/* ==========================================================================
   Synthwave hero scene
   ========================================================================== */

.hero { padding: 0; overflow: hidden; }

.hero-scene {
    --horizon: 64%;
    position: relative;
    height: clamp(230px, 30vw, 340px);
    overflow: hidden;
    background: linear-gradient(180deg, #07030f 0%, #150a2e 38%, #2b0c4a var(--horizon), var(--bg) var(--horizon));
    border-bottom: 1px solid var(--border);
    isolation: isolate;
}

.sky { position: absolute; inset: 0 0 calc(100% - var(--horizon)) 0; overflow: hidden; }

.stars {
    position: absolute; inset: -20px;
    background-image:
        radial-gradient(1px 1px at 8% 18%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 17% 62%, #fff 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 26% 34%, var(--cyan) 50%, transparent 51%),
        radial-gradient(1px 1px at 38% 12%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 46% 72%, #fff 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 61% 22%, var(--purple-hi) 50%, transparent 51%),
        radial-gradient(1px 1px at 69% 58%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 77% 9%, #fff 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 85% 40%, var(--pink) 50%, transparent 51%),
        radial-gradient(1px 1px at 93% 70%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 4% 82%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 55% 46%, #fff 50%, transparent 51%);
    will-change: transform, opacity;
    animation: twinkle 4s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: 0.45; } to { opacity: 1; } }

/* pulsing sun glow: a soft radial layer that only fades/scales (no animated filter) */
.sun-glow {
    position: absolute;
    left: 50%; bottom: -80%;
    width: clamp(320px, 42vw, 520px);
    aspect-ratio: 1;
    margin-left: calc(clamp(320px, 42vw, 520px) / -2);
    border-radius: 50%;
    background: radial-gradient(circle, rgb(var(--pink-rgb) / 0.42) 0%, rgb(var(--amber-rgb) / 0.16) 38%, transparent 68%);
    will-change: transform, opacity;
    animation: glow-pulse 5s ease-in-out infinite;
}
@keyframes glow-pulse { 0%, 100% { opacity: 0.7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }

.sun {
    position: absolute;
    left: 50%; bottom: -46%;
    width: clamp(170px, 22vw, 270px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: linear-gradient(180deg, #ffe66d 0%, var(--amber) 28%, var(--pink) 62%, var(--purple-mid) 100%);
    -webkit-mask: linear-gradient(#000 0 0) top / 100% 46% no-repeat,
                  repeating-linear-gradient(180deg, #000 0 9px, transparent 9px 14px);
            mask: linear-gradient(#000 0 0) top / 100% 46% no-repeat,
                  repeating-linear-gradient(180deg, #000 0 9px, transparent 9px 14px);
    filter: drop-shadow(0 0 30px rgb(var(--pink-rgb) / 0.7)) drop-shadow(0 0 80px rgb(var(--amber-rgb) / 0.35));
    margin-left: calc(clamp(170px, 22vw, 270px) / -2);
    will-change: transform;
}

.floor-clip {
    position: absolute;
    top: var(--horizon); left: 0; right: 0; bottom: 0;
    overflow: hidden;
}
.floor-par { position: absolute; inset: 0; will-change: transform; }
.floor {
    position: absolute;
    top: 0;
    left: -60%;
    width: 220%;
    height: 390%;
    transform-origin: top center;
    transform: perspective(240px) rotateX(70deg) translateY(-54px);
    will-change: transform;
    background-image:
        linear-gradient(rgb(var(--pink-rgb) / 0.85) 2px, transparent 2px),
        linear-gradient(90deg, rgb(var(--pink-rgb) / 0.85) 2px, transparent 2px);
    background-size: 54px 54px;
    animation: floor-roll 1.1s linear infinite;
}
@keyframes floor-roll { to { transform: perspective(240px) rotateX(70deg) translateY(0); } }

.floor-fade {
    position: absolute;
    top: var(--horizon); left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, var(--bg) 0%, rgb(var(--bg-rgb) / 0.4) 40%, rgb(var(--bg-rgb) / 0) 70%, rgb(var(--bg-rgb) / 0.7) 100%);
    pointer-events: none;
}

.horizon {
    position: absolute;
    top: calc(var(--horizon) - 1px); left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--pink) 20%, #fff 50%, var(--pink) 80%, transparent);
    box-shadow: 0 0 18px var(--pink), 0 0 40px rgb(var(--pink-rgb) / 0.6);
}

.scene-logo {
    position: absolute;
    left: 0; right: 0; top: 40%;
    z-index: 2;
    text-align: center;
    translate: 0 -50%;
    will-change: transform;
}

.ascii-chrome {
    /* inline SVG (theme/_erhan_logo.svg): same look as the old text art, but font-independent */
    display: block;
    width: clamp(230px, 28vw, 410px);
    height: auto;
    margin: 0 auto;
    overflow: visible;
    filter: drop-shadow(0 3px 0 rgb(var(--bg-rgb) / 0.9)) drop-shadow(0 0 14px rgb(var(--pink-rgb) / 0.55));
}
/* one-shot glitch, triggered every few seconds by JS (no idle animation cost) */
.ascii-chrome.glitch-once { animation: ascii-glitch 0.32s steps(1) 1; }
@keyframes ascii-glitch {
    0% { transform: translate(-5px, 0) skewX(10deg); clip-path: inset(10% 0 55% 0); }
    25% { transform: translate(4px, 0); clip-path: inset(50% 0 10% 0); }
    50% { transform: translate(-2px, 0) skewX(-6deg); clip-path: none; }
    75%, 100% { transform: none; clip-path: none; }
}

.scene-tag {
    margin: 10px 0 0;
    font-size: 12px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--cyan);
    text-shadow: 0 0 10px rgb(var(--cyan-rgb) / 0.7), 0 2px 0 var(--bg);
}

/* ticker */
.ticker {
    overflow: hidden;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(90deg, rgb(var(--pink-rgb) / 0.12), rgb(var(--p-rgb) / 0.06), rgb(var(--cyan-rgb) / 0.12));
    -webkit-mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
            mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.ticker-track { display: inline-flex; will-change: transform; animation: ticker 32s linear infinite; }
.ticker-track span {
    padding: 7px 0;
    font-family: var(--font-display);
    font-size: 21px;
    letter-spacing: 0.14em;
    color: var(--purple-hi);
    padding-right: 0.6em;
}
@keyframes ticker { to { transform: translateX(-50%); } }

.hero-body {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 36px;
    padding: 26px 28px 28px;
}
.hero-console { min-width: 0; padding-left: 28px; border-left: 1px dashed var(--border); }

/* light travelling around the hero border: four comets that only translate + fade */
.hero-edge { position: absolute; inset: 0; z-index: 3; overflow: hidden; pointer-events: none; }
.hero-edge i { position: absolute; opacity: 0; will-change: transform, opacity; animation: 8s linear infinite; }
.hero-edge i:nth-child(1) { top: 0; left: 0; width: 100%; height: 1px; animation-name: run-top;
    background: linear-gradient(90deg, transparent 70%, var(--pink) 90%, #fff 96%, var(--cyan)); }
.hero-edge i:nth-child(2) { top: 0; right: 0; width: 1px; height: 100%; animation-name: run-right;
    background: linear-gradient(180deg, transparent 70%, var(--pink) 90%, #fff 96%, var(--cyan)); }
.hero-edge i:nth-child(3) { bottom: 0; left: 0; width: 100%; height: 1px; animation-name: run-bottom;
    background: linear-gradient(270deg, transparent 70%, var(--pink) 90%, #fff 96%, var(--cyan)); }
.hero-edge i:nth-child(4) { top: 0; left: 0; width: 1px; height: 100%; animation-name: run-left;
    background: linear-gradient(0deg, transparent 70%, var(--pink) 90%, #fff 96%, var(--cyan)); }
@keyframes run-top {
    0% { opacity: 1; transform: translateX(-100%); }
    32% { opacity: 1; transform: translateX(35%); }
    32.1%, 100% { opacity: 0; transform: translateX(35%); }
}
@keyframes run-right {
    0%, 27.9% { opacity: 0; transform: translateY(-100%); }
    28% { opacity: 1; transform: translateY(-100%); }
    52% { opacity: 1; transform: translateY(35%); }
    52.1%, 100% { opacity: 0; transform: translateY(35%); }
}
@keyframes run-bottom {
    0%, 47.9% { opacity: 0; transform: translateX(100%); }
    48% { opacity: 1; transform: translateX(100%); }
    80% { opacity: 1; transform: translateX(-35%); }
    80.1%, 100% { opacity: 0; transform: translateX(-35%); }
}
@keyframes run-left {
    0%, 75.9% { opacity: 0; transform: translateY(100%); }
    76% { opacity: 1; transform: translateY(100%); }
    100% { opacity: 1; transform: translateY(-35%); }
}

/* pause ambient motion when the hero is off-screen (JS) or the visitor turned CRT off */
.hero.offscreen .hero-scene *, .hero.offscreen .ticker-track, .hero.offscreen .hero-edge i, .crt-off .hero-edge i,
.crt-off .hero-scene *, .crt-off .ticker-track, .crt-off .eq i {
    animation-play-state: paused !important;
}

/* ==========================================================================
   Motion & effects
   ========================================================================== */

/* ── Panels power on when scrolled into view (JS adds .in) ── */
.js .content { opacity: 0; animation: failsafe-show 0.01s 3s forwards; } /* shows panels if erhanos.js never runs */
.js.fx-ok .content:not(.in) { animation: none; }
@keyframes failsafe-show { to { opacity: 1; } }
.js .content.in { animation: panel-on 0.6s cubic-bezier(.2, .7, .2, 1) both; }
.js .content.in::after {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 0;
    z-index: 4;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cyan), #fff, var(--pink), transparent);
    box-shadow: 0 0 14px var(--cyan), 0 0 30px rgb(var(--pink-rgb) / 0.6);
    pointer-events: none;
    animation: scan-down 0.6s cubic-bezier(.2, .7, .2, 1) forwards;
}
@keyframes panel-on {
    from { opacity: 0; clip-path: inset(0 0 100% 0); }
    to { opacity: 1; clip-path: inset(0 0 0 0); }
}
@keyframes scan-down {
    0% { transform: translateY(0); opacity: 1; }
    85% { opacity: 1; }
    100% { transform: translateY(var(--panel-h, 400px)); opacity: 0; }
}

/* ── Glitch on page titles ── */
.content-title:hover, .hs-cover h1:hover { animation: glitch 0.4s steps(2) 1; }
@keyframes glitch {
    0%, 100% { transform: none; clip-path: none; }
    20% { transform: translate(-3px, 1px); text-shadow: -3px 0 var(--pink), 3px 0 var(--cyan); clip-path: inset(15% 0 45% 0); }
    40% { transform: translate(3px, -1px); text-shadow: 3px 0 var(--pink), -3px 0 var(--cyan); clip-path: inset(55% 0 8% 0); }
    60% { transform: translate(-1px, 0); text-shadow: -2px 0 var(--cyan), 2px 0 var(--pink); clip-path: none; }
    80% { transform: translate(1px, 1px); }
}

/* ── Equalizer next to ~/mixes ── */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 0.7em; margin-left: -2px; }
.eq i { width: 3px; height: 100%; background: linear-gradient(0deg, var(--purple), var(--cyan)); transform-origin: bottom; animation: eq 0.9s ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-duration: 0.6s; animation-delay: -0.2s; }
.eq i:nth-child(3) { animation-duration: 1.1s; animation-delay: -0.5s; }
.eq i:nth-child(4) { animation-duration: 0.7s; animation-delay: -0.1s; }
.eq i:nth-child(5) { animation-duration: 1s; animation-delay: -0.7s; }
@keyframes eq { 0% { transform: scaleY(0.15); } 100% { transform: scaleY(1); } }

/* ── Active menu item: neon gradient + shimmer ── */
.sidemenu nav a.active-sec {
    overflow: hidden;
    background: linear-gradient(90deg, var(--purple), var(--pink));
    border-color: var(--purple);
    box-shadow: 0 0 22px rgb(var(--pink-rgb) / 0.35);
}
.sidemenu nav a.active-sec::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / 0.38) 50%, transparent 70%);
    transform: translateX(-100%);
    pointer-events: none;
}
.sidemenu nav a.active-sec::before { will-change: transform; animation: shimmer 4s ease-in-out infinite; }
@keyframes shimmer { 0%, 30% { transform: translateX(-100%); } 70%, 100% { transform: translateX(100%); } }

/* ── Buttons: neon gradient + light sweep ── */
.btn-primary,
.btn-primary:focus-visible {
    border-color: var(--purple);
    background:
        linear-gradient(110deg, transparent 35%, rgb(255 255 255 / 0.5) 50%, transparent 65%) 160% 0 / 250% 100% no-repeat,
        linear-gradient(90deg, var(--purple), var(--pink));
    transition: background-position 0.6s ease, box-shadow 0.15s, transform 0.08s;
}
.btn-primary:hover {
    border-color: var(--pink);
    background:
        linear-gradient(110deg, transparent 35%, rgb(255 255 255 / 0.5) 50%, transparent 65%) -60% 0 / 250% 100% no-repeat,
        linear-gradient(90deg, var(--purple), var(--pink));
    box-shadow: 0 0 22px rgb(var(--pink-rgb) / 0.5), 3px 3px 0 var(--purple-dark);
}
.btn-outline-primary:hover { background: linear-gradient(90deg, var(--purple), var(--pink)); border-color: var(--pink); }

/* ── List rows: scan sweep on hover ── */
.ls-item { overflow: hidden; }
.ls-item::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgb(var(--p-rgb) / 0.16), rgb(var(--cyan-rgb) / 0.08), transparent);
    transform: translateX(-100%);
    pointer-events: none;
}
.ls-item:hover::before { transform: translateX(100%); transition: transform 0.7s ease; }
.ls-item:hover .ls-thumb { border-color: var(--pink); box-shadow: 0 0 14px rgb(var(--pink-rgb) / 0.4); }
.ls-thumb { transition: border-color 0.2s, box-shadow 0.2s; }

/* ── Portrait: RGB-split glitch on hover ── */
.hs-headline .img-wrap:hover img { animation: img-glitch 0.5s steps(2) 2; }
@keyframes img-glitch {
    0%, 100% { transform: none; filter: saturate(1.1) contrast(1.05); }
    25% { transform: translate(-3px, 0); filter: drop-shadow(3px 0 0 var(--cyan)) drop-shadow(-3px 0 0 var(--pink)); clip-path: inset(10% 0 50% 0); }
    50% { transform: translate(3px, 0); clip-path: inset(50% 0 5% 0); }
    75% { transform: none; filter: hue-rotate(40deg); clip-path: none; }
}

/* ── Typewriter boot log (JS) ── */
.js .boot-log li { opacity: 1; animation: none; }
.js .boot-log li.pending { visibility: hidden; }

/* ── Decrypting headings (JS) ── */
.decrypting { color: var(--cyan) !important; text-shadow: 0 0 10px rgb(var(--cyan-rgb) / 0.6) !important; }

/* ── CRT page transitions (cross-document View Transitions) ── */
@media (prefers-reduced-motion: no-preference) {
    @view-transition { navigation: auto; }
    .sysbar { view-transition-name: sysbar; }
    .sidemenu { view-transition-name: sidemenu; }
    .content-wrapper { view-transition-name: main; }
    ::view-transition-old(main) { animation: crt-off 0.22s cubic-bezier(.6, 0, 1, .4) both; }
    ::view-transition-new(main) { animation: crt-on 0.42s cubic-bezier(0, .6, .4, 1) both; }
    ::view-transition-group(sidemenu), ::view-transition-group(sysbar) { animation-duration: 0s; }
}
@keyframes crt-off {
    60% { transform: scaleY(0.006) scaleX(1); filter: brightness(3); opacity: 1; }
    100% { transform: scaleY(0.006) scaleX(0); filter: brightness(5); opacity: 0; }
}
@keyframes crt-on {
    0% { transform: scaleY(0.006) scaleX(0); filter: brightness(5); opacity: 0; }
    35% { transform: scaleY(0.006) scaleX(1); filter: brightness(3); opacity: 1; }
    100% { transform: none; filter: none; opacity: 1; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */


@media (max-width: 991px) {
    :root { --side-w: 0px; }

    /* touch-friendly top bar: every control is at least 44x44px */
    :root { --sysbar-h: 52px; }
    .sysbar { padding: 0 8px; }
    #toggle-button {
        display: inline-flex; align-items: center; justify-content: center;
        width: 44px; height: 44px;
        flex-shrink: 0;
        font-size: 20px;
        color: var(--purple-hi);
        border: 1px solid var(--border-hi);
        background: rgb(var(--p-rgb) / 0.06);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    #toggle-button:hover, #toggle-button:active { border-color: var(--purple); background: rgb(var(--p-rgb) / 0.14); }
    #menu-toggle:checked ~ .sysbar #toggle-button { color: var(--bg); background: var(--purple); border-color: var(--purple); }
    .sysbar-btn { min-height: 44px; padding: 0 12px; }

    /* drawer: bigger tap targets */
    .sidemenu nav a { min-height: 46px; }
    .featured-btn { width: 44px; height: 44px; font-size: 17px; }
    .side-footer a { width: 44px; height: 44px; }

    .sidemenu {
        width: 280px;
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform 0.25s ease, visibility 0.25s;
    }
    #menu-toggle:checked ~ .sidemenu { transform: none; visibility: visible; }
    #menu-toggle:checked ~ .menu-scrim {
        display: block;
        position: fixed; inset: var(--sysbar-h) 0 0 0;
        z-index: 40;
        background: rgb(var(--bg-rgb) / 0.7);
        backdrop-filter: blur(2px);
    }

    .content-wrapper { padding: calc(var(--sysbar-h) + 12px) 12px 0; }
    .hero-body { grid-template-columns: 1fr; gap: 22px; padding: 20px 18px; }
    .hero-console { padding-left: 0; border-left: 0; padding-top: 20px; border-top: 1px dashed var(--border); }
    .content-wrapper { view-transition-name: none; }
    .hs-inner { padding: 16px; }
    .top-banner { padding: 20px 18px; }
    .top-banner::after { display: none; }
    .hs-cover { height: 220px; }
    .content-article { font-size: 15px; }
    .toc { width: 100%; }
    .prompt-user { display: none; }
    .prompt-colon { display: none; }
}

@media (max-width: 575px) {
    .hero-scene { --horizon: 66%; height: 210px; }
    .scene-tag { font-size: 10px; letter-spacing: 0.2em; }
    body { font-size: 14px; }
    .sysbar { gap: 12px; padding: 0 10px; }
    .content-title::before { flex-basis: 100%; margin-bottom: 4px; }
    .statusline .sl-file { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .boot-log li { opacity: 1; }
    html { scroll-behavior: auto; }
}

@media print {
    body::before, body::after, .sysbar, .sidemenu, #content-navbar, .statusline, .admin-bar { display: none !important; }
    .content-wrapper { margin: 0; padding: 0; }
    body { background: #fff; color: #000; }
}
