@font-face {
  font-family: 'VT323';
  src: url('/fonts/VT323-Regular.ttf') format('truetype');
  font-display: swap;
}

@font-face {
  font-family: 'Share Tech Mono';
  src: url('/fonts/ShareTechMono-Regular.ttf') format('truetype');
  font-display: swap;
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #1c1a14;
  --bg-off:      #231f16;
  --bg-hover:    #272318;
  --border:      #3a3020;
  --border-light:#2a2418;
  --text:        #ede8d8;
  --text-muted:  #b8a880;
  --text-faint:  #8a7040;
  --accent:      #c8922a;
  --accent-hover:#daa840;
  --tag-bg:      #1e1a10;
  --tag-border:  #3a2e18;
  --mono:        'Share Tech Mono', 'Courier New', monospace;
  --display:     'VT323', 'Courier New', monospace;

  /* type scale */
  --text-xs:   0.694rem;   /* ~11px — tags, meta, faint labels */
  --text-sm:   0.833rem;   /* ~13px — excerpts, secondary content */
  --text-base: 1rem;       /* ~16px — body, nav */
  --text-lg:   1.2rem;     /* ~19px — post titles in listings */
  --text-xl:   1.44rem;    /* ~23px — subheadings */
  --text-2xl:  2rem;       /* ~32px — post page headings (VT323) */
  --text-3xl:  3.25rem;    /* ~52px — site title (VT323) */
}

html { font-size: 18px; }

body {
  font-family: var(--mono);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

/* ── Vignette overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.35) 100%);
  pointer-events: none;
  z-index: 9998;
}

/* ── Scan-line CRT effect ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.08) 3px,
    rgba(0, 0, 0, 0.08) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

/* ── Layout ── */
.site-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header ── */
.site-header {
  padding: 20px 0 16px;
}

.header-rule {
  border-top: 1px solid var(--border);
  margin-bottom: 40px;
}

.header-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.site-title {
  font-family: var(--display);
  font-size: var(--text-3xl);
  letter-spacing: 2px;
  text-decoration: none;
  color: var(--accent);
  line-height: 1;
  text-shadow: 0 0 20px rgba(200, 146, 42, 0.4);
}

.site-title:hover { color: var(--accent-hover); }

.site-title::after {
  content: '\00a0';
  font-family: var(--display);
  font-size: var(--text-3xl);
  background-color: currentColor;
  vertical-align: baseline;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.site-subtitle {
  display: block;
  font-size: var(--text-base);
  color: var(--text-faint);
  margin-top: 2px;
  letter-spacing: 0.5px;
}

.site-nav {
  display: flex;
  gap: 4px;
  font-size: var(--text-base);
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  color: var(--text-muted);
  padding: 2px 6px;
  border: 1px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}

.site-nav a:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--bg-hover);
}

.site-nav a.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(200, 146, 42, 0.08);
  text-shadow: 0 0 12px rgba(200, 146, 42, 0.3);
}

/* ── Main ── */
.site-main { flex: 1; padding-bottom: 60px; }

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 16px 0 24px;
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--text-faint);
}

.site-footer a { color: var(--text-faint); }
.site-footer a:hover { color: var(--text); }

/* ── Shared prompt line ── */
.prompt-line {
  font-size: var(--text-base);
  color: var(--text-faint);
  /*margin-bottom: 20px;*/
  letter-spacing: 0.3px;
}

.error-output {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 6px;
  margin-bottom: 32px;
}


/* ── Section label ── */
.section-label {
  font-size: var(--text-base);
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.section-label::before {
  content: '// ';
  color: var(--text-faint);
  letter-spacing: 0;
}

/* ── Post entries (list + home) ── */
.post-entry {
  padding: 16px 12px;
  border-bottom: 1px solid var(--border-light);
  border-left: 3px solid transparent;
  margin-left: -12px;
  transition: border-color 0.15s, background 0.15s;
}

.post-entry:last-of-type { border-bottom: none; }

.post-entry:hover {
  border-left-color: var(--accent);
  background: linear-gradient(to right, rgba(200, 146, 42, 0.05), transparent 60%);
}

.post-entry-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.post-date {
  font-size: var(--text-base);
  color: var(--text-faint);
  display: block;
  margin-bottom: 3px;
}

.post-title {
  font-size: var(--text-lg);
  font-weight: normal;
  text-decoration: none;
  color: var(--text);
  display: block;
  margin-bottom: 5px;
}

.post-title::before { content: '> '; color: var(--text-faint); }
.post-entry-link:hover .post-title { color: var(--accent-hover); }

.post-excerpt {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 8px;
}

.tag-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

.tag {
  font-size: var(--text-xs);
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  color: var(--text-muted);
  padding: 1px 8px;
  border-radius: 2px;
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: border-color 0.15s, color 0.15s;
}

.tag:hover {
  color: var(--accent-hover);
  border-color: var(--accent);
}

.more-link {
  display: inline-block;
  margin-top: 20px;
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: none;
}

.more-link:hover { color: var(--text); }

/* ── Home intro ── */
.home-intro {
  margin-bottom: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border-light);
}

