:root {
  --lime: #c1fd05;
  --violet: #3e01fe;
  --ink: #050505;
  --paper: #f2f2ea;
  --muted: #8b8b85;
  --line: #262626;
  --pixel: "Press Start 2P", monospace;
  --body: "Space Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--ink); }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font: 18px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--lime); }
a:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
img { max-width: 100%; display: block; }

/* marquee bar, as on the X header */
.marquee {
  background: var(--violet);
  color: var(--lime);
  font: 9px/1 var(--pixel);
  overflow: hidden;
  white-space: nowrap;
  padding: 7px 0;
}
.marquee span { display: inline-block; animation: scroll 60s linear infinite; }
.marquee b { font-weight: normal; padding: 0 2.5em; }
/* content is two identical halves, so -50% loops seamlessly */
@keyframes scroll { to { transform: translateX(-50%); } }
/* section-break tickers: lime band runs the other way so the two don't read as copies of the header */
.marquee.lime { background: var(--lime); color: var(--violet); }
.marquee.lime span { animation-direction: reverse; }
@media (prefers-reduced-motion: reduce) {
  .marquee span { animation: none; }
}

.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }

/* lime hero with crosshair corners */
.hero {
  position: relative;
  background: var(--lime);
  color: var(--ink);
  padding: clamp(24px, 16vh - 72px, 72px) 16px clamp(32px, 21vh - 93px, 96px); /* shrinks on short screens so each section still fits */
  text-align: center;
}
.hero h1 {
  font: clamp(16px, 3.4vw, 30px)/1.7 var(--pixel);
  margin: 0;
}
.plus {
  position: absolute;
  font: 28px/1 var(--body);
  font-weight: 300;
}
.plus.tl { top: 12px; left: 18px; }
.plus.tr { top: 12px; right: 18px; }
.plus.bl { bottom: 12px; left: 18px; }
.plus.br { bottom: 12px; right: 18px; }

.id { display: flex; gap: 24px; align-items: flex-end; margin-top: -72px; position: relative; }
.bust {
  width: 144px; height: 144px; flex: none;
  border-radius: 50%;
  border: 4px solid var(--ink);
  background: var(--violet);
  overflow: hidden;
}
.id h2 { font: 20px/1.4 var(--pixel); margin: 0 0 4px; }
.handle { color: var(--muted); margin: 0; }

.bio { margin: 24px 0 8px; font-size: 20px; }
.bio strong { color: var(--lime); font-weight: 500; }
.meta { color: var(--muted); font-size: 15px; display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 0; list-style: none; }

