/* ============ d0tslash — terminal theme ============ */

:root {
  --bg: #0b0912;
  --bg-soft: #131020;
  --bg-card: #16121f;
  --border: #2a2440;
  --text: #c9c4d4;
  --text-dim: #7d7691;
  --accent: #a78bfa;   /* purple */
  --accent-2: #4ade80; /* green */
  --accent-3: #f472b6; /* pink */
  --shadow: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
  --bg: #f4f2fa;
  --bg-soft: #ffffff;
  --bg-card: #ffffff;
  --border: #ddd6ee;
  --text: #2b2440;
  --text-dim: #6f6a85;
  --accent: #7c3aed;
  --accent-2: #16a34a;
  --accent-3: #db2777;
  --shadow: rgba(80, 60, 140, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  /* slashed zero, so d0tslash never reads as "dotslash" */
  font-feature-settings: "zero" 1;
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  transition: background 0.25s ease, color 0.25s ease;
}

/* subtle scanlines for CRT vibe (dark mode only) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.015) 0px,
    rgba(255, 255, 255, 0.015) 1px,
    transparent 1px,
    transparent 3px
  );
}
[data-theme="light"] body::before { display: none; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }

/* ---------- header ---------- */
header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 0;
  gap: 1rem;
}

.logo {
  font-family: "Silkscreen", monospace;
  font-size: 1.5rem;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
}
.logo .tilde { margin-right: 0.4rem; }
.logo .cursor-block { margin-left: 0.4rem; }
.logo .tilde { color: var(--accent-2); }
/* the pixel font draws 0 and O identically — colour the zero so the name reads right */
.zero {
  color: var(--accent-2);
  position: relative;
}
.zero::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  height: 0.09em;
  background: currentColor;
  transform: rotate(-38deg);
}
.logo .cursor-block {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  background: var(--accent-2);
  animation: blink 1.1s steps(1) infinite;
}

nav.links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
nav.links a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
}
nav.links a:hover, nav.links a.active { color: var(--accent); }
nav.links a::before { content: "./"; color: var(--accent-2); opacity: 0.7; }

.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.15s;
}
.theme-toggle:hover { border-color: var(--accent); }

/* ---------- terminal hero ---------- */
.terminal {
  margin: 2.5rem 0 1.5rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px var(--shadow);
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-soft) 70%, var(--bg));
}
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--border); }
.dot.r { background: #f87171; } .dot.y { background: #fbbf24; } .dot.g { background: #34d399; }
.terminal-title {
  margin-left: 0.6rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.terminal-body {
  padding: 1.4rem 1.6rem 1.6rem;
  min-height: 220px;
  cursor: text;
}
.term-line { display: flex; gap: 0.6rem; align-items: baseline; flex-wrap: wrap; }
.term-line .prompt { color: var(--accent-2); font-weight: 700; flex-shrink: 0; }
.term-line .cmd { color: var(--text); font-weight: 600; }
.term-out { color: var(--text-dim); padding: 0.1rem 0 0.5rem 1.4rem; }
.term-out .hl { color: var(--accent); }
.term-out .hl2 { color: var(--accent-2); }
.term-out a { color: var(--accent); }

.term-input-line { display: flex; gap: 0.6rem; align-items: baseline; }
#term-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  flex: 1;
  caret-color: var(--accent-2);
}
.hint { color: var(--text-dim); font-size: 0.8rem; padding-left: 1.4rem; opacity: 0.7; }

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

/* ---------- search bar ---------- */
.grep-bar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1.3rem;
  margin: 1.5rem 0 1rem;
  transition: border-color 0.15s;
}
.grep-bar:focus-within { border-color: var(--accent); }
.grep-bar .prompt { color: var(--accent-2); font-weight: 700; }
.grep-bar .flag { color: var(--text); }
.grep-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--accent);
  font: inherit;
}
.grep-bar input::placeholder { color: var(--text-dim); opacity: 0.6; }
.grep-bar .path { color: var(--accent); opacity: 0.8; }
.grep-bar kbd {
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0 0.4rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ---------- tag filters ---------- */
.tag-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0.5rem 0 1rem; }
.tag-chip {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.85rem;
  padding: 0.2rem 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
}
.tag-chip:hover { border-color: var(--accent); color: var(--accent); }
.tag-chip.active {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- posts ---------- */
.post-list { list-style: none; }
.post-item {
  padding: 2.2rem 0;
  border-bottom: 1px dashed var(--border);
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 2rem;
  align-items: center;
}
.post-item.hidden { display: none; }

.post-meta { font-size: 0.85rem; margin-bottom: 0.4rem; }
.post-meta .date { color: var(--accent-2); }
.post-meta .tag { color: var(--accent); margin-left: 0.8rem; }

.post-title {
  font-family: "Silkscreen", monospace;
  font-size: 1.55rem;
  line-height: 1.3;
  margin: 0.2rem 0 0.6rem;
}
.post-title a { color: var(--text); text-decoration: none; transition: color 0.15s; }
.post-title a:hover { color: var(--accent); }

.post-desc { color: var(--text-dim); font-size: 0.95rem; }

.read-link {
  display: inline-block;
  margin-top: 0.8rem;
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
}
.read-link:hover { text-decoration: underline; }

.post-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Silkscreen", monospace;
  font-size: 1.1rem;
  color: var(--accent);
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    radial-gradient(circle at 75% 80%, color-mix(in srgb, var(--accent-2) 15%, transparent), transparent 55%),
    var(--bg-soft);
  overflow: hidden;
  text-align: center;
  padding: 0.5rem;
}

