/* Post pages: PS1 framing, plain readable body text. */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --ink: #e4e8f8;
  --dim: #8d97c9;
  --gold: #ffd34d;
  --edge: #eef0ff;
  --navy: #0b0d33;
  --pad: clamp(20px, 5vw, 52px);
  --display: "Arial Black", "Arial Bold", Gadget, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
}

html { background: #0a0818; }
body {
  margin: 0;
  color: var(--ink);
  font: 400 clamp(17px, 1rem + 0.25vw, 19px) / 1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--gold); color: #0a0818; }

/* the room from the title screen, darkened, behind everything */
.room {
  position: fixed; inset: 0; z-index: -1;
  background:
    linear-gradient(rgba(10, 8, 24, 0.5), rgba(10, 8, 24, 0.82)),
    url("room.png") center / cover no-repeat;
  image-rendering: pixelated;
}

/* --- top bar */
.topbar, main, .post-footer { max-width: 780px; margin-inline: auto; padding-inline: 16px; }
.topbar { padding-top: clamp(18px, 4vh, 36px); }
.home {
  font: italic 900 15px/1 var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dim);
  text-decoration: none;
  text-shadow: 2px 2px 0 #000;
}
.home:hover, .home:focus-visible { color: #fff; }

/* --- the window */
.window {
  margin-top: 16px;
  padding: var(--pad);
  background: rgba(9, 12, 46, 0.94);
  border: 3px solid var(--edge);
  border-radius: 10px;
  box-shadow: 0 0 0 3px var(--navy), 10px 10px 0 rgba(0, 0, 0, 0.55), inset 0 2px 0 rgba(255, 255, 255, 0.18);
  animation: window-open 0.16s steps(4);
}
@keyframes window-open { from { transform: scaleY(0); } }

.post-header {
  margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) 1.6em;
  padding: calc(var(--pad) * 0.8) var(--pad);
  background: linear-gradient(180deg, rgba(52, 74, 196, 0.95) 0%, rgba(20, 28, 116, 0.95) 100%);
  border-bottom: 2px solid rgba(238, 240, 255, 0.55);
  border-radius: 7px 7px 0 0;
}
.post-date { font: 700 13px/1 var(--mono); letter-spacing: 0.1em; color: var(--gold); text-shadow: 1px 1px 0 #000; }
.post-title {
  margin: 0.35em 0 0;
  font: italic 900 clamp(30px, 5.2vw, 50px) / 1.08 var(--display);
  letter-spacing: -0.01em;
  filter: drop-shadow(2px 2px 0 var(--navy)) drop-shadow(2px 2px 0 #000);
}
.post-title span {
  color: transparent;
  background: linear-gradient(180deg, #fff 0%, #d6e4ff 40%, #7393ff 50%, #2b3fb8 52%, #8fb0ff 75%, #f4f8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding-right: 0.08em;
}

/* --- body copy: readable first */
.post-body > :first-child { margin-top: 0; }
.post-body > :last-child { margin-bottom: 0; }
.post-body p, .post-body ul, .post-body ol { margin: 0 0 1.1em; }
.post-body li + li { margin-top: 0.3em; }
.post-body h1, .post-body h2, .post-body h3, .post-body h4 {
  margin: 1.8em 0 0.6em;
  font-family: var(--display);
  font-style: italic;
  line-height: 1.2;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
}
.post-body h1 { font-size: 1.45em; }
.post-body h2 { font-size: 1.3em; }
.post-body h3, .post-body h4 { font-size: 1.08em; color: var(--gold); }
.post-body a { color: #9cc0ff; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.post-body a:hover { color: var(--gold); }
.post-body strong { color: #fff; }

.post-body blockquote {
  margin: 1.6em 0;
  padding: 0.9em 1.2em;
  background: linear-gradient(180deg, rgba(52, 74, 196, 0.35), rgba(20, 28, 116, 0.35));
  border: 2px solid rgba(238, 240, 255, 0.7);
  border-radius: 8px;
  font-style: italic;
}
.post-body blockquote p:last-child { margin-bottom: 0; }

.post-body img, .post-body iframe, .post-body video {
  display: block;
  max-width: 100%;
  margin: 1.6em auto;
  border: 3px solid var(--edge);
  border-radius: 4px;
  box-shadow: 0 0 0 3px var(--navy), 6px 6px 0 rgba(0, 0, 0, 0.5);
}
.post-body img { height: auto; }
.post-body iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; }

/* code looks like the CRT on the desk */
.post-body code { font: 0.86em/1.5 var(--mono); color: #5cff8a; background: #04100c; padding: 0.12em 0.35em; border-radius: 3px; }
.post-body pre {
  margin: 1.6em 0;
  padding: 1em 1.2em;
  overflow-x: auto;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px), #04100c;
  border: 2px solid #2a3a8a;
  border-radius: 6px;
  box-shadow: inset 0 0 28px rgba(92, 255, 138, 0.08);
}
.post-body pre code { padding: 0; background: none; }
.post-body .highlight .k, .post-body .highlight .kd, .post-body .highlight .nb { color: #3fd6ff; }
.post-body .highlight .s, .post-body .highlight .s1, .post-body .highlight .s2 { color: #ffd35c; }
.post-body .highlight .nf, .post-body .highlight .nc { color: #ff7ad9; }
.post-body .highlight .c, .post-body .highlight .c1, .post-body .highlight .cm { color: #6b7aa6; }

.post-body hr { height: 3px; margin: 2.2em 0; border: 0; background: linear-gradient(90deg, transparent, var(--edge), transparent); }
.post-body table { width: 100%; margin: 1.6em 0; border-collapse: collapse; font-size: 0.92em; }
.post-body th, .post-body td { padding: 0.5em 0.7em; border: 1px solid rgba(238, 240, 255, 0.25); text-align: left; }
.post-body th { background: rgba(52, 74, 196, 0.4); }

/* --- "more posts" menu */
.post-nav { margin-top: 28px; }
.post-nav .menu-list { list-style: none; margin: 0; padding: 0 0 0 1.7em; font: italic 900 clamp(16px, 2vw, 20px) / 1.55 var(--display); }
.menu-item { position: relative; display: inline-block; padding: 0.02em 0.15em; color: var(--dim); text-decoration: none; text-shadow: 2px 2px 0 #000; outline: none; }
.menu-item.is-selected, .menu-item:hover { color: #fff; text-shadow: 2px 2px 0 #000, 0 0 0.45em rgba(110, 160, 255, 0.9); }
.menu-item:focus-visible { outline: 2px dashed var(--gold); }
.has-cursor .menu-item:focus-visible { outline: none; }
.menu-item .label { margin-right: 0.6em; font: normal 700 0.7em var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.menu-item.is-confirm { animation: confirm 0.1s steps(1) 4; }
@keyframes confirm { 50% { color: var(--gold); } }
.no-3d-cursor .menu-item.is-selected::before { content: "\25B6"; position: absolute; left: -1.2em; color: var(--gold); font-style: normal; }

#cursor { position: fixed; left: -100px; top: -100px; z-index: 5; width: 28px; height: 28px; image-rendering: pixelated; cursor: pointer; }
#cursor[hidden], .no-3d-cursor #cursor { display: none; }

/* --- footer */
.post-footer { padding-block: 28px 40px; font: 700 11px/1.4 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); text-shadow: 1px 1px 0 #000; }
.post-footer a { color: inherit; }
.post-footer a:hover { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .window, .menu-item.is-confirm { animation: none; }
}
