/* imcharlesmendez.com — clean / minimal / ASCII-paper
 * Replaces all prior stylesheets. White paper, ink type, generous
 * whitespace, single accent. No CRT, no glows, no chrome.
 * --------------------------------------------------------------- */

:root {
  --bg:        #ffffff;
  --bg-elev:   #fafaf7;
  --bg-deep:   #f3f1eb;

  --ink:       #111111;
  --ink-dim:   #6b6b6b;
  --ink-faint: #b8b8b8;

  --accent:    #111111;
  --accent-dim: rgba(17, 17, 17, 0.06);
  --accent-2:  #111111;   /* no secondary color — pure monochrome */

  --line:        rgba(17, 17, 17, 0.10);
  --line-strong: rgba(17, 17, 17, 0.22);
  --selection:   rgba(17, 17, 17, 0.14);

  --pad-block: 56px;
  --col: 780px;
  --gap: 28px;
  --row: 16px;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-density="compact"] {
  --pad-block: 40px;
  --col: 720px;
  --gap: 20px;
  --row: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  font-feature-settings: "ss01", "ss02", "calt", "liga";
}

::selection { background: var(--selection); color: var(--ink); }

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color 140ms ease, opacity 140ms ease;
}
a:hover { border-bottom-color: var(--ink); }

button {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 6px 10px;
  cursor: pointer;
}
button:hover { border-color: var(--ink); }
button.ghost { border-color: transparent; padding: 4px 6px; }
button.ghost:hover { border-color: var(--line); background: transparent; }

/* Kill every decorative overlay from the legacy stack. */
.crt-scanlines, .crt-vignette, .mouse-trail, .paper-banner,
body::before, body::after {
  display: none !important;
  background: none !important;
}

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

.shell {
  position: relative;
  z-index: 2;
  max-width: var(--col);
  margin: 0 auto;
  padding: var(--pad-block) 28px 96px;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 56px;
  font-size: 12.5px;
  color: var(--ink-dim);
  border: none;
}
.topbar::after { display: none !important; }
.topbar .left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-dim);
}
.topbar .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink);
  box-shadow: none;
  animation: none;
}
.topbar .clock { display: none; }
.topbar .path { color: var(--ink); }
.topbar .path .sep { color: var(--ink-faint); }
.topbar nav {
  display: inline-flex;
  align-items: center;
  gap: 22px;
}
.topbar nav a {
  border-bottom: none;
  color: var(--ink-dim);
  position: relative;
  padding: 2px 0;
}
.topbar nav a::before, .topbar nav a::after { content: none !important; }
.topbar nav a:hover { color: var(--ink); }
.topbar nav a.active {
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
}

.kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  color: var(--ink-dim);
  background: transparent;
  letter-spacing: 0;
}

/* --- hero ------------------------------------------------------ */

.hero {
  padding: 8px 0 28px;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: start;
}
@media (min-width: 760px) {
  .hero-grid {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 56px;
    align-items: start;
  }
  .hero-side { order: -1; }
}

.hero-main { min-width: 0; }
.hero-side { min-width: 0; }

