/* ==========================================================================
   riteshsharma.me — "terminal" theme
   One narrow column, monospace, plain text and links. Fast and a bit quirky.
   ========================================================================== */

:root {
    --bg: #0f0f0e;
    --bg-soft: #161615;
    --line: #2a2a28;
    --text: #d6d6d0;
    --bright: #f2f2ec;
    --dim: #85857e;
    --faint: #5a5a55;
    --green: #7ee787;
    --amber: #e3b341;
    --blue: #79c0ff;
    --select: rgba(126, 231, 135, 0.22);
    --code-bg: #0b0b0a;
    --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    color-scheme: dark;
}
:root[data-theme="light"] {
    --bg: #fbfaf6;
    --bg-soft: #f2f0ea;
    --line: #dedbd2;
    --text: #2b2b28;
    --bright: #111110;
    --dim: #6e6e68;
    --faint: #9d9c95;
    --green: #1a7f37;
    --amber: #9a6700;
    --blue: #0969da;
    --select: rgba(26, 127, 55, 0.16);
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.7 var(--mono);
    -webkit-font-smoothing: antialiased;
}
::selection { background: var(--select); }
a { color: var(--bright); text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
a:hover { color: var(--bg); background: var(--bright); text-decoration: none; }
:focus-visible { outline: 1px dashed var(--green); outline-offset: 2px; }
h1, h2, h3, h4 { color: var(--bright); font-weight: 600; line-height: 1.3; margin: 0; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; }

.page { max-width: 760px; margin: 0 auto; padding: 28px 20px 48px; }

/* ---------- header ---------- */
.top {
    display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px;
    padding-bottom: 14px; margin-bottom: 44px; border-bottom: 1px dashed var(--line);
}
.path { color: var(--bright); font-weight: 600; }
.path a { color: var(--bright); text-decoration: none; }
.path a:hover { color: var(--bg); }
.path .tilde { color: var(--green); }
.path .sep { color: var(--faint); }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; }
.top nav a { color: var(--dim); text-decoration: none; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--bright); background: none; }
.top nav a[aria-current="page"]::before { content: "*"; color: var(--green); }
.theme-btn {
    font: inherit; font-size: 14px; color: var(--dim); background: none; border: 0; padding: 0; cursor: pointer;
}
.theme-btn:hover { color: var(--bright); }
.theme-icon-light { display: none; }
:root[data-theme="light"] .theme-icon-light { display: inline; }
:root[data-theme="light"] .theme-icon-dark { display: none; }

/* ---------- command blocks ---------- */
.block { margin: 0 0 44px; }
.cmd { color: var(--bright); margin-bottom: 12px; font-weight: 500; }
.cmd::before { content: "$ "; color: var(--green); font-weight: 600; }
.cmd .arg { color: var(--dim); font-weight: 400; }
.out { color: var(--text); }
.out p { max-width: 64ch; }
.dim { color: var(--dim); }
.faint { color: var(--faint); }
.green { color: var(--green); }
.amber { color: var(--amber); }
.hl { color: var(--bright); }
.more { display: inline-block; margin-top: 10px; font-size: 14px; }

/* ls -l style rows */
.ls { display: grid; gap: 2px; }
.ls li { display: grid; grid-template-columns: 11ch minmax(0, 1fr) auto; gap: 0 2ch; align-items: baseline; }
.ls .date { color: var(--faint); }
.ls .meta { color: var(--faint); font-size: 13px; white-space: nowrap; }
.ls a { text-decoration: none; }
.ls a:hover { text-decoration: none; }

