/* blog.css */

/* ------------------------------------------------------------------ fonts */

@font-face {
    font-family: "Cilantro";
    src: url("/fonts/cilantro.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Cilantro-bold";
    src: url("/fonts/cilantroBold.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Berkeley Mono";
    src: url("/fonts/berkeley-mono/BerkeleyMono-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Berkeley Mono";
    src: url("/fonts/berkeley-mono/BerkeleyMono-Oblique.woff2") format("woff2");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Berkeley Mono";
    src: url("/fonts/berkeley-mono/BerkeleyMono-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Berkeley Mono";
    src: url("/fonts/berkeley-mono/BerkeleyMono-Bold-Oblique.woff2") format("woff2");
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

/* ------------------------------------------------------------- animations */

@property --angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@keyframes spin-border {
    to { --angle: 360deg; }
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes glow {
    from { text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 2px #0092e6, 0 0 3px #0092e6, 0 0 4px #0092e6, 0 0 5px #0092e6, 0 0 6px #0092e6; }
    to { text-shadow: 0 0 2px #fff, 0 0 2px #4dbeff, 0 0 2px #4dbeff, 0 0 3px #4dbeff, 0 0 4px #4dbeff, 0 0 5px #4dbeff, 0 0 6px #4dbeff; }
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

/* ----------------------------------------------------------------- tokens */

:root {
    --bg: #05050c;
    --panel: #0d0b1d;
    --panel-deep: #08071a;
    --line: #2839fd;
    --line-dark: #1f288d;
    --accent: #0092e6;
    --accent-light: #4dbeff;
    --glow: #0037ff;
    --text: #ffffff;
    --text-soft: #cfd2ec;
    --muted: #8b8ca8;
    --code-inline: #334155;
    --code-bg: #070714;
    --danger: #ff5c7a;
    --ok: #5cffb0;

    --font: "Cilantro", sans-serif;
    --font-bold: "Cilantro-bold", sans-serif;
    --font-menu: "PT Serif", serif;
    --font-mono: "Berkeley Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    --radius: 4px;
    --sidebar: 300px;
    --gap: 28px;

    color-scheme: dark;
}

/* ------------------------------------------------------------------- base */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 16px;
}

body {
    margin: 0;
    min-height: 100vh;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--line);
    color: #fff;
}

img,
video,
canvas {
    max-width: 100%;
}

b,
strong,
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-bold);
    font-weight: normal;
}

a {
    color: var(--text);
    text-decoration-line: underline;
    text-decoration-style: dotted;
    text-decoration-color: var(--line);
    text-underline-offset: 3px;
    transition: text-shadow 0.15s ease, color 0.15s ease;
}

a:hover,
a:focus-visible {
    color: #fff;
    text-decoration-color: var(--accent-light);
    text-shadow: 0 0 2px #fff, 0 0 4px var(--accent), 0 0 8px var(--accent);
}

:focus-visible {
    outline: 2px dotted var(--accent-light);
    outline-offset: 3px;
}

code,
kbd,
pre,
samp {
    font-family: var(--font-mono);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

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

/* Matrix rain from the portfolio, sitting behind everything */
.backg-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    display: block;
    opacity: 0.75;
    pointer-events: none;
}

/* --------------------------------------------------------- shared pieces */

/* The spinning blue border used across the portfolio */
.panel {
    border: 1px solid transparent;
    border-radius: var(--radius);
    background-image:
        linear-gradient(var(--panel), var(--panel)),
        conic-gradient(from var(--angle), var(--line), var(--line-dark), var(--line));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    animation: spin-border 6s linear infinite;
}

/* Animated dotted rule (the one between the portfolio buttons) */
hr.dots,
.prose hr {
    border: none;
    height: 4px;
    width: 100%;
    margin: 18px 0;
    background-image: linear-gradient(90deg, var(--line), var(--line-dark), var(--line));
    background-size: 200% 100%;
    animation: gradientMove 3s linear infinite;
    -webkit-mask-image: radial-gradient(circle, black 30%, transparent 35%);
    -webkit-mask-size: 5px 5px;
    mask-image: radial-gradient(circle, black 30%, transparent 35%);
    mask-size: 5px 5px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 36px;
    padding: 4px 16px;
    border: 1px solid transparent;
    border-radius: 2px;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-bold);
    font-size: 15px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.btn:hover {
    background: #13a4f7;
    box-shadow: 0 0 12px rgba(77, 190, 255, 0.55);
    text-shadow: none;
}

.btn:active {
    transform: translateY(1px);
}

.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.btn.ghost {
    background-image:
        linear-gradient(var(--bg), var(--bg)),
        conic-gradient(from var(--angle), var(--line), var(--line-dark), var(--line));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    animation: spin-border 6s linear infinite;
}

.btn.ghost:hover {
    border-width: 1px;
    box-shadow: 0 0 10px rgba(40, 57, 253, 0.6);
}

.btn.small {
    min-height: 28px;
    padding: 2px 10px;
    font-size: 13px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    display: inline-block;
    padding: 0 9px;
    border: 1px dotted var(--line);
    border-radius: 2px;
    color: var(--accent-light);
    font-family: var(--font-bold);
    font-size: 12px;
    line-height: 22px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    background: rgba(5, 5, 12, 0.6);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

a.chip:hover,
button.chip:hover,
.chip.active {
    background: var(--line);
    border-style: solid;
    color: #fff;
    text-shadow: none;
}

button.chip {
    cursor: pointer;
    font-size: 12px;
}

.chip .count {
    opacity: 0.6;
    margin-left: 4px;
}

input[type="text"],
input[type="email"],
input[type="search"],
input[type="url"],
input[type="datetime-local"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line-dark);
    border-radius: 2px;
    background: var(--panel-deep);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-light);
    box-shadow: 0 0 0 1px var(--accent-light), 0 0 12px rgba(0, 146, 230, 0.35);
}

::placeholder {
    color: var(--muted);
    opacity: 0.8;
}

label {
    font-family: var(--font-bold);
}

/* ----------------------------------------------------------------- header */

.site-header {
    max-width: calc(1200px - 40px);
    margin: 0 auto;
    padding: 34px 20px 0;
    text-align: center;
}

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    text-decoration: none;
}

.brand:hover {
    text-shadow: none;
}

.website-title {
    font-family: var(--font-bold);
    font-size: clamp(34px, 6vw, 52px);
    letter-spacing: 4px;
    line-height: 1.1;
    text-shadow:
        0 0 7px #ffffff90,
        0 0 10px #ffffff90,
        0 0 21px #0037ff90,
        0 0 42px #0037ff90,
        0 0 82px #0037ff90,
        0 0 92px #0037ff90;
}

.brand-sub {
    font-family: var(--font-bold);
    font-size: clamp(14px, 2vw, 18px);
    letter-spacing: 3px;
    text-transform: uppercase;
    /* color: var(--accent-light);
    animation: glow 1.4s ease-in-out infinite alternate; */
}

.pronounce {
    margin: 2px 0 18px;
    font-size: small;
    font-style: italic;
    color: #7f7f7f;
    opacity: 0.8;
}

.main-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    max-width: 1160px;
    margin: 0 auto;
    border-top: 1px solid #4b66ff;
    border-bottom: 1px solid #4b66ff;
    font-family: var(--font-bold);
}

.main-menu a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #fff;
    font-weight: bold;
    font-size: 20px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
}

.main-menu a.active {
    animation: glow 1s ease-in-out infinite alternate;
}

.main-menu a:hover {
    text-shadow: 0 0 2px #fff, 0 0 6px var(--accent-light);
}

.main-menu svg {
    fill: #fff;
    display: block;
}

.main-menu .menu-rss:hover svg {
    filter: drop-shadow(0 0 6px rgba(77, 190, 255, 0.9));
}

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

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--sidebar);
    gap: var(--gap);
    align-items: start;
    max-width: 1200px;
    margin: 28px auto 0;
    padding: 0 20px;
}

