/* ===============================================================
   bhanuharya@sec : plain text theme
   one column, hairlines, no decoration.  light and dark.
   =============================================================== */

:root {
  color-scheme: light;
  --bg: #fbfbfa;
  --fg: #1c1c1a;
  --muted: #6f6f68;
  --faint: #97978e;
  --rule: #dedcd6;
  --rule-soft: #ebe9e4;
  --link: #1e4fb5;
  --visited: #6a4bab;
  --code-bg: #f2f1ec;
  --sel: #f4e2a0;
  --accent: #a8442a;
  --mono: ui-monospace, "SF Mono", "DejaVu Sans Mono", "Courier New", monospace;
  --sans: Verdana, Geneva, "DejaVu Sans", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14161a;
  --fg: #cfcdc7;
  --muted: #85837d;
  --faint: #6a6862;
  --rule: #2a2d33;
  --rule-soft: #22252a;
  --link: #93b6f7;
  --visited: #bfa8ee;
  --code-bg: #1b1e23;
  --sel: #3b3a24;
  --accent: #e0866b;
}

* { box-sizing: border-box; }

html { background: var(--bg); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 24px 72px;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.62;
}

::selection { background: var(--sel); }

.wrap { max-width: 720px; margin: 0 auto; }

a { color: var(--link); text-decoration: none; }
a:visited { color: var(--visited); }
a:hover { text-decoration: underline; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--rule);
}
.skip:focus { left: 8px; top: 8px; z-index: 10; }

/* --- masthead --- */
.site-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  padding: 34px 0 12px;
  border-bottom: 1px solid var(--rule);
}

.site-name {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--fg);
}
.site-name:visited { color: var(--fg); }
.site-name:hover { text-decoration: none; color: var(--accent); }

.site-nav {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 14px;
  font-family: var(--mono);
  font-size: 12.5px;
}
.site-nav a { color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--fg); text-decoration: none; }

.theme-toggle {
  font: inherit;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); text-decoration: underline; }

/* --- main + footer --- */
main { padding-top: 30px; }

.footer {
  margin-top: 64px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-size: 12.5px;
  color: var(--muted);
}
.footer p { margin: 0 0 4px; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--fg); }

.dim { color: var(--muted); }
.note-new { color: var(--accent); font-family: var(--mono); font-size: 11px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
/* --- headings --- */
h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 600;
  line-height: 1.3;
  color: var(--fg);
}

h1 { font-size: 21px; margin: 0 0 10px; letter-spacing: -0.3px; }
h2 { font-size: 16px; margin: 38px 0 10px; }
h3 { font-size: 14.5px; margin: 28px 0 8px; }
h4 { font-size: 13.5px; margin: 22px 0 6px; color: var(--muted); }

.section-head {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  margin: 42px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}

p { margin: 0 0 14px; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 32px 0; }

blockquote {
  margin: 20px 0;
  padding: 0 0 0 16px;
  border-left: 2px solid var(--rule);
  color: var(--muted);
}

ul, ol { margin: 0 0 16px; padding-left: 22px; }
li { margin-bottom: 5px; }
li > ul, li > ol { margin: 5px 0 0; }

/* --- code --- */
code, pre, kbd, samp { font-family: var(--mono); font-size: 12.5px; }

code {
  background: var(--code-bg);
  padding: 1px 4px;
  border-radius: 2px;
}

pre {
  position: relative;
  background: var(--code-bg);
  border: 1px solid var(--rule);
  padding: 12px 13px;
  overflow-x: auto;
  line-height: 1.5;
  border-radius: 2px;
}
pre code { background: none; padding: 0; font-size: 12.5px; }

.highlight { background: var(--code-bg); }
.highlight pre { border: 0; margin: 0; }

/* --- tables --- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: 13px;
}
th, td {
  border: 1px solid var(--rule);
  padding: 6px 9px;
  text-align: left;
  vertical-align: top;
}
th {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--code-bg);
}
.table-scroll { overflow-x: auto; }

/* --- media --- */
img { max-width: 100%; height: auto; border: 1px solid var(--rule); }
figure { margin: 22px 0; }
figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* --- post / page --- */
.post-header, .page-header { margin-bottom: 26px; }

