/* ===========================================================================
   0x4p0ll0 — security writeups
   Chirpy-style layout (fixed sidebar / feed / right panel) on the site's own
   palette: IBM Plex Sans + Mono, light default with a real dark mode.
   =========================================================================== */

:root {
  --bg: #fcfcfa;
  --surface: #ffffff;
  --surface-2: #f3f4f1;
  --surface-3: #ecedea;
  --text: #16181c;
  --text-muted: #5b6169;
  --border: #e4e5e0;
  --border-strong: #d3d5cd;
  --accent: #1f8a53;
  --accent-hover: #176b40;
  --code-bg: #f5f7f4;

  --diff-easy: #1f8a53;
  --diff-medium: #b3781c;
  --diff-hard: #c1443b;
  --diff-insane: #7c46c9;

  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --sidebar-w: 17rem;
  --panel-w: 15.5rem;
  --content-max: 64rem;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 18, 20, 0.04), 0 8px 24px -12px rgba(16, 18, 20, 0.12);
}

:root[data-theme="dark"] {
  --bg: #101312;
  --surface: #171b19;
  --surface-2: #1e2320;
  --surface-3: #252b27;
  --text: #e7e9e6;
  --text-muted: #99a29b;
  --border: #272d2a;
  --border-strong: #333b37;
  --accent: #5cc98d;
  --accent-hover: #7ad6a3;
  --code-bg: #14100e;

  --diff-easy: #5cc98d;
  --diff-medium: #d7a24a;
  --diff-hard: #e0685f;
  --diff-insane: #b389e8;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 30px -14px rgba(0, 0, 0, 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101312;
    --surface: #171b19;
    --surface-2: #1e2320;
    --surface-3: #252b27;
    --text: #e7e9e6;
    --text-muted: #99a29b;
    --border: #272d2a;
    --border-strong: #333b37;
    --accent: #5cc98d;
    --accent-hover: #7ad6a3;
    --code-bg: #14100e;
    --diff-easy: #5cc98d;
    --diff-medium: #d7a24a;
    --diff-hard: #e0685f;
    --diff-insane: #b389e8;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 30px -14px rgba(0, 0, 0, 0.55);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

/* --- custom cursor: "handssss" skeleton hands --------------------------
   Source: rw-designer.com/cursor-set/handssss by "ro" (public domain).
   The original .ani files are animated; browsers can't use .ani, so the
   10 frames are exported to PNG and stepped through by animating the
   `cursor` property (Chrome/Firefox). `cursor` inherits, so `html`
   cascades everywhere; clickable elements use the second hand set. */
@keyframes cur-arrow {
  0%,100% { cursor: url("hand/arrow-0.png") 5 6, auto; }
  10% { cursor: url("hand/arrow-1.png") 5 6, auto; }
  20% { cursor: url("hand/arrow-2.png") 5 6, auto; }
  30% { cursor: url("hand/arrow-3.png") 5 6, auto; }
  40% { cursor: url("hand/arrow-4.png") 5 6, auto; }
  50% { cursor: url("hand/arrow-5.png") 5 6, auto; }
  60% { cursor: url("hand/arrow-6.png") 5 6, auto; }
  70% { cursor: url("hand/arrow-7.png") 5 6, auto; }
  80% { cursor: url("hand/arrow-8.png") 5 6, auto; }
  90% { cursor: url("hand/arrow-9.png") 5 6, auto; }
}
@keyframes cur-hand {
  0%,100% { cursor: url("hand/hand-0.png") 5 6, pointer; }
  10% { cursor: url("hand/hand-1.png") 5 6, pointer; }
  20% { cursor: url("hand/hand-2.png") 5 6, pointer; }
  30% { cursor: url("hand/hand-3.png") 5 6, pointer; }
  40% { cursor: url("hand/hand-4.png") 5 6, pointer; }
  50% { cursor: url("hand/hand-5.png") 5 6, pointer; }
  60% { cursor: url("hand/hand-6.png") 5 6, pointer; }
  70% { cursor: url("hand/hand-7.png") 5 6, pointer; }
  80% { cursor: url("hand/hand-8.png") 5 6, pointer; }
  90% { cursor: url("hand/hand-9.png") 5 6, pointer; }
}

html {
  cursor: url("hand/arrow-0.png") 5 6, auto;
  animation: cur-arrow 1s steps(1) infinite;
}
a, button, summary, label[for], [role="button"], .theme-toggle,
input[type="checkbox"], input[type="radio"], input[type="submit"], input[type="button"] {
  cursor: url("hand/hand-0.png") 5 6, pointer;
  animation: cur-hand 1s steps(1) infinite;
}
input[type="text"], input[type="search"], input[type="email"],
input[type="url"], textarea {
  cursor: text;
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  html,
  a, button, summary, label[for], [role="button"], .theme-toggle,
  input[type="checkbox"], input[type="radio"], input[type="submit"], input[type="button"] {
    animation: none;
  }
}
@media (hover: none) {
  html { cursor: auto; animation: none; }
  a, button, summary, label[for], [role="button"], .theme-toggle { cursor: pointer; animation: none; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; }
code, pre, kbd, samp { font-family: var(--font-mono); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--text);
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0 0 8px 0;
  z-index: 40;
}
.skip-link:focus { left: 0; }

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  padding: 2.25rem 1.5rem 1.5rem;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 30;
}