.layout.wide {
    grid-template-columns: minmax(0, 1fr);
}

.content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    animation: fade-up 0.6s ease both;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 14px;
    font-size: 20px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.section-title::after {
    content: "";
    flex: 1;
    height: 4px;
    background-image: linear-gradient(90deg, var(--line), var(--line-dark), var(--line));
    background-size: 200% 100%;
    animation: gradientMove 3s linear infinite;
    -webkit-mask-image: radial-gradient(circle, black 30%, transparent 35%);
    -webkit-mask-size: 5px 5px;
    mask-image: radial-gradient(circle, black 30%, transparent 35%);
    mask-size: 5px 5px;
}

.section-title .more {
    order: 2;
    font-family: var(--font);
    font-size: 13px;
    letter-spacing: 1px;
}

.empty-note {
    padding: 22px;
    text-align: center;
    color: var(--muted);
}

/* ------------------------------------------------------------- front page */

.intro {
    padding: 18px 22px;
    text-align: center;
    color: var(--text-soft);
}

.intro h1 {
    margin: 0 0 4px;
    font-size: 22px;
    color: var(--text);
}

.intro p {
    margin: 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
    gap: 14px;
}

.project-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px 14px;
    text-align: center;
    text-decoration: none;
    background: rgba(13, 11, 29, 0.85);
    border: 1px solid var(--line-dark);
    border-radius: var(--radius);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.project-card:hover {
    border-color: var(--accent-light);
    box-shadow: 0 0 18px rgba(40, 57, 253, 0.45);
    transform: translateY(-2px);
    text-shadow: none;
}

