/* cvam.sight — clean blog stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600;700&family=Kalam:wght@300;400;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --paper: #f5efe1;
  --paper-2: #ebe3cf;
  --ink: #2a2620;
  --ink-soft: #5a5346;
  --ink-faint: #948a78;
  --yellow: #f0c040;
  --yellow-soft: #f7d971;
  --yellow-deep: #d9a830;
  --accent: #c96442;
  --font-display: 'Caveat', cursive;
  --font-body: 'Kalam', cursive;
  --font-mono: 'JetBrains Mono', monospace;
  --max-width: 960px;
  --sidebar-width: 230px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--ink); transition: color 0.15s; }
a:hover { color: var(--accent); }

/* ── reading progress bar ── */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--yellow), var(--accent));
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ── layout: sidebar + main ── */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  padding: 28px 20px;
  border-right: 1.5px solid var(--ink);
  background: var(--paper-2);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.12) transparent;
}
.sidebar .logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  margin-bottom: 4px;
}
.sidebar .logo:hover { color: var(--accent); }
.sidebar-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.4;
  margin: 0 0 24px;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar nav a {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--ink);
  padding: 7px 10px;
  border-radius: 6px;
  transition: background 0.15s, transform 0.1s;
  border: 1.2px solid transparent;
}
.sidebar nav a.active {
  background: var(--yellow);
  border-color: var(--ink);
  font-weight: 500;
}
.sidebar nav a:hover:not(.active) { background: rgba(0,0,0,0.05); }

.sidebar-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--ink-faint);
}
.sidebar-label {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin: 0 0 8px;
}
.sidebar-cats {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sidebar-cat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  padding: 3px 6px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.12s;
}
.sidebar-cat:hover { background: rgba(0,0,0,0.05); color: var(--ink); }
.sidebar-cat .count {
  font-size: 10px;
  color: var(--ink-faint);
  background: var(--paper);
  border: 1px solid var(--ink-faint);
  border-radius: 999px;
  padding: 0 5px;
  min-width: 18px;
  text-align: center;
}
.sidebar-now {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.4;
  margin: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sidebar-footer a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 2px 0;
  transition: color 0.12s;
}
.sidebar-footer a:hover { color: var(--accent); }

.page {
  margin-left: var(--sidebar-width);
  flex: 1;
  max-width: var(--max-width);
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page > .footer {
  margin-top: auto;
}

.dot {
  width: 14px; height: 14px;
  background: var(--yellow);
  border: 1.5px solid var(--ink);
  display: inline-block;
}

/* ── hero ── */
.hero {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 28px;
  margin-bottom: 28px;
}
.hero-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.stamp {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--accent);
  border: 1.5px dashed var(--accent);
  padding: 1px 8px;
  transform: rotate(-3deg);
  display: inline-block;
  background: rgba(201,100,66,0.08);
  letter-spacing: 0.04em;
}
.hero-text h1 {
  font-family: var(--font-display);
  font-size: 50px;
  font-weight: 700;
  line-height: 0.98;
  margin: 8px 0 16px;
}
.hero-text h1 a {
  text-decoration: none;
  color: var(--ink);
  transition: color 0.15s;
}
.hero-text h1 a:hover { color: var(--accent); }
.excerpt {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 16px;
  max-width: 520px;
}

/* ── shared ── */
.meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tag {
  display: inline-block;
  border: 1.2px solid var(--ink);
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--paper);
  text-transform: lowercase;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.12s, transform 0.1s;
}
.tag.fill { background: var(--yellow); }
.tag:hover { background: var(--yellow-soft); transform: translateY(-1px); }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--ink); background: var(--paper);
  padding: 6px 16px; font-family: var(--font-body);
  font-size: 14px; cursor: pointer; text-decoration: none;
  box-shadow: 2px 2px 0 var(--ink); color: var(--ink);
  transition: transform 0.1s, box-shadow 0.1s;
}
.btn.primary { background: var(--yellow); }
.btn:hover { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }

.rule { height: 1.5px; background: var(--ink); border: none; margin: 0 0 24px; }