.hero .name {
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0 0 18px;
  display: block;
  text-wrap: balance;
  color: var(--ink);
}
.hero .name .accent-mark {
  color: var(--ink-faint);
  display: inline-block;
  margin-left: 2px;
  font-weight: 400;
  animation: caret 1.1s steps(2) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.hero .tagline {
  font-size: 15px;
  color: var(--ink);
  margin: 0 0 14px;
  max-width: 56ch;
  font-weight: 400;
  line-height: 1.55;
}
.hero .tagline em {
  color: var(--ink);
  font-style: normal;
  font-weight: 600;
  background: none;
}

.hero .sub {
  color: var(--ink-dim);
  font-size: 13px;
  margin: 0 0 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hero .sub .pip { display: none; }
.hero .sub .hl { color: var(--ink); font-weight: 500; }

.hero .links {
  display: flex;
  gap: 18px;
  margin-top: 6px;
  flex-wrap: wrap;
  font-size: 13.5px;
}
.hero .links a {
  border-bottom: 1px solid var(--line);
  padding: 2px 0;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  line-height: 1;
}
.hero .links a svg {
  flex-shrink: 0;
  vertical-align: middle;
  color: var(--ink-dim);
  transition: color 140ms ease;
}
.hero .links a:hover svg { color: var(--ink); }
.hero .links a::before { content: none !important; }
.hero .links a:hover { border-bottom-color: var(--ink); }

/* --- portrait -------------------------------------------------- */

.paper-portrait {
  position: relative;
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1 / 1;
}
.paper-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* The source is a JPEG with a near-white background; blend it onto
     our page so the halftone reads as ink on the same paper. */
  mix-blend-mode: multiply;
  filter: contrast(1.06);
}
.paper-portrait::after { content: none !important; }
.paper-portrait .pp-cap { display: none; }

@media (max-width: 759px) {
  .paper-portrait { max-width: 180px; margin: 0 0 8px; }
}

/* --- now strip ------------------------------------------------- */

.now {
  margin-top: 36px;
  padding: 12px 0;
  border: none;
  border-top: 1px solid var(--line);
  background: transparent !important;
  display: flex;
  gap: 14px;
  align-items: baseline;
  flex-wrap: wrap;
  font-size: 12.5px;
}
.now::before { display: none !important; }
.now .label {
  color: var(--ink-faint);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  min-width: 0;
}
.now .label::before { display: none !important; }
.now .body { color: var(--ink); font-size: 13px; flex: 1; min-width: 200px; }
.now .now-ts { color: var(--ink-faint); font-size: 11px; }

/* --- section eyebrow ------------------------------------------ */

.section {
  padding: 20px 0 12px;
}
.section:first-of-type { padding-top: 16px; }

.eyebrow {
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}
.eyebrow .hash { display: none; }
.eyebrow .num {
  color: var(--ink-faint);
  font-weight: 500;
  letter-spacing: 0.14em;
}
.eyebrow .num::before, .eyebrow .num::after { content: none !important; }
.eyebrow .lbl {
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}
.eyebrow .kind { color: var(--ink-faint); font-size: 10.5px; }
.eyebrow .rule {
  flex: 1;
  height: 1px;
  background: var(--line);
  margin: 0;
}

/* --- titles ---------------------------------------------------- */

h1.title, h2.title {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 12px;
  color: var(--ink);
}
h1.title { font-size: clamp(28px, 4vw, 38px); }
h2.title { font-size: clamp(20px, 2.6vw, 24px); }

.muted { color: var(--ink-dim); }
.faint { color: var(--ink-faint); }
.accent { color: var(--ink); }
.kw { color: var(--ink); font-weight: 600; }

/* --- lists ----------------------------------------------------- */

ul.bare { list-style: none; padding: 0; margin: 0; }
ul.bare > li { padding: var(--row) 0; border-top: 1px solid var(--line); }
ul.bare > li:first-child { border-top: none; padding-top: 0; }

/* blog list */
.post {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 18px;
  align-items: baseline;
  padding: var(--row) 0;
  border-top: 1px solid var(--line);
}
.post:first-of-type { border-top: none; padding-top: 0; }
.post .date {
  color: var(--ink-faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  opacity: 1;
}
.post .post-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.post .title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.post .ptitle {
  color: var(--ink);
  border-bottom: none;
  font-size: 14.5px;
  font-weight: 500;
}
a.ptitle:hover { color: var(--ink); border-bottom: 1px solid var(--ink); }
.post .pdesc {
  margin: 0;
  font-size: 13px;
  color: var(--ink-dim);
  max-width: 60ch;
  line-height: 1.55;
}
.post .ptags {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.tag {
  font-size: 10.5px;
  color: var(--ink-faint);
  padding: 1px 7px;
  border: 1px solid var(--line);
  cursor: pointer;
  user-select: none;
  letter-spacing: 0.02em;
  background: transparent;
}
.tag:hover { color: var(--ink); border-color: var(--ink); background: transparent; }
.tag.active { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.post .pread {
  color: var(--ink-faint);
  font-size: 11.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 580px) {
  .post { grid-template-columns: 1fr; gap: 4px; padding: 14px 0; }
}

/* --- resume entries -------------------------------------------- */

.entry {
  padding: 12px 0;
  cursor: pointer;
  position: relative;
  transition: padding 200ms ease;
  border-top: 1px solid var(--line);
}
.entry:first-of-type { border-top: none; }
.entry + .entry { border-top: 1px solid var(--line); }
.entry .head {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 16px;
  align-items: baseline;
}
.entry .when {
  color: var(--ink-faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  opacity: 1;
}
.entry .what { color: var(--ink); font-size: 14px; }
.entry .what .role { color: var(--ink); font-weight: 600; }
.entry .what .at { color: var(--ink-dim); }
.entry .toggle { color: var(--ink-faint); font-size: 12px; }
.entry[data-open="true"] .toggle { color: var(--ink); }
.entry .body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 360ms ease, opacity 240ms ease, margin-top 240ms ease;
  opacity: 0;
  color: var(--ink-dim);
  font-size: 13px;
  padding-left: 126px;
  margin-top: 0;
}
.entry[data-open="true"] .body {
  max-height: 800px;
  opacity: 1;
  margin-top: 12px;
}
.entry .body ul { margin: 0; padding-left: 18px; }
.entry .body li { padding: 3px 0; color: var(--ink-dim); }
.entry .body li::marker { color: var(--ink-faint); content: "— "; }

@media (max-width: 580px) {
  .entry .head { grid-template-columns: 1fr auto; }
  .entry .when { grid-column: 1 / -1; }
  .entry .body { padding-left: 0; }
}

/* --- resume (revamped) ---------------------------------------- */
/* Resume entries always render fully expanded — it's a printable
 * document, not a teaser. Date column on the left, role/company/
 * bullets on the right. Skills KVs match the same column rhythm. */

.r-dl {
  border-bottom: 1px solid var(--ink) !important;
  font-weight: 500;
}

.r-list { display: grid; gap: 0; margin-top: 4px; }
.r-entry {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 4px 24px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.r-list .r-entry:first-child { border-top: none; padding-top: 4px; }
.r-when {
  color: var(--ink-faint);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  padding-top: 3px;
}
.r-body { min-width: 0; }
.r-head {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.r-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: var(--ink-faint);
  align-self: center;
  flex-shrink: 0;
  transform: translateY(-1px);
}
.r-ic svg { display: block; }
.r-entry:hover .r-ic { color: var(--ink); }
.r-role {
  font-weight: 600;
  color: var(--ink);
  font-size: 14.5px;
  letter-spacing: -0.005em;
}
.r-at {
  color: var(--ink-dim);
  font-size: 13.5px;
  position: relative;
  padding-left: 12px;
}
.r-at::before {
  content: "·";
  color: var(--ink-faint);
  position: absolute;
  left: 3px;
  top: -1px;
}
.r-sum {
  margin: 0 0 10px;
  color: var(--ink-dim);
  font-size: 13px;
  max-width: 62ch;
  line-height: 1.6;
}
.r-bullets {
  margin: 0;
  padding: 0;
  list-style: none;
}
.r-bullets li {
  padding: 3px 0 3px 16px;
  color: var(--ink);
  font-size: 13px;
  max-width: 66ch;
  line-height: 1.65;
  position: relative;
}
.r-bullets li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--ink-faint);
}

/* skills key/value grid — matches the resume column rhythm */
.kvs {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 2px 24px;
  margin: 0;
}
.kvs dt {
  color: var(--ink-faint);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 0;
  font-weight: 600;
}
.kvs dd {
  margin: 0;
  padding: 8px 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
  border-top: 1px solid var(--line);
}
.kvs dt {
  border-top: 1px solid var(--line);
}
.kvs dt:first-of-type,
.kvs dd:first-of-type + dt,
.kvs > dt:first-child,
.kvs > dd:nth-of-type(1) {
  /* keep first row's top line so the section reads as a table */
}

@media (max-width: 580px) {
  .r-entry { grid-template-columns: 1fr; gap: 6px; }
  .r-when { padding-top: 0; }
  .kvs { grid-template-columns: 1fr; gap: 0; }
  .kvs dt { padding: 10px 0 0; border-top: 1px solid var(--line); }
  .kvs dd { padding: 4px 0 10px; border-top: none; }
  .kvs dt:first-child { border-top: none; }
}

/* --- drafts ---------------------------------------------------- */

.drafts { display: grid; gap: 0; margin-top: 4px; }
.draft {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 16px;
  align-items: baseline;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  opacity: 0.7;
}
.draft:first-of-type { border-top: none; padding-top: 0; }
.draft .d-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-faint);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.draft .d-state::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ink-faint);
  animation: none !important;
  box-shadow: none !important;
}
.draft .d-state[data-status="drafting"] { color: var(--ink); }
.draft .d-state[data-status="drafting"]::before { background: var(--ink); }
.draft .d-state[data-status="outlining"] { color: var(--ink-dim); }
.draft .d-state[data-status="outlining"]::before { background: var(--ink-dim); }
.draft .d-title { color: var(--ink); font-size: 14px; font-weight: 500; }
.draft .d-tags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.draft .d-blurb {
  color: var(--ink-dim);
  font-size: 12.5px;
  margin: 4px 0 0;
  max-width: 64ch;
  grid-column: 2 / 3;
}
.draft .d-eta {
  color: var(--ink-faint);
  font-size: 11px;
  white-space: nowrap;
}
.drafts-head { margin-top: 0; }
.drafts-note { color: var(--ink-faint); font-size: 11.5px; margin: 0 0 10px; }
@media (max-width: 580px) {
  .draft { grid-template-columns: 1fr; gap: 4px; }
  .draft .d-eta { display: none; }
  .draft .d-blurb { grid-column: 1; }
}