.project-icon {
    width: 84px;
    height: 84px;
    padding: 6px;
    border: 1px solid transparent;
    background-image:
        linear-gradient(var(--bg), var(--bg)),
        conic-gradient(from var(--angle), var(--line), var(--line-dark), var(--line));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    animation: spin-border 6s linear infinite;
}

.project-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-name {
    font-family: var(--font-bold);
    font-size: 16px;
    line-height: 1.25;
}

.project-desc {
    font-size: 13px;
    line-height: 1.45;
    color: var(--muted);
}

/* post cards (front page + archive) */

.post-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.post-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line-dark);
    border-radius: var(--radius);
    background: rgba(13, 11, 29, 0.92);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
    border-color: var(--accent-light);
    box-shadow: 0 0 20px rgba(40, 57, 253, 0.4);
}

.post-card.featured {
    grid-column: 1 / -1;
}

.post-card .thumb {
    display: block;
    aspect-ratio: 16 / 7;
    overflow: hidden;
    background:
        radial-gradient(circle at 30% 30%, rgba(40, 57, 253, 0.35), transparent 60%),
        repeating-linear-gradient(90deg, rgba(40, 57, 253, 0.12) 0 1px, transparent 1px 16px),
        var(--panel-deep);
    border-bottom: 1px solid var(--line-dark);
}

.post-card.featured .thumb {
    aspect-ratio: 21 / 8;
}

.post-card .thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.4s ease;
    filter: saturate(0.9);
}

.post-card:hover .thumb img {
    transform: scale(1.03);
    filter: saturate(1.1);
}

.post-card .thumb.placeholder {
    display: grid;
    place-items: center;
}

.post-card .thumb.placeholder img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    opacity: 0.6;
}

.post-card .card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px 16px;
    flex: 1;
}

.post-card h3 {
    margin: 0;
    font-size: 20px;
    line-height: 1.25;
}

.post-card.featured h3 {
    font-size: 26px;
}

.post-card h3 a {
    text-decoration: none;
}

.post-card .summary {
    margin: 0;
    color: var(--text-soft);
    font-size: 15px;
    line-height: 1.55;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    font-size: 13px;
    color: var(--muted);
}

.read-more {
    margin-top: auto;
    align-self: flex-start;
    font-family: var(--font-bold);
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--accent-light);
}

/* ------------------------------------------------------------------- post */

.post {
    overflow: hidden;
}

.post-banner {
    margin: 0;
    max-height: 460px;
    overflow: hidden;
    border-bottom: 1px solid var(--line-dark);
    background: var(--panel-deep);
}

.post-banner img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 460px;
    object-fit: cover;
}