section { margin: 64px 0 0; }
.label {
  font: 11px/1 var(--pixel);
  color: var(--lime);
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin: 0 0 24px;
}
/* home: full width on the footer's 4-column lines; each section sits on a different span of them */
main.wrap { max-width: none; padding: 0; }
main section { margin-top: 0; }
main section + section .label { border-top: 0; }
main .label { display: flex; padding: 0; margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
main .label span { padding: 14px 18px; }
main .label span:first-child { border-right: 1px solid var(--line); font-variant-numeric: tabular-nums; }
/* Work: the whole width, one strip of cells */
/* Writing: columns 2-4, hung off the footer's first column line */
main #writing .posts, main #writing .more { margin-left: 25%; }
main #writing .posts li { display: grid; grid-template-columns: 120px auto 1fr; align-items: baseline; gap: 6px 16px; padding: clamp(10px, 2.4vh, 22px) 18px; }
main #writing .posts time { grid-row: 1 / 3; width: auto; }
main #writing .posts li > a { font-size: 22px; line-height: 1.3; font-weight: 500; }
main #writing .pinned { justify-self: start; margin: 0; }
main #writing .excerpt { grid-column: 2 / 4; margin: 0; max-width: 72ch; color: var(--muted); font-size: 15px; line-height: 1.5; }
main #writing .more { margin-top: 0; padding: 18px 18px clamp(24px, 7vh, 64px); }
/* desktop: each section fills the screen and scrolling snaps between them; phone scrolls freely (stacked cards are taller than a screen) */
@media (min-width: 721px) and (min-height: 560px) {
  html:has(.intro) { scroll-snap-type: y mandatory; } /* home only: inner pages have just the footer as a snap point */
  .intro, main section { min-height: 100svh; scroll-snap-align: start; display: flex; flex-direction: column; }
  .tmux { display: flex; margin-top: auto; position: sticky; bottom: 0; z-index: 2; background: var(--ink); /* visible on arrival even when a section runs past the screen */ font: 12px/1 ui-monospace, "DejaVu Sans Mono", monospace; color: var(--muted); }
  .tmux a { padding: 9px 14px; color: var(--muted); text-decoration: none; }
  .tmux a:hover { color: var(--lime); }
  .tmux a.on { background: var(--violet); color: var(--lime); }
  .tmux span { margin-left: auto; padding: 9px 18px; color: #4a4a46; }
  main #writing .more { flex: 1; }
  .foot { scroll-snap-align: end; }
}
/* intro: masthead on the left half, the pinned post on the right, split on the footer's middle line */
.intro-row { display: block; }
.intro-row .masthead { align-items: center; }
/* intro hero: featured project (left) and pinned post (right), each linking on to its section */
/* the two intro blocks share one height: chip rows, titles and link rows line up */
.spots { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
.spots .spot { align-items: stretch; }
.spots .preview { align-self: center; }
.spots .feature { display: flex; flex-direction: column; }
.spots .feature .go { margin-top: auto; }
.spots .spot.left { grid-template-columns: 2fr 3fr; }
.spots .feature p:not(.go) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; height: 6.4em; line-height: 1.6; } /* both blurbs exactly 4 lines */
.feature .chips time { line-height: 1; }
.spot { display: grid; align-items: center; }
.spot.left { grid-template-columns: 1fr 1fr; }
.spot .preview { margin: 0; border: 0; display: block; background: #000; }
.feature { padding: 40px 32px 4px; }
.feature .chips { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.feature .chips .pinned, .feature .chips .tag { margin: 0; }
/* Work: project rows stepping left to right across the screen */
.projects { display: grid; gap: 12px; padding: 24px max(0px, 8vw - 80px) 0; }
.projects .spot { width: 58%; grid-template-columns: min(50%, (100svh - 330px) * .59) 1fr; } /* preview shrinks so three rows fit the screen height */
.projects .spot:nth-child(2) { margin-left: 21%; }
.projects .spot:nth-child(3) { margin-left: 42%; }
.projects .feature { padding: 4px 28px; }
.projects .feature h3 { font-size: clamp(22px, 2vw, 26px); margin: 4px 0 8px; }
.projects .feature p { font-size: 15px; margin-bottom: 10px; }
.feature time { color: var(--muted); font-size: 14px; }
.feature h3 { font: 500 clamp(24px, 2.4vw, 32px)/1.2 var(--body); margin: 6px 0 14px; }
.feature h3 a { color: var(--paper); text-decoration: none; }
.feature h3 a:hover { color: var(--lime); }
.feature .go { display: flex; gap: 28px; margin: 0; }
.feature p { margin: 0 0 18px; max-width: 60ch; color: var(--muted); font-size: 16px; }
.feature .read { text-decoration: none; font: 500 13px/1.5 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--lime); }
.feature .read::before { content: "[\2192]"; margin-right: 10px; color: var(--muted); }
/* quiet terminal flourishes for the empty space: dot matrix, shell prompts, tmux bar, crosshair */
body { background-image: radial-gradient(#161616 1px, transparent 1.5px); background-size: 24px 24px; }
.posts, .more { background: var(--ink); }
.prompt { font: 12px/1.6 ui-monospace, "DejaVu Sans Mono", monospace; color: #4a4a46; margin: 0; padding: 18px; }
#writing > .prompt { width: 25%; height: 56px; margin-bottom: -56px; box-sizing: border-box; } /* sits in the empty left column, beside the first post */
.cur { display: inline-block; width: .6em; height: 1.1em; vertical-align: text-bottom; background: var(--lime); opacity: .6; animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.tmux { display: none; } /* shown on desktop by the media query at the end of the file */
.intro { position: relative; }
.cross { position: absolute; left: 50%; bottom: 31px; transform: translate(-50%, 50%); font: 300 22px/1 var(--body); color: var(--muted); display: none; }
@media (prefers-reduced-motion: reduce) { .cur { animation: none; } }
/* masthead instead of a profile header: bust beside the name, no overlap with the hero */
.masthead { display: flex; }
.masthead .bust { width: 144px; height: 144px; margin: clamp(12px, 10vh - 42px, 48px) 0 clamp(12px, 10vh - 42px, 48px) 18px; background: var(--violet); }
.masthead .bust img { width: 100%; height: 100%; object-fit: cover; display: block; }
.masthead > div:last-child { padding: clamp(16px, 3.5vh, 32px) 32px; align-self: center; max-width: 720px; }
.masthead h2 { font: clamp(24px, 4vw, 40px)/1.2 var(--pixel); color: var(--lime); margin: 0; }
.masthead .bio { margin: 20px 0 8px; }
.masthead .meta { margin: 0; }
.masthead .meta a { color: inherit; text-decoration: none; }
.masthead .meta a:hover { color: var(--lime); }
.more { margin: 16px 0 0; font: 500 13px/1.5 var(--body); letter-spacing: .08em; text-transform: uppercase; }
.more a { text-decoration: none; }
.more a::before { content: "[\2192]"; margin-right: 10px; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card {
  border: 1px solid var(--line);
  padding: 0 20px 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, transform .15s;
}
a.card:hover { border-color: var(--lime); transform: translateY(-2px); }
.preview {
  aspect-ratio: 16 / 9;
  margin: 0 -20px 18px;
  background: var(--violet);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.preview { position: relative; }
.preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* drawn at 2x and scaled down: the browser averages the sub-pixel letters instead of aliasing them */
.preview iframe { position: absolute; top: 0; left: 0; width: 200%; height: 200%; transform: scale(.5); transform-origin: 0 0; border: 0; pointer-events: none; opacity: 0; transition: opacity .4s; }
.preview iframe.ready { opacity: 1; }
.card h3 { font: 500 22px/1.3 var(--body); margin: 0 0 10px; color: var(--paper); }
.card p { margin: 0; color: #bdbdb5; font-size: 16px; }
.tag { display: inline-block; margin-top: 14px; font: 8px/1 var(--pixel); background: var(--violet); color: var(--lime); padding: 6px 8px; }

.posts { list-style: none; padding: 0; margin: 0; }
.posts li { display: flex; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.posts time { color: var(--muted); font-size: 14px; flex: none; width: 96px; font-variant-numeric: tabular-nums; }
.posts a { color: var(--paper); text-decoration: none; }
.posts a:hover { color: var(--lime); }

.links { display: flex; flex-wrap: wrap; gap: 12px; padding: 0; list-style: none; }
.links a {
  display: inline-block; padding: 12px 16px;
  border: 1px solid var(--lime); text-decoration: none;
  font: 10px/1 var(--pixel);
}
.links a:hover { background: var(--lime); color: var(--ink); }

footer { color: var(--muted); font-size: 14px; padding: 32px 0 48px; border-top: 1px solid var(--line); }


/* home footer: a grid of hairline boxes, after the Marathon site footer */
.foot {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  font: 500 13px/1.5 var(--body); letter-spacing: .08em; text-transform: uppercase;
}
.foot .cell { margin: 0; padding: 18px; border: 0 solid var(--line); min-height: 64px; }
.foot .quote { grid-column: 3; border-width: 0 1px 1px; color: var(--lime); min-height: 160px; }
.foot .quote cite { display: block; margin-top: 12px; font-style: normal; color: var(--muted); }
.foot .e1 { grid-column: 1 / 3; }
.foot .e2 { border-bottom-width: 1px; }
.foot .label { grid-column: 1; display: flex; padding: 0; align-self: start; border-width: 1px 1px 1px 0; min-height: 0; color: var(--lime); }
.foot .label span { padding: 14px 18px; }
.foot .label span:first-child { border-right: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.foot .list { grid-column: 2; list-style: none; border-width: 0 0 0 1px; }
.foot .list li { margin: 4px 0; }
.foot .list a { text-decoration: none; }
.foot .list a::before { content: "[\2197]"; margin-right: 10px; color: var(--muted); }
.foot .list a:hover { color: var(--muted); }
.foot .site { grid-column: 4; border-width: 0 0 1px 1px; }
.foot .site a { color: var(--muted); }
.foot .site a::before { content: "[\2192]"; }
.foot .site a:hover { color: var(--lime); }
.foot .stripes { grid-column: 3; justify-self: end; width: 45%; padding: 0;
  background: repeating-linear-gradient(-45deg, var(--violet) 0 18px, transparent 18px 36px); }
.foot .mark { grid-column: 1 / 3; align-self: end; border-top-width: 1px; font: clamp(28px, 5vw, 56px)/1 var(--pixel); color: var(--lime); text-transform: none; letter-spacing: 0; padding: 48px 18px; }
.foot .mark a { color: inherit; text-decoration: none; }
.foot .legal { grid-column: 3 / 5; align-self: stretch; display: flex; align-items: end; border-width: 1px 0 0 1px; color: var(--muted); font-size: 11px; }
@media (max-width: 720px) {
  .foot { grid-template-columns: 1fr 1fr; }
  .foot .e1, .foot .e2 { display: none; }
  .foot .quote { grid-column: 1 / -1; border-width: 0 0 1px; min-height: 0; }
  .foot .label { grid-column: 1 / -1; border-width: 0 0 1px; }
  .foot .list { grid-column: 1; border-width: 0; }
  .foot .site { grid-column: 2; border-width: 0 0 0 1px; }
  .foot .stripes { grid-column: 1 / -1; width: 100%; height: 36px; min-height: 0; order: 1; }
  .foot .mark { order: 2; }
  .foot .legal { order: 3; }
  .foot .mark, .foot .legal { grid-column: 1 / -1; border-width: 1px 0 0; }
}

/* blog pages */
.top { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; }
.top a { text-decoration: none; font: 11px/1 var(--pixel); }
.top img { width: 40px; height: 40px; border-radius: 50%; background: var(--violet); }
article { max-width: 680px; margin: 40px auto 80px; }
article h1 { font: clamp(24px, 4vw, 40px)/1.2 var(--pixel); color: var(--lime); margin: 0 0 16px; } /* same as the home masthead name */
article .date { color: var(--muted); margin: 0 0 40px; }
article h2, article h3 { font-weight: 600; margin-top: 2em; }
article blockquote { margin: 1.5em 0; padding-left: 20px; border-left: 3px solid var(--violet); color: #d6d6ce; }
article pre { background: #111; padding: 16px; overflow-x: auto; font-size: 15px; }
article code { font-size: .9em; }
article img, article video { max-width: 100%; height: auto; display: block; }
article video { width: 100%; background: #000; margin: 0 0 32px; }
article.project { max-width: 880px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 32px 0; }
.gallery img { width: 100%; border: 1px solid var(--line); }
.substack { font-size: 15px; color: var(--muted); border: 1px solid var(--line); padding: 10px 14px; margin: 24px 0; }
/* Substack's own embeds (subscribe widgets, buttons) don't work off-site */
article [class^="subscription-widget"], article .button-wrapper { display: none; }
article figure { margin: 2em 0; }
article figcaption { color: var(--muted); font-size: 14px; margin-top: 8px; }

@media (max-width: 560px) {
  .id { flex-direction: column; align-items: flex-start; gap: 12px; }
  .bust { width: 112px; height: 112px; }
  .posts li { flex-direction: column; align-items: flex-start; gap: 2px; }
  .spots, .spot.left { grid-template-columns: 1fr; }
  .projects .spot { width: auto; margin-left: 0 !important; }
  .projects { gap: 32px; }
  .feature { padding: 24px 18px 32px; }
  .masthead { flex-direction: column; }
  .masthead .bust { margin-bottom: 0; }
  .masthead > div:last-child { padding: 24px 18px 40px; }
  main #writing .posts, main #writing .more { margin-left: 0; border-left: 0; }
  main #writing .posts li { grid-template-columns: auto 1fr; }
  main #writing .posts time { grid-row: auto; grid-column: 1 / -1; }
  main #writing .excerpt { grid-column: 1 / -1; }
  #writing > .prompt { display: none; }
  .pinned { margin-left: 0; }
}

/* Bible ASCII live embed */
.live { position: relative; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line); margin: 0 0 16px; }
.live iframe { width: 100%; height: 100%; border: 0; display: block; }
.live-cover {
  position: absolute; inset: 0; width: 100%;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 16px;
  background: transparent; border: 0; cursor: pointer;
  color: var(--lime); font: 9px/1.6 var(--pixel); text-shadow: 0 0 6px #000, 0 0 2px #000;
}
.live.active .live-cover { display: none; }
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 0 0 40px; }
.book {
  text-align: left; padding: 0 0 10px; background: none; color: var(--paper);
  border: 1px solid var(--line); cursor: pointer; font: inherit;
}
.book img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin-bottom: 8px; }
.book .name { display: block; font: 9px/1.6 var(--pixel); padding: 0 10px; }
.book .scene { display: block; font-size: 12px; line-height: 1.4; color: var(--muted); padding: 2px 10px 0; }
.book:hover, .book.on { border-color: var(--lime); }
.book.on .name { color: var(--lime); }
.cta { display: inline-block; padding: 12px 16px; border: 1px solid var(--lime); text-decoration: none; font: 10px/1 var(--pixel); }
.cta:hover { background: var(--lime); color: var(--ink); }
.pinned { font: 8px/1 var(--pixel); background: var(--violet); color: var(--lime); padding: 6px 8px; margin-left: 8px; vertical-align: middle; }
/* after the base flourish rules so it wins: tmux bar and crosshair only when sections snap */
@media (min-width: 721px) and (min-height: 560px) {
  .tmux { display: flex; }
  .cross { display: block; }
  .intro-row { flex: 1; display: flex; flex-direction: column; }
  .spots { margin-block: auto; padding-inline: max(0px, 8vw - 80px); } /* hero centred in the space under the masthead, inset from the edges */
}

/* short desktop windows (under ~760px tall): shorter blurbs so each section still fits one screen */
@media (min-width: 721px) and (max-height: 760px) {
  .spots .feature p:not(.go) { -webkit-line-clamp: 3; line-clamp: 3; height: 4.8em; }
  .projects .feature p:not(.go) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
  main #writing .excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; line-clamp: 1; overflow: hidden; }
}
