@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=JetBrains+Mono:ital,wght@0,400;0,500;1,400&family=VT323&display=swap');

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SHARED TOKENS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
:root {
  --paper-white:      #f4f0e8;
  --paper-green:      #d6ecd6;
  --paper-green-dark: #c2dfc2;
  --hole-color:       #e0dbd0;
  --ink:              #1a1a1a;
  --ink-faded:        #3a3a3a;
  --ink-light:        #666;
  --perforation:      #ccc8bc;
  --stripe-gap:       28px;
  --font-mono:        'Share Tech Mono', monospace;
  --font-type:        'JetBrains Mono', monospace;
  --font-pixel:       'VT323', monospace;
  --page-max:         760px;

  /* printer shell palette */
  --px-beige:        #d4c9a8;
  --px-beige-light:  #e8dfc0;
  --px-beige-mid:    #c8bc9a;
  --px-beige-dark:   #a89870;
  --px-beige-shadow: #b8a878;
  --px-ink:          #4a3f28;
  --px-ink-mid:      #7a6a48;
  --px-chassis:      #1a1a1a;
  --px-interior:     #2a2018;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   BASE BODY (post pages)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
body {
  background: #2a2a2a;
  font-family: var(--font-mono);
  min-height: 100vh;
  padding: 40px 20px;
}

/* index page overrides body bg to match printer surround */
body.index-page {
  background: #1a1a1a;
  padding: 32px 16px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SHARED NAV
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.site-nav {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
  display: flex;
  gap: 24px;
}
.site-nav a { color: #aaa; text-decoration: none; }
.site-nav a:hover { color: #fff; }

/* index nav full-width */
body.index-page .site-nav {
  width: 100%;
  max-width: 720px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   POST PAGE — dot-matrix paper layout
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.printer-wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  position: relative;
}

.paper {
  position: relative;
  background: var(--paper-white);
  padding: 0 52px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5), 0 1px 4px rgba(0,0,0,0.3);
}

.paper::before {
  content: '';
  position: absolute;
  top: 0; left: 52px; right: 52px; bottom: 0;
  background: repeating-linear-gradient(
    to bottom,
    var(--paper-white) 0px,
    var(--paper-white) var(--stripe-gap),
    var(--paper-green) var(--stripe-gap),
    var(--paper-green) calc(var(--stripe-gap) * 2)
  );
  pointer-events: none;
  z-index: 0;
}

.holes-left,
.holes-right {
  position: absolute;
  top: 0; bottom: 0;
  width: 52px;
  background: var(--paper-green-dark);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0;
}
.holes-left  { left: 0;  border-right: 1px solid var(--perforation); }
.holes-right { right: 0; border-left:  1px solid var(--perforation); }

.hole {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2a2a2a;
  margin-bottom: 18px;
  flex-shrink: 0;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
}

.tear-top {
  height: 16px;
  background: var(--paper-white);
  border-bottom: 2px dashed var(--perforation);
  position: relative;
  z-index: 3;
  margin: 0 52px;
}

.content {
  position: relative;
  z-index: 1;
  padding: 32px 32px 48px;
}

.printer-header {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-light);
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--perforation);
  padding-bottom: 10px;
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  text-transform: uppercase;
}

.category {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 12px;
}

h1.post-title {
  font-family: var(--font-type);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 16px;
  letter-spacing: 0;
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ink);
}
.post-meta span { margin-right: 24px; }

.post-body {
  font-family: var(--font-type);
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink-faded);
}
.post-body p { margin-bottom: 1.4em; }

.post-body h2 {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink);
  margin: 2.2em 0 0.8em;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--perforation);
}

.post-body blockquote {
  border-left: 3px solid var(--ink);
  margin: 1.6em 0;
  padding: 4px 0 4px 20px;
  font-size: 13px;
  color: var(--ink);
}

.post-body ul {
  margin: 0 0 1.4em 1.2em;
}
.post-body ul li {
  margin-bottom: 0.4em;
}

.printer-footer {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-light);
  letter-spacing: 0.08em;
  border-top: 1px solid var(--perforation);
  padding-top: 10px;
  margin-top: 28px;
  display: flex;
  justify-content: space-between;
  text-transform: uppercase;
}
.printer-footer a { color: var(--ink-light); text-decoration: none; }
.printer-footer a:hover { color: var(--ink); }

