/* ============================================
   CHRONDUIT PROTOCOL — STYLESHEET
   Optimised for terminal browsers (links2, w3m)
   Degrades intentionally in graphical browsers
   ============================================ */

/* --- ROOT VARIABLES --- */
/* These set the colour palette and font.
   Change --green to #ffb000 for amber instead. */
:root {
  --green: #00ff41;       /* classic terminal green */
  --dimgreen: #00a832;    /* dimmer green for secondary text */
  --bg: #0a0a0a;          /* near-black background */
  --warn: #ff4444;        /* red for warnings/corruption */
  --grey: #444444;        /* for borders and dividers */
  --max-width: 80ch;      /* 80 character column width — terminal standard */
}

/* --- RESET & BASE --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--green);
  font-family: "Courier New", Courier, monospace; /* monospace is essential */
  font-size: 14px;
  line-height: 1.6;
  max-width: var(--max-width);
  margin: 0 auto;           /* centres the column */
  padding: 1em;
}

/* --- HEADINGS --- */
h1, h2, h3 {
  color: var(--green);
  font-family: "Courier New", Courier, monospace;
  font-weight: bold;
  margin-bottom: 0.5em;
  margin-top: 1em;
}

h1 { font-size: 1.2em; }
h2 { font-size: 1.0em; }
h3 { font-size: 0.95em; }

/* --- PARAGRAPHS & TEXT --- */
p {
  margin-bottom: 1em;
  max-width: 72ch; /* comfortable reading width */
}

/* --- LINKS --- */
a {
  color: var(--dimgreen);
  text-decoration: underline;
}

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

a:visited {
  color: var(--dimgreen);
}

/* --- HORIZONTAL RULES (dividers) --- */
hr {
  border: none;
  border-top: 1px solid var(--grey);
  margin: 1.5em 0;
}

/* --- PRE / CODE BLOCKS --- */
/* Used for ASCII art, terminal output, garbled text */
pre {
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  line-height: 1.4;
  overflow-x: auto;
  margin-bottom: 1em;
  color: var(--green);
}

code {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.95em;
}

/* --- SPECIAL CLASSES --- */

/* .header-bar — the top bar that appears on every page */
.header-bar {
  border-bottom: 1px solid var(--grey);
  padding-bottom: 0.75em;
  margin-bottom: 1.5em;
  color: var(--dimgreen);
  font-size: 0.85em;
}

/* .footer-bar — the bottom bar on every page */
.footer-bar {
  border-top: 1px solid var(--grey);
  padding-top: 0.75em;
  margin-top: 2em;
  color: var(--dimgreen);
  font-size: 0.8em;
}

/* .nav — simple navigation links */
.nav {
  margin-bottom: 1.5em;
  font-size: 0.85em;
}

.nav a {
  margin-right: 2em;
}

/* .warn-box — boxed warning/notice */
.warn-box {
  border: 1px solid var(--warn);
  padding: 0.75em 1em;
  margin-bottom: 1.5em;
  color: var(--warn);
  font-size: 0.85em;
}

/* .log-meta — metadata line above a log entry */
.log-meta {
  color: var(--dimgreen);
  font-size: 0.8em;
  margin-bottom: 0.75em;
}

/* .corrupt — garbled/corrupted text sections */
/* Looks broken intentionally */
.corrupt {
  color: var(--warn);
  font-size: 0.85em;
  opacity: 0.75;
  word-break: break-all;
  letter-spacing: 0.05em;
}

/* .redacted — solid block redaction */
.redacted {
  background-color: var(--green);
  color: var(--green); /* text invisible against bg */
  user-select: none;
}

/* .dim — dimmed secondary text */
.dim {
  color: var(--dimgreen);
  font-size: 0.85em;
}

/* .blink — slow blinking cursor effect */
/* Won't work in links2, purely decorative in GUI browsers */
.blink {
  animation: blink-anim 1.2s step-end infinite;
}

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

/* .scanline — subtle scanline overlay for GUI browsers */
/* links2 ignores this entirely */
.scanline::after {
  content: "";
  display: block;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
  z-index: 9999;
}
