/* ===== Reset & base ===== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #000; }
body {
  font-family: 'IBM Plex Mono', monospace;
  color: #e8e6e0;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}
a { color: inherit; }
::selection { background: #ff2a1a; color: #000; }

:root {
  --red: #ff2a1a;
  --amber: #f5b524;
  --green: #33d17a;
  --border-green: #2f7a52;
  --bg-alt: #0c0c0e;
  --bg-alt-2: #0a0a0a;
  --line: #1e1e1e;
  --line-2: #262626;
  --text-dim: #7a7a72;
  --text-mid: #c7c7c0;
  --blue: #4b7bc4;
}

/* ===== Keyframes ===== */
@keyframes om-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes om-mq { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes om-spin { to { transform: rotate(360deg); } }
@keyframes om-flick { 0%, 100% { opacity: 1; } 7% { opacity: .86; } 9% { opacity: 1; } }

/* ===== Scanline overlay ===== */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  background: repeating-linear-gradient(180deg, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 2px, rgba(0, 0, 0, .20) 3px, rgba(0, 0, 0, 0) 4px);
  mix-blend-mode: multiply;
}

/* ===== Header / nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 22px;
  background: #000;
  border-bottom: 1px solid var(--border-green);
  flex-wrap: wrap;
}
.dots { display: flex; gap: 6px; align-items: center; }
.dot { width: 11px; height: 11px; display: inline-block; }
.dot-red { background: var(--red); }
.dot-amber { background: var(--amber); }
.dot-green { background: var(--green); }
.brand { text-decoration: none; color: #e8e6e0; font-weight: 700; font-size: 14px; letter-spacing: 1px; }
.sep { color: var(--border-green); font-size: 13px; }
.path { color: var(--green); font-size: 13px; }
.nav { margin-left: auto; display: flex; gap: 8px; align-items: center; font-size: 13px; flex-wrap: wrap; }
.nav-link { text-decoration: none; color: #e8e6e0; padding: 6px 12px; transition: color .15s; }
.nav-link.active { color: #000; background: var(--red); font-weight: 700; }

/* ===== Hover utilities (replace non-standard style-hover attributes) ===== */
.hv-red:hover { color: var(--red); }
.hv-red-border:hover { border-color: var(--red); color: var(--red); }
.hv-invert:hover { background: #000; color: var(--red); }
.hv-bg-alt:hover { background: var(--bg-alt); }
.hv-bg-row:hover { background: var(--bg-alt-2); }
.hv-amber:hover { color: var(--amber); }

/* ===== Hero / terminal boot sections ===== */
.hero {
  position: relative;
  overflow: hidden;
  padding: 40px 22px 56px;
  border-bottom: 2px solid var(--red);
  animation: om-flick 7s linear infinite;
}
.hero-narrow { padding: 44px 22px; }
.hero-inner { position: relative; z-index: 2; max-width: 1120px; margin: 0 auto; }
.hero-inner-narrow { max-width: 1000px; }
.hero-inner-article { max-width: 760px; }
.pcb-canvas { position: absolute; pointer-events: none; }
.boot-log { margin: 0 0 26px; font-size: 14px; line-height: 1.75; color: var(--green); }
.boot-ok { color: var(--green); }
.boot-warn { color: var(--amber); }
.prompt-line { color: var(--green); font-size: 15px; margin-bottom: 6px; }
.hero-title {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  line-height: .9;
  margin: 0 0 10px;
  letter-spacing: -3px;
  color: #e8e6e0;
}
.cursor-block {
  display: inline-block;
  width: .5em;
  animation: om-blink 1.1s step-end infinite;
}
.hero-subtitle { font-size: 16px; color: var(--green); margin-bottom: 2px; }
.hero-desc { font-size: 13px; color: var(--text-dim); max-width: 640px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* ===== Buttons ===== */
.btn {
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  padding: 12px 20px;
  display: inline-block;
}
.btn-fill { color: #000; background: var(--red); }
.btn-outline { color: #e8e6e0; border: 1px solid var(--border-green); }
.btn-fill-band { color: var(--red); background: #000; padding: 14px 26px; }
.btn-outline-band { color: #000; border: 2px solid #000; padding: 12px 26px; }

/* ===== Marquee band ===== */
.marquee-strip {
  overflow: hidden;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 15px;
  padding: 9px 0;
}
.marquee-strip.on-black { background: #000; color: var(--red); }
.marquee-track { display: inline-flex; white-space: nowrap; animation: om-mq 24s linear infinite; }
.marquee-track.rev { animation-direction: reverse; animation-duration: 32s; }

/* ===== Band section (hardware/software) ===== */
.band { background: var(--red); color: #000; overflow: hidden; }
.grid-band {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 22px;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 40px;
  align-items: center;
}
.band-title { font-family: 'Space Mono', monospace; font-weight: 700; line-height: 1.02; letter-spacing: -1px; margin: 0 0 20px; }
.band-desc { max-width: 520px; font-size: 15px; line-height: 1.8; margin: 0 0 28px; }
.band-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.band-die {
  justify-self: center;
  position: relative;
  filter: drop-shadow(0 20px 50px rgba(0, 0, 0, .5));
}
.band-die canvas {
  width: min(460px, 80vw);
  height: min(460px, 80vw);
  display: block;
  border-radius: 50%;
  background: #000;
  border: 4px solid #000;
  animation: om-spin 200s linear infinite;
}
.band-die-label {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  color: var(--amber);
  font-size: 11px;
  letter-spacing: 2px;
  padding: 4px 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* ===== Section headers ===== */
.section { max-width: 1120px; margin: 0 auto; padding: 56px 22px; }
.section-narrow { max-width: 1000px; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  flex-wrap: wrap;
}
.section-head-title { color: var(--red); font-family: 'Space Mono', monospace; font-weight: 700; font-size: 20px; }
.section-head-count { color: var(--text-dim); font-size: 12px; letter-spacing: 2px; }
.section-head-link { margin-left: auto; text-decoration: none; color: var(--green); font-size: 13px; }

/* ===== Pagination ===== */
.pagination { display: flex; align-items: center; gap: 16px; margin-top: 32px; }
.pagination-status { color: var(--text-dim); font-size: 12px; letter-spacing: 1px; }

/* ===== Selected work / projects grid ===== */
.grid-work, .grid-projects, .grid-prevnext {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: var(--line);
  border: 1px solid var(--line);
}
.card {
  text-decoration: none;
  color: #e8e6e0;
  background: #000;
  padding: 26px;
  display: block;
}
.card-eyebrow { font-size: 11px; letter-spacing: 2px; }
.card-title { font-family: 'Space Mono', monospace; font-weight: 700; font-size: 24px; margin: 8px 0 6px; }
.card-desc { font-size: 13px; line-height: 1.7; color: var(--text-mid); }

.project-card { background: #000; padding: 28px; display: flex; flex-direction: column; }
.project-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.project-eyebrow { font-size: 11px; letter-spacing: 2px; }
.project-index { color: var(--text-dim); font-size: 11px; }
.project-thumb {
  aspect-ratio: 16 / 8;
  background: var(--bg-alt);
  border: 1px solid var(--line-2);
  background-image: repeating-linear-gradient(45deg, #0b0b0d, #0b0b0d 10px, #121214 10px, #121214 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 1px;
  margin-bottom: 16px;
}
.project-title { font-family: 'Space Mono', monospace; font-weight: 700; font-size: 24px; margin-bottom: 8px; }
.project-desc { font-size: 13px; line-height: 1.7; color: var(--text-mid); margin: 0 0 16px; flex: 1; }
.project-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tag { border: 1px solid var(--line-2); color: var(--text-dim); font-size: 11px; padding: 3px 8px; }
a.tag { text-decoration: none; display: inline-block; transition: border-color .15s, color .15s; }
a.tag:hover { border-color: var(--red); color: var(--red); }
.project-link { text-decoration: none; color: var(--red); font-size: 13px; font-weight: 700; }

/* ===== Blog teaser rows (home) ===== */
.blog-teaser {
  text-decoration: none;
  color: #e8e6e0;
  display: flex;
  gap: 18px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px dashed var(--line);
  flex-wrap: wrap;
}
.teaser-date { color: var(--text-dim); font-size: 12px; min-width: 96px; }
.pill { font-size: 10px; font-weight: 700; padding: 2px 7px; letter-spacing: 1px; color: #000; }
.pill-outline { font-size: 11px; padding: 5px 11px; letter-spacing: 1px; border: 1px solid var(--line-2); background: transparent; }
a.pill, a.pill-outline { display: inline-block; text-decoration: none; transition: border-color .15s, color .15s; }
a.pill-outline:hover, a.pill-outline.is-active { border-color: var(--red); color: var(--red); }
.tag-filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.teaser-title { font-size: 16px; }

/* ===== Blog list rows (blog.html) ===== */
.post-row {
  text-decoration: none;
  color: #e8e6e0;
  display: block;
  border-bottom: 1px solid var(--line);
  padding: 26px 0;
}
.post-row-meta { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.post-row-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.post-row-title { display: block; text-decoration: none; font-family: 'Space Mono', monospace; font-weight: 700; font-size: clamp(22px, 3vw, 30px); margin-bottom: 8px; }
.post-row-title:hover { color: var(--red); }
.post-row-desc { font-size: 14px; line-height: 1.75; color: var(--text-mid); margin: 0; max-width: 760px; }

/* ===== Article (post.html) ===== */
.back-link { text-decoration: none; color: var(--green); font-size: 13px; }
.article-meta { display: flex; gap: 14px; align-items: center; margin: 20px 0 14px; flex-wrap: wrap; }
.article-title { font-family: 'Space Mono', monospace; font-weight: 700; line-height: .98; margin: 0; letter-spacing: -2px; }
.article-lede { font-size: 16px; line-height: 1.7; color: var(--text-mid); margin: 18px 0 0; }
.article-body { max-width: 760px; margin: 0 auto; padding: 48px 22px 20px; font-size: 16px; line-height: 1.85; color: #d8d6d0; }
.article-body p { margin: 0 0 22px; text-align: justify; text-justify: inter-word; }
.article-body h2 { font-family: 'Space Mono', monospace; font-weight: 700; font-size: 26px; color: var(--red); margin: 40px 0 16px; letter-spacing: -1px; }
.code-block {
  background: var(--bg-alt-2);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--red);
  padding: 18px 20px;
  margin: 0 0 26px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-mid);
  overflow-x: auto;
}
.code-comment { color: var(--text-dim); margin-bottom: 8px; }
.figure-placeholder {
  aspect-ratio: 16 / 9;
  background: var(--bg-alt);
  border: 1px solid var(--line-2);
  background-image: repeating-linear-gradient(45deg, #0b0b0d, #0b0b0d 12px, #121214 12px, #121214 24px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 1px;
  margin: 0 0 10px;
}
.figure-caption { color: var(--text-dim); font-size: 12px; text-align: center; margin: 0 0 30px; }
.post-figure { margin: 0 0 30px; }
.post-figure img, .post-figure video { display: block; width: 100%; border: 1px solid var(--line-2); }
.post-figure .figure-caption { margin: 10px 0 0; }
/* Scale-down variants: add one of these classes to <figure class="post-figure ..."> to shrink
   an oversized image instead of having it fill the full article width. Image stays centered. */
.post-figure.w-25 { max-width: 25%; margin-left: auto; margin-right: auto; }
.post-figure.w-50 { max-width: 50%; margin-left: auto; margin-right: auto; }
.post-figure.w-75 { max-width: 75%; margin-left: auto; margin-right: auto; }
.upload-status { display: block; font-size: 12px; color: var(--text-dim); margin-top: 6px; }
.upload-status.is-error { color: var(--red); }
.editor-toolbar { margin: 0 0 8px; }
.editor-toolbar .btn-small { font-size: 12px; padding: 6px 12px; }
#content.is-dragover { outline: 2px dashed var(--red); outline-offset: -2px; }
.cheatsheet { margin: 8px 0 24px; border: 1px solid var(--line-2); background: var(--bg-alt-2); }
.cheatsheet summary { cursor: pointer; padding: 12px 16px; font-family: 'Space Mono', monospace; font-size: 13px; color: var(--amber); letter-spacing: .5px; user-select: none; }
.cheatsheet[open] summary { border-bottom: 1px solid var(--line-2); }
.cheatsheet-body { padding: 14px 16px 4px; }
.cheatsheet-row { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: start; margin-bottom: 12px; }
.cheatsheet-label { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; padding-top: 8px; }
.cheatsheet-row code { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; line-height: 1.6; color: #d8d6d0; background: var(--bg-alt); border-left: 2px solid var(--red); padding: 6px 10px; white-space: pre-wrap; word-break: break-word; }
.pull-quote {
  border-left: 3px solid var(--amber);
  margin: 0 0 26px;
  padding: 6px 0 6px 20px;
  font-family: 'Space Mono', monospace;
  font-size: 20px;
  line-height: 1.5;
  color: #e8e6e0;
}
.article-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 30px 0 0; }
.prevnext-card { text-decoration: none; color: #e8e6e0; background: #000; padding: 22px; }
.prevnext-card.next { text-align: right; }
.prevnext-label { color: var(--text-dim); font-size: 12px; margin-bottom: 6px; }
.prevnext-title { font-family: 'Space Mono', monospace; font-weight: 700; font-size: 16px; }

/* ===== About page ===== */
.grid-bio { max-width: 1000px; margin: 0 auto; padding: 52px 22px; display: grid; grid-template-columns: .85fr 1.15fr; gap: 44px; align-items: start; }
.avatar-box {
  aspect-ratio: 1 / 1;
  max-width: 220px;
  margin: 0 auto;
  background: var(--bg-alt);
  border: 1px solid var(--line-2);
  background-image: repeating-linear-gradient(45deg, #0b0b0d, #0b0b0d 11px, #121214 11px, #121214 22px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 1px;
  padding: 16px;
  overflow: hidden;
}
.avatar-box img { width: 100%; height: 100%; object-fit: cover; }
.status-box { border: 1px solid var(--border-green); margin-top: 14px; padding: 14px; font-size: 12px; line-height: 1.9; color: var(--text-mid); }
.status-label { color: var(--red); letter-spacing: 2px; margin-bottom: 8px; }
.bio-lead { font-size: 16px; line-height: 1.9; color: #e8e6e0; margin: 0 0 20px; }
.bio-text { font-size: 15px; line-height: 1.9; color: var(--text-mid); margin: 0 0 20px; }
.specs-title { color: var(--red); font-family: 'Space Mono', monospace; font-weight: 700; font-size: 16px; margin-bottom: 14px; }
.specs-table { font-size: 13px; border: 1px solid var(--line-2); }
.specs-row { display: grid; grid-template-columns: 1.3fr 2fr; border-top: 1px solid var(--line-2); color: var(--text-mid); }
.specs-row:first-child { border-top: none; background: var(--bg-alt); color: var(--amber); font-weight: 600; letter-spacing: 1px; }
.specs-row.alt { background: #080808; }
.specs-cell { padding: 9px 13px; border-right: 1px solid var(--line-2); }
.specs-cell:last-child { border-right: none; }

.offclock-band { background: var(--red); color: #000; }
.offclock-inner { max-width: 1120px; margin: 0 auto; padding: 48px 22px; }
.offclock-title { font-family: 'Space Mono', monospace; font-weight: 700; margin: 0 0 6px; letter-spacing: -1px; }
.offclock-sub { font-size: 13px; margin-bottom: 26px; opacity: .75; letter-spacing: 1px; }
.grid-offclock { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; background: #000; border: 2px solid #000; }
.offclock-card { background: var(--red); padding: 22px; }
.offclock-card-title { font-family: 'Space Mono', monospace; font-weight: 700; font-size: 20px; }
.offclock-card-desc { font-size: 13px; line-height: 1.7; margin-top: 6px; }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--line); background: #000; }
.footer-bar { display: flex; align-items: center; gap: 20px; padding: 16px 22px; font-size: 12px; color: var(--border-green); flex-wrap: wrap; }
.badge-ready { color: #000; background: var(--green); padding: 2px 8px; font-weight: 700; }
.footer-email { text-decoration: none; color: var(--border-green); }
.eof { margin-left: auto; }
.cursor-eof {
  display: inline-block;
  width: 8px;
  height: 13px;
  background: var(--green);
  margin-left: 6px;
  vertical-align: middle;
  animation: om-blink 1.1s step-end infinite;
}

/* ===== Admin ===== */
.admin-content { max-width: 900px; margin: 0 auto; padding: 40px 22px 64px; }
.admin-error { color: var(--red); font-size: 13px; margin-bottom: 18px; }
.admin-actions { margin-bottom: 24px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table th { color: var(--text-dim); letter-spacing: 1px; font-weight: 600; }
.admin-row-actions { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.badge-published { color: #000; background: var(--green); padding: 2px 8px; font-size: 11px; font-weight: 700; }
.badge-draft { color: var(--text-dim); border: 1px solid var(--line-2); padding: 2px 8px; font-size: 11px; }
.admin-form { max-width: 640px; }
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 12px; color: var(--text-dim); letter-spacing: 1px; margin-bottom: 6px; }
.field input[type="text"], .field input[type="password"], .field textarea, .field select {
  width: 100%;
  background: var(--bg-alt-2);
  border: 1px solid var(--line-2);
  color: #e8e6e0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  padding: 10px 12px;
}
.field textarea { min-height: 260px; resize: vertical; }
.field-checkbox { display: flex; align-items: center; gap: 8px; }
.field-checkbox label { margin: 0; }
.btn-link { background: none; border: none; padding: 0; text-decoration: underline; cursor: pointer; font-family: inherit; font-size: inherit; color: inherit; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; background: var(--line); border: 1px solid var(--line); margin-bottom: 10px; }
.stat-card { background: #000; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.stat-value { font-family: 'Space Mono', monospace; font-weight: 700; font-size: 32px; }
.stat-label { font-size: 11px; letter-spacing: 1px; color: var(--text-dim); }
.hitbar-chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.hitbar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.hitbar-fill { width: 100%; min-height: 2px; background: var(--red); }
.hitbar-label { font-size: 9px; color: var(--text-dim); writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.ip-pill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ip-pill { font-size: 12px; border: 1px solid var(--line-2); color: var(--text-mid); padding: 4px 10px; }

/* ===== Responsive ===== */
@media (max-width: 760px) {
  .site-header { padding: 10px 16px; gap: 8px; }
  .nav { gap: 4px; }
  .nav-link { padding: 6px 8px; }

  .hero, .hero-narrow { padding: 28px 16px 36px; }
  .section, .grid-bio, .article-body, section.hero-inner { padding-left: 16px; padding-right: 16px; }
  .section { padding: 36px 16px; }

  .grid-band { grid-template-columns: 1fr; padding: 36px 16px; gap: 28px; }
  .band-die { order: -1; }

  .grid-work, .grid-projects, .grid-prevnext { grid-template-columns: 1fr; }
  .grid-bio { grid-template-columns: 1fr; padding: 36px 16px; }
  .grid-offclock { grid-template-columns: repeat(2, 1fr); }

  .prevnext-card.next { text-align: left; }
}

@media (max-width: 480px) {
  .grid-offclock { grid-template-columns: 1fr; }
}

/* Honeypot link: never visible/reachable to real users, only present for
   scrapers that parse raw HTML without rendering CSS. */
.trap-link {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