/* work: expandable rows */
.work details { border-left: 1px solid var(--line); padding-left: 14px; margin: 0 0 6px; }
.work summary {
    display: grid; grid-template-columns: 18ch 10ch minmax(0, 1fr); gap: 0 2ch;
    cursor: pointer; list-style: none; color: var(--bright);
}
.work summary::-webkit-details-marker { display: none; }
.work summary .co::before { content: "+ "; color: var(--green); }
.work details[open] summary .co::before { content: "- "; }
.work summary .yrs { color: var(--faint); }
.work summary .role { color: var(--dim); }
.work summary:hover .co { text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
.work .detail { padding: 8px 0 12px 2ch; color: var(--text); }
.work .detail li { position: relative; padding-left: 2ch; max-width: 66ch; }
.work .detail li::before { content: "·"; position: absolute; left: 0; color: var(--faint); }
.work .detail .stack { margin-top: 6px; color: var(--faint); font-size: 13px; }

/* key: value lines */
.kv { display: grid; grid-template-columns: 12ch minmax(0, 1fr); gap: 2px 2ch; }
.kv dt { color: var(--amber); }
.kv dd { margin: 0; }

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

/* form */
.mail { display: grid; gap: 10px; max-width: 560px; }
.mail label { display: grid; grid-template-columns: 11ch minmax(0, 1fr); align-items: baseline; color: var(--dim); }
.mail label.area { align-items: start; }
.mail input, .mail textarea {
    font: inherit; color: var(--bright); background: transparent;
    border: 0; border-bottom: 1px dashed var(--line); padding: 4px 0; outline: none; width: 100%; resize: vertical;
}
.mail textarea { border: 1px dashed var(--line); padding: 8px; }
.mail input:focus, .mail textarea:focus { border-color: var(--green); }
.mail input::placeholder, .mail textarea::placeholder { color: var(--faint); }
.mail button {
    justify-self: start; margin-top: 4px; font: inherit; cursor: pointer;
    color: var(--bg); background: var(--bright); border: 0; padding: 4px 14px;
}
.mail button:hover { background: var(--green); }

.cursor { display: inline-block; width: .6em; height: 1.1em; vertical-align: -3px; background: var(--text); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- listing pages ---------- */
.title { font-size: 1.5rem; margin-bottom: 6px; }
.title::before { content: "# "; color: var(--faint); }
.subtitle { color: var(--dim); margin-bottom: 32px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.tags a { color: var(--dim); text-decoration: none; }
.tags a:hover { color: var(--bg); }
.tags .n { color: var(--faint); }
.year { margin: 28px 0 8px; color: var(--faint); }

/* ---------- article ---------- */
.post-head { margin-bottom: 32px; }
.post-head h1 { font-size: clamp(1.45rem, 3.6vw, 1.9rem); line-height: 1.25; letter-spacing: -0.01em; }
.post-head h1::before { content: "# "; color: var(--faint); }
.post-meta { margin-top: 12px; font-size: 14px; color: var(--dim); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.post-meta a { color: var(--dim); text-decoration: none; }
.post-meta a:hover { color: var(--bg); }
.post-desc { margin-top: 14px; color: var(--dim); font-family: var(--sans); font-size: 1.05rem; line-height: 1.6; }

.tldr { border-left: 2px solid var(--green); padding: 4px 0 4px 16px; margin: 0 0 28px; }
.tldr .label { color: var(--green); font-size: 13px; }
.tldr p { margin: 4px 0 0; font-family: var(--sans); font-size: 1.02rem; line-height: 1.65; color: var(--text); }

.toc { margin: 0 0 32px; font-size: 14px; }
.toc summary { cursor: pointer; color: var(--dim); }
.toc summary:hover { color: var(--bright); }
.toc ol { margin: 8px 0 0; padding-left: 3ch; color: var(--faint); }
.toc li { margin: 2px 0; }
.toc li.lvl-3 { margin-left: 3ch; list-style-type: "- "; }
.toc a { color: var(--dim); text-decoration: none; }
.toc a:hover { color: var(--bg); }

.cover { margin: 0 0 32px; border: 1px solid var(--line); }
.cover img { display: block; width: 100%; }

/* markdown output: readable proportional body, mono for structure */
.prose { font-family: var(--sans); font-size: 1.06rem; line-height: 1.75; color: var(--text); }
.prose h1, .prose h2, .prose h3, .prose h4 { font-family: var(--mono); margin: 2em 0 .7em; }
.prose h1 { font-size: 1.35rem; }
.prose h2 { font-size: 1.2rem; }
.prose h2::before { content: "## "; color: var(--faint); }
.prose h3 { font-size: 1.05rem; }
.prose h3::before { content: "### "; color: var(--faint); }
.prose h4 { font-size: 1rem; color: var(--text); }
.prose p, .prose ul, .prose ol, .prose table, .prose blockquote, .prose .highlight { margin: 0 0 1.25em; }
.prose ul { list-style: none; padding-left: 0; }
.prose ul > li { position: relative; padding-left: 1.4em; margin: .35em 0; }
.prose ul > li::before { content: "-"; position: absolute; left: 0; color: var(--faint); font-family: var(--mono); }
.prose ol { padding-left: 1.6em; }
.prose ol > li { margin: .35em 0; }
.prose ol > li::marker { color: var(--faint); font-family: var(--mono); font-size: .9em; }
.prose li > ul, .prose li > ol { margin: .35em 0 0; }
.prose strong { color: var(--bright); font-weight: 600; }
.prose a { color: var(--blue); text-decoration-color: color-mix(in srgb, var(--blue) 40%, transparent); }
.prose a:hover { color: var(--bg); background: var(--blue); }
.prose hr { border: 0; border-top: 1px dashed var(--line); margin: 2.4em 0; }
.prose blockquote { margin-left: 0; padding-left: 16px; border-left: 2px solid var(--line); color: var(--dim); }
.prose img { border: 1px solid var(--line); }
.prose :not(pre) > code { font: .88em var(--mono); color: var(--amber); background: var(--bg-soft); padding: .1em .35em; }
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 8px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { font-family: var(--mono); font-weight: 600; color: var(--bright); background: var(--bg-soft); }
.math-display { overflow-x: auto; }

.highlight { position: relative; background: var(--code-bg); border: 1px solid var(--line); }
.highlight pre { margin: 0; padding: 16px 18px; overflow-x: auto; font: 13.5px/1.65 var(--mono); color: #e6edf3; }
.copy-btn {
    position: absolute; top: 6px; right: 6px; font: 12px var(--mono); color: #8b949e;
    background: #161b22; border: 1px solid #30363d; padding: 2px 8px; cursor: pointer; opacity: 0; transition: opacity .15s;
}
.highlight:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: #e6edf3; }

.post-foot { margin-top: 48px; padding-top: 16px; border-top: 1px dashed var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; font-size: 14px; }

/* ---------- notes ---------- */
.note { margin: 0 0 40px; }
.note-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; align-items: baseline; margin-bottom: 12px; }
.note-head h2 { font-size: 1.12rem; }
.note-head h2 a { color: var(--bright); text-decoration: none; }
.note-head h2 a::before { content: "## "; color: var(--faint); }
.note-head time { color: var(--faint); font-size: 13px; }
.note .prose { font-size: 1rem; }
.note .prose h2 { font-size: 1rem; margin-top: 1.4em; }
.note .tags { margin-top: 4px; color: var(--faint); }

/* ---------- footer ---------- */
.foot { margin-top: 64px; padding-top: 14px; border-top: 1px dashed var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; font-size: 13px; color: var(--faint); }
.foot a { color: var(--dim); text-decoration: none; }
.foot a:hover { color: var(--bg); }

/* ---------- small screens ---------- */
@media (max-width: 600px) {
    body { font-size: 14px; }
    .page { padding: 20px 16px 40px; }
    .top { margin-bottom: 32px; }
    .ls li { grid-template-columns: minmax(0, 1fr); }
    .ls .date { font-size: 12.5px; }
    .ls .meta { display: none; }
    .work summary { grid-template-columns: minmax(0, 1fr) auto; }
    .work summary .role { grid-column: 1 / -1; }
    .kv { grid-template-columns: 9ch minmax(0, 1fr); }
    .mail label { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

/* ==========================================================================
   Polish layer: ambient light, glass header, window frame, motion, hovers
   ========================================================================== */
:root { --glow-1: rgba(126, 231, 135, 0.10); --glow-2: rgba(121, 192, 255, 0.08); --dot: rgba(255,255,255,.045); --card: rgba(255,255,255,.025); --card-hover: rgba(255,255,255,.045); }
:root[data-theme="light"] { --glow-1: rgba(26, 127, 55, 0.08); --glow-2: rgba(9, 105, 218, 0.07); --dot: rgba(0,0,0,.05); --card: rgba(0,0,0,.018); --card-hover: rgba(0,0,0,.035); }

body { position: relative; isolation: isolate; overflow-x: clip; }
body::before {
    content: ""; position: absolute; inset: 0 0 auto; height: 900px; z-index: -1; pointer-events: none;
    background:
        radial-gradient(600px 340px at 20% -40px, var(--glow-1), transparent 70%),
        radial-gradient(520px 320px at 85% 0, var(--glow-2), transparent 70%);
}
body::after {
    content: ""; position: absolute; inset: 0 0 auto; height: 700px; z-index: -1; pointer-events: none;
    background-image: radial-gradient(var(--dot) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(#000, transparent 85%);
    -webkit-mask-image: linear-gradient(#000, transparent 85%);
}

/* glass sticky header */
.top {
    position: sticky; top: 0; z-index: 20;
    margin: -28px calc(50% - 50vw) 44px; padding: 18px max(20px, calc(50vw - 360px)) 14px;
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    backdrop-filter: blur(12px) saturate(160%); -webkit-backdrop-filter: blur(12px) saturate(160%);
    border-bottom: 1px solid var(--line);
}
.top nav a { padding: 2px 6px; margin: 0 -6px; border-radius: 6px; transition: color .15s, background .15s; }
.top nav a:hover { background: var(--card-hover); }

/* intro */
.hero { padding: 28px 0 40px; }
.status {
    display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px;
    padding: 4px 12px 4px 10px; border: 1px solid var(--line); border-radius: 999px;
    font-size: 13px; color: var(--dim); background: var(--card);
}
.status .pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.status .pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--green); animation: pulse 2s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(3); opacity: 0; } }
.name {
    font-size: clamp(2.3rem, 7vw, 3.7rem); font-weight: 600; letter-spacing: -0.045em; line-height: 1.05;
    background: linear-gradient(100deg, var(--bright) 30%, var(--green) 75%, var(--blue));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.name .caret { display: inline-block; width: .5em; height: .8em; margin-left: .08em; vertical-align: -0.04em; background: var(--green); animation: blink 1.1s steps(1) infinite; }
.tagline { margin-top: 14px; color: var(--dim); font-size: 1.02rem; }
.tagline .sep { color: var(--faint); margin: 0 .5ch; }

/* terminal window frame */
.window {
    border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 0 0 48px;
    background: color-mix(in srgb, var(--bg-soft) 65%, transparent);
    box-shadow: 0 30px 60px -40px rgba(0,0,0,.55);
}
.window-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--faint); }
.window-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.window-bar i:nth-child(1) { background: #ff5f57; } .window-bar i:nth-child(2) { background: #febc2e; } .window-bar i:nth-child(3) { background: #28c840; }
.window-bar span { margin-left: auto; margin-right: auto; transform: translateX(-20px); }
.window-body { padding: 22px 22px 6px; }
.window-body .block { margin-bottom: 28px; }

/* section commands: typed + anchored */
.cmd { position: relative; }
.cmd .typed-caret { display: inline-block; width: .55em; height: 1em; vertical-align: -2px; margin-left: 2px; background: var(--green); }

/* rows with hover */
.ls { gap: 0; }
.ls li { padding: 6px 10px; margin: 0 -10px; border-radius: 8px; transition: background .15s; position: relative; }
.ls li:hover { background: var(--card-hover); }
.ls li a { transition: color .15s; }
.ls li:hover a { color: var(--green); background: none; }
.ls li a::after { content: ""; position: absolute; inset: 0; }
.ls li .meta::after { content: " →"; opacity: 0; transition: opacity .15s, margin .15s; margin-left: -4px; }
.ls li:hover .meta::after { opacity: 1; margin-left: 0; }

.work details { border-left: 0; padding: 0; margin: 0 0 6px; border: 1px solid transparent; border-radius: 10px; transition: background .2s, border-color .2s; }
.work details:hover { background: var(--card); }
.work details[open] { background: var(--card); border-color: var(--line); }
.work summary { padding: 8px 12px; border-radius: 10px; }
.work .detail { padding: 2px 12px 12px calc(12px + 2ch); }
.work details[open] .detail { animation: slide .25s ease; }
@keyframes slide { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* links as pills */
.links { gap: 8px; }
.links a {
    padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none;
    color: var(--text); background: var(--card); font-size: 14px; transition: border-color .15s, color .15s, background .15s, transform .15s;
}
.links a::after { content: " ↗"; color: var(--faint); }
.links a[href^="/"]::after, .links a[download]::after { content: ""; }
.links a:hover { color: var(--green); border-color: color-mix(in srgb, var(--green) 50%, transparent); background: var(--card-hover); transform: translateY(-1px); }

/* stack: chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { padding: 1px 9px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; color: var(--text); background: var(--card); }

/* tags and buttons */
.tags a { padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); transition: border-color .15s, color .15s; }
.tags a:hover { color: var(--green); background: var(--card); border-color: color-mix(in srgb, var(--green) 50%, transparent); }
.mail { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.mail button { border-radius: 6px; transition: background .15s, transform .15s; }
.mail button:hover { transform: translateY(-1px); }
.mail textarea { border-radius: 8px; }

/* post polish */
.post-head { padding-top: 12px; }
.tldr { border-left: 0; border: 1px solid color-mix(in srgb, var(--green) 35%, var(--line)); border-radius: 10px; padding: 14px 18px; background: color-mix(in srgb, var(--green) 6%, transparent); }
.toc { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: var(--card); }
.cover, .highlight, .prose table, .prose img { border-radius: 10px; overflow: hidden; }
.note { padding: 22px 22px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }

/* reveal */
.js .reveal { opacity: 0; transform: translateY(10px); transition: opacity .55s ease, transform .55s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .js .reveal { opacity: 1; transform: none; transition: none; }
    .status .pulse::after, .name .caret { animation: none; }
}
@media (max-width: 600px) {
    .top { margin: -20px calc(50% - 50vw) 32px; padding: 14px 16px 12px; }
    .window-body { padding: 16px 14px 2px; }
    .window-bar span { transform: none; }
    .work summary { padding: 8px 10px; }
    .work .detail { padding-left: calc(10px + 2ch); }
    .note { padding: 18px 16px 10px; }
}

/* ==========================================================================
   Gradient layer + explore grid, sitemap footer, author box
   ========================================================================== */
:root {
    --g1: #7ee787; --g2: #56d4dd; --g3: #a78bfa; --g4: #f778ba;
    --grad: linear-gradient(110deg, var(--g1), var(--g2) 40%, var(--g3) 75%, var(--g4));
    --grad-soft: linear-gradient(110deg, rgba(126,231,135,.16), rgba(86,212,221,.12) 40%, rgba(167,139,250,.14) 75%, rgba(247,120,186,.12));
}
:root[data-theme="light"] {
    --g1: #1a7f37; --g2: #0e7490; --g3: #6d28d9; --g4: #be185d;
    --grad-soft: linear-gradient(110deg, rgba(26,127,55,.09), rgba(14,116,144,.08) 40%, rgba(109,40,217,.08) 75%, rgba(190,24,93,.07));
}
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* richer ambient light */
body::before {
    background:
        radial-gradient(560px 320px at 12% -60px, color-mix(in srgb, var(--g1) 18%, transparent), transparent 70%),
        radial-gradient(520px 320px at 55% -120px, color-mix(in srgb, var(--g2) 14%, transparent), transparent 70%),
        radial-gradient(560px 360px at 92% -40px, color-mix(in srgb, var(--g3) 18%, transparent), transparent 70%);
}

/* name: full spectrum, slowly drifting */
.name {
    background: linear-gradient(100deg, var(--bright) 0%, var(--bright) 22%, var(--g1) 45%, var(--g2) 62%, var(--g3) 80%, var(--g4) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: drift 9s ease-in-out infinite alternate;
}
@keyframes drift { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
.name .caret { background: var(--g3); -webkit-text-fill-color: initial; }
.hero::after { content: ""; display: block; height: 1px; margin-top: 34px; background: linear-gradient(90deg, var(--g1), var(--g2), var(--g3), transparent); opacity: .55; }

/* gradient-bordered status pill */
.status { border: 1px solid transparent; background: linear-gradient(var(--bg), var(--bg)) padding-box, var(--grad) border-box; }

/* window: gradient top edge */
.window { position: relative; }
.window::before { content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: var(--grad); opacity: .8; }
.cmd::before { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* explore tiles */
.explore { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile {
    position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px 18px 16px;
    border-radius: 12px; text-decoration: none; color: var(--text);
    border: 1px solid var(--line); background: var(--card);
    transition: transform .2s ease, border-color .2s, background .2s;
}
.tile::before {
    content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
    background: var(--grad); opacity: 0; transition: opacity .25s;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.tile:hover { color: var(--text); background: var(--grad-soft); transform: translateY(-2px); border-color: transparent; }
.tile:hover::before { opacity: 1; }
.tile .count { font-size: 2.2rem; font-weight: 600; letter-spacing: -0.04em; line-height: 1.1; }
.tile .label { color: var(--bright); font-weight: 600; }
.tile .desc { color: var(--dim); font-size: 13.5px; line-height: 1.5; }
.tile .go { margin-top: 8px; font-size: 13px; color: var(--faint); transition: color .2s; }
.tile:hover .go { color: var(--g2); }

/* two recent lists side by side */
.recent-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.recent-head .more { margin: 0 0 12px; }

/* author box */
.author {
    margin-top: 40px; padding: 18px 20px; border-radius: 12px; position: relative;
    border: 1px solid transparent; background: linear-gradient(var(--bg-soft), var(--bg-soft)) padding-box, var(--grad) border-box;
    display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start;
}
.author .mono-avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--grad); color: #0f0f0e; font-weight: 700; }
.author p { margin: 2px 0 8px; color: var(--dim); font-size: 14px; line-height: 1.6; }
.author .hl { font-weight: 600; }
.author .links a { font-size: 13px; padding: 3px 10px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.pager a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--text); background: var(--card); font-size: 14px; transition: border-color .2s, background .2s; }
.pager a:hover { background: var(--grad-soft); color: var(--text); border-color: var(--line); }
.pager small { display: block; color: var(--faint); font-size: 12px; margin-bottom: 2px; }
.pager .next { text-align: right; grid-column: 2; }

/* sitemap footer */
.foot { display: block; margin-top: 72px; padding-top: 0; border-top: 0; position: relative; }
.foot::before { content: ""; display: block; height: 1px; margin-bottom: 28px; background: linear-gradient(90deg, transparent, var(--g1), var(--g2), var(--g3), transparent); opacity: .5; }
.sitemap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 28px; }
.sitemap h4 { font-size: 12px; font-weight: 500; color: var(--faint); margin-bottom: 8px; }
.sitemap h4::before { content: "~/"; }
.sitemap ul { display: grid; gap: 4px; }
.sitemap a { color: var(--dim); text-decoration: none; font-size: 13.5px; }
.sitemap a:hover { color: var(--bright); background: none; text-decoration: underline; text-decoration-color: var(--g2); }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; font-size: 12.5px; color: var(--faint); }

@media (max-width: 600px) {
    .explore { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
    .tile { padding: 14px; }
    .tile .count { font-size: 1.8rem; }
    .tile .desc { display: none; }
    .sitemap { grid-template-columns: 1fr 1fr; }
    .pager { grid-template-columns: 1fr; }
    .pager .next { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) { .name { animation: none; } }

/* ---------- syntax highlighting (Pygments github-dark) ---------- */
.highlight .c { color: #8B949E; font-style: italic } /* Comment */
.highlight .err { color: #F85149 } /* Error */
.highlight .esc { color: #E6EDF3 } /* Escape */
.highlight .g { color: #E6EDF3 } /* Generic */
.highlight .k { color: #FF7B72 } /* Keyword */
.highlight .l { color: #A5D6FF } /* Literal */
.highlight .n { color: #E6EDF3 } /* Name */
.highlight .o { color: #FF7B72; font-weight: bold } /* Operator */
.highlight .x { color: #E6EDF3 } /* Other */
.highlight .p { color: #E6EDF3 } /* Punctuation */
.highlight .ch { color: #8B949E; font-style: italic } /* Comment.Hashbang */
.highlight .cm { color: #8B949E; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #8B949E; font-weight: bold; font-style: italic } /* Comment.Preproc */
.highlight .cpf { color: #8B949E; font-style: italic } /* Comment.PreprocFile */
.highlight .c1 { color: #8B949E; font-style: italic } /* Comment.Single */
.highlight .cs { color: #8B949E; font-weight: bold; font-style: italic } /* Comment.Special */
.highlight .gd { color: #FFA198; background-color: #490202 } /* Generic.Deleted */
.highlight .ge { color: #E6EDF3; font-style: italic } /* Generic.Emph */
.highlight .ges { color: #E6EDF3; font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #FFA198 } /* Generic.Error */
.highlight .gh { color: #79C0FF; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #56D364; background-color: #0F5323 } /* Generic.Inserted */
.highlight .go { color: #8B949E } /* Generic.Output */
.highlight .gp { color: #8B949E } /* Generic.Prompt */
.highlight .gs { color: #E6EDF3; font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #79C0FF } /* Generic.Subheading */
.highlight .gt { color: #FF7B72 } /* Generic.Traceback */
.highlight .g-Underline { color: #E6EDF3; text-decoration: underline } /* Generic.Underline */
.highlight .kc { color: #79C0FF } /* Keyword.Constant */
.highlight .kd { color: #FF7B72 } /* Keyword.Declaration */
.highlight .kn { color: #FF7B72 } /* Keyword.Namespace */
.highlight .kp { color: #79C0FF } /* Keyword.Pseudo */
.highlight .kr { color: #FF7B72 } /* Keyword.Reserved */
.highlight .kt { color: #FF7B72 } /* Keyword.Type */
.highlight .ld { color: #79C0FF } /* Literal.Date */
.highlight .m { color: #A5D6FF } /* Literal.Number */
.highlight .s { color: #A5D6FF } /* Literal.String */
.highlight .na { color: #E6EDF3 } /* Name.Attribute */
.highlight .nb { color: #E6EDF3 } /* Name.Builtin */
.highlight .nc { color: #F0883E; font-weight: bold } /* Name.Class */
.highlight .no { color: #79C0FF; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #D2A8FF; font-weight: bold } /* Name.Decorator */
.highlight .ni { color: #FFA657 } /* Name.Entity */
.highlight .ne { color: #F0883E; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #D2A8FF; font-weight: bold } /* Name.Function */
.highlight .nl { color: #79C0FF; font-weight: bold } /* Name.Label */
.highlight .nn { color: #FF7B72 } /* Name.Namespace */
.highlight .nx { color: #E6EDF3 } /* Name.Other */
.highlight .py { color: #79C0FF } /* Name.Property */
.highlight .nt { color: #7EE787 } /* Name.Tag */
.highlight .nv { color: #79C0FF } /* Name.Variable */
.highlight .ow { color: #FF7B72; font-weight: bold } /* Operator.Word */
.highlight .pm { color: #E6EDF3 } /* Punctuation.Marker */
.highlight .w { color: #6E7681 } /* Text.Whitespace */
.highlight .mb { color: #A5D6FF } /* Literal.Number.Bin */
.highlight .mf { color: #A5D6FF } /* Literal.Number.Float */
.highlight .mh { color: #A5D6FF } /* Literal.Number.Hex */
.highlight .mi { color: #A5D6FF } /* Literal.Number.Integer */
.highlight .mo { color: #A5D6FF } /* Literal.Number.Oct */
.highlight .sa { color: #79C0FF } /* Literal.String.Affix */
.highlight .sb { color: #A5D6FF } /* Literal.String.Backtick */
.highlight .sc { color: #A5D6FF } /* Literal.String.Char */
.highlight .dl { color: #79C0FF } /* Literal.String.Delimiter */
.highlight .sd { color: #A5D6FF } /* Literal.String.Doc */
.highlight .s2 { color: #A5D6FF } /* Literal.String.Double */
.highlight .se { color: #79C0FF } /* Literal.String.Escape */
.highlight .sh { color: #79C0FF } /* Literal.String.Heredoc */
.highlight .si { color: #A5D6FF } /* Literal.String.Interpol */
.highlight .sx { color: #A5D6FF } /* Literal.String.Other */
.highlight .sr { color: #79C0FF } /* Literal.String.Regex */
.highlight .s1 { color: #A5D6FF } /* Literal.String.Single */
.highlight .ss { color: #A5D6FF } /* Literal.String.Symbol */
.highlight .bp { color: #E6EDF3 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #D2A8FF; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #79C0FF } /* Name.Variable.Class */
.highlight .vg { color: #79C0FF } /* Name.Variable.Global */
.highlight .vi { color: #79C0FF } /* Name.Variable.Instance */
.highlight .vm { color: #79C0FF } /* Name.Variable.Magic */
.highlight .il { color: #A5D6FF } /* Literal.Number.Integer.Long */

/* each explore tile gets its own slice of the spectrum */
.tile .count { background-size: 100% 100%; }
.tile:nth-child(1) .count { background-image: linear-gradient(135deg, var(--g1), var(--g2)); }
.tile:nth-child(2) .count { background-image: linear-gradient(135deg, var(--g2), var(--g3)); }
.tile:nth-child(3) .count { background-image: linear-gradient(135deg, var(--g3), var(--g4)); }
.tile:nth-child(4) .count { background-image: linear-gradient(135deg, var(--g4), var(--g1)); }

/* ==========================================================================
   Soft gradient (from the first redesign): blue/violet glow over a faint grid.
   Overrides the bolder spectrum above; gradient is used sparingly.
   ========================================================================== */
:root {
    --g1: #7aa2ff; --g2: #a47bff; --g3: #ff7ab8; --g4: #7aa2ff;
    --grad: linear-gradient(92deg, #7aa2ff 0%, #a47bff 50%, #ff7ab8 100%);
    --glow-a: rgba(47, 99, 255, 0.30);
    --glow-b: rgba(164, 123, 255, 0.22);
    --grid-line: rgba(240, 246, 252, 0.045);
}
:root[data-theme="light"] {
    --g1: #1d5cff; --g2: #7c4dff; --g3: #e0468f; --g4: #1d5cff;
    --grad: linear-gradient(92deg, #1d5cff 0%, #7c4dff 50%, #e0468f 100%);
    --glow-a: rgba(29, 92, 255, 0.13);
    --glow-b: rgba(124, 77, 255, 0.10);
    --grid-line: rgba(15, 23, 42, 0.05);
}

/* backdrop: two soft glows + a masked grid ("hatch") */
body::before {
    inset: -80px 0 auto; height: 820px;
    background:
        radial-gradient(600px 380px at 18% 22%, var(--glow-a), transparent 70%),
        radial-gradient(520px 360px at 82% 6%, var(--glow-b), transparent 70%);
    filter: blur(10px);
}
body::after {
    height: 760px;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 25%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 25%, #000 30%, transparent 75%);
}

/* name: solid, with only the surname in the gradient; no drift */
.name { background: none; color: var(--bright); animation: none; -webkit-text-fill-color: currentColor; }
.name .grad { -webkit-text-fill-color: transparent; }
.name .caret { background: var(--g2); }
.hero::after { background: var(--line); opacity: 1; }

/* quieter accents */
.status { border: 1px solid var(--line); background: var(--card); }
.cmd::before { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--green); }
.window::before { inset: 0; height: auto; border-radius: inherit; padding: 1px; opacity: 1; pointer-events: none;
    background: linear-gradient(135deg, rgba(122,162,255,.55), rgba(164,123,255,.35) 50%, rgba(255,122,184,.25));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
:root[data-theme="light"] .window::before { background: linear-gradient(135deg, rgba(29,92,255,.35), rgba(124,77,255,.22) 50%, rgba(224,70,143,.15)); }

/* explore tiles: one gradient for all counts, calm hover */
.tile:nth-child(n) .count { background-image: var(--grad); }
.tile:hover { background: var(--card-hover); transform: translateY(-1px); border-color: var(--line); }
.tile::before { opacity: 0; }
.tile:hover::before { opacity: .7; }
.tile:hover .go { color: var(--g1); }

.author { border: 1px solid var(--line); background: var(--bg-soft); }
.author .mono-avatar { background: linear-gradient(135deg, var(--g1), var(--g2)); color: #fff; }
.pager a:hover { background: var(--card-hover); }
.foot::before { background: var(--line); opacity: 1; }
.tldr { border-color: color-mix(in srgb, var(--g1) 30%, var(--line)); background: color-mix(in srgb, var(--g1) 6%, transparent); }
.tldr .label { color: var(--g1); }

/* richer top nav */
.top nav { align-items: baseline; }
.nav-sep { color: var(--faint); }
@media (max-width: 760px) {
    .top { flex-direction: column; align-items: stretch; gap: 8px; }
    .top nav {
        flex-wrap: nowrap; overflow-x: auto; gap: 14px; padding-bottom: 2px;
        scrollbar-width: none; -webkit-overflow-scrolling: touch;
        mask-image: linear-gradient(90deg, #000 85%, transparent);
        -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    }
    .top nav::-webkit-scrollbar { display: none; }
    .top nav a, .theme-btn { white-space: nowrap; flex: none; }
}

/* ==========================================================================
   Three-colour palette (blue · violet · green) + readability pass.
   Everything else is neutral grey. This block intentionally comes last.
   ========================================================================== */
:root {
    --blue: #7aa2ff; --violet: #a78bfa; --green: #7ee787;
    --text: #e4e4de; --bright: #f5f5f0; --dim: #a6a69f; --faint: #75756f;
    --amber: var(--blue);
    --g1: var(--blue); --g2: var(--violet); --g3: var(--violet); --g4: var(--blue);
    --grad: linear-gradient(92deg, var(--blue), var(--violet));
    --select: rgba(122, 162, 255, 0.25);
}
:root[data-theme="light"] {
    --blue: #1d5cff; --violet: #6d4aff; --green: #1a7f37;
    --text: #1f1f1c; --bright: #0e0e0d; --dim: #55554f; --faint: #85857e;
    --amber: var(--blue);
    --grad: linear-gradient(92deg, var(--blue), var(--violet));
    --select: rgba(29, 92, 255, 0.15);
}

/* name: solid, no gradient */
.name, .name .grad { background: none; color: var(--bright); -webkit-text-fill-color: currentColor; animation: none; }
.name .caret { background: var(--blue); }

/* window: neutral dots, quiet blue→violet edge */
.window-bar i, .window-bar i:nth-child(n) { background: var(--line); }
.window::before { background: linear-gradient(135deg, color-mix(in srgb, var(--blue) 45%, transparent), color-mix(in srgb, var(--violet) 30%, transparent)); }
:root[data-theme="light"] .window::before { background: linear-gradient(135deg, color-mix(in srgb, var(--blue) 30%, transparent), color-mix(in srgb, var(--violet) 20%, transparent)); }

/* explore counts: blue→violet only */
.tile:nth-child(n) .count { background-image: var(--grad); }
.tile:hover .go { color: var(--blue); }
.author .mono-avatar { background: var(--grad); }
.tldr { border-color: color-mix(in srgb, var(--blue) 30%, var(--line)); background: color-mix(in srgb, var(--blue) 6%, transparent); }
.tldr .label { color: var(--blue); }
.prose :not(pre) > code { color: var(--bright); }
.prose a { color: var(--blue); }

/* ---------- readability ---------- */
body { font-size: 15.5px; }
.out p, .kv dd, .work .detail li, .tile .desc, .author p, .post-desc, .subtitle, .mail input, .mail textarea {
    font-family: var(--sans);
}
.out p { font-size: 1.06rem; line-height: 1.8; max-width: 66ch; color: var(--text); margin-bottom: 1.1em; }
.out p .hl { font-weight: 600; }
.kv dd { font-size: 1.02rem; line-height: 1.65; }
.kv dt { font-size: 14.5px; padding-top: 2px; }
.work .detail li { font-size: 1rem; line-height: 1.7; margin: 3px 0; }
.ls li { padding: 7px 10px; }
.ls a { font-size: 15px; }
.tile .desc { font-size: 14px; }
.tagline { font-size: 1.05rem; }
.prose { font-size: 1.08rem; line-height: 1.8; }

/* ---------- code: three colours + greys ---------- */
.highlight [class] { color: #e6edf3; font-style: normal; font-weight: normal; }
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .cp, .highlight .ch, .highlight .cpf { color: #7d8590; font-style: italic; }
.highlight .k, .highlight .kc, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt, .highlight .ow, .highlight .nt { color: #a78bfa; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sa, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .sr, .highlight .ss, .highlight .dl { color: #7ee787; }
.highlight .nf, .highlight .fm, .highlight .nc, .highlight .nb, .highlight .bp, .highlight .mi, .highlight .mf, .highlight .m, .highlight .mh, .highlight .mo, .highlight .il { color: #7aa2ff; }
.highlight .o, .highlight .p { color: #9da5b0; }

/* ==========================================================================
   Red accent palette (red · blue · green) + de-emphasised tag-like elements.
   ========================================================================== */
:root {
    --red: #ff6767;
    --blue: #7aa2ff; --green: #7ee787;
    --violet: var(--red);
    --amber: var(--red);
    --g1: var(--red); --g2: var(--red); --g3: var(--red); --g4: var(--red);
    --grad: linear-gradient(92deg, var(--red), var(--red));
    --glow-a: rgba(255, 103, 103, 0.16);
    --glow-b: rgba(122, 162, 255, 0.14);
    --select: rgba(255, 103, 103, 0.25);
}
:root[data-theme="light"] {
    --red: #d63a3a;
    --blue: #1d5cff; --green: #1a7f37;
    --violet: var(--red); --amber: var(--red);
    --grad: linear-gradient(92deg, var(--red), var(--red));
    --glow-a: rgba(214, 58, 58, 0.09);
    --glow-b: rgba(29, 92, 255, 0.08);
    --select: rgba(214, 58, 58, 0.15);
}
.name .caret { background: var(--red); }
.prose a { color: var(--red); text-decoration-color: color-mix(in srgb, var(--red) 40%, transparent); }
.prose a:hover { color: var(--bg); background: var(--red); }
.top nav a[aria-current="page"]::before { color: var(--red); }
.tile:nth-child(n) .count { background: none; color: var(--red); -webkit-text-fill-color: currentColor; }
.tile:hover .go { color: var(--red); }
.tile:hover::before { opacity: 0; }
.tile:hover { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
.window::before { background: linear-gradient(135deg, color-mix(in srgb, var(--red) 35%, transparent), transparent 60%); }
:root[data-theme="light"] .window::before { background: linear-gradient(135deg, color-mix(in srgb, var(--red) 25%, transparent), transparent 60%); }
.author .mono-avatar { background: var(--red); color: #fff; }
.tldr { border-color: color-mix(in srgb, var(--red) 30%, var(--line)); background: color-mix(in srgb, var(--red) 5%, transparent); }
.tldr .label { color: var(--red); }
.ls li:hover a { color: var(--red); }
.links a:hover, .tags a:hover { color: var(--red); }
.highlight .k, .highlight .kc, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt, .highlight .ow, .highlight .nt { color: #ff8a8a; }

/* ---------- tag-like elements: quiet, inline, small ---------- */
/* stack: plain comma-style text instead of chips */
.chips { display: block; }
.chips span { display: inline; padding: 0; border: 0; background: none; font-size: inherit; color: var(--text); }
.chips span + span::before { content: " · "; color: var(--faint); }

/* links: inline text links, no pills */
.links { gap: 4px 18px; }
.links a { padding: 0; border: 0; border-radius: 0; background: none; font-size: 15px; color: var(--bright);
    text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; transform: none !important; }
.links a:hover { background: none; text-decoration-color: var(--red); }

/* topics line on listing pages */
.topics { margin: -18px 0 32px; font-size: 13px; color: var(--faint); }
.topics a { color: var(--dim); text-decoration: none; margin-right: 10px; }
.topics a:hover { color: var(--red); background: none; }

/* tags on notes / posts: small and faint */
.tags a, .note .tags span { padding: 0; border: 0; background: none; font-size: 12.5px; color: var(--faint); }
.note .tags { gap: 2px 10px; margin-top: 2px; }
.post-meta a { color: var(--faint); font-size: 13px; }

/* work/project names: room for the longest slug */
.work summary { grid-template-columns: 20ch 10ch minmax(0, 1fr); }
@media (max-width: 600px) { .work summary { grid-template-columns: minmax(0, 1fr) auto; } }

/* notes: clear hierarchy between note title and its inner headings */
.note-head h2 { font-size: 1.35rem; }
.note .prose h2 { font-size: .95rem; color: var(--dim); }
.note .prose h2::before { content: none; }

/* ---------- informative hero ---------- */
.hero { padding: 24px 0 36px; }
.hero .name { font-size: clamp(2.1rem, 6vw, 3.2rem); }
.hero-lead {
    margin: 18px 0 0; max-width: 60ch;
    font-family: var(--sans); font-size: clamp(1.15rem, 2.4vw, 1.35rem); line-height: 1.6; color: var(--text);
}
.hero-lead strong { color: var(--bright); font-weight: 600; }
.facts { display: grid; gap: 6px; margin: 26px 0 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.facts div { display: grid; grid-template-columns: 8ch minmax(0, 1fr); gap: 2ch; align-items: baseline; }
.facts dt { color: var(--faint); font-size: 13.5px; }
.facts dd { margin: 0; font-family: var(--sans); font-size: 1rem; color: var(--text); }
.facts a { color: var(--bright); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.act {
    display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 8px;
    font-size: 14px; text-decoration: none; color: var(--bright); border: 1px solid var(--line); background: var(--card);
    transition: border-color .15s, background .15s, color .15s;
}
.act:hover { color: var(--bright); background: var(--card-hover); border-color: var(--faint); }
.act.primary { background: var(--red); border-color: var(--red); color: #fff; }
.act.primary:hover { background: color-mix(in srgb, var(--red) 85%, #fff); color: #fff; }
.tagline { display: none; }
@media (max-width: 600px) {
    .facts div { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .facts div + div { margin-top: 6px; }
}

/* skip link (keyboard users) */
.skip { position: absolute; left: 12px; top: -48px; z-index: 50; padding: 6px 12px; border-radius: 6px; background: var(--red); color: #fff; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- section separation ---------- */
.sec { margin-top: 88px; }
.hero + .sec { margin-top: 32px; }
.sec.block { margin-bottom: 0; }
.sec-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.sec-num {
    font-size: 12.5px; font-weight: 600; color: var(--red);
    padding: 2px 7px; border: 1px solid color-mix(in srgb, var(--red) 40%, var(--line)); border-radius: 6px;
    background: color-mix(in srgb, var(--red) 8%, transparent);
}
.sec-head h2 { font-size: 1.45rem; font-weight: 600; letter-spacing: -0.02em; color: var(--bright); }
.sec-rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.sec-more { font-size: 13.5px; color: var(--dim); text-decoration: none; white-space: nowrap; }
.sec-more:hover { color: var(--red); background: none; }
.sec .cmd { font-size: 13.5px; color: var(--dim); font-weight: 400; margin-bottom: 14px; }
.sec .cmd::before { font-weight: 500; }
.sec .window .cmd { color: var(--bright); font-weight: 500; font-size: 15px; }
.sec .window { margin-bottom: 0; }
#mail { margin-top: 28px; }
@media (max-width: 600px) {
    .sec { margin-top: 64px; }
    .sec-head h2 { font-size: 1.25rem; }
}

/* ==========================================================================
   Interactive shell
   ========================================================================== */
.sh { font-family: var(--mono); font-size: 14.5px; line-height: 1.65; }
.sh-out { max-height: 340px; overflow-y: auto; padding: 14px 18px 4px; scrollbar-width: thin; }
.sh-row { white-space: pre-wrap; word-break: break-word; margin-bottom: 6px; color: var(--text); }
.sh-row a { color: var(--bright); }
.sh-row a:hover { color: var(--bg); background: var(--red); text-decoration: none; }
.sh-echo { color: var(--bright); margin-top: 6px; }
.sh-user { color: var(--green); }
.sh-cwd { color: var(--blue); }
.sh-dim { color: var(--faint); }
.sh-err { color: var(--red); }
.sh-key { color: var(--red); }
.sh-dir { color: var(--blue) !important; }
.sh-line { display: flex; align-items: baseline; gap: 8px; padding: 6px 18px 14px; }
.sh-prompt { flex: none; color: var(--bright); white-space: nowrap; }
.sh-input {
    flex: 1; min-width: 0; font: inherit; color: var(--bright); background: transparent; border: 0; outline: none;
    caret-color: var(--red); padding: 0;
}
.sh-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 18px 14px; border-top: 1px dashed var(--line); }
.sh-chips button {
    font: 13px var(--mono); color: var(--dim); background: var(--card); border: 1px solid var(--line); border-radius: 6px;
    padding: 3px 10px; cursor: pointer; transition: color .15s, border-color .15s;
}
.sh-chips button:hover { color: var(--red); border-color: color-mix(in srgb, var(--red) 50%, var(--line)); }
.sh-inline-win { margin-bottom: 0; }
.sh-inline-win .sh-out { min-height: 120px; }

/* overlay */
.sh-overlay {
    position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-start; justify-content: center;
    padding: 12vh 16px 16px; background: rgba(0, 0, 0, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.sh-overlay.open { display: flex; animation: sh-in .14s ease; }
@keyframes sh-in { from { opacity: 0; } to { opacity: 1; } }
.sh-window { width: min(720px, 100%); margin: 0; background: var(--bg); box-shadow: 0 40px 80px -30px rgba(0,0,0,.7); }
.sh-window .sh-out { max-height: 50vh; min-height: 140px; }
.sh-close { margin-left: auto; font: 12px var(--mono); color: var(--faint); background: none; border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; cursor: pointer; }
.sh-close:hover { color: var(--bright); }
.sh-window .window-bar span { transform: none; margin-left: 10px; margin-right: 0; }
html.sh-lock { overflow: hidden; }

/* nav ⌘K button + hero hint */
.kbd-btn { border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; font-size: 12.5px; line-height: 1.6; }
.kbd-btn:hover { border-color: var(--faint); }
.hint { margin: 16px 0 0; font-size: 13px; color: var(--faint); }
kbd { font: 12px var(--mono); color: var(--dim); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--card); }
@media (hover: none) { .hint, .kbd-btn { display: none; } }
@media (max-width: 600px) {
    .sh { font-size: 13.5px; }
    .sh-out, .sh-line, .sh-chips { padding-left: 12px; padding-right: 12px; }
    .sh-prompt .sh-user { display: none; }
    .sh-overlay { padding-top: 8vh; }
}

/* ---------- reading polish ---------- */
.read-progress {
    position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60;
    background: var(--red); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none;
}
.prose h2, .prose h3 { position: relative; }
.anchor {
    margin-left: .5ch; font-weight: 400; font-size: .85em; color: var(--faint); text-decoration: none;
    opacity: 0; transition: opacity .15s, color .15s;
}
.prose h2:hover .anchor, .prose h3:hover .anchor, .anchor:focus-visible { opacity: 1; }
.anchor:hover { color: var(--red); background: none; }
.anchor.done { opacity: 1; color: var(--green); font-size: .7em; }
@media (hover: none) { .anchor { opacity: .5; } }

.link-card {
    position: absolute; z-index: 70; padding: 12px 14px; border-radius: 10px;
    background: var(--bg-soft); border: 1px solid var(--line); box-shadow: 0 20px 40px -20px rgba(0,0,0,.6);
    opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity .15s, transform .15s;
}
.link-card.on { opacity: 1; transform: none; pointer-events: auto; }
.lc-meta { font-size: 12px; color: var(--faint); }
.lc-title { margin: 4px 0 6px; font-weight: 600; color: var(--bright); line-height: 1.35; }
.lc-desc { font-family: var(--sans); font-size: 14px; line-height: 1.55; color: var(--dim); }
.sh-title { color: var(--bright); font-weight: 600; }

/* ---------- shell: fish-style ghost suggestion ---------- */
.sh-field { position: relative; flex: 1; min-width: 0; display: flex; }
.sh-ghost { position: absolute; inset: 0; pointer-events: none; white-space: pre; overflow: hidden; font: inherit; }
.sh-ghost-pre { color: transparent; }
.sh-ghost-suf { color: var(--faint); }
.sh-field .sh-input { position: relative; background: transparent; }

/* ---------- clickable $ commands ---------- */
.cmd-run { cursor: pointer; display: inline-flex; align-items: baseline; gap: 10px; border-radius: 6px; padding: 1px 8px; margin-left: -8px; transition: background .15s; }
.cmd-run::after { content: "↵ run"; font-size: 11.5px; color: var(--faint); opacity: 0; transition: opacity .15s; }
.cmd-run:hover, .cmd-run:focus-visible { background: var(--card-hover); }
.cmd-run:hover::after, .cmd-run:focus-visible::after { opacity: 1; }
.recent-head .cmd-run { margin-bottom: 14px; }

/* ---------- select-to-share ---------- */
.share-pop {
    position: absolute; z-index: 80; display: flex; gap: 2px; padding: 4px; border-radius: 9px;
    background: var(--bright); box-shadow: 0 12px 30px -10px rgba(0,0,0,.5);
    opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity .12s, transform .12s;
}
.share-pop.on { opacity: 1; transform: none; pointer-events: auto; }
.share-pop button {
    font: 12.5px var(--mono); color: var(--bg); background: none; border: 0; border-radius: 6px; padding: 5px 9px; cursor: pointer;
}
.share-pop button:hover { background: color-mix(in srgb, var(--bg) 14%, transparent); }
.share-pop::after { content: ""; position: absolute; left: var(--arrow, 50%); bottom: -5px; width: 10px; height: 10px; margin-left: -5px; background: var(--bright); transform: rotate(45deg); }
.share-pop.below::after { bottom: auto; top: -5px; }

/* ---------- neofetch + man ---------- */
.nf { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; margin: 4px 0 6px; }
.nf pre, .man { margin: 0; font: inherit; white-space: pre; line-height: 1.55; }
.nf-logo { color: var(--red); line-height: 1.25; padding-top: 2px; }
.nf-info { min-width: 0; white-space: pre-wrap; }
.nf-sw { display: inline-block; width: 22px; height: 12px; margin-right: 4px; border-radius: 2px; vertical-align: middle; }
.nf-r { background: var(--red); } .nf-b { background: var(--blue); } .nf-g { background: var(--green); } .nf-k { background: var(--faint); }
.man { white-space: pre-wrap; color: var(--text); }
.man-h { color: var(--bright); font-weight: 600; }
.man b { color: var(--red); font-weight: 500; }
.sh-inline-win .sh-out { max-height: 420px; }
@media (max-width: 560px) { .nf-logo { display: none; } }
.nf-logo { line-height: 1.05; letter-spacing: 0; padding-top: 6px; }
.nf-info { flex: 1 1 240px; }
.sh-colon { color: var(--text); }
@media (max-width: 600px) { .sh-prompt .sh-user { display: none; } }

/* neofetch v2: svg logo + grid info */
.sh-row:has(.nf) { white-space: normal; }
.nf { display: flex; gap: 30px; align-items: flex-start; }
svg.nf-logo { flex: none; color: var(--red); margin-top: 6px; }
.nf .nf-info { flex: 1 1 auto; min-width: 0; white-space: normal; }
.nf-head { margin-bottom: 2px; }
.nf-rule { width: 26ch; max-width: 100%; border-top: 1px solid var(--line); margin: 4px 0 6px; }
.nf-row { display: grid; grid-template-columns: 9ch minmax(0, 1fr); gap: 0 1ch; line-height: 1.6; }
.nf-swatches { margin-top: 10px; }
@media (max-width: 560px) { svg.nf-logo { display: none; } }

/* ==========================================================================
   Header v2: full-width bar outside the page column + mobile menu.
   Replaces the earlier negative-margin / 100vw approach.
   ========================================================================== */
.top {
    position: sticky; top: 0; z-index: 40;
    margin: 0; padding: 0; display: block;
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: blur(12px) saturate(160%); -webkit-backdrop-filter: blur(12px) saturate(160%);
    border-bottom: 1px solid var(--line);
}
.top-inner {
    max-width: 760px; margin: 0 auto; padding: 16px 20px 14px;
    display: flex; align-items: baseline; justify-content: space-between; gap: 8px 20px;
}
.page { padding-top: 44px; }
.path { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top nav { min-width: 0; flex-wrap: wrap; overflow: visible; mask-image: none; -webkit-mask-image: none; }
.menu-btn { display: none; font: 14px var(--mono); color: var(--dim); background: none; border: 0; padding: 0; cursor: pointer; flex: none; }
.menu-btn:hover, .menu-btn[aria-expanded="true"] { color: var(--bright); }
body { overflow-x: clip; }
@supports not (overflow: clip) { body { overflow-x: hidden; } }

@media (max-width: 900px) {
    .top-inner { flex-wrap: wrap; align-items: center; padding: 12px 16px; }
    .path { flex: 1 1 0; }
    .menu-btn { display: inline-block; }
    .top nav {
        display: none; flex-basis: calc(100% + 32px); max-width: none; flex-direction: column; align-items: stretch; gap: 0;
        margin: 8px -16px -12px; padding: 4px 16px 10px; border-top: 1px solid var(--line);
        background: var(--bg);
    }
    .top nav.open { display: flex; }
    .top nav a, .top nav .theme-btn {
        display: block; padding: 11px 0; margin: 0; border-radius: 0; font-size: 15px; text-align: left;
        border-bottom: 1px dashed var(--line); white-space: nowrap;
    }
    .top nav > :last-child { border-bottom: 0; }
    .top nav .nav-sep, .top nav .kbd-btn { display: none; }
    .page { padding-top: 32px; }
}

/* ==========================================================================
   Cursor experiments (static/js/cursor.js)
   ========================================================================== */
.cur { position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; will-change: transform; }

/* block: terminal caret that morphs */
html.cur-block, html.cur-block * { cursor: none !important; }
.cur-block-el {
    width: 10px; height: 18px; background: var(--red); border-radius: 1px; mix-blend-mode: normal;
    transition: transform .07s linear, width .18s ease, height .18s ease, opacity .2s, border-radius .18s;
}
.cur-block-el.is-link { border-radius: 2px; transition: transform .16s cubic-bezier(.2,.8,.2,1), width .16s ease, height .16s ease; }
.cur-block-el.is-text { background: var(--red); }
.cur-block-el.idle { animation: blink 1.1s steps(1) infinite; }
.cur-block-el.press { animation: cur-press .18s ease; }
@keyframes cur-press { 50% { filter: brightness(1.6); } }

/* ring: trailing circle around the native pointer */
.cur-ring-el {
    width: 32px; height: 32px; border-radius: 50%;
    border: 1.5px solid color-mix(in srgb, var(--bright) 55%, transparent);
    transition: border-color .2s, background-color .2s, opacity .2s;
}
.cur-ring-el.is-link { border-color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
.cur-ring-el.press { animation: ring-press .3s ease; }
@keyframes ring-press { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 45%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }

/* spotlight: grid + glow light up around the pointer (sits behind content) */
.cur-spot {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(260px circle at var(--mx, -999px) var(--my, -999px), color-mix(in srgb, var(--red) 13%, transparent), transparent 70%),
        radial-gradient(420px circle at var(--mx, -999px) var(--my, -999px), color-mix(in srgb, var(--blue) 8%, transparent), transparent 70%);
}
.cur-spot::after {
    content: ""; position: absolute; inset: 0;
    background-image:
        linear-gradient(color-mix(in srgb, var(--bright) 14%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--bright) 14%, transparent) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(200px circle at var(--mx, -999px) var(--my, -999px), #000, transparent 75%);
    mask-image: radial-gradient(200px circle at var(--mx, -999px) var(--my, -999px), #000, transparent 75%);
}
@media (prefers-reduced-motion: reduce) { .cur-block-el, .cur-ring-el { transition: none; } }

/* ==========================================================================
   Visitor preferences (set from the shell: accent / text / motion)
   ========================================================================== */
/* accent: swap which of the three colours leads. --red is the "primary accent" token. */
:root[data-accent="blue"] { --red: #7aa2ff; --select: rgba(122, 162, 255, .25); }
:root[data-accent="green"] { --red: #7ee787; --select: rgba(126, 231, 135, .22); }
:root[data-theme="light"][data-accent="blue"] { --red: #1d5cff; }
:root[data-theme="light"][data-accent="green"] { --red: #1a7f37; }
:root:not([data-theme="light"])[data-accent="green"] .act.primary, :root:not([data-theme="light"])[data-accent="green"] .author .mono-avatar { color: #0f0f0e; }

/* text size */
:root[data-text="small"] { font-size: 93.75%; }
:root[data-text="small"] body { font-size: 14.5px; }
:root[data-text="large"] { font-size: 112.5%; }
:root[data-text="large"] body { font-size: 17px; }
:root[data-text="large"] .sh { font-size: 16px; }

/* motion off */
:root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after {
    animation: none !important; transition: none !important; scroll-behavior: auto !important;
}
:root[data-motion="off"].js .reveal { opacity: 1; transform: none; }

.sh-on { color: var(--bright); }

/* header gets more room than the text column so the full nav fits on one line */
.top-inner { max-width: 1040px; }
@media (min-width: 901px) { .top nav { flex-wrap: nowrap; white-space: nowrap; } }

/* accent also drives the background glow (left = accent, right = a second palette colour) */
:root[data-accent="blue"]  { --glow-a: rgba(122, 162, 255, 0.18); --glow-b: rgba(126, 231, 135, 0.09); }
:root[data-accent="green"] { --glow-a: rgba(126, 231, 135, 0.13); --glow-b: rgba(122, 162, 255, 0.13); }
:root[data-theme="light"][data-accent="blue"]  { --glow-a: rgba(29, 92, 255, 0.10); --glow-b: rgba(26, 127, 55, 0.06); }
:root[data-theme="light"][data-accent="green"] { --glow-a: rgba(26, 127, 55, 0.10); --glow-b: rgba(29, 92, 255, 0.07); }

/* links that set their own colour need their own hover too, or the global
   inverted hover paints bright-on-bright and the text disappears */
.note-head h2 a:hover { color: var(--red); background: none; }
.facts a:hover { color: var(--red); background: none; text-decoration-color: var(--red); }
