/* ============================================================
   1337 — terminal layer over Ghost's Source theme
   Palette matches 1337.show and its Calendly embed.
   Loaded after built/screen.css. :root:root outranks both
   Source's variables and the ones {{ghost_head}} injects.
   ============================================================ */

:root:root,
:root:root.has-light-text {
  --tty-bg:   #050705;
  --tty-fg:   #3ee63e;
  --tty-hi:   #c8ff5a;
  --tty-dim:  #1f8a2a;
  --tty-well: #0c140c;

  --background-color:     var(--tty-bg);
  --ghost-accent-color:   var(--tty-hi);
  --color-darker-gray:    var(--tty-hi);
  --color-primary-text:   var(--tty-fg);
  --color-secondary-text: var(--tty-dim);
  --color-border:         rgb(31 138 42 / .55);
  --color-lighter-gray:   var(--tty-well);
  --color-light-gray:     var(--tty-well);
  --color-mid-gray:       var(--tty-dim);
  --color-dark-gray:      var(--tty-fg);

  --font-sans:       var(--font-mono);
  --font-serif:      var(--font-mono);
  --gh-font-heading: var(--font-mono);
  --gh-font-body:    var(--font-mono);
}

/* ---------- the tube ---------- */
html, body { background: var(--tty-bg); }
body {
  color: var(--tty-fg);
  font-family: var(--font-mono);
  text-shadow: 0 0 3px rgb(62 230 62 / .35);
}
body::after {                     /* scanlines, static */
  content: "";
  position: fixed; inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgb(0 0 0 / .22) 2px 3px);
}
::selection { background: var(--tty-hi); color: var(--tty-bg); text-shadow: none; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--tty-hi);
  outline-offset: 2px;
}

/* One face everywhere; Source's heading tracking and weights retire */
.is-title, .is-body, h1, h2, h3, h4, h5, h6, .gh-navigation-logo {
  font-family: var(--font-mono) !important;
  letter-spacing: 0 !important;
}
.is-title { font-weight: 700; }

/* ---------- inbox: post list reads as BSD mail headers ---------- */
.gh-container { counter-reset: msg; }
.gh-container .gh-card { counter-increment: msg; }
.gh-container .gh-card-title::before {
  content: " N " counter(msg) "  root@" var(--tty-host, "netsys") "  ";
  content: " N " counter(msg) "  root@" var(--tty-host, "netsys") "  " / "";
  color: var(--tty-dim);
  font-weight: 400;
  white-space: pre;
}
.gh-card-link:hover .gh-card-title { opacity: 1; text-decoration: underline; }

/* ---------- images take the phosphor (delete to keep full colour) ---------- */
.gh-card-image img, .gh-article-image img, .gh-header-image img, .gh-featured-image img {
  filter: grayscale(1) sepia(1) hue-rotate(60deg) saturate(2.5) brightness(.8) contrast(1.1);
}

/* ---------- square everything ---------- */
.gh-button, .gh-form, .gh-form-input, .gh-card-image, .gh-article-image,
.kg-card, .kg-image, .kg-bookmark-container, .kg-callout-card, .gh-cta, img {
  border-radius: 0 !important;
}

/* ---------- controls: outlined, inverted on hover ---------- */
.gh-button, .gh-form .gh-button {
  background: transparent;
  color: var(--tty-hi);
  border: 1px solid var(--tty-hi);
  box-shadow: none;
}
.gh-button:hover, .gh-form .gh-button:hover {
  background: var(--tty-hi);
  color: var(--tty-bg);
  opacity: 1;
  text-shadow: none;
}
.gh-form {
  background: var(--tty-bg);
  border: 1px solid var(--tty-dim);
}
.gh-form-input, .gh-form-input::placeholder { color: var(--tty-fg); font-family: var(--font-mono); }

/* ---------- post body ---------- */
.gh-content hr { background: none; border: 0; border-top: 1px dashed var(--tty-dim); }
.gh-content blockquote:not([class]) { border-left: 2px solid var(--tty-dim); }
.gh-content pre, .gh-content :not(pre) > code { background: var(--tty-well); color: var(--tty-fg); border-radius: 0; }
.gh-content .kg-callout-card { background: var(--tty-well) !important; color: var(--tty-fg); }
.gh-article-tag, .gh-card-tag { color: var(--tty-dim); }

/* ---------- the transcript under the navigation ---------- */
.tty-outer { margin-top: 24px; }
.tty {
  margin: 0;
  padding: 14px 16px;
  background: var(--tty-bg);
  border: 1px solid var(--tty-dim);
  color: var(--tty-fg);
  font: 15px/1.45 var(--font-mono);
  white-space: pre-wrap;
  overflow-x: auto;
  text-shadow: 0 0 4px rgb(62 230 62 / .45);
}
.tty .sys, .tty-signoff { color: var(--tty-dim); }
.ps1 { color: var(--tty-dim); }
.cmd, .tty .say { color: var(--tty-hi); }
.cursor-block {
  display: inline-block;
  width: .6em; height: 1.1em;
  vertical-align: text-bottom;
  background: var(--tty-fg);
  animation: tty-blink 1.06s steps(1) infinite;
}
@keyframes tty-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor-block { animation: none; } }

.tty-signoff {
  margin-top: 24px;
  font: 14px/1.5 var(--font-mono);
  white-space: pre-wrap;
}

/* ---------- 404 ---------- */
.nf-main { padding-block: 24px 64px; }
.nf-log { min-height: 55vh; }
.nf-exit { margin-top: 20px; }
.nf-truth { margin-top: 28px; max-width: 64ch; color: var(--tty-dim); font-size: 14px; line-height: 1.5; }
.vh {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