.content-block {
  font-size: var(--text-base);
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 600px;
}

.home-recent { }

/* ── Single post ── */
.post-header { margin-bottom: 36px; }

.post-heading {
  font-family: var(--display);
  font-size: var(--text-2xl);
  font-weight: normal;
  letter-spacing: 1px;
  line-height: 1.2;
  margin: 10px 0 10px;
}

.post-meta {
  font-size: var(--text-xs);
  color: var(--text-faint);
}

.post-meta time { }
.canonical-note { font-style: italic; }

.post-body {
  font-size: var(--text-base);
  line-height: 1.85;
  max-width: 660px;
}

.post-body h2 {
  font-family: var(--display);
  font-size: var(--text-xl);
  font-weight: normal;
  margin: 36px 0 12px;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 6px;
}

.post-body h2::before { content: '## '; color: var(--text-faint); }
.post-body h3::before { content: '### '; color: var(--text-faint); }

.post-body h3 {
  font-size: var(--text-lg);
  font-weight: normal;
  margin: 24px 0 8px;
  color: var(--text-muted);
}

.post-body p { margin-bottom: 18px; }

.post-body a { color: var(--text); }

.post-body code {
  font-family: var(--mono);
  font-size: var(--text-sm);
  background: var(--bg-off);
  border: 1px solid var(--border-light);
  padding: 1px 6px;
  border-radius: 2px;
}

.post-body pre {
  background: var(--bg-off);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  padding: 16px 20px;
  overflow-x: auto;
  margin: 20px 0;
  font-size: var(--text-sm);
  line-height: 1.6;
}

.post-body pre code {
  background: none;
  border: none;
  padding: 0;
}

.post-body blockquote {
  border-left: 3px solid var(--border);
  padding: 4px 0 4px 20px;
  color: var(--text-muted);
  font-style: italic;
  margin: 20px 0;
}

.post-body ul, .post-body ol {
  padding-left: 24px;
  margin-bottom: 18px;
}

.post-body li { margin-bottom: 4px; }

.post-body img {
  max-width: 100%;
  border: 1px solid var(--border-light);
  margin: 20px 0;
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 32px 0;
}

.post-footer { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border-light); }

.back-link {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: none;
}

.back-link:hover { color: var(--text); }

/* ── CV page ── */
.cv-section-heading {
  font-size: var(--text-sm);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 32px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}

.cv-section-heading:first-of-type { margin-top: 0; }
.cv-section-heading::before { content: '// '; color: var(--text-faint); }

.cv-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px 20px;
  font-size: var(--text-sm);
  padding: 7px 0;
  border-bottom: 1px dotted var(--border-light);
  color: var(--text-muted);
}

.cv-row:last-child { border-bottom: none; }
.cv-year { color: var(--text-faint); font-size: var(--text-sm); }
.cv-detail { color: var(--text); }
.cv-detail strong { font-weight: normal; color: var(--text); }
.cv-detail em { font-style: normal; color: var(--text-muted); }

/* ── List page ── */
.list-page { }

/* ── Boot animation ── */
.boot-hidden {
  opacity: 0;
  pointer-events: none;
}

.boot-visible {
  animation: fadeIn 0.2s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.site-nav.nav-locked {
  opacity: 0.3;
  pointer-events: none;
}

.site-nav.nav-locked a {
  color: var(--text-faint);
  border-color: transparent !important;
  background: none !important;
}

.prompt-line.typing::after {
  content: '▋';
  color: var(--accent);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
  font-size: 0.85em;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .header-inner { gap: 16px; }
  .site-nav { align-self: flex-start; }
}

@media (max-width: 560px) {
  .header-inner { flex-direction: column; gap: 8px; }
  .site-subtitle { margin-left: 0; display: block; }
  .site-nav { gap: 4px; }
  .post-heading { font-size: var(--text-xl); }
  .cv-row { grid-template-columns: 80px 1fr; }
}