.side-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  color: var(--text);
  text-align: center;
}
.side-brand:hover { color: var(--text); }
.side-brand img {
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-strong);
}
.side-name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--text-muted);
}

.side-tagline {
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.55;
  text-align: center;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 2.75rem;
}
.side-nav a {
  display: flex;
  align-items: center;
  gap: 1.05rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.side-nav a svg { flex: 0 0 auto; }
.side-nav a:hover { color: var(--text); background: var(--surface-2); }
.side-nav a.is-active { color: var(--text); background: var(--surface-3); }

.side-foot {
  margin-top: auto;
  padding-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 0.5rem;
}
.side-socials { display: contents; }
.side-foot a,
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}
.side-foot a svg,
.theme-toggle svg { width: 20px; height: 20px; }
.side-foot a:hover,
.theme-toggle:hover { color: var(--accent); background: var(--surface-2); }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

/* --- shell / topbar -------------------------------------------------------- */

.shell {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 2rem;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { opacity: 0.5; }
.breadcrumb [aria-current] {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 24rem;
}

.search {
  position: relative;
  flex: 0 0 auto;
  width: min(20rem, 40vw);
}
.search-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
#search-input {
  width: 100%;
  padding: 0.5rem 0.9rem 0.5rem 2.4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
}
#search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}
.search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: min(26rem, 80vw);
  max-height: 70vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.4rem;
  z-index: 25;
}
.search-hit {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  color: var(--text);
}
.search-hit:hover { background: var(--surface-2); color: var(--text); }
.search-hit-title { display: block; font-weight: 600; font-size: 0.92rem; }
.search-hit-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.search-empty {
  margin: 0;
  padding: 0.8rem 0.7rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

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

.layout {
  flex: 1;
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding: 2.5rem 2rem 3.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--panel-w);
  gap: 3rem;
  align-items: start;
}
.content { min-width: 0; }

.panel {
  position: sticky;
  top: 5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  font-size: 0.9rem;
}
.panel-block { }
.panel-title {
  margin: 0 0 0.9rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.panel-list { list-style: none; margin: 0; padding: 0; }
.panel-list li { margin: 0.55rem 0; line-height: 1.4; }
.panel-list a { color: var(--text); }
.panel-list a:hover { color: var(--accent); }
.panel-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 2rem 2.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
}
.site-footer p { margin: 0.15rem 0; }

/* --- mobile nav toggle -------------------------------------------------- */

.nav-toggle {
  display: none;
  position: fixed;
  top: 0.7rem;
  left: 0.7rem;
  z-index: 45;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 29;
  background: rgba(0, 0, 0, 0.45);
}

/* --- home feed --------------------------------------------------------- */

.feed { display: flex; flex-direction: column; gap: 1.25rem; }

.feed-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.feed-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}
.feed-card-link {
  display: flex;
  gap: 1.5rem;
  padding: 1.4rem 1.5rem;
  color: var(--text);
}
.feed-card-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.feed-card-title {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.3;
}
.feed-card:hover .feed-card-title { color: var(--accent-hover); }
.feed-card-summary {
  margin: 0 0 0.9rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.feed-card-meta {
  margin: auto 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}
.meta-item { display: inline-flex; align-items: center; gap: 0.4rem; }
.meta-item svg { opacity: 0.7; }
.feed-card-tags { margin: 0.85rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }

.feed-card-thumb {
  flex: 0 0 13rem;
  align-self: center;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.feed-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* --- shared bits: tags, chips ---------------------------------------- */

.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0.12rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  white-space: nowrap;
}
a.tag:hover { color: var(--accent); border-color: var(--accent); }
.tag::before { content: "#"; opacity: 0.55; }

.chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: lowercase;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  border: 1px solid currentColor;
}
.chip-easy { color: var(--diff-easy); }
.chip-medium { color: var(--diff-medium); }
.chip-hard { color: var(--diff-hard); }
.chip-insane { color: var(--diff-insane); }

