@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,500;1,8..60,400&display=swap');

/* ============================================================
   tokens
   ============================================================ */
:root {
  --ink:    #0a0a0a;
  --paper:  #15140f;
  --rule:   #2a2a26;
  --muted:  #7a7a72;
  --fg:     #e8e6e1;
  --fg2:    #cfcbc2;
  --fg3:    #d6d2c8;
  --accent: #c89b3c;
  --accent2:#6b5224;
  --green:  #7ec488;
  --mono:   "JetBrains Mono", "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --serif:  "Source Serif 4", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

@keyframes vcBlink   { 50% { opacity: 0; } }
@keyframes vcMarquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ============================================================
   shared layout / utilities
   ============================================================ */
.page {
  position: relative;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 40px 40px;
  box-sizing: border-box;
}
.page.post {
  padding: 28px 48px 40px;
  line-height: 1.55;
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(255,255,255,0.025) 0px,
    rgba(255,255,255,0.025) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 1;
}

.accent { color: var(--accent); }
.muted  { color: var(--muted); }
.serif  { font-family: var(--serif); }

.footer {
  display: flex;
  align-items: center;
  padding: 14px 0 6px;
  font-size: 12px;
  color: var(--fg2);
  position: relative;
  z-index: 2;
}
.footer-right { margin-left: auto; display: flex; gap: 4px; align-items: center; }

.cursor-line { font-size: 13px; margin-top: 4px; position: relative; z-index: 2; }
.blink { display: inline-block; animation: vcBlink 1.05s steps(1) infinite; color: var(--fg); }

/* ============================================================
   HOME — page chrome
   ============================================================ */
.border-line {
  color: var(--accent);
  font-size: 12px;
  line-height: 1;
  white-space: pre;
  overflow: hidden;
  opacity: 0.7;
  position: relative;
  z-index: 2;
}

/* HOME — banner / about (from BBSHeader) */
.banner { padding: 20px 0 14px; position: relative; z-index: 2; }

.mega-ascii {
  margin: 0;
  font-size: 11px;
  line-height: 1;
  white-space: pre;
  font-family: var(--mono);
  font-weight: 700;
  background: linear-gradient(180deg, #f4e2a8 0%, #e8c870 22%, #d4a648 50%, #c89b3c 72%, #8b6c24 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 0 1px rgba(200,155,60,0.35));
}

.tagline { margin: 14px 0 0; font-size: 13px; letter-spacing: 1px; color: var(--fg2); }
.hi      { color: var(--fg); }

.banner-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
  margin-top: 22px;
}

.about-prompt  { font-size: 12.5px; color: var(--fg); margin-bottom: 6px; }
.about-kicker  { font-size: 11.5px; color: var(--accent); letter-spacing: 1.5px; margin-bottom: 12px; overflow: hidden; white-space: nowrap; }
.about-para    { font-family: var(--serif); font-size: 15.5px; line-height: 1.55; color: var(--fg3); margin: 0 0 10px; }
.dropcap       { font-family: var(--mono); font-size: 26px; line-height: 1; float: left; color: var(--accent); padding: 2px 8px 0 0; font-weight: 700; }
.about-tags    { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px dotted var(--rule); }
.tag-label     { font-size: 10.5px; color: var(--muted); letter-spacing: 1.5px; margin-right: 4px; }
.about-tag     { font-size: 11px; color: var(--fg2); border: 1px solid var(--rule); padding: 1px 7px; }

.portrait-wrap    { font-size: 11px; line-height: 1.25; }
.portrait-border  { margin: 0; color: var(--accent); font-family: var(--mono); white-space: pre; }
.portrait-frame   { border-left: 1px solid var(--accent); border-right: 1px solid var(--accent); padding: 0 12px; background: var(--ink); perspective: 600px; }
.portrait-img     { display: block; width: 100%; height: auto; filter: contrast(1.05); transition: transform 0.3s ease; will-change: transform; }
.portrait-caption { margin-top: 8px; font-size: 12px; line-height: 1.5; }

/* HOME — sysop block (from SysopBlock) */
.sysop {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 36px;
  padding: 24px 0 16px;
  position: relative;
  z-index: 2;
}

.sysop-card      { border: 1px solid var(--accent); background: var(--paper); font-family: var(--mono); color: var(--accent); font-size: 11.5px; line-height: 1.25; }
.sysop-card-head { text-align: center; letter-spacing: 1px; padding: 6px 10px; border-bottom: 1px solid var(--accent); background: rgba(200,155,60,0.08); }
.sysop-card-body { margin: 0; padding: 10px 12px; white-space: pre; color: var(--fg2); }
.sysop-card-foot { text-align: center; letter-spacing: 1px; padding: 6px 10px; border-top: 1px solid var(--accent); }
.online       { color: var(--green); }
.link         { color: var(--accent); cursor: pointer; }
.link:hover   { text-decoration: underline; }

.kv             { border-collapse: collapse; font-size: 13px; margin-bottom: 18px; }
.k              { color: var(--muted); padding: 3px 18px 3px 0; vertical-align: top; letter-spacing: 1px; }

.marquee-wrap  {
  grid-column: 1 / -1;
  margin-top: 4px;
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 8px 14px;
  overflow: hidden;
  white-space: nowrap;
  font-size: 12px;
  color: var(--accent);
}
.marquee-text  { display: inline-block; animation: vcMarquee 30s linear infinite; }

/* HOME — file area (from FileArea) */
.area-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border: 3px double var(--accent);
  padding: 8px 14px;
  margin-top: 14px;
  color: var(--accent);
  font-size: 11.5px;
  letter-spacing: 1px;
  position: relative;
  z-index: 2;
}