.post-meta, .page-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
}
.post-meta a, .page-meta a { color: var(--muted); }

.post-content, .page-content { font-size: 15px; }
.post-content > :first-child, .page-content > :first-child { margin-top: 0; }

.post-content h2 { padding-bottom: 6px; border-bottom: 1px solid var(--rule-soft); }

.post-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}
.tag::before { content: "#"; }

.post-nav {
  margin-top: 48px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
}
.post-nav a { max-width: 47%; }

/* --- the shell prompt line used above page headings --- */
.page-prompt {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 20px;
}
.page-prompt .prompt, .page-prompt .cmd { color: var(--fg); }
.page-prompt .loc { color: var(--faint); }

.page-lead { font-size: 14.5px; margin-bottom: 26px; }

.about-links { font-family: var(--mono); font-size: 12.5px; }
/* --- home: intro + notes list --- */
.intro { margin-bottom: 8px; }
.intro p { margin-bottom: 12px; font-size: 14.5px; }

.notes { list-style: none; margin: 0; padding: 0; }

.note {
  padding: 13px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.note:last-child { border-bottom: 0; }

.note-title { font-size: 15px; color: var(--link); }
.note-title:visited { color: var(--visited); }

.note-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
}
.note-meta .sep { color: var(--faint); padding: 0 2px; }
.note-excerpt { font-size: 13.5px; color: var(--muted); margin-top: 5px; }

/* --- blog index --- */
.tag-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-family: var(--mono);
  font-size: 12px;
  margin: 0 0 26px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule-soft);
}
.tag-filter-label { color: var(--faint); }
.tag-filter-select {
  width: min(100%, 20rem);
  max-width: 100%;
  min-height: 44px;
  padding: 0 10px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 2px;
  font: inherit;
  font-family: var(--mono);
  font-size: 12px;
}
.tag-filter-select:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list > li {
  padding: 16px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.post-card-title { font-size: 15px; margin: 0 0 4px; font-weight: 600; }
.post-card-title a { color: var(--link); }
.post-card-excerpt { font-size: 13.5px; color: var(--muted); margin: 6px 0 0; }
.post-card-excerpt p { margin: 0; }
.post-card-cta { display: none; }
.tag-empty-msg { font-size: 13px; }

/* --- 404 --- */
.not-found pre {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  padding: 12px 13px;
  overflow-x: auto;
}

/* --- copy button on code blocks --- */
.code-copy-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 1px 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease;
}
pre:hover .code-copy-btn, .code-copy-btn:focus { opacity: 1; }
.code-copy-btn:hover { color: var(--fg); }
.copy-success { color: var(--accent); }

/* --- syntax highlighting, muted both ways --- */
.highlight .c, .highlight .c1, .highlight .cm { color: var(--faint); font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn { color: var(--accent); }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb { color: #3f7a4f; }
html[data-theme="dark"] .highlight .s,
html[data-theme="dark"] .highlight .s1,
html[data-theme="dark"] .highlight .s2 { color: #9ecf9f; }
.highlight .nb, .highlight .nf, .highlight .nv { color: #7a5cc0; }
html[data-theme="dark"] .highlight .nb,
html[data-theme="dark"] .highlight .nf,
html[data-theme="dark"] .highlight .nv { color: #c3a5ff; }
.highlight .mi, .highlight .mf { color: #b07020; }
.highlight .err { color: var(--accent); }

/* --- small screens --- */
@media (max-width: 620px) {
  body { padding: 0 16px 56px; font-size: 14px; }
  .site-head { padding-top: 22px; }
  .site-nav { margin-left: 0; }
  .site-nav { width: 100%; }
  .tag-filter-select { flex: 1 1 200px; min-width: 0; }
  .post-nav { flex-direction: column; }
  .post-nav a { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  .site-nav, .footer, .post-nav, .tag-filter-bar { display: none; }
  body { color: #000; background: #fff; }
}
