/* Cortex Log: stripe.dev-style layout dressed in Cortex Command's GUI colours. Tokens below. */
:root {
  --bg: #0c0b09;
  --fg: #f4f1df;          /* game cream */
  --muted: #9a967f;
  --yellow: #faf240;      /* GUI selection yellow */
  --rust: #ed5a0e;        /* palette orange */
  --amber: #c98239;
  --green: #4c6944;       /* SkinGreen panel fill */
  --green-hi: #65854c;    /* bevel highlight */
  --green-lo: #405030;    /* bevel shadow */
  --hair: rgba(244, 241, 223, 0.12);
  --panel: rgba(18, 17, 14, 0.85);
  --sans: "Geist", "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  --pixel: "Silkscreen", "Geist Mono", monospace;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  color-scheme: dark;
}

body {
  margin: 0;
  padding: 0 16px;
  color: var(--fg);
  /* the title-screen nebula, dimmed so text stays readable */
  background:
    linear-gradient(rgba(12, 11, 9, 0.6), rgba(12, 11, 9, 0.9)),
    url("/assets/nebula.jpg") center top / cover fixed,
    var(--bg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; }

/* ---------- top nav ---------- */

nav.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 0;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.mark {
  width: 24px;
  height: 24px;
  margin-right: 6px;
  background: url("/assets/icon.png") center / cover;
  border: 1px solid #000;
}
/* A Cortex Command GUI button: green fill, light top-left edge, dark bottom-right edge, black outline. */
.chip {
  font-family: var(--pixel);
  font-size: 16px;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 8px 5px;
  color: var(--fg);
  background: var(--green);
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 var(--green-hi), inset -1px -1px 0 var(--green-lo);
}
.chip:hover { color: var(--yellow); }
.chip.active { color: #000; background: var(--yellow); box-shadow: inset -1px -1px 0 #b8ad1c; }
.spacer { flex: 1; }

/* ---------- shared bits ---------- */

.display {
  font-weight: 300;
  font-size: clamp(48px, 8.5vw, 112px);
  line-height: 0.95;
  letter-spacing: -0.06em;
  margin: 0;
}
.display sup {
  font-family: var(--pixel);
  font-size: 16px;
  letter-spacing: 0;
  color: var(--yellow);
  vertical-align: top;
  position: relative;
  top: 0.6em;
  margin-left: 8px;
}

.label {
  font-family: var(--pixel);
  font-size: 16px;
  text-transform: uppercase;
  color: var(--yellow);
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--amber);
}

/* ---------- home ---------- */

.hero {
  position: relative;
  isolation: isolate;
  /* reach the screen edge so the planet is cut off there instead of widening the page */
  margin-right: -16px;
  padding-right: 16px;
  overflow-x: clip;
  padding: 56px 0 48px;
  min-height: 380px;
}
.hero .logo {
  display: block;
  width: min(524px, 100%);
  height: auto;
  margin: 0 0 28px -4px;
  image-rendering: pixelated;
}
.hero p {
  font-family: var(--pixel);
  font-size: 16px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 20px 0 0;
}
.hero .planet {
  position: absolute;
  z-index: -1;
  top: 24px;
  right: -40px;
  width: clamp(200px, 32vw, 420px);
  height: auto;
  pointer-events: none;
}

.rows { list-style: none; margin: 0 0 96px; padding: 0; }
.rows a {
  display: grid;
  grid-template-columns: 128px 1fr 24px;
  align-items: baseline;
  gap: 12px;
  padding: 12px 8px 12px 0;
  border-bottom: 1px solid var(--hair);
  text-decoration: none;
}
.rows a:hover { background: rgba(76, 105, 68, 0.25); }
.rows a:hover .row-plus { color: var(--yellow); }
.row-date { font-family: var(--pixel); font-size: 16px; color: var(--muted); }
.row-date::before { content: "\25A0  "; color: var(--yellow); }
.row-title {
  font-size: clamp(19px, 2.4vw, 26px);
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-plus { text-align: right; font-weight: 300; font-size: 20px; color: var(--muted); }
.rows .empty { padding: 12px 0; color: var(--muted); }

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

/* Post pages (and the home page): article on the left, entries column on the right. */
.with-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 64px;
  align-items: start;
}
.side {
  position: sticky;
  top: 64px;
  margin-top: 48px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding-bottom: 24px;
}
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list a {
  display: block;
  padding: 10px 8px 10px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.side-list .row-date { display: block; margin-bottom: 4px; }
.side-list a:hover { background: rgba(76, 105, 68, 0.25); }
.side-list .current a { color: var(--yellow); background: rgba(76, 105, 68, 0.25); }
.side-all {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--pixel);
  font-size: 16px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--yellow);
}
.side-all:hover { text-decoration: underline; }
.empty { color: var(--muted); padding: 48px 0; }