/* image thumbnails: add class "has-img" and put an <img> inside .post-thumb */
.post-thumb.has-img { padding: 0; }
.post-thumb.has-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.no-results {
  text-align: center;
  color: var(--text-dim);
  padding: 3rem 0;
  display: none;
}
.no-results .hl2 { color: var(--accent-2); }

/* ---------- article pages ---------- */
.article { max-width: 760px; margin: 3rem auto; }
.article h1 {
  font-family: "Silkscreen", monospace;
  font-size: 2rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}
.article .post-meta { margin-bottom: 2rem; }
.article h2 {
  font-family: "Silkscreen", monospace;
  font-size: 1.25rem;
  color: var(--accent);
  margin: 2.2rem 0 0.8rem;
}
.article p { margin: 1rem 0; color: var(--text); }
.article pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  margin: 1.2rem 0;
  font-size: 0.9rem;
}
.article code { color: var(--accent-2); }
.article img {
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  display: block;
  margin: 1.2rem auto;
}
.article figure { margin: 1.5rem 0; }
.article figcaption {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}
.article figcaption::before { content: "// "; color: var(--accent-2); }
.article a { color: var(--accent); }
/* the pixel font mangles digits at large sizes — 404 gets the mono treatment */
.code-404 {
  font-family: "JetBrains Mono", ui-monospace, monospace !important;
  font-size: 5rem !important;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  line-height: 1.1;
}
.back-link { color: var(--accent-2); text-decoration: none; }
.back-link:hover { text-decoration: underline; }

/* ---------- about page ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 2rem 0; }
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.6rem;
}
.card h3 {
  font-family: "Silkscreen", monospace;
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 0.8rem;
}
.card ul { list-style: none; }
.card li { padding: 0.25rem 0; color: var(--text-dim); }
.card li::before { content: "❯ "; color: var(--accent-2); }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 2rem 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}
footer .hl { color: var(--accent); }
footer .hl2 { color: var(--accent-2); }
footer a { color: var(--accent); text-decoration: none; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .post-item { grid-template-columns: 1fr; gap: 1rem; }
  .post-thumb { max-width: 340px; }
  .nav { flex-direction: column; align-items: flex-start; }
  .about-grid { grid-template-columns: 1fr; }
  .post-title { font-size: 1.25rem; }
}