/* --- quotes wall ----------------------------------------------- */

.quotes-list { list-style: none; padding: 0; margin: 0; }
.quote {
  position: relative;
  padding: 26px 0 26px 30px;
  border-top: 1px solid var(--line);
}
.quote:first-child { border-top: none; padding-top: 6px; }
.quote .q-mark {
  position: absolute;
  left: -2px;
  top: 18px;
  font-size: 34px;
  line-height: 1;
  color: var(--ink-faint);
  font-family: Georgia, "Times New Roman", serif;
  user-select: none;
}
.quote:first-child .q-mark { top: 0; }
.quote .q-text {
  margin: 0;
  padding: 0;
  border: none;
  font-style: normal;
  font-size: clamp(15px, 1.9vw, 18px);
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--ink);
  max-width: 62ch;
}
.quote .q-attr {
  margin-top: 12px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
}
.quote .q-author {
  color: var(--ink-dim);
  font-weight: 600;
}
.quote .q-author::before {
  content: "— ";
  color: var(--ink-faint);
  font-weight: 400;
}
.quote .q-sep { color: var(--ink-faint); }
.quote .q-source { color: var(--ink-faint); font-style: italic; }
.quote .q-note {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--ink-faint);
}
.quote .q-note::before { content: "// "; }

/* --- work case cards ------------------------------------------ */