.post-head {
  position: relative;
  max-width: 900px;
  margin: 48px 0 64px;
  padding: 12px 0;
}
.post-head i {
  position: absolute;
  font-style: normal;
  font-size: 14px;
  line-height: 1;
  color: var(--yellow);
}
.post-head i::before { content: "+"; }
.post-head i:nth-child(1) { top: -8px; left: -4px; }
.post-head i:nth-child(2) { top: -8px; right: -4px; }
.post-head i:nth-child(3) { bottom: -8px; left: -4px; }
.post-head i:nth-child(4) { bottom: -8px; right: -4px; }

/* Article column: the label, text and pager never run the full width of the screen. */
.body { max-width: 760px; }

.prose { margin-top: 20px; }
.prose h2, .prose h3 {
  font-weight: 300;
  letter-spacing: -0.05em;
  line-height: 1;
  margin: 1.6em 0 0.5em;
}
.prose h2 { font-size: clamp(34px, 5vw, 52px); }
.prose h3 { font-size: clamp(24px, 3vw, 32px); color: var(--yellow); }
.prose a { text-decoration-color: var(--amber); text-underline-offset: 3px; }
.prose a:hover { color: var(--yellow); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li::marker { color: var(--amber); }
.prose strong { color: #fff; }
.prose blockquote {
  margin: 24px 0;
  padding-left: 16px;
  border-left: 2px solid var(--rust);
  color: var(--muted);
}

.prose code {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 1px 5px;
  color: var(--yellow);
  background: rgba(76, 105, 68, 0.3);
}
.prose pre {
  margin: 24px 0;
  padding: 16px;
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--green-lo);
}
.prose pre code { padding: 0; background: none; color: var(--fg); font-size: 14px; line-height: 1.5; }

.prose table { border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { padding: 6px 12px; border-bottom: 1px solid var(--hair); text-align: left; }
.prose th { font-family: var(--pixel); font-size: 16px; text-transform: uppercase; font-weight: 400; color: var(--yellow); }

/* Task lists: the checkbox replaces the bullet. */
.prose li:has(> input[type="checkbox"]) { list-style: none; margin-left: -22px; }
.prose li > input[type="checkbox"] { margin: 0 8px 0 0; accent-color: var(--yellow); }

/* Screenshots and videos sit in a GUI window frame. */
figure {
  margin: 32px 0;
  padding: 6px;
  background: var(--green);
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 var(--green-hi), inset -1px -1px 0 var(--green-lo);
}
figure img, figure video, figure iframe {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #000;
  background: #000;
}
figure.video iframe { aspect-ratio: 16 / 9; }
figcaption {
  font-family: var(--pixel);
  font-size: 16px;
  text-transform: uppercase;
  color: var(--fg);
  margin: 8px 2px 2px;
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 96px 0 64px;
}
.pager a, .pager span {
  padding: 8px 16px;
  border: 1px solid var(--yellow);
  border-radius: 999px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pager a:hover { background: var(--yellow); color: #000; }
.pager span { visibility: hidden; }

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

footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 0 24px;
  border-top: 1px solid var(--amber);
  font-family: var(--pixel);
  font-size: 16px;
  text-transform: uppercase;
  color: var(--muted);
}
footer a { color: var(--fg); }

::selection { background: var(--yellow); color: #000; }

/* Narrower screens: the entries column drops below the article. */
@media (max-width: 1000px) {
  .with-side { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .side { position: static; max-height: none; margin: 0 0 64px; max-width: 760px; }
}

@media (max-width: 600px) {
  nav.top { flex-wrap: wrap; row-gap: 6px; }
  .hero { min-height: 0; }
  .hero .planet { opacity: 0.5; top: 0; }
  .rows a { grid-template-columns: 1fr 20px; gap: 4px 8px; }
  .row-date { grid-column: 1 / -1; }
  .row-title { white-space: normal; }
  .pager { grid-template-columns: 1fr; }
  .pager span { display: none; }
  footer { flex-direction: column; gap: 4px; }
}
