/* ============================================================
   CRT MONITOR THEME
   Monochrome blue-white phosphor, color-shifted from classic
   green terminal to a cool blue/purple hue. Scanlines + vignette
   simulate an old CRT screen. <pre> (ASCII art) is the priority:
   it must render with zero visual interference.
   ============================================================ */

/* OpenDyslexicMono: https://opendyslexic.org/ */
@import url('https://fonts.cdnfonts.com/css/open-dyslexic');

:root {
  /* deep indigo/purple-blue, like a monitor housing in a dark room */
  --bg: #0a0820;
  --bg-deep: #050310;

  /* bright blue-white phosphor text */
  --fg: #dce8ff;
  --fg-dim: rgba(220, 232, 255, 0.65);

  /* saturated cool blue accent, stays in the same hue family
     so the whole page reads as one color-shifted monochrome screen */
  --accent: #5fc9ff;
  --accent-dim: rgba(95, 201, 255, 0.4);

  --glow: rgba(140, 205, 255, 0.85);

  --radius: 0;
  --font-size: 1.2rem;
  --line-height: 1.5em;

  --font-mono:
    "OpenDyslexicMono",
    "JetBrains Mono",
    Monaco,
    Consolas,
    "Ubuntu Mono",
    monospace;
}

html {
  box-sizing: border-box;
}

*,
*:before,
*:after {
  box-sizing: inherit;
  margin: 0;
  padding: 0;
}

html,
body {
  background: var(--bg-deep);
}

body {
  position: relative;
  min-height: 100vh;
  font-family: var(--font-mono);
  font-size: var(--font-size);
  font-weight: 400;
  line-height: var(--line-height);
  background: radial-gradient(ellipse at center, var(--bg) 0%, var(--bg-deep) 100%);
  color: var(--fg);
  text-rendering: optimizeLegibility;
  font-variant-ligatures: none;
  -webkit-overflow-scrolling: touch;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  padding: 40px 32px;
  text-shadow:
    0 0 2px var(--glow),
    0 0 6px var(--glow),
    0 0 14px rgba(95, 201, 255, 0.35);
}