.tear-bottom {
  height: 16px;
  background: var(--paper-white);
  border-top: 2px dashed var(--perforation);
  position: relative;
  z-index: 3;
  margin: 0 52px;
}

.page-num {
  position: absolute;
  right: 60px;
  bottom: 18px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  z-index: 3;
}

.empty-state, .error-state {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-light);
  text-align: center;
  padding: 40px 0;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   INDEX PAGE — pixel-art printer shell
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.index-wrap {
  max-width: 720px;
  width: 100%;
}

/* ── overall printer box ── */
.px-printer {
  width: 100%;
  image-rendering: pixelated;
}

/* ── top body ── */
.px-body {
  background: var(--px-beige);
  border: 3px solid var(--px-chassis);
  border-bottom: none;
  box-shadow:
    inset  3px  3px 0 var(--px-beige-light),
    inset -3px -3px 0 var(--px-beige-dark);
}

/* control panel row */
.px-top-panel {
  background: var(--px-beige-mid);
  border-bottom: 3px solid var(--px-chassis);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: inset 0 -2px 0 var(--px-beige-dark);
}

.px-brand {
  font-family: var(--font-pixel);
  font-size: 22px;
  color: var(--px-ink);
  letter-spacing: 0.05em;
  flex: 1;
  line-height: 1.1;
}
.px-brand span {
  font-family: var(--font-mono);
  font-size: 9px;
  display: block;
  letter-spacing: 0.18em;
  color: var(--px-ink-mid);
  text-transform: uppercase;
  margin-top: 2px;
}

/* LEDs */
.px-leds { display: flex; gap: 6px; align-items: center; }
.px-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--px-chassis);
}
.px-led-green { background: #4caf50; }
.px-led-amber { background: #ff9800; }
.px-led-off   { background: #6d6050; }

/* pixel buttons */
.px-btn {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--px-beige-mid);
  background: var(--px-ink);
  border: 2px solid var(--px-chassis);
  padding: 3px 7px;
  box-shadow:
    inset  1px  1px 0 #6a5a38,
    inset -1px -1px 0 #2a2018;
  cursor: default;
  user-select: none;
}

/* vent slots */
.px-vents {
  padding: 8px 16px;
}
.px-vent-line {
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--px-beige-dark) 0px,
    var(--px-beige-dark) 6px,
    var(--px-beige)      6px,
    var(--px-beige)      9px
  );
  border-top: 1px solid var(--px-beige-shadow);
  border-bottom: 1px solid var(--px-beige-light);
}

/* paper exit slot */
.px-slot-area {
  background: var(--px-beige-shadow);
  border-top: 3px solid var(--px-chassis);
  border-bottom: 3px solid var(--px-chassis);
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.px-slot-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--px-ink);
}
.px-slot-groove {
  flex: 1;
  height: 7px;
  background: var(--px-interior);
  border: 1px solid var(--px-chassis);
  box-shadow: inset 0 2px 0 #1a1208;
  position: relative;
  overflow: hidden;
}
.px-slot-groove::after {
  content: '';
  position: absolute;
  top: 2px; left: 0; right: 0;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    #3a3028 0px, #3a3028 4px,
    transparent 4px, transparent 8px
  );
}

/* ── paper feed wrapper (dark surround) ── */
.px-feed-wrapper {
  background: var(--px-interior);
  border-left:  3px solid var(--px-chassis);
  border-right: 3px solid var(--px-chassis);
  padding: 0 10px;
}

/* scrollable area */
.px-scroll {
  height: 420px;
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--px-beige) var(--px-interior);
}
.px-scroll::-webkit-scrollbar { width: 14px; }
.px-scroll::-webkit-scrollbar-track {
  background: var(--px-interior);
  border-left: 2px solid var(--px-chassis);
}
.px-scroll::-webkit-scrollbar-thumb {
  background: var(--px-beige-mid);
  border: 2px solid var(--px-chassis);
  box-shadow:
    inset  1px 0 0 var(--px-beige-light),
    inset -1px 0 0 var(--px-beige-dark);
}

/* ── dot-matrix paper roll ── */
.px-paper {
  background: var(--paper-white);
  position: relative;
  min-height: 100%;
}
.px-paper::before {
  content: '';
  position: absolute;
  top: 0; left: 36px; right: 36px; bottom: 0;
  background: repeating-linear-gradient(
    to bottom,
    var(--paper-white) 0px,
    var(--paper-white) var(--stripe-gap),
    var(--paper-green) var(--stripe-gap),
    var(--paper-green) calc(var(--stripe-gap) * 2)
  );
  pointer-events: none;
  z-index: 0;
}