.work-list { display: grid; gap: 0; margin-top: 4px; }
.case {
  border: none;
  border-top: 1px solid var(--line);
  background: transparent !important;
  padding: 28px 0;
  position: relative;
}
.case::before { display: none !important; }
.case:first-child { border-top: none; padding-top: 8px; }
.case .head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  align-items: baseline;
  margin-bottom: 6px;
}
.case .name {
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.015em;
  margin: 0;
}
.case .name::before { content: none !important; }
.case .meta {
  font-size: 11px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  gap: 10px;
  align-items: center;
}
.case .meta .status {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10px;
  padding: 1px 7px;
  border: 1px solid var(--line);
  color: var(--ink-dim);
  font-weight: 500;
}
.case .meta .status[data-status="active"] {
  color: var(--ink);
  border-color: var(--ink);
}
.case .meta .status[data-status="research"] {
  color: var(--ink-dim);
}
.case .tagline { color: var(--ink-dim); font-size: 13px; margin: 0 0 14px; }
.case .summary {
  color: var(--ink);
  font-size: 13.5px;
  margin: 0 0 18px;
  max-width: 64ch;
  line-height: 1.65;
}
.case .grid {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 6px 18px;
  font-size: 13px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.case .grid dt {
  color: var(--ink-faint);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 0;
  font-weight: 500;
}
.case .grid dd {
  margin: 0;
  color: var(--ink-dim);
  padding: 6px 0;
  border-bottom: none;
}
.case .footer {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
@media (max-width: 580px) {
  .case .head { grid-template-columns: 1fr; }
  .case .grid { grid-template-columns: 1fr; gap: 2px; }
  .case .grid dt { padding-bottom: 0; }
}

/* --- prose (single post) -------------------------------------- */

.back-link {
  display: inline-block;
  font-size: 12px;
  color: var(--ink-dim);
  border-bottom: none;
  margin: 8px 0 28px;
}
.back-link:hover { color: var(--ink); }

.post-head {
  margin: 0 0 32px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.post-head .meta {
  font-size: 11.5px;
  color: var(--ink-faint);
  margin: 0 0 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.post-head h1 {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  text-wrap: balance;
  color: var(--ink);
}
.post-head .tags-row { display: inline-flex; gap: 6px; flex-wrap: wrap; }

.prose {
  font-family: var(--mono);
  font-size: 14.5px;
  color: var(--ink);
  line-height: 1.8;
  max-width: 64ch;
}
.prose p { margin: 0 0 20px; color: var(--ink); }
.prose p.lede { color: var(--ink); font-size: 16px; font-weight: 500; }
.prose h2 {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 17px;
  margin: 40px 0 14px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.prose h2::before { content: none !important; }
.prose h3 {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 15px;
  margin: 28px 0 10px;
  color: var(--ink);
}
.prose h3::before { content: none !important; }
.prose h4 {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13.5px;
  margin: 22px 0 8px;
  color: var(--ink-dim);
}
.prose h4::before { content: none !important; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 20px; color: var(--ink); }
.prose ul li::marker { color: var(--ink-faint); content: "— "; }
.prose ol { list-style: none; counter-reset: olc; padding-left: 0; }
.prose ol > li {
  counter-increment: olc;
  padding: 4px 0 4px 38px;
  position: relative;
}
.prose ol > li::before {
  content: counter(olc, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 4px;
  color: var(--ink-faint);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.prose li { padding: 2px 0; }
.prose a {
  color: var(--ink);
  border-bottom: 1px solid var(--line-strong);
}
.prose a:hover { border-bottom-color: var(--ink); }
.prose blockquote {
  margin: 0 0 20px;
  padding: 2px 0 2px 18px;
  border-left: 2px solid var(--ink);
  color: var(--ink-dim);
  font-style: normal;
}
.prose code {
  font-family: var(--mono);
  font-size: 13.5px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 0;
}
.prose pre {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  padding: 16px 18px;
  overflow-x: auto;
  line-height: 1.65;
  margin: 0 0 20px;
}
.prose pre code { background: transparent; border: none; padding: 0; }
.prose hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 28px 0;
}
.prose .comment { color: var(--ink-faint); }

.prose img,
.prose image-slot {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 28px auto;
  border: 1px solid var(--line);
  background: var(--bg-elev);
}
.prose figure { margin: 28px 0; }
.prose figure img, .prose figure image-slot { margin: 0; }
.prose figure figcaption {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--ink-faint);
  text-align: center;
  letter-spacing: 0.02em;
}

.post-cover {
  width: 100%;
  margin: 0 0 28px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  aspect-ratio: 16 / 7;
  overflow: hidden;
  display: block;
}
.post-cover image-slot, .post-cover img {
  width: 100%; height: 100%; display: block; object-fit: cover;
}

.post .thumb {
  width: 56px; height: 38px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  flex-shrink: 0;
  overflow: hidden;
}
.post .thumb image-slot, .post .thumb img {
  width: 100%; height: 100%; display: block; object-fit: cover;
}

.post-nav {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.post-nav a { display: block; border-bottom: none; padding: 8px 0; }
.post-nav .label {
  display: block;
  font-size: 10.5px;
  color: var(--ink-faint);
  margin-bottom: 4px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.post-nav .ttl { color: var(--ink); font-size: 13px; }
.post-nav a:hover .ttl { border-bottom: 1px solid var(--ink); }
.post-nav .next { text-align: right; }
.post-nav .empty { color: var(--ink-faint); font-size: 12px; padding: 8px 0; }
.post-nav .empty.next { text-align: right; }
@media (max-width: 480px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next, .post-nav .empty.next { text-align: left; }
}

/* --- highlight.js (monochrome) -------------------------------- */

.hljs { background: transparent; color: var(--ink); font-family: var(--mono); }
.hljs-comment, .hljs-quote { color: var(--ink-faint); font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal,
.hljs-section, .hljs-link, .hljs-built_in, .hljs-type,
.hljs-function .hljs-title, .hljs-title.function_,
.hljs-addition { color: var(--ink); font-weight: 600; }
.hljs-string, .hljs-attr, .hljs-symbol, .hljs-bullet, .hljs-meta-string {
  color: var(--ink-dim);
}
.hljs-number, .hljs-regexp, .hljs-deletion, .hljs-meta-keyword { color: var(--ink); }
.hljs-title, .hljs-name, .hljs-tag, .hljs-selector-id, .hljs-selector-class { color: var(--ink); }
.hljs-attribute, .hljs-variable, .hljs-template-variable { color: var(--ink-dim); }
.hljs-params { color: var(--ink); }
.hljs-meta, .hljs-doctag { color: var(--ink-faint); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

/* --- TOC ------------------------------------------------------- */

.post-toc {
  position: fixed;
  right: max(24px, calc((100vw - var(--col)) / 2 - 220px));
  top: 22vh;
  width: 180px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-faint);
  z-index: 50;
}
.post-toc .toc-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}
.post-toc ul { list-style: none; padding: 0; margin: 0; }
.post-toc li {
  padding: 4px 0 4px 12px;
  border-left: 1px solid var(--line);
  position: relative;
  color: var(--ink-faint);
  cursor: pointer;
}
.post-toc li.toc-h3 { padding-left: 24px; font-size: 10.5px; }
.post-toc li:hover { color: var(--ink-dim); }
.post-toc li.active {
  color: var(--ink);
  border-left-color: var(--ink);
}
.post-toc li.active::before { display: none; }
.post-toc a { border-bottom: none; color: inherit; display: block; }
.post-toc a:hover { color: var(--ink); }
.post-toc .progress-fill {
  position: absolute;
  left: 0; top: 0;
  width: 1px;
  background: var(--ink);
}
@media (max-width: 1180px) { .post-toc { display: none; } }

/* --- command palette ------------------------------------------ */

.cmdk-overlay {
  position: fixed; inset: 0;
  background: rgba(17, 17, 17, 0.20);
  backdrop-filter: blur(4px);
  z-index: 9500;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
}
.cmdk-overlay.open { display: flex; }
.cmdk {
  width: min(540px, 92vw);
  background: var(--bg);
  border: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  box-shadow: 0 20px 60px rgba(17, 17, 17, 0.12);
}
.cmdk .input-row {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.cmdk .input-row .p { color: var(--ink-faint); }
.cmdk input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--ink); font: inherit; caret-color: var(--ink);
}
.cmdk .results { max-height: 340px; overflow-y: auto; }
.cmdk .results .item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; cursor: pointer; color: var(--ink-dim);
  border-left: 2px solid transparent;
}
.cmdk .results .item .kind { color: var(--ink-faint); font-size: 11px; }
.cmdk .results .item.active {
  background: var(--bg-elev); color: var(--ink);
  border-left-color: var(--ink);
}
.cmdk .hint {
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 11px;
  display: flex; gap: 12px; flex-wrap: wrap;
}

/* --- cmdk hint toast (kept but quiet) ------------------------- */

.cmdk-hint {
  position: fixed;
  right: 22px; bottom: 22px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--ink-dim);
  z-index: 9400;
  display: inline-flex; align-items: center; gap: 10px;
  box-shadow: 0 8px 20px rgba(17, 17, 17, 0.06);
  animation: hint-in 360ms ease 800ms both;
  max-width: calc(100vw - 44px);
}
.cmdk-hint .x { border: none; background: transparent; color: var(--ink-faint); padding: 0 0 0 4px; font: inherit; cursor: pointer; }
.cmdk-hint .x:hover { color: var(--ink); }
@keyframes hint-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.cmdk-hint.out { animation: hint-out 220ms ease forwards; }
@keyframes hint-out { to { opacity: 0; transform: translateY(8px); } }
@media (max-width: 580px) { .cmdk-hint { display: none; } }

/* --- easter egg modal ----------------------------------------- */

.egg {
  position: fixed; inset: 0;
  background: rgba(17, 17, 17, 0.25);
  backdrop-filter: blur(4px);
  z-index: 9700;
  display: none; align-items: center; justify-content: center;
}
.egg.open { display: flex; }
.egg .box {
  width: min(520px, 90vw);
  background: var(--bg);
  border: 1px solid var(--ink);
  padding: 24px 26px;
  box-shadow: none;
}
.egg .box pre { margin: 0 0 14px; color: var(--ink); font-size: 11px; line-height: 1.1; white-space: pre; overflow-x: auto; }
.egg .box .body { color: var(--ink-dim); font-size: 13px; line-height: 1.7; }
.egg .box .body em { color: var(--ink); font-style: normal; }
.egg .box .close { margin-top: 14px; }

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

.footbar {
  margin-top: 80px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--ink-faint);
}
.footbar .right { display: inline-flex; gap: 16px; align-items: center; }

/* --- utilities ------------------------------------------------ */

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.divider { border: none; border-top: 1px solid var(--line); margin: var(--gap) 0; }
.small { font-size: 12px; }
.tiny  { font-size: 11px; }

/* j/k cursor row in blog index */
ul.bare > li.cursor { background: var(--bg-elev); position: relative; }
ul.bare > li.cursor::before {
  content: "";
  position: absolute;
  left: -8px; top: 0; bottom: 0;
  width: 2px; background: var(--ink); box-shadow: none;
}

/* image-slot styles inherit page palette */
image-slot {
  --is-bg:           var(--bg-elev);
  --is-border:       var(--line);
  --is-placeholder:  var(--ink-faint);
  --is-text:         var(--ink-dim);
}

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(17, 17, 17, 0.15); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: rgba(17, 17, 17, 0.25); }

/* statblock (hidden — kept as no-op safety net) */
.statblock { display: none !important; }

/* --- blog banner ---------------------------------------------- */

.blog-banner {
  position: relative;
  margin: 0 0 8px;
  overflow: hidden;
}
.blog-banner img {
  display: block;
  width: 100%;
  height: auto;
  /* Soft horizontal fade at the edges so the strip dissolves into the
     paper instead of terminating in a hard rectangle. */
  -webkit-mask-image:
    linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
          mask-image:
    linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
  /* Multiply pulls the dark ink through, brightness+contrast pushes the
     cream JPEG background up to the page's pure white so the image
     reads as ink on the same paper. Light opacity drop keeps it ambient. */
  mix-blend-mode: multiply;
  filter: brightness(1.12) contrast(1.08) grayscale(0.15);
  opacity: 0.72;
}

/* Tighter top of the blog page — hero hugs the banner, sections sit
   closer together than the home cadence. */
.blog-page .hero { padding: 0 0 12px; }
.blog-page .section { padding: 20px 0 12px; }
.blog-page .section:first-of-type { padding-top: 12px; }
.blog-page .filterbar { margin: 4px 0 12px; }
.blog-page .hero .name { margin-bottom: 10px; }
.blog-page .hero .tagline { margin-bottom: 8px; }
.blog-page .hero .sub { margin-bottom: 0; }

/* --- subtle entry animation ---------------------------------- */

.in-up {
  opacity: 0;
  transform: translateY(6px);
  animation: inUp 500ms ease forwards;
}
@keyframes inUp { to { opacity: 1; transform: translateY(0); } }
.d-1 { animation-delay: 40ms; }
.d-2 { animation-delay: 100ms; }
.d-3 { animation-delay: 160ms; }
.d-4 { animation-delay: 220ms; }
.d-5 { animation-delay: 280ms; }
.d-6 { animation-delay: 340ms; }
.d-7 { animation-delay: 400ms; }

main > *:not(.preview-card) {
  opacity: 0;
  transform: translateY(6px);
  animation: inUp 480ms ease forwards;
}
main > *:nth-child(1) { animation-delay: 0ms; }
main > *:nth-child(2) { animation-delay: 80ms; }
main > *:nth-child(3) { animation-delay: 160ms; }
main > *:nth-child(4) { animation-delay: 240ms; }
main > *:nth-child(5) { animation-delay: 320ms; }
main > *:nth-child(6) { animation-delay: 400ms; }

/* glitch off — no more text-shadow shudders */
.glitchable { animation: none !important; }

/* reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .in-up, main > * { opacity: 1 !important; transform: none !important; animation: none !important; }
  .hero .name .accent-mark { animation: none !important; opacity: 1 !important; }
  *, *::before, *::after { transition-duration: 0.001ms !important; }
}

/* --- mobile --------------------------------------------------- */

@media (max-width: 720px) {
  .shell { padding: 36px 20px 80px; }
  .topbar { padding-bottom: 40px; }
  .hero { padding: 0 0 20px; }
  .section { padding: 28px 0 var(--gap); }
}
@media (max-width: 480px) {
  .topbar { flex-wrap: wrap; gap: 16px; }
  .topbar .left { width: 100%; }
  .topbar nav { width: 100%; gap: 16px; flex-wrap: wrap; }
  .topbar nav a { font-size: 12px; }
  .hero .name { font-size: clamp(28px, 9vw, 40px); }
}

@supports (padding: max(0px)) {
  .shell { padding-bottom: max(80px, env(safe-area-inset-bottom)); }
  .cmdk-hint { bottom: max(22px, env(safe-area-inset-bottom)); }
}