/* --- CRT scanlines: fixed overlay, sits above content --- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 1px,
    rgba(0, 0, 20, 0.35) 2px,
    rgba(0, 0, 20, 0.35) 3px
  );
  pointer-events: none;
  z-index: 9999;
}

/* --- CRT vignette: darkens the edges of the "screen" --- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0, 0, 15, 0.55) 100%
  );
  pointer-events: none;
  z-index: 9998;
}

h1 {
  font-size: calc(var(--font-size) * 1.45);
  letter-spacing: 0;
}

h2 {
  font-size: calc(var(--font-size) * 1.3);
  letter-spacing: 0;
}

h3 {
  font-size: calc(var(--font-size) * 1.15);
  letter-spacing: 0;
}

h4,
h5,
h6 {
  font-size: var(--font-size);
  letter-spacing: 0;
}

h1, h2, h3, h4, h5, h6,
p, ul, ol,
img, figure, video,
table {
  margin: 25px 0;
}

a {
  color: var(--accent);
  text-decoration-color: var(--accent-dim);
}

a:hover {
  text-decoration-style: solid;
}

button {
  position: relative;
  font: inherit;
  font-weight: bold;
  text-decoration: none;
  text-align: center;
  background: transparent;
  color: var(--accent);
  padding: 5px 18px;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  transition: background 0.15s linear;
  appearance: none;
  cursor: pointer;
  outline: none;
}

button:hover {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
}

button:focus-visible,
a:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

fieldset {
  display: inline-block;
  border: 1px solid var(--fg-dim);
  border-radius: var(--radius);
  padding: 10px;
}

fieldset *:first-child {
  margin-top: 0;
}

fieldset input,
fieldset select,
fieldset textarea,
fieldset label,
fieldset button {
  margin-top: calc(var(--line-height) * 0.5);
  width: 100%;
}

label {
  display: inline-block;
}

label input {
  margin-top: 0;
}

input,
textarea,
select {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--fg-dim);
  border-radius: var(--radius);
  padding: 10px;
  font: inherit;
  appearance: none;
}

input[type="checkbox"] {
  width: auto;
}

input:focus-visible,
input:active,
textarea:focus-visible,
textarea:active,
select:focus-visible,
select:active {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

input:active,
textarea:active,
select:active {
  box-shadow: none;
}

select {
  background-image: linear-gradient(
      45deg,
      transparent 50%,
      var(--fg) 50%
    ),
    linear-gradient(135deg, var(--fg) 50%, transparent 50%);
  background-position: calc(100% - 20px), calc(100% - 15px);
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

select option {
  background: var(--bg);
}

input[type="checkbox"],
input[type="radio"] {
  vertical-align: middle;
  padding: 10px;
  box-shadow: inset 0 0 0 3px var(--bg);
}

input[type="radio"] {
  display: inline-block;
  width: 10px !important;
  height: 10px !important;
  border-radius: 20px;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background: var(--accent);
}

img {
  display: block;
  max-width: 100%;
  border: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 6px;
  overflow: hidden;
}

figure img,
figure video {
  margin-bottom: 0;
}

figure figcaption {
  background: var(--accent);
  color: var(--bg-deep);
  text-align: center;
  font-size: 1em;
  font-weight: normal;
  margin-top: -6px;
  text-shadow: none;
}

ul,
ol {
  margin-left: 4ch;
  padding: 0;
}

ul ul,
ul ol,
ol ul,
ol ol {
  margin-top: 0;
}

li::marker {
  color: var(--accent);
}

ul li,
ol li {
  position: relative;
}

code,
kbd {
  font-family: var(--font-mono) !important;
  font-feature-settings: normal;
  font-variant-ligatures: none;
  background: rgba(140, 180, 255, 0.06);
  color: var(--accent);
  padding: 0 6px;
  margin: 0 2px;
  font-size: 0.95em;
}

code {
  border: 1px solid var(--accent-dim);
}

kbd {
  border-top: 1px solid var(--accent-dim);
  border-left: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  border-bottom: 3px solid var(--accent);
  border-radius: 4px;
}

code code {
  background: transparent;
  padding: 0;
  margin: 0;
}

/* --- <pre>: ASCII art priority. No border, no background, no
   distinct color, no ligatures — it must blend seamlessly into
   the page and never distort character alignment. --- */
pre {
  tab-size: 4;
  background: transparent;
  color: inherit;
  text-shadow: inherit;
  padding: 0;
  margin: 25px 0;
  font: inherit;
  overflow-x: auto;
  border: none;
  font-variant-ligatures: none;
  white-space: pre;
}

pre code {
  background: none;
  color: inherit;
  margin: 0;
  padding: 0;
  font: inherit;
  border: none;
  font-variant-ligatures: none;
}

sup {
  line-height: 0;
}

abbr {
  position: relative;
  text-decoration-style: wavy;
  text-decoration-color: var(--accent);
  cursor: help;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.25em;
}

mark {
  background: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--bg-deep);
  text-shadow: none;
}

blockquote {
  position: relative;
  border-top: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  margin: 0;
  padding: 25px;
}

blockquote:before {
  content: ">";
  display: block;
  position: absolute;
  left: 0;
  color: var(--accent);
}

blockquote p:first-child {
  margin-top: 0;
}

blockquote p:last-child {
  margin-bottom: 0;
}

table {
  table-layout: auto;
  border-collapse: collapse;
}

table,
th,
td {
  border: 1px solid var(--fg-dim);
  padding: 10px;
}

th {
  border-style: solid;
  color: var(--fg);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

hr {
  width: 100%;
  border: none;
  background: var(--accent);
  height: 1px;
  box-shadow: 0 0 6px var(--accent);
}

/* Bold elements */

h1, h2, h3, h4, h5, h6,
b, strong,
th,
button {
  font-weight: 600;
}