.post-head {
    padding: 24px 32px 0;
}

.post-title {
    margin: 12px 0 6px;
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.15;
    text-shadow: 0 0 12px rgba(0, 55, 255, 0.55);
}

.post-meta {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.post > hr.dots,
.post-foot hr.dots {
    width: auto;
    margin: 20px 32px;
}

.post-body {
    padding: 0 32px 8px;
}

.post-foot {
    padding: 0 0 26px;
}

.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 0 32px;
}

.post-nav a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    border: 1px dotted var(--line);
    border-radius: 2px;
    text-decoration: none;
}

.post-nav a:hover {
    border-style: solid;
    background: rgba(40, 57, 253, 0.12);
    text-shadow: none;
}

.post-nav .dir {
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent-light);
}

.post-nav .next {
    grid-column: 2;
    text-align: right;
}

.read-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    z-index: 50;
    transform-origin: 0 50%;
    transform: scaleX(var(--progress, 0));
    background: linear-gradient(90deg, var(--line), var(--accent-light));
    box-shadow: 0 0 10px var(--accent);
    pointer-events: none;
}

/* ------------------------------------------------------------------ prose */

.prose {
    color: var(--text-soft);
    overflow-wrap: break-word;
}

.prose > * + * {
    margin-top: 1em;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose figure,
.prose pre,
.prose table {
    margin-bottom: 0;
}

.prose p {
    margin-top: 1em;
}

.prose > :first-child {
    margin-top: 0;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
    position: relative;
    color: var(--text);
    line-height: 1.25;
    margin: 1.8em 0 0.4em;
    scroll-margin-top: 20px;
}

.prose h1 { font-size: 1.9em; }

.prose h2 {
    font-size: 1.55em;
    padding-left: 14px;
}

.prose h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.18em;
    bottom: 0.18em;
    width: 4px;
    background: linear-gradient(var(--accent-light), var(--line));
    box-shadow: 0 0 10px var(--accent);
}

.prose h3 { font-size: 1.25em; }
.prose h4 { font-size: 1.08em; color: var(--accent-light); }