.page-title {
  margin: 0 0 2rem;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.empty { color: var(--text-muted); padding: 1rem 0; }

/* --- archives timeline ---------------------------------------------------- */

.archive {
  --gap: 4.25rem;          /* width of the date gutter, up to the line */
  position: relative;
  margin-top: 0.5rem;
}
.archive::before {         /* the continuous vertical line */
  content: "";
  position: absolute;
  left: var(--gap);
  top: 0.7rem;
  bottom: 0.7rem;
  width: 2px;
  transform: translateX(-1px);
  background: var(--border-strong);
}

.archive-year {
  position: relative;
  margin: 2.4rem 0 0.9rem;
  padding-left: calc(var(--gap) + 1.5rem);
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-muted);
}
.archive-year:first-child { margin-top: 0; }
.archive-year::before {    /* hollow ring on the line */
  content: "";
  position: absolute;
  left: var(--gap);
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border-strong);
}

.archive-row {
  position: relative;
  display: block;
  margin-left: calc(var(--gap) - 1rem);
  padding: 0.72rem 0.75rem 0.72rem 2.5rem;
  border-radius: 8px;
  color: var(--accent);
  line-height: 1.4;
}
.archive-row:hover { background: var(--surface-2); color: var(--accent-hover); }
.archive-row::before {     /* filled dot on the line */
  content: "";
  position: absolute;
  left: 1rem;
  top: 50%;
  width: 9px;
  height: 9px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--border-strong);
}
.archive-row:hover::before { background: var(--accent); }

.archive-date {
  position: absolute;
  left: calc(1rem - var(--gap));
  top: 50%;
  transform: translateY(-50%);
  width: calc(var(--gap) - 0.9rem);
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.archive-date b { color: var(--text); font-weight: 600; }

.archive-title { font-size: 0.98rem; font-weight: 500; }

/* --- categories --------------------------------------------------------- */

.cat-grid { display: flex; flex-direction: column; gap: 1.5rem; }
.cat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.25rem 1.5rem 1.5rem;
}
.cat-card-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.cat-card-head svg { color: var(--accent); }
.cat-card-head h2 { margin: 0; font-size: 1.1rem; font-weight: 600; }
.cat-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
}
.cat-list { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.cat-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--border);
}
.cat-list li:last-child { border-bottom: 0; }
.cat-list a { font-weight: 500; }
.cat-list time { flex: 0 0 auto; font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-muted); }

/* --- tags page --------------------------------------------------------- */

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.tag-cloud-item {
  font-family: var(--font-mono);
  font-size: calc(0.8rem + var(--w, 0) * 0.55rem);
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.25rem 0.7rem;
}
.tag-cloud-item:hover { color: var(--accent); border-color: var(--accent); }
.tag-cloud-item span { opacity: 0.6; }

.tag-section { margin-bottom: 2.25rem; scroll-margin-top: 5rem; }
.tag-section-head {
  margin: 0 0 0.5rem;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
}
.tag-section-head span { color: var(--text-muted); font-size: 0.85rem; }

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

.post-page .layout { max-width: 62rem; }

.back-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.back-link:hover { color: var(--accent); }
.back-link-end { margin-top: 3rem; }

.post-header {
  margin: 0 0 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.post-header h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.021em;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.5; }
.post-header .post-tags { margin-top: 0.9rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }

.post-hero {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}

/* TOC in the right panel */
.post-toc .toc, .post-toc .toc ul { margin: 0; padding: 0; list-style: none; }
.post-toc .toc li { margin: 0; }
.post-toc .toc a {
  display: block;
  padding: 0.28rem 0 0.28rem 0.85rem;
  border-left: 2px solid var(--border);
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.4;
}
.post-toc .toc a:hover { color: var(--text); border-left-color: var(--border-strong); }
.post-toc .toc a.is-active { color: var(--accent); border-left-color: var(--accent); }
.post-toc .toc ul ul a { padding-left: 1.7rem; }