.file-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 1.5px;
  border-bottom: 1px solid var(--rule);
  position: relative;
  z-index: 2;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 12px;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px dotted #1a1a17;
  font-size: 13px;
  position: relative;
  z-index: 2;
  transition: background 0.1s;
}
.file-row:hover { background: rgba(200,155,60,0.05); }

.col-num  { width: 70px; flex-shrink: 0; }
.col-date { width: 110px; flex-shrink: 0; }
.col-size { width: 80px; flex-shrink: 0; }
.col-dl   { width: 70px; flex-shrink: 0; font-size: 11px; }
.col-name { flex: 1; min-width: 0; }

.fname  { color: var(--fg); letter-spacing: 0.5px; }
.flag   { color: var(--ink); background: var(--accent); font-size: 10px; padding: 1px 6px; letter-spacing: 1px; font-weight: 700; }


/* HOME — bottom panels */
.bottom {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  padding: 30px 0 20px;
  position: relative;
  z-index: 2;
}
.bottom-head { color: var(--accent); font-size: 12px; letter-spacing: 2px; margin-bottom: 12px; }
.link-list   { list-style: none; padding: 0; margin: 0; font-size: 13px; line-height: 1.9; }
.bulletin-card      { border: 1px solid var(--accent); background: var(--paper); font-family: var(--mono); font-size: 11.5px; line-height: 1.45; }
.bulletin-card-head { text-align: center; letter-spacing: 1px; padding: 6px 10px; color: var(--accent); border-bottom: 1px solid var(--accent); background: rgba(200,155,60,0.08); }
.bulletin-card-body { padding: 10px 12px; color: var(--fg2); }
.bulletin-card-body p { margin: 0 0 8px; }
.bulletin-card-body .link { display: inline-block; }

.gb         { font-size: 12.5px; }
.gb-name    { color: var(--accent); }
.gb-msg     { color: var(--fg3); margin-top: 2px; line-height: 1.5; font-size: 14px; }

/* guestbook page */
.gb-intro   { font-family: var(--serif); font-size: 15px; line-height: 1.55; color: var(--fg3); max-width: 720px; margin: 14px 0 0; position: relative; z-index: 2; }
.gb-wrap    { max-width: 860px; margin: 22px 0 30px; position: relative; z-index: 2; }

/* ============================================================
   POST page (from posts/[slug].astro)
   ============================================================ */
.link:hover { text-decoration: underline; }

/* breadcrumb */
.crumb-bar {
  display: flex;
  align-items: center;
  font-size: 12.5px;
  padding: 2px 0 14px;
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
  gap: 2px;
}
.crumb      { color: var(--fg2); }
.crumb-link { color: var(--fg); cursor: pointer; }
.crumb-link:hover { color: var(--accent); }
.crumb-sep  { color: var(--rule); padding: 0 2px; }
.crumb-right { margin-left: auto; color: var(--muted); display: flex; gap: 14px; font-size: 12.5px; }

