/* ---------------------------------------------------------------
   lpr.sh // ctf writeups
   terminal-flavored, no build tooling required to read this file
--------------------------------------------------------------- */

:root {
  --bg: #0a0d0a;
  --bg-raised: #0f130f;
  --border: #1f2b20;
  --fg: #cfe8d8;
  --fg-dim: #7c9384;
  --accent: #39ff88;
  --accent-dim: #1f8f52;
  --amber: #ffb347;
  --red: #ff5f5f;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo,
    Consolas, "Liberation Mono", monospace;
  --max-width: 860px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.6;
  position: relative;
}

/* subtle CRT scanline overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.015) 0px,
    rgba(255, 255, 255, 0.015) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent-dim);
}

a:hover {
  color: #ffffff;
  border-bottom-color: var(--accent);
  text-shadow: 0 0 8px var(--accent);
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* ---------------- header / nav ---------------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to bottom, var(--bg-raised), var(--bg));
}

.site-header .wrap {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.brand {
  display: block;
  font-size: 1.15rem;
  color: var(--fg);
  border-bottom: none;
  margin-bottom: 0.9rem;
}

.brand .prompt {
  color: var(--accent);
}

.brand .path {
  color: var(--fg-dim);
}

.brand .cursor {
  display: inline-block;
  width: 0.55em;
  background: var(--accent);
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
  margin-left: 2px;
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

nav.main-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0;
  margin: 0;
  padding: 0;
}

nav.main-nav li:not(:last-child)::after {
  content: "|";
  color: var(--border);
  margin: 0 0.6rem;
}

nav.main-nav a {
  border-bottom: none;
  color: var(--fg-dim);
}

nav.main-nav a:hover,
nav.main-nav a.active {
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent);
}

/* ---------------- terminal window chrome ---------------- */

.term {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 1.75rem 0;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  background: #12170f;
  border-bottom: 1px solid var(--border);
}

.term-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.term-dot.red {
  background: #ff5f56;
}
.term-dot.yellow {
  background: #ffbd2e;
}
.term-dot.green {
  background: #27c93f;
}

.term-title {
  margin-left: 0.5rem;
  color: var(--fg-dim);
  font-size: 0.8rem;
}

.term-body {
  padding: 1rem 1.25rem;
}

/* ---------------- headings ---------------- */

h1,
h2,
h3,
h4 {
  color: #eafff2;
  line-height: 1.3;
  font-weight: 600;
}

h1 {
  font-size: 1.6rem;
}
h2 {
  font-size: 1.25rem;
  margin-top: 2.25rem;
}
h3 {
  font-size: 1.05rem;
}

h1::before,
h2::before {
  content: "# ";
  color: var(--accent-dim);
}

/* ---------------- writeup list ---------------- */

.entry-list {
  margin-top: 1.5rem;
}

.entry-list-header {
  color: var(--fg-dim);
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 0.25rem;
}

.entry {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.entry:hover {
  background: rgba(57, 255, 136, 0.04);
}

.entry-date {
  color: var(--fg-dim);
  font-size: 0.85rem;
  min-width: 6.5rem;
}

.entry-title a {
  border-bottom: none;
  font-weight: 600;
}

.entry-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.tag {
  font-size: 0.72rem;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  border-radius: 4px;
  padding: 0.05rem 0.4rem;
  border-bottom: none !important;
  white-space: nowrap;
}

.tag:hover {
  background: var(--accent-dim);
  color: #06120b;
}

/* ---------------- post meta ---------------- */

.post-meta {
  color: var(--fg-dim);
  font-size: 0.85rem;
  margin: -0.5rem 0 1.5rem;
}

.post-meta .sep {
  margin: 0 0.5rem;
  color: var(--border);
}

/* ---------------- code blocks ---------------- */

pre,
code {
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

code {
  background: rgba(57, 255, 136, 0.08);
  color: #d3ffe4;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

pre {
  background: #0d110d;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  line-height: 1.5;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
}

blockquote {
  border-left: 3px solid var(--accent-dim);
  margin: 1.25rem 0;
  padding: 0.2rem 1rem;
  color: var(--fg-dim);
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.25rem 0;
  font-size: 0.9rem;
}

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

th {
  color: var(--accent);
  background: var(--bg-raised);
}

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

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

/* ---------------- ascii banner ---------------- */

.ascii-banner {
  color: var(--accent);
  font-size: 0.6rem;
  line-height: 1.15;
  white-space: pre;
  overflow-x: auto;
  text-shadow: 0 0 10px rgba(57, 255, 136, 0.35);
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .ascii-banner {
    font-size: 0.85rem;
  }
}

.tagline {
  color: var(--fg-dim);
  margin-top: -0.5rem;
}

.tagline .accent {
  color: var(--accent);
}

/* ---------------- tag cloud ---------------- */

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0;
}

/* ---------------- social icons ---------------- */

.social-icons {
  display: flex;
  gap: 1rem;
  margin: -0.5rem 0 1.5rem;
}

.social-icons a {
  display: inline-flex;
  color: var(--fg-dim);
  border-bottom: none;
  transition: color 0.15s ease;
}

.social-icons a:hover {
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent);
}

.easter-egg {
  color: var(--fg-dim);
  opacity: 0.2;
  border-bottom: none !important;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.easter-egg:hover,
.easter-egg:focus-visible {
  opacity: 1;
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent);
}

/* ---------------- footer ---------------- */

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--fg-dim);
  font-size: 0.8rem;
}

.site-footer .wrap {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
}

.site-footer a {
  color: var(--fg-dim);
  border-bottom: 1px dashed var(--border);
}

.site-footer a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------------- misc ---------------- */

.back-link {
  display: inline-block;
  margin-top: 2.5rem;
  border-bottom: none;
  color: var(--fg-dim);
}

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

.empty-state {
  color: var(--fg-dim);
  font-style: italic;
}

::selection {
  background: var(--accent-dim);
  color: #06120b;
}

/* ---------------- syntax highlighting (prism) ---------------- */

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: var(--fg-dim);
  font-style: italic;
}

.token.punctuation {
  color: var(--fg-dim);
}

.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted {
  color: var(--red);
}

.token.boolean,
.token.number {
  color: var(--amber);
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: var(--accent);
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: #d3ffe4;
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #7dd3fc;
}

.token.function,
.token.class-name {
  color: #ffd580;
}

.token.regex,
.token.important,
.token.variable {
  color: var(--amber);
}

.highlight-line {
  background: rgba(57, 255, 136, 0.08);
  display: block;
  margin: 0 -1.1rem;
  padding: 0 1.1rem;
}
