/* ── terminal theme ─────────────────────────────────────────── */

:root {
  --bg: #0e1116;
  --bg-alt: #151b24;
  --border: #242e3d;
  --fg: #c9d3df;
  --dim: #7d8899;
  --green: #45d17e;
  --blue: #64aff2;
  --cyan: #56b6c2;
  --amber: #e5c07b;
  --red: #e06c75;
  --purple: #c678dd;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", "Source Code Pro",
    "Noto Sans Mono CJK JP", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  scrollbar-color: var(--border) var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.75;
}

::selection {
  background: var(--green);
  color: var(--bg);
}

/* ── header ─────────────────────────────────────────────────── */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.prompt-nav {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1.25rem;
}

.prompt { white-space: nowrap; }
.prompt-user, .prompt-host { color: var(--green); font-weight: 700; }
.prompt-at, .prompt-colon, .prompt-dollar { color: var(--dim); }
.prompt-path { color: var(--blue); font-weight: 700; }

.nav-entries {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.nav-entries a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.nav-entries a:hover { text-decoration: underline; }

.nav-entries a.active {
  color: var(--bg);
  background: var(--blue);
  padding: 0 0.3rem;
}

/* ── main ───────────────────────────────────────────────────── */

.site-main {
  flex: 1;
  width: 100%;
  max-width: 52rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.cat-line {
  color: var(--dim);
  margin: 0 0 2rem;
  word-break: break-all;
}

/* home hero */

.hero {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-alt);
}

.hero > p { margin: 0; }

.hero .avatar {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.hero-text { min-width: 15rem; flex: 1; }
.hero-text h1 { margin-top: 0; }
.hero-text h1::before { content: none; }
.hero-text p { margin: 0.5rem 0 0; color: var(--dim); }
.hero-text a { color: var(--cyan); }

/* headings — shell-comment style prefixes */

h1, h2, h3, h4 {
  line-height: 1.35;
  margin: 2.2em 0 0.8em;
  font-weight: 700;
}

h1 { font-size: 1.55rem; margin-top: 0.2em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: 1rem; }

h1::before { content: "# ";    color: var(--green); }
h2::before { content: "## ";   color: var(--green); }
h3::before { content: "### ";  color: var(--green); }
h4::before { content: "#### "; color: var(--green); }

/* links */

a { color: var(--cyan); }
a:hover { color: var(--green); }

/* lists, rules, quotes */

hr {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 2.5rem 0;
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.2rem 1.25rem;
  border-left: 2px solid var(--green);
  color: var(--dim);
}

/* code */

code {
  font-family: var(--mono);
  font-size: 0.95em;
}

:not(pre) > code {
  color: var(--amber);
  background: var(--bg-alt);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

div.highlighter-rouge, figure.highlight {
  margin: 1.5rem 0;
}

pre.highlight, .highlight > pre {
  margin: 0;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  background: #0a0d12;
  border: 1px solid var(--border);
  border-radius: 6px;
  line-height: 1.6;
}

/* tables */

table {
  border-collapse: collapse;
  margin: 1.5rem 0;
  display: block;
  overflow-x: auto;
  max-width: 100%;
}

th, td {
  border: 1px solid var(--border);
  padding: 0.35rem 0.8rem;
  text-align: left;
}

th { background: var(--bg-alt); color: var(--green); }

/* images */

img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

/* listings (auto-generated index pages) */

ul.listing {
  list-style: none;
  padding-left: 0;
}

ul.listing li::before {
  content: "-rw-r--r--  ";
  color: var(--dim);
}

ul.listing.listing-columns {
  columns: 3 14rem;
  column-gap: 2rem;
}

ul.listing.listing-columns li::before { content: ""; }

.recent { margin-top: 3.5rem; }

/* ── footer ─────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--dim);
  font-size: 0.85rem;
}

.site-footer p {
  max-width: 52rem;
  margin: 0.35rem auto;
  padding: 0 1.25rem;
}

.site-footer p:first-child { padding-top: 1rem; }
.site-footer p:last-child { padding-bottom: 1rem; }

.site-footer a { color: var(--dim); }
.site-footer a:hover { color: var(--green); }

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 0.15em;
  vertical-align: text-bottom;
  background: var(--green);
  animation: blink 1.2s steps(1) infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
}

/* ── rouge syntax highlighting (one-dark-ish) ───────────────── */

.highlight { color: #b8c2cf; }
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs,
.highlight .cp, .highlight .cpf { color: #66707e; font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp,
.highlight .kr, .highlight .kc, .highlight .kv, .highlight .ow { color: var(--purple); }
.highlight .kt, .highlight .nc, .highlight .nn { color: var(--amber); }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb,
.highlight .sc, .highlight .sd, .highlight .sh, .highlight .sx,
.highlight .sr, .highlight .ss, .highlight .si, .highlight .se { color: #98c379; }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh,
.highlight .mo, .highlight .mb, .highlight .il { color: #d19a66; }
.highlight .nf, .highlight .fm, .highlight .nx { color: var(--blue); }
.highlight .no, .highlight .nd, .highlight .nl, .highlight .nt { color: var(--red); }
.highlight .nb, .highlight .bp, .highlight .vc, .highlight .vg,
.highlight .vi, .highlight .nv { color: var(--cyan); }
.highlight .o, .highlight .p, .highlight .pi { color: #9aa5b1; }
.highlight .gh, .highlight .gu { color: var(--blue); font-weight: 700; }
.highlight .gd { color: var(--red); }
.highlight .gi { color: #98c379; }
.highlight .err { color: var(--red); }

/* ── responsive tweaks ──────────────────────────────────────── */

@media (max-width: 600px) {
  body { font-size: 14px; }
  .site-main { padding-top: 1.25rem; }
}
