/* ─────────────────────────────────────────────────────────────
   ceptln.com

   The page reads as its own markdown source. Structural marks
   (#, ##, **, _, -, [ ], ( )) are drawn by CSS via ::before /
   ::after, so they are never selectable, never copied, and
   never read aloud by a screen reader.

   Shared by the index and the article pages.
   ───────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #ffffff;
  --ink: #242424;
  --ink-bold: #4d4d4d; /* bold sits greyer than body ink, so weight
                          carries the emphasis, not blackness */
  --muted: #767676;
  --mark: #c2c2c2; /* the #, **, _, -, [ ] ( ) syntax */
  --rule: #e6e6e6;
  --link: #2b62c4;
}

:root[data-theme="dark"] {
  --bg: #121212;
  --ink: #dcdcdc;
  --ink-bold: #b4b4b4;
  --muted: #8a8a8a;
  --mark: #4a4a4a;
  --rule: #2a2a2a;
  --link: #7aa5f5;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, "DejaVu Sans Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  font-weight: 500; /* 500 = Medium in SF Mono. Enough weight to hold
                       the page together at 12px without reading bold. */
  -webkit-font-smoothing: antialiased;
}

/* The measure is set in ch, so it tracks the font size: shrinking
   the type buys more characters per line, not a narrower column. */
.page {
  max-width: 88ch;
  margin: 0 auto;
  padding: 4.5rem 2rem 9rem;
}

/* Prose wants a shorter line than an index does. */
.page--article {
  max-width: 74ch;
}

/* ── Headings ───────────────────────────────────────────────── */

h1,
h2,
h3 {
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  text-indent: -2ch;
  padding-left: 2ch;
}

h1 {
  font-size: 1.15rem;
}

h2 {
  font-size: 1rem;
  margin-top: 2.75rem;
  text-indent: -3ch;
  padding-left: 3ch;
}

h3 {
  font-size: 0.95rem;
  margin-top: 2rem;
  text-indent: -4ch;
  padding-left: 4ch;
}

h1::before { content: "# ";   color: var(--mark); font-weight: 400; }
h2::before { content: "## ";  color: var(--mark); font-weight: 400; }
h3::before { content: "### "; color: var(--mark); font-weight: 400; }

/* ── Blockquote ─────────────────────────────────────────────── */

.quote {
  margin: 1.2rem 0 0;
  color: var(--muted);
  text-indent: -2ch;
  padding-left: 2ch;
  max-width: 74ch;
}

.quote::before {
  content: "> ";
  color: var(--mark);
}

/* ── Emphasis: standard markdown, doubled ───────────────────── */

strong {
  font-weight: 700;
  color: var(--ink-bold);
}

strong::before,
strong::after {
  content: "**";
  color: var(--mark);
  font-weight: 400;
}

em {
  font-style: normal;
  color: var(--muted);
}

em::before,
em::after {
  content: "_";
  color: var(--mark);
}

/* ── Lists ──────────────────────────────────────────────────── */

ul {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
}

li {
  padding-left: 2ch;
  text-indent: -2ch;
  margin-bottom: 0.55rem;
}

li::before {
  content: "- ";
  color: var(--mark);
}

/* ── Links wear their markdown syntax ───────────────────────── */

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Brackets live on a wrapper, not on the anchor: they are
   punctuation, not part of the link target or its underline. */
.l::before { content: "["; color: var(--mark); }
.l::after  { content: "]"; color: var(--mark); }

.href { color: var(--muted); }

.date { color: var(--muted); }

.note {
  color: var(--muted);
  margin-top: 1.4rem;
  padding-left: 2ch;
}

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 4rem 0 1.2rem;
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2rem;
  color: var(--muted);
}

/* A fake button: no chrome, no box. Real <button> so it stays
   keyboard-reachable; the underline only shows on hover. */
.theme {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.theme:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.theme:focus-visible {
  outline: 1px solid var(--muted);
  outline-offset: 3px;
}

/* ── Article pages ──────────────────────────────────────────── */

.back {
  display: block;
  margin-bottom: 2rem;
  color: var(--muted);
  text-decoration: none;
}
.back::before { content: "← "; color: var(--mark); }
.back:hover { color: var(--link); }

.meta {
  color: var(--muted);
  margin: 0.9rem 0 0;
  padding-left: 2ch;
}

.article p {
  margin: 1.1rem 0 0;
  padding-left: 2ch;
  max-width: 72ch;
}

.article ul {
  padding-left: 2ch;
}

.article li {
  max-width: 72ch;
}

/* Pull quote from the source material. */
.pull {
  margin: 1.6rem 0 0;
  padding-left: 2ch;
  color: var(--muted);
  max-width: 72ch;
  text-indent: -2ch;
}
.pull::before { content: "> "; color: var(--mark); }

/* Responsive 16:9 video, on youtube-nocookie so the embed does
   not set tracking cookies before the visitor presses play. */
.video {
  position: relative;
  width: 100%;
  max-width: 72ch;
  aspect-ratio: 16 / 9;
  margin: 1.8rem 0 0 2ch;
  border: 1px solid var(--rule);
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 34rem) {
  .page {
    padding: 2.5rem 1.35rem 5rem;
  }
  .video {
    margin-left: 0;
  }
}