.top-rule, .bottom-rule {
  color: var(--accent);
  font-size: 12px;
  line-height: 1;
  white-space: pre;
  overflow: hidden;
  opacity: 0.7;
  position: relative;
  z-index: 2;
}
.mid-rule {
  color: var(--rule);
  font-size: 11px;
  line-height: 1;
  white-space: pre;
  overflow: hidden;
  margin: 30px 0;
  position: relative;
  z-index: 2;
}

/* file viewer header */
.file-header { position: relative; z-index: 2; padding-top: 18px; }
.file-top-bar {
  margin: 0;
  color: var(--accent);
  font-size: 11.5px;
  line-height: 1;
  white-space: pre;
  overflow: hidden;
  font-family: var(--mono);
}
.file-meta {
  border-left: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  background: #0c0c0a;
  padding: 14px 22px;
}
.meta-table  { border-collapse: collapse; font-size: 13px; }
.meta-k      { color: var(--muted); padding: 2px 20px 2px 0; vertical-align: top; letter-spacing: 1px; width: 90px; }
.cat-tag     { color: var(--accent); font-size: 11px; letter-spacing: 1.5px; margin-right: 14px; }
.status-ok   { color: var(--green); }

.post-title {
  font-family: var(--mono);
  font-size: 48px;
  line-height: 1.08;
  letter-spacing: -1.2px;
  margin: 24px 0 16px;
  font-weight: 600;
  color: var(--fg);
  padding: 18px 22px 0;
  border-left: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  background: #0c0c0a;
}
.post-dek {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.5;
  color: var(--fg3);
  margin: 0;
  padding: 0 22px 18px;
  border-left: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  background: #0c0c0a;
}
.byline {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  letter-spacing: 1.5px;
  color: var(--muted);
  padding: 12px 22px 14px;
  border: 1px solid var(--accent);
  border-top: none;
  background: #0c0c0a;
}
.dot { color: var(--rule); }
.byline-right { margin-left: auto; display: flex; gap: 10px; letter-spacing: 0; }
.action-btn {
  color: var(--fg);
  font-size: 11.5px;
  letter-spacing: 1px;
  cursor: pointer;
  border-bottom: 1px dotted var(--rule);
}

/* body grid */
.body-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  position: relative;
  z-index: 2;
}
.article { min-width: 0; }

/* prose */
.prose p {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
  color: var(--fg3);
  margin: 0 0 16px;
  max-width: 760px;
}
.prose p:first-child {
  font-size: 20px;
  line-height: 1.55;
  color: var(--fg);
  margin-bottom: 22px;
}
.prose > p:first-child::first-letter {
  float: left;
  font-family: var(--mono);
  font-size: 48px;
  line-height: 48px;
  font-weight: 700;
  color: var(--accent);
  padding: 4px 12px 0 0;
}
.prose h2 {
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: -0.3px;
  color: var(--accent);
  margin: 34px 0 14px;
  font-weight: 600;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--rule);
}
.prose pre {
  margin: 20px 0;
  padding: 16px 18px;
  background: var(--paper);
  color: var(--fg2);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre;
  font-family: var(--mono);
  border-left: 2px solid var(--accent);
  overflow: auto;
  max-width: 760px;
}
.prose code {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.92em;
  background: rgba(200,155,60,0.07);
  padding: 0 4px;
}
.prose pre code {
  background: none;
  padding: 0;
  color: var(--fg2);
  font-size: inherit;
}
.prose blockquote {
  margin: 24px 0;
  padding: 14px 22px 14px 26px;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.4;
  color: var(--fg);
  font-style: italic;
  border-left: 3px solid var(--accent);
  max-width: 740px;
}
.prose ul, .prose ol {
  padding-left: 0;
  margin: 8px 0 16px;
  list-style: none;
  max-width: 760px;
}
.prose li {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
  color: var(--fg3);
  padding: 4px 0 4px 20px;
  position: relative;
}
.prose li::before {
  content: '→';
  color: var(--accent);
  position: absolute;
  left: 0;
}