.box {
  border: 1.5px solid var(--ink);
  background: var(--paper);
  padding: 14px;
  border-radius: 2px;
}

.hatch {
  background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(42,38,32,0.18) 6px 7px);
  border: 1.5px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft);
  text-transform: uppercase; height: 220px;
}
.hatch.yellow {
  background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(217,168,48,0.35) 6px 7px), var(--yellow-soft);
}

/* ── now / stats row ── */
.info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}
.sticky-note {
  background: var(--yellow-soft);
  border: 1.5px solid var(--ink);
  padding: 14px 16px;
  font-family: var(--font-body);
  transform: rotate(-1deg);
  box-shadow: 2px 3px 0 var(--ink);
}
.sticky-note p { margin: 0 0 4px; }
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}
.stat-grid div strong {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1;
  display: block;
}
.stat-grid div span {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ── contribution/streak grid ── */
.streak-section {
  margin-bottom: 32px;
  padding: 16px;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
}
.streak-section > .meta { margin-bottom: 10px; }
.contrib-grid {
  display: grid;
  grid-template-columns: repeat(26, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 3px;
}
.contrib-cell {
  aspect-ratio: 1;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  transition: transform 0.1s;
}
.contrib-cell:hover { transform: scale(1.4); z-index: 1; }
.contrib-cell.l1 { background: rgba(240,192,64,0.25); }
.contrib-cell.l2 { background: rgba(240,192,64,0.5); }
.contrib-cell.l3 { background: var(--yellow); }
.contrib-cell.l4 { background: var(--yellow-deep); }
.streak-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
}

/* ── post card grid ── */
.feed { margin-bottom: 28px; }
.feed > .meta { margin-bottom: 12px; }

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.post-card {
  border: 1.5px solid var(--ink);
  padding: 18px;
  background: var(--paper);
  display: flex; flex-direction: column; gap: 8px;
  position: relative;
  text-decoration: none;
  color: var(--ink);
  transition: box-shadow 0.15s, transform 0.15s;
  border-radius: 3px;
}
.post-card:hover {
  box-shadow: 4px 4px 0 var(--ink);
  transform: translate(-2px, -2px);
}
.post-card:hover h3 { color: var(--accent); }
.post-card .cat {
  position: absolute; top: -10px; left: 12px;
  background: var(--yellow); border: 1.2px solid var(--ink);
  padding: 1px 8px; font-family: var(--font-mono);
  font-size: 10px; text-transform: uppercase;
}
.post-card h3 {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700;
  margin: 4px 0 2px; line-height: 1.1;
  transition: color 0.15s;
}
.post-card .card-excerpt {
  font-size: 13px; color: var(--ink-soft); line-height: 1.4;
}
.post-card .card-meta {
  display: flex; gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px; color: var(--ink-faint);
  text-transform: uppercase; margin-top: auto;
}

/* ── single post ── */
.post-header { margin-bottom: 32px; }
.post-header h1 {
  font-family: var(--font-display);
  font-size: 54px; font-weight: 700;
  line-height: 0.98; margin: 10px 0 16px;
}
.post-body {
  font-size: 16px;
  line-height: 1.75;
  max-width: 720px;
}
.post-body h2 {
  font-family: var(--font-display);
  font-size: 30px; font-weight: 700;
  margin: 40px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--ink-faint);
}
.post-body h3 {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 600;
  margin: 28px 0 8px;
}
.post-body pre {
  background: #1e1a14;
  color: #f0c040;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 16px 20px;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  overflow-x: auto;
  line-height: 1.6;
  position: relative;
}
.post-body pre::before {
  content: '//';
  position: absolute;
  top: 8px; right: 12px;
  font-size: 10px;
  color: rgba(240,192,64,0.3);
}
.post-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--paper-2);
  padding: 1px 5px;
  border-radius: 3px;
}
.post-body pre code {
  background: none;
  padding: 0;
}
.post-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 20px 0;
  padding: 8px 20px;
  color: var(--ink-soft);
  font-style: italic;
  background: rgba(201,100,66,0.04);
  border-radius: 0 4px 4px 0;
}
.post-body img {
  max-width: 100%;
  border: 1.5px solid var(--ink);
}
.post-body ul, .post-body ol {
  padding-left: 24px;
}
.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1.5px solid var(--ink);
}
.post-nav a {
  text-decoration: none;
  font-family: var(--font-body);
  padding: 6px 12px;
  border-radius: 4px;
  transition: background 0.12s;
}
.post-nav a:hover { background: var(--yellow-soft); }