.prose h2, .prose h3, .prose h4 { scroll-margin-top: 5.5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* --- prose (rendered markdown) --------------------------------------- */

.prose { font-size: 1rem; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 1.15rem 0; }
.prose li { margin: 0.35rem 0; }
.prose li > ul, .prose li > ol { margin: 0.35rem 0; }

.prose h2 {
  margin: 2.6rem 0 1rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--border);
  font-size: 1.38rem;
  font-weight: 600;
  letter-spacing: -0.014em;
}
.prose h3 { margin: 2rem 0 0.75rem; font-size: 1.12rem; font-weight: 600; }
.prose h4 { margin: 1.6rem 0 0.6rem; font-size: 1rem; font-weight: 600; color: var(--text-muted); }

.prose a {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-underline-offset: 0.15em;
}
.prose a:hover { text-decoration-color: currentColor; }
.prose strong { font-weight: 600; }

.prose img { display: block; margin: 1.6rem 0; border-radius: 10px; border: 1px solid var(--border); }
.prose hr { margin: 2.5rem 0; border: 0; border-top: 1px solid var(--border); }

.prose .toc {
  margin: 1.75rem 0 2.25rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 0.92rem;
}
.prose .toc > ul { margin: 0; }
.prose .toc ul { list-style: none; padding-left: 0; }
.prose .toc li { margin: 0.3rem 0; }
.prose .toc ul ul { padding-left: 1rem; margin: 0.3rem 0; }
.prose .toc a { color: var(--text-muted); text-decoration: none; }
.prose .toc a:hover { color: var(--accent); }

.prose blockquote {
  margin: 1.6rem 0;
  padding: 0.4rem 0 0.4rem 1.1rem;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
}
.prose blockquote p { margin: 0.5rem 0; }

.prose :not(pre) > code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.1em 0.38em;
  font-size: 0.88em;
  word-break: break-word;
}

.prose pre, .prose .highlight pre, .prose .codehilite pre {
  margin: 1.5rem 0;
  padding: 1rem 1.1rem;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.prose .highlight, .prose .codehilite { margin: 1.5rem 0; }
.prose .highlight pre, .prose .codehilite pre { margin: 0; }

.prose table {
  width: 100%;
  margin: 1.6rem 0;
  border-collapse: collapse;
  font-size: 0.92rem;
  display: block;
  overflow-x: auto;
}
.prose th, .prose td { border: 1px solid var(--border); padding: 0.5rem 0.75rem; text-align: left; }
.prose th { background: var(--surface-2); font-weight: 600; }

/* --- about ----------------------------------------------------------- */

.about-header { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 2rem; }
.about-avatar { border-radius: 12px; border: 1px solid var(--border); }
.about-header h1 { margin: 0 0 0.25rem; font-size: 1.7rem; font-weight: 600; letter-spacing: -0.02em; }
.about-role { margin: 0; color: var(--text-muted); font-family: var(--font-mono); font-size: 0.85rem; }
.about-connect {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.about-connect a { margin-right: 1.5rem; }

/* --- 404 ----------------------------------------------------------- */

.notfound { text-align: center; padding-block: 3rem; }
.notfound-code { margin: 0; font-family: var(--font-mono); font-size: 3.5rem; font-weight: 600; color: var(--accent); }
.notfound h1 { margin: 0.5rem 0 0.75rem; font-size: 1.6rem; font-weight: 600; }
.notfound p { color: var(--text-muted); }

.button {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
}
.button:hover { background: var(--accent-hover); color: #fff; }
:root[data-theme="dark"] .button { color: #0f1211; }

/* --- focus / motion ------------------------------------------------- */

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

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

@media (max-width: 75rem) {
  :root { --content-max: 46rem; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .panel { display: none; }
}

@media (max-width: 54rem) {
  .nav-toggle { display: grid; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: none; }
  .shell { margin-left: 0; }
  .topbar { padding-left: 3.75rem; }
}

@media (min-width: 54.01rem) {
  .sidebar-backdrop { display: none !important; }
}

@media (max-width: 40rem) {
  .topbar { flex-wrap: wrap; }
  .search { width: 100%; order: 3; }
  .layout { padding: 1.75rem 1.15rem 2.5rem; }
  .feed-card-link { flex-direction: column-reverse; gap: 1rem; }
  .feed-card-thumb { flex-basis: auto; width: 100%; align-self: stretch; }
  .about-header { flex-direction: column; align-items: flex-start; }
  .archive { --gap: 3.5rem; }
  .archive-year { font-size: 1.2rem; }
}