/* sprocket strips */
.px-holes-strip {
  position: absolute;
  top: 0; bottom: 0;
  width: 36px;
  background: var(--paper-green-dark);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0;
}
.px-holes-left  { left: 0;  border-right: 1px solid var(--perforation); }
.px-holes-right { right: 0; border-left:  1px solid var(--perforation); }

.px-hole {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--px-interior);
  margin-bottom: 18px;
  flex-shrink: 0;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}

/* paper content area */
.px-paper-content {
  position: relative;
  z-index: 1;
  padding: 24px 52px 32px;
}

/* reuse printer-header from post pages, already defined above */

/* ── index entry list ── */
.post-entry {
  border-bottom: 1px dashed var(--perforation);
  padding: 20px 0;
}
.post-entry:first-of-type { padding-top: 0; }
.post-entry:last-of-type  { border-bottom: none; }

.entry-title {
  font-family: var(--font-pixel);
  font-size: 26px;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
  font-weight: normal;
}
.entry-title a {
  color: var(--ink);
  text-decoration: none;
}
.entry-title a:hover { color: #3a6a3a; }

.entry-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-light);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}
.entry-meta span { margin-right: 16px; }

.entry-excerpt {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.75;
  color: var(--ink-faded);
  margin-bottom: 10px;
}

.entry-readmore {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
}
.entry-readmore:hover { color: #3a6a3a; border-color: #3a6a3a; }

/* tear line at bottom of roll */
.px-tear-bottom {
  height: 12px;
  border-top: 2px dashed var(--perforation);
  margin: 8px 36px 0;
  position: relative;
  z-index: 3;
}

/* ── printer bottom body ── */
.px-bottom {
  background: var(--px-beige);
  border: 3px solid var(--px-chassis);
  border-top: none;
  padding: 10px 16px 14px;
  box-shadow:
    inset  3px  3px 0 var(--px-beige-light),
    inset -3px -3px 0 var(--px-beige-dark);
}

.px-feet {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}
.px-foot {
  width: 48px;
  height: 8px;
  background: var(--px-beige-dark);
  border: 2px solid var(--px-chassis);
  border-top: none;
  box-shadow: inset 1px 0 0 var(--px-beige);
}

.px-bottom-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--px-ink-mid);
  text-align: center;
}

/* ── Essay music player ── */
.essay-player {
  position: relative;
  margin: 32px 0 0;
  border-top: 1px solid var(--perforation);
  padding-top: 16px;
}

.essay-player-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-light);
  margin-bottom: 6px;
}

.essay-player-track {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.essay-player-track span {
  color: var(--ink-light);
  font-size: 11px;
}

.essay-player iframe {
  display: block;
  width: 100%;
  height: 80px;
  border: none;
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RESPONSIVE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 600px) {
  /* post pages */
  body { padding: 16px 8px; }
  .holes-left, .holes-right { display: none; }
  .paper { padding: 0; }
  .paper::before { left: 0; right: 0; }
  .tear-top, .tear-bottom { margin: 0; }
  .content { padding: 20px 16px 32px; }
  .printer-header { flex-direction: column; gap: 2px; font-size: 10px; }
  h1.post-title { font-size: 18px; }
  .post-meta { font-size: 10px; display: flex; flex-direction: column; gap: 4px; }
  .post-meta span { margin-right: 0; }
  .post-body { font-size: 13px; line-height: 1.75; }
  .printer-footer { flex-direction: column; gap: 4px; font-size: 10px; }
  .site-nav { flex-wrap: wrap; gap: 12px; font-size: 10px; }
  .page-num { right: 16px; bottom: 10px; }

  /* index printer */
  body.index-page { padding: 12px 8px 32px; }
  .px-scroll { height: 360px; }
  .px-paper-content { padding: 16px 44px 24px; }
  .px-holes-strip { width: 28px; }
  .px-paper::before { left: 28px; right: 28px; }
  .px-brand { font-size: 18px; }
  .entry-title { font-size: 22px; }
  .printer-header { flex-direction: column; gap: 2px; font-size: 9px; }
}