/* ── archive ── */
.archive-list { list-style: none; padding: 0; }
.archive-list li {
  display: grid;
  grid-template-columns: 80px 80px 1fr 80px;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--ink);
  align-items: baseline;
}
.archive-list li a {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.1;
  transition: color 0.12s;
}
.archive-list li a:hover { color: var(--accent); }

/* ── tags page ── */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.tag-cloud .tag { font-size: 12px; padding: 4px 12px; }

/* ── vocab panel ── */
.vocab-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 260px;
  height: 100vh;
  padding: 28px 16px;
  border-left: 1.5px solid var(--ink);
  background: var(--paper-2);
  display: flex;
  flex-direction: column;
  gap: 0;
  z-index: 100;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.12) transparent;
}
.vocab-panel-label {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin: 0 0 14px;
}
.vocab-term {
  border-bottom: 1px dashed var(--ink-faint);
  padding: 0;
  cursor: pointer;
  transition: background 0.12s;
  border-radius: 4px;
  overflow: hidden;
}
.vocab-term:last-child { border-bottom: none; }
.vocab-term-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 6px;
  gap: 6px;
  user-select: none;
}
.vocab-term-header:hover { background: rgba(0,0,0,0.04); }
.vocab-term-word {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.vocab-term-arrow {
  font-size: 10px;
  color: var(--ink-faint);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.vocab-term.open .vocab-term-arrow { transform: rotate(90deg); }
.vocab-term-def {
  display: none;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
  padding: 0 8px 12px;
  background: rgba(240,192,64,0.08);
  border-left: 2.5px solid var(--yellow);
  margin: 0 0 0 0;
}
.vocab-term.open .vocab-term-def { display: block; }

/* term highlights inside post body */
.term-highlight {
  background: rgba(240,192,64,0.25);
  border-bottom: 1.5px dashed var(--yellow-deep);
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.15s;
}
.term-highlight:hover { background: rgba(240,192,64,0.5); }
.term-highlight.active {
  background: rgba(240,192,64,0.6);
  border-bottom-style: solid;
}

/* shift page content when vocab panel is present */
.has-vocab .page {
  margin-right: 260px;
}

/* ── about page ── */
.about-content { max-width: 640px; font-size: 16px; line-height: 1.7; }
.about-content h2 {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 700;
  margin: 28px 0 10px;
}

/* ── footer ── */
.footer {
  border-top: 1.5px solid var(--ink);
  padding-top: 12px;
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.footer-links { display: flex; gap: 12px; }
.footer-links a { color: var(--ink-soft); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }

/* hide vocab panel on narrow/tablet screens */
@media (max-width: 1100px) {
  .vocab-panel { display: none; }
  .has-vocab .page { margin-right: 0; }
}

/* ── responsive ── */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0; left: 0; right: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 16px;
    gap: 8px;
    border-right: none;
    border-bottom: 1.5px solid var(--ink);
  }
  .sidebar-sub,
  .sidebar-section,
  .sidebar-footer { display: none; }
  .sidebar nav { flex-direction: row; gap: 4px; }
  .sidebar nav a { font-size: 10px; padding: 4px 8px; }
  .page {
    margin-left: 0;
    padding: 68px 16px 24px;
  }
  .hero { grid-template-columns: 1fr; }
  .hero-aside { display: none; }
  .hero-text h1 { font-size: 36px; }
  .info-row { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: 1fr; }
  .archive-list li { grid-template-columns: 60px 1fr; }
  .archive-list li .meta:first-child,
  .archive-list li .meta:last-child { display: none; }
  .contrib-grid { grid-template-columns: repeat(13, 1fr); }
  .post-header h1 { font-size: 38px; }
}
