/* itzjsn.com /writing/ (Jason 11/15). Same tokens as the live homepage (home.css :root): warm near-black, cream type,
   lime as the one sharp accent, JetBrains Mono for the voice, Instrument Sans for reading.
   The homepage's dot field is WebGL tied to its hero; here it is a still CSS dot grid so long reads stay calm. */
:root {
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --body: "Instrument Sans", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --bg: #0A0A08; --bg-2: #11120E; --bg-3: #1B1D16;
  --ink: #F2EAD8; --text: #E4DDCB; --mute: #A9A48F;
  --accent: #BFF05C; --accent-hi: #DDF79E;
  --rule: rgba(242, 234, 216, .14);
  --col: 680px; --wide: 1040px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body {
  margin: 0; color: var(--text); font: 400 19px/1.65 var(--body);
  background-color: var(--bg);
  background-image: radial-gradient(rgba(242, 234, 216, .075) 1px, transparent 1.2px);
  background-size: 15px 15px; background-attachment: fixed;
}
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hi); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
img { display: block; max-width: 100%; height: auto; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 9; background: var(--accent); color: var(--bg); padding: 8px 12px; }
.wrap { width: min(var(--wide), 100% - 32px); margin-inline: auto; }

/* top bar */
.bar { position: sticky; top: 0; z-index: 5; background: rgba(10, 10, 8, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 58px; }
.mark { font: 800 20px var(--mono); letter-spacing: -.05em; color: var(--ink); text-decoration: none; }
.mark::after { content: ""; display: inline-block; width: .45em; height: .9em; margin-left: .12em; vertical-align: -.12em; background: var(--accent); }
.bar nav { display: flex; gap: 22px; font: 500 14px var(--mono); }
.bar nav a { color: var(--mute); text-decoration: none; }
.bar nav a:hover, .bar nav a[aria-current] { color: var(--accent); }

/* page head */
.post-head { max-width: var(--col); margin: 64px auto 32px; }
.kicker { font: 500 13px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin: 0 0 18px; }
.kicker a { color: var(--accent); text-decoration: none; }
h1 { font: 800 clamp(34px, 5.4vw, 58px)/1.04 var(--mono); letter-spacing: -.045em; color: var(--ink); margin: 0 0 20px; text-wrap: balance; }
h1 em { font: italic 400 1.08em/1 var(--serif); letter-spacing: 0; color: var(--accent); }
.dek { font-size: 21px; line-height: 1.5; color: var(--mute); margin: 0; text-wrap: pretty; }

/* cover */
.cover { margin: 0 auto 48px; }
.cover img { width: 100%; border-radius: 10px; border: 1px solid var(--rule); }
.cover figcaption { max-width: var(--col); margin: 10px auto 0; font: 400 12px/1.5 var(--mono); color: var(--mute); }
.cover figcaption a { color: var(--mute); }

/* body */
.body { max-width: var(--col); margin: 0 auto; }
.body > p { margin: 0 0 1.15em; text-wrap: pretty; }
.body strong { color: var(--ink); font-weight: 600; }
.body > p:has(> strong:only-child) { font-size: 22px; line-height: 1.45; }
.body h2 { font: 700 24px/1.25 var(--mono); letter-spacing: -.03em; color: var(--ink); margin: 2.2em 0 .7em; scroll-margin-top: 80px; }
.body ul { margin: 0 0 1.3em; padding: 0; list-style: none; }
.body li { position: relative; padding: 0 0 .7em 1.4em; }
.body li::before { content: ""; position: absolute; left: 0; top: .72em; width: .55em; height: 2px; background: var(--accent); }
.body blockquote { margin: 1.4em 0; padding: .2em 0 .2em 1.1em; border-left: 3px solid var(--accent); }
.body blockquote p { margin: 0; font: italic 400 26px/1.35 var(--serif); color: var(--ink); }
.body figure { margin: 2em 0; }
.body figure img { width: 100%; border-radius: 8px; border: 1px solid var(--rule); background: var(--bg-3); }
.body h2#sources ~ ul { font-size: 15px; line-height: 1.5; }
.body h2#sources ~ ul li { padding-bottom: .55em; }
.note { font: 400 13px/1.6 var(--mono); color: var(--mute); border-top: 1px solid var(--rule); padding-top: 18px; margin-top: 2em; }

/* the YouTube card */
.yt { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 0; margin: 2em 0; text-decoration: none; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; transition: border-color .2s, transform .2s; }
.yt:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }
.yt-img { position: relative; display: block; }
.yt-img img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 9; }
.yt-play { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; background: var(--accent); box-shadow: 0 6px 30px rgba(0,0,0,.5); }
.yt-play::after { content: ""; position: absolute; left: 26px; top: 20px; border-left: 18px solid var(--bg); border-top: 12px solid transparent; border-bottom: 12px solid transparent; }
.yt-txt { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 20px 22px; }
.yt-k { font: 500 12px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.yt-t { font: 700 22px/1.2 var(--mono); letter-spacing: -.03em; color: var(--ink); }
.yt-s { font-size: 15px; color: var(--mute); }

/* the end */
.end { max-width: var(--col); margin: 56px auto 80px; padding-top: 28px; border-top: 1px solid var(--rule); }
.end-k { font: 500 13px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin: 0; }
.end .yt { margin: 14px 0 20px; }
.end-x { font: 500 15px var(--mono); margin: 0; color: var(--mute); }

/* Look B, "breaks" (Jason 11/15: "B, drop the fig labels"): images step out wider than the text, numbered sections */
.b .body { counter-reset: sec; }
.b .body h2 { counter-increment: sec; border-top: 1px solid var(--rule); padding-top: 22px; }
.b .body h2::before { content: counter(sec, decimal-leading-zero) " / "; color: var(--accent); }
.b .body h2#sources::before { content: ""; }
.b .body figure { width: min(var(--wide), 100vw - 32px); margin-left: 50%; transform: translateX(-50%); margin-block: 2.6em; }

/* the index */
.cards { list-style: none; padding: 0; margin: 0 0 96px; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; }
.card { display: flex; flex-direction: column; gap: 8px; height: 100%; text-decoration: none; color: var(--text); background: var(--bg-2);
  border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; padding-bottom: 22px; transition: border-color .2s, transform .2s; }
.card:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }
.card-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card-img img.from-cover { object-position: left center; }
.card-k { font: 500 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--mute); padding: 10px 20px 0; }
.card-t { font: 700 21px/1.22 var(--mono); letter-spacing: -.03em; color: var(--ink); padding: 0 20px; }
.card-s { font-size: 16px; line-height: 1.5; color: var(--mute); padding: 0 20px; }
.index .post-head { max-width: var(--wide); }
.index .dek { max-width: 36em; }

footer { border-top: 1px solid var(--rule); padding: 26px 0 40px; font: 400 13px/1.6 var(--mono); color: var(--mute); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
footer a { color: var(--mute); }

@media (max-width: 700px) {
  body { font-size: 18px; }
  .bar nav { gap: 14px; font-size: 13px; }
  .bar nav a[href="/#about"], .bar nav a[href="/#channels"] { display: none; }
  .post-head { margin-top: 40px; }
  .dek { font-size: 19px; }
  .yt { grid-template-columns: 1fr; }
  .body > p:has(> strong:only-child) { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { .yt, .card { transition: none; } .yt:hover, .card:hover { transform: none; } }