.end-of-file { margin-top: 30px; }
.eof-rule    { margin: 0; color: var(--rule); font-size: 11px; white-space: pre; font-family: var(--mono); }
.eof-meta    { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* aside */
.aside { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.aside-top, .aside-bot {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  line-height: 1;
  white-space: pre;
  font-family: var(--mono);
}
.aside-body {
  border-left: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  background: #0c0c0a;
  padding: 12px 18px;
  font-size: 12.5px;
  line-height: 1.55;
}
.tldr-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg3);
}
.tldr-list code {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.9em;
}
.timeline-table { border-collapse: collapse; font-size: 12px; width: 100%; }
.timeline-table td { padding: 2px 10px 2px 0; vertical-align: top; color: var(--fg2); }
.tl-date { color: var(--muted); white-space: nowrap; }
.tool-list { list-style: none; padding: 0; margin: 0; font-size: 12.5px; line-height: 1.85; color: var(--fg2); }

/* related */
.related { position: relative; z-index: 2; }
.section-head { font-size: 13px; color: var(--fg); margin-bottom: 12px; letter-spacing: 0.5px; }
.rel-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 6px;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px dotted #1a1a17;
}
.rel-row:hover { background: rgba(200,155,60,0.04); }
.rel-fname { width: 130px; flex-shrink: 0; }
.rel-date  { width: 110px; flex-shrink: 0; font-size: 12px; }
.rel-title { flex: 1; font-size: 16px; }
.rel-read  { width: 60px; text-align: right; font-size: 12px; }

/* comments */
.comments { position: relative; z-index: 2; margin-top: 30px; }
.comments-head {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: var(--fg);
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}
.comments-actions { margin-left: auto; display: flex; gap: 10px; }
.comments-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.comment {
  border-left: 1px solid var(--rule);
  padding: 4px 14px 8px;
}
.comment-meta {
  font-size: 11.5px;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.comment-msg {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg3);
}

/* responsive */
@media (max-width: 900px) {
  .body-grid { grid-template-columns: 1fr; }
  .comments-grid { grid-template-columns: 1fr; }
  .post-title { font-size: 32px; }
}

/* ============================================================
   blog additions (prose media/tables/links + home responsive)
   ============================================================ */
.prose h1 { display: none; }                 /* paper's leading # title — post-title shows it */
.prose a  { color: var(--accent); border-bottom: 1px dotted var(--accent2); }
.prose img { max-width: 100%; height: auto; display: block; margin: 22px 0; border: 1px solid var(--rule); }
.prose em { font-style: italic; }
.prose table {
  border-collapse: collapse; font-family: var(--mono); font-size: 12.5px;
  margin: 22px 0; width: 100%; max-width: 760px; color: var(--fg2);
}
.prose th, .prose td { border: 1px solid var(--rule); padding: 6px 10px; text-align: left; vertical-align: top; line-height: 1.45; }
.prose th { color: var(--accent); letter-spacing: 0.5px; }
.prose h3 { font-family: var(--mono); font-size: 16px; color: var(--fg); margin: 24px 0 10px; letter-spacing: -0.2px; }

@media (max-width: 720px) {
  .page, .page.post { padding: 20px 16px 28px; }
  .banner-grid { grid-template-columns: 1fr; gap: 22px; }
  .sysop       { grid-template-columns: 1fr; gap: 18px; }
  .bottom      { grid-template-columns: 1fr; gap: 22px; }
  .body-grid   { grid-template-columns: 1fr; gap: 28px; }
  .mega-ascii  { font-size: 5.5px; }
  .border-line, .top-rule, .bottom-rule, .file-top-bar, .portrait-border, .aside-top, .aside-bot { font-size: 7px; }
  .post-title  { font-size: 30px; }
  .file-head .col-size, .file-head .col-dl, .file-row .col-size, .file-row .col-dl { display: none; }
  /* stop horizontal overflow on the post page (phones) */
  .byline { flex-wrap: wrap; gap: 8px; }
  .byline-right { margin-left: 0; }
  .eof-rule { overflow: hidden; }
  .prose table { display: block; overflow-x: auto; }
}