.heading-anchor {
    margin-left: 8px;
    color: var(--line);
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.prose :is(h1, h2, h3, h4, h5, h6):hover .heading-anchor,
.heading-anchor:focus-visible {
    opacity: 1;
}

.prose strong {
    color: var(--text);
}

.prose em {
    font-style: italic;
}

.prose ul,
.prose ol {
    padding-left: 1.4em;
}

.prose li + li {
    margin-top: 0.3em;
}

.prose ul > li::marker {
    content: "▸ ";
    color: var(--accent-light);
}

.prose ol > li::marker {
    color: var(--accent-light);
    font-family: var(--font-mono);
}

.prose li > input[type="checkbox"] {
    accent-color: var(--accent);
    margin: 0 8px 0 -1.4em;
}

.prose li:has(> input[type="checkbox"]) {
    list-style: none;
}

.prose li:has(> input[type="checkbox"])::marker {
    content: "";
}

.prose blockquote {
    margin-left: 0;
    margin-right: 0;
    padding: 10px 16px;
    border-left: 3px dotted var(--accent-light);
    background: rgba(40, 57, 253, 0.08);
    color: var(--text);
}

.prose blockquote > :first-child { margin-top: 0; }

.prose :not(pre) > code {
    padding: 2px 5px;
    border-radius: 2px;
    background-color: var(--code-inline);
    color: #e6ecff;
    font-size: 0.86em;
}

.prose kbd {
    padding: 1px 6px;
    border: 1px solid var(--line-dark);
    border-bottom-width: 3px;
    border-radius: 3px;
    background: var(--panel-deep);
    font-size: 0.85em;
}

.prose mark {
    background: rgba(0, 146, 230, 0.35);
    color: #fff;
    padding: 0 3px;
}

.prose img {
    border: 1px solid #fff;
    border-radius: 2px;
}

.prose figure {
    margin-left: 0;
    margin-right: 0;
}

.post-figure {
    text-align: center;
}

.post-figure img {
    max-height: 70vh;
    width: auto;
    cursor: zoom-in;
    transition: border-width 0.1s ease;
}

.post-figure img:hover {
    border-width: 2px;
}

.prose figcaption {
    margin-top: 6px;
    font-size: 14px;
    color: var(--muted);
    text-align: center;
}

.table-wrap {
    overflow-x: auto;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.prose th,
.prose td {
    padding: 7px 10px;
    border: 1px dotted var(--line-dark);
    text-align: left;
}

.prose th {
    font-family: var(--font-bold);
    font-weight: normal;
    color: var(--text);
    background: rgba(40, 57, 253, 0.15);
}

.prose iframe {
    max-width: 100%;
    border: 1px solid var(--line-dark);
}

.pk-error {
    color: var(--danger);
}

/* ------------------------------------------------------------- code block */

.code-block {
    margin-left: 0;
    margin-right: 0;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background-image:
        linear-gradient(var(--code-bg), var(--code-bg)),
        conic-gradient(from var(--angle), var(--line), var(--line-dark), var(--line));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    animation: spin-border 6s linear infinite;
}

.code-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 !important;
    padding: 5px 8px 5px 14px;
    border-bottom: 1px dotted var(--line-dark);
    background: rgba(40, 57, 253, 0.1);
    font-family: var(--font-mono);
    font-size: 12px !important;
    text-align: left !important;
    color: var(--accent-light) !important;
    letter-spacing: 0.5px;
}

.code-copy {
    padding: 2px 10px;
    border: 1px dotted var(--line);
    border-radius: 2px;
    background: transparent;
    color: var(--text-soft);
    font-family: var(--font-mono);
    font-size: 12px;
    cursor: pointer;
}

.code-copy:hover {
    background: var(--line);
    border-style: solid;
    color: #fff;
}

.code-copy.done {
    border-color: var(--ok);
    color: var(--ok);
}

.code-block pre {
    margin: 0;
    padding: 14px 16px;
    overflow-x: auto;
    tab-size: 4;
}

.code-block code {
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
}

pre::-webkit-scrollbar { height: 8px; }
pre::-webkit-scrollbar-thumb { background: var(--line-dark); border-radius: 4px; }

/* highlight.js theme in the site palette */
.hljs { color: #dfe3ff; background: transparent; }
.hljs-comment,
.hljs-quote { color: #6c70a0; font-style: italic; }
.hljs-keyword,
.hljs-selector-tag,
.hljs-doctag { color: #4dbeff; font-weight: 700; }
.hljs-built_in,
.hljs-name { color: #66e0ff; }
.hljs-string,
.hljs-regexp,
.hljs-template-string,
.hljs-addition { color: #f7c873; }
.hljs-number,
.hljs-literal,
.hljs-symbol,
.hljs-bullet { color: #ff8fd8; }
.hljs-title,
.hljs-title.function_,
.hljs-section { color: #9fb4ff; }
.hljs-title.class_,
.hljs-type,
.hljs-class .hljs-title { color: #c6a8ff; }
.hljs-attr,
.hljs-attribute,
.hljs-variable,
.hljs-template-variable,
.hljs-property { color: #8fd3ff; }
.hljs-params { color: #dfe3ff; }
.hljs-meta,
.hljs-selector-id,
.hljs-selector-class { color: #7f88ff; }
.hljs-deletion { color: #ff6b8b; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }
.hljs-subst { color: #dfe3ff; }

/* --------------------------------------------------------------- players */

.pk-player {
    position: relative;
}

/* audio */
.pk-audio.enhanced > audio {
    display: none;
}

.pk-audio.enhanced > figcaption,
.pk-tracker.enhanced > .pk-tracker-fallback {
    display: none;
}

/* tracker modules without JavaScript: just a download link */
.pk-tracker-fallback {
    display: inline-block;
    padding: 8px 12px;
    border: 1px dotted var(--line);
}

.pk-tracker-fallback span {
    color: var(--muted);
    font-size: 13px;
}

.pk-tracker-info {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.5px;
    color: var(--accent-light);
}

.pk-trk-status {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pk-tracker-info a {
    flex: none;
    color: var(--muted);
    text-decoration: none;
}

.pk-tracker-info a:hover {
    color: #fff;
}

.pk-tracker.error .pk-trk-status {
    color: var(--danger);
}

.pk-audio-ui {
    position: relative;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 12px 14px;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background-image:
        linear-gradient(var(--panel-deep), var(--panel-deep)),
        conic-gradient(from var(--angle), var(--line), var(--line-dark), var(--line));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    animation: spin-border 6s linear infinite;
    text-align: left;
}

.pk-viz {
    position: absolute;
    inset: auto 0 0 0;
    width: 100%;
    height: 100%;
    opacity: 0.35;
    pointer-events: none;
}

.pk-cover {
    position: relative;
    width: 76px;
    height: 76px;
    border: 1px solid var(--line);
    background: var(--bg);
    overflow: hidden;
}

.pk-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none !important;
    transition: transform 0.4s ease;
}

.pk-player.playing .pk-cover {
    box-shadow: 0 0 14px var(--accent);
}

.pk-main {
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pk-title {
    overflow: hidden;
    color: #fff;
    font-family: var(--font-bold);
    font-size: 17px;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pk-artist-line {
    margin-top: -4px;
    color: var(--muted);
    font-size: 13px;
}

.pk-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pk-btn {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: rgba(5, 5, 12, 0.7);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.pk-btn:hover {
    background: var(--line);
    box-shadow: 0 0 10px rgba(77, 190, 255, 0.5);
}

.pk-btn.play {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-color: var(--accent-light);
}

.pk-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.pk-bar {
    position: relative;
    flex: 1;
    height: 22px;
    cursor: pointer;
    touch-action: none;
}

.pk-bar::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 4px;
    transform: translateY(-50%);
    background-image: radial-gradient(circle, var(--line-dark) 35%, transparent 40%);
    background-size: 5px 4px;
}

.pk-fill {
    position: absolute;
    left: 0;
    top: 50%;
    height: 4px;
    width: calc(var(--value, 0) * 100%);
    transform: translateY(-50%);
    background: linear-gradient(90deg, var(--line), var(--accent-light));
    box-shadow: 0 0 8px var(--accent);
}

.pk-buffer {
    position: absolute;
    left: 0;
    top: 50%;
    height: 4px;
    width: calc(var(--buffer, 0) * 100%);
    transform: translateY(-50%);
    background: rgba(40, 57, 253, 0.35);
}

.pk-knob {
    position: absolute;
    top: 50%;
    left: calc(var(--value, 0) * 100%);
    width: 12px;
    height: 12px;
    transform: translate(-50%, -50%);
    background: #fff;
    box-shadow: 0 0 8px var(--accent-light);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.pk-bar:hover .pk-knob,
.pk-bar:focus-visible .pk-knob,
.pk-bar.dragging .pk-knob {
    opacity: 1;
}

.pk-time {
    flex: none;
    min-width: 92px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-soft);
    text-align: right;
}

.pk-vol {
    flex: 0 0 70px;
}

/* video */
.pk-video {
    text-align: center;
}

.pk-video-frame {
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background-image:
        linear-gradient(#000, #000),
        conic-gradient(from var(--angle), var(--line), var(--line-dark), var(--line));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    animation: spin-border 6s linear infinite;
}

.pk-video-frame video {
    display: block;
    width: 100%;
    max-height: 72vh;
    background: #000;
    cursor: pointer;
}

.pk-video-frame:fullscreen video {
    max-height: none;
    height: 100%;
}

.pk-big-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 72px;
    height: 72px;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: rgba(0, 146, 230, 0.85);
    box-shadow: 0 0 24px var(--accent);
    color: #fff;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.pk-big-play svg {
    width: 28px;
    height: 28px;
    margin-left: 4px;
    fill: #fff;
}

.pk-big-play:hover {
    transform: translate(-50%, -50%) scale(1.06);
}

.pk-player.playing .pk-big-play {
    opacity: 0;
    pointer-events: none;
}

.pk-video-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px 10px 8px;
    background: linear-gradient(transparent, rgba(5, 5, 12, 0.92));
    transition: opacity 0.25s ease;
}

.pk-player.playing.idle .pk-video-bar {
    opacity: 0;
}

.pk-player.playing.idle .pk-video-frame {
    cursor: none;
}

.pk-video.enhanced > figcaption {
    margin-top: 6px;
}

/* youtube (loads the real player only when clicked) */
.pk-youtube {
    text-align: center;
}

.pk-yt-link,
.pk-youtube iframe {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #000;
}

.pk-yt-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none !important;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.pk-yt-link:hover img {
    opacity: 1;
}

.pk-yt-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 72px;
    height: 72px;
    transform: translate(-50%, -50%);
    border: 2px solid #fff;
    border-radius: 50%;
    background: rgba(0, 146, 230, 0.85);
    box-shadow: 0 0 24px var(--accent);
}

.pk-yt-play::after {
    content: "";
    position: absolute;
    left: 28px;
    top: 21px;
    border-style: solid;
    border-width: 14px 0 14px 22px;
    border-color: transparent transparent transparent #fff;
}

/* ---------------------------------------------------------------- sidebar */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
    animation: fade-up 0.6s ease 0.1s both;
}

.widget {
    padding: 14px 16px 16px;
}

.widget-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-light);
}

.widget-title::after {
    content: "";
    flex: 1;
    height: 2px;
    border-top: 2px dotted var(--line-dark);
}

.widget-body {
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-soft);
}

.widget-body p {
    margin: 0 0 0.7em;
}

.widget-body p:last-child {
    margin-bottom: 0;
}

.widget-body ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.widget-about .avatar {
    display: block;
    width: 72px;
    height: 72px;
    margin: 2px auto 12px;
    padding: 5px;
    border: 1px solid transparent;
    background-image:
        linear-gradient(var(--bg), var(--bg)),
        conic-gradient(from var(--angle), var(--line), var(--line-dark), var(--line));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    animation: spin-border 6s linear infinite;
    object-fit: contain;
}

.search-form {
    display: flex;
    gap: 6px;
}

.search-form input {
    flex: 1;
    min-width: 0;
}

.search-form .btn {
    min-height: 0;
    padding: 0 12px;
}

.widget-categories .chips {
    gap: 7px;
}

.social-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.social-list a,
.social-list button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 8px;
    border: 1px dotted var(--line-dark);
    border-radius: 2px;
    background: transparent;
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.social-list a:hover,
.social-list button:hover {
    background: rgba(40, 57, 253, 0.2);
    border-style: solid;
    border-color: var(--line);
    text-shadow: none;
}

.social-icon {
    flex: none;
    width: 16px;
    height: 16px;
    background-color: #fff;
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}

.link-list li + li {
    margin-top: 8px;
}

.link-list a {
    font-family: var(--font-bold);
}

.link-list .note {
    display: block;
    font-size: 13px;
    color: var(--muted);
}

.feed-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.feed-row input {
    flex: 1;
    min-width: 0;
    padding: 4px 8px;
    font-family: var(--font-mono);
    font-size: 12px;
}

.feed-select {
    margin-top: 8px;
    padding: 4px 8px;
    font-size: 14px;
}

.email-form {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.email-form input {
    flex: 1;
    min-width: 0;
}

.clock-face {
    font-family: var(--font-mono);
    font-size: 26px;
    color: #fff;
    text-align: center;
    text-shadow: 0 0 8px var(--accent);
    letter-spacing: 1px;
}

.clock-date {
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

.toc-list li {
    margin: 0;
}

.toc-list a {
    display: block;
    padding: 3px 0 3px 10px;
    border-left: 2px dotted var(--line-dark);
    font-size: 14px;
    text-decoration: none;
    color: var(--text-soft);
}

.toc-list a.depth-3 {
    padding-left: 22px;
    font-size: 13px;
}

.toc-list a.current {
    border-left: 2px solid var(--accent-light);
    color: #fff;
    text-shadow: 0 0 6px var(--accent);
}

/* ---------------------------------------------------------------- archive */

.archive-panel {
    padding: 20px 22px;
}

.archive-panel h1 {
    margin: 0 0 12px;
    font-size: 28px;
}

.archive-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 6px;
}

.archive-count {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
}

.archive-year {
    margin: 22px 0 8px;
    font-size: 18px;
    color: var(--accent-light);
}

.archive-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.archive-item {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 4px 16px;
    padding: 12px 0;
    border-bottom: 1px dotted var(--line-dark);
}

.archive-item time {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
    padding-top: 3px;
}

.archive-item h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.3;
}

.archive-item h2 a {
    text-decoration: none;
}

.archive-item p {
    grid-column: 2;
    margin: 0;
    font-size: 14px;
    color: var(--text-soft);
}

.archive-item .chips {
    grid-column: 2;
    margin-top: 4px;
}

mark.hit {
    background: rgba(0, 146, 230, 0.4);
    color: #fff;
    padding: 0 2px;
}

/* --------------------------------------------------------------- feedback */

.form-panel {
    padding: 22px 24px 26px;
}

.form-panel h1 {
    margin: 0 0 6px;
    font-size: 28px;
}

.form-panel > p {
    margin: 0 0 18px;
    color: var(--text-soft);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.field.full {
    grid-column: 1 / -1;
}

.field label {
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent-light);
}

.field textarea {
    min-height: 180px;
    resize: vertical;
    line-height: 1.5;
}

.field .hint {
    font-size: 13px;
    color: var(--muted);
}

.honeypot {
    position: absolute;
    left: -9999px;
}

.notice {
    padding: 12px 16px;
    border: 1px dotted var(--ok);
    border-radius: 2px;
    color: var(--ok);
    background: rgba(92, 255, 176, 0.06);
}

.notice.error {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(255, 92, 122, 0.06);
}

/* ------------------------------------------------------- lightbox overlay */

.info-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.82);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.info-overlay.open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0s;
}

.info-content {
    position: relative;
    max-width: min(1100px, 100%);
    max-height: 100%;
    padding: 10px;
    transform: translateY(20px);
    transition: transform 0.25s ease;
}

.info-overlay.open .info-content {
    transform: none;
}

.info-content img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 110px);
    margin: 0 auto;
    object-fit: contain;
}

.info-content p {
    margin: 8px 0 0;
    font-size: 14px;
    color: var(--text-soft);
    text-align: center;
}

.info-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--bg);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

/* ----------------------------------------------------------------- footer */

.site-footer {
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 0 20px 34px;
    text-align: center;
    font-size: 14px;
    color: var(--muted);
}

.site-footer p {
    margin: 0;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 2000;
    padding: 8px 16px;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: var(--panel);
    box-shadow: 0 0 18px rgba(40, 57, 253, 0.5);
    color: #fff;
    font-size: 14px;
    transform: translate(-50%, 20px);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 980px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        align-items: start;
    }
}

@media (max-width: 674px) {
    body {
        font-size: 16px;
    }

    .site-header {
        padding-top: 24px;
    }

    .main-menu a {
        padding: 10px 7px;
        font-size: 13px;
        letter-spacing: 0.5px;
    }

    .layout {
        margin-top: 18px;
        padding: 0 12px;
        gap: 18px;
    }

    .content {
        gap: 18px;
    }

    .post-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .post-card.featured h3 {
        font-size: 22px;
    }

    .post-head,
    .post-body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .post > hr.dots,
    .post-foot hr.dots {
        margin-left: 16px;
        margin-right: 16px;
    }

    .post-nav {
        grid-template-columns: 1fr;
        padding: 0 16px;
    }

    .post-nav .next {
        grid-column: 1;
    }

    .archive-item {
        grid-template-columns: minmax(0, 1fr);
    }

    .archive-item p,
    .archive-item .chips {
        grid-column: 1;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .pk-audio-ui {
        grid-template-columns: 56px minmax(0, 1fr);
    }

    .pk-cover {
        width: 56px;
        height: 56px;
    }

    .pk-vol {
        display: none;
    }

    .pk-time {
        min-width: 0;
    }

    .info-close {
        top: 4px;
        right: 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001s !important;
        scroll-behavior: auto !important;
    }
}
