:root {
  color-scheme: dark;
  --background: #101211;
  --surface: #151816;
  --surface-hover: #1b201d;
  --text: #e4e8e5;
  --muted: #a0aaa3;
  --line: #2a302c;
  --line-strong: #526057;
  --accent: #a3d9ad;
  --accent-dim: #3aa95c;
  --max: 1080px;
  --reading: 68ch;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: var(--background); }

a {
  color: inherit;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
}

a:hover { color: var(--accent); text-decoration-color: var(--accent); }
a:focus-visible,
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
img { max-width: 100%; }
button { touch-action: manipulation; }
[id] { scroll-margin-top: 2rem; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 20;
  padding: .65rem 1rem;
  background: var(--accent);
  color: var(--background);
  transform: translateY(-200%);
}

.skip-link:focus { transform: none; }

.site-header,
.site-footer,
main {
  width: min(calc(100% - 3rem), var(--max));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 96px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: -.025em;
  white-space: nowrap;
  font-size: .85rem;
}

.wordmark span,
.footer-mark {
  color: var(--accent);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: -.08em;
}

.wordmark span::before { content: "["; color: var(--muted); }
.wordmark span::after { content: "]"; color: var(--muted); }

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: .25rem 1.1rem;
}

nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: .75rem; text-decoration: none; }
nav a:hover,
nav a[aria-current="page"] { color: var(--accent); }
nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: .6em; text-decoration-color: var(--accent); }

.nav-llm-copy {
  padding: .45rem .7rem;
  min-height: 44px;
  min-width: 20ch;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .72rem;
  cursor: pointer;
}

.nav-llm-copy::before { content: "> "; color: var(--accent); }
.nav-llm-copy:hover { color: var(--accent); background: var(--surface-hover); border-color: var(--line-strong); }
.nav-llm-copy:hover::before { color: var(--accent); }
.nav-llm-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

main { min-height: 70vh; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: clamp(3rem, 7vw, 6rem);
  align-items: center;
  padding: clamp(4rem, 8vw, 7rem) 0;
  border-bottom: 1px solid var(--line);
}

.kicker,
.eyebrow {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .025em;
  line-height: 1.5;
}

.kicker::before { content: "> "; color: var(--muted); }

h1,
h2,
h3 {
  margin-top: 0;
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -.045em;
}

h1 { max-width: 19ch; margin-bottom: 1.5rem; font-size: clamp(2rem, 4.5vw, 3.5rem); text-wrap: balance; }
h2 { font-size: clamp(1.4rem, 2.8vw, 2rem); }
h3 { font-size: 1.2rem; }

.hero-lede,
.page-intro > p:last-child,
.dek {
  max-width: 60ch;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.75;
}

.hero-actions,
.article-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.75rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 46px;
  padding: .6rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: transparent;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

.button:hover { background: var(--accent); color: var(--background); }
.button-small { min-height: 40px; font-size: .78rem; }
.text-link { font-size: .78rem; font-weight: 500; text-underline-offset: .4em; }

.hero-portrait { margin: 0; }

.hero-portrait img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  filter: grayscale(1) contrast(1.04);
}

.hero-portrait figcaption {
  display: flex;
  justify-content: space-between;
  padding-top: .7rem;
  color: var(--muted);
  font-size: .7rem;
  letter-spacing: .02em;
}

.hero-portrait figcaption span { color: var(--accent); }

.section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section + .section { border-top: 1px solid var(--line); }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.section-heading h2 { margin-bottom: 0; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  transition: background .15s ease;
}

.project-card-media {
  position: absolute;
  top: 1.4rem;
  right: 1.4rem;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 3px;
  background: #0d0b17;
}

.project-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card.has-image .card-top { padding-right: 3.5rem; }
.project-card:hover,
.project-card:focus-within { background: var(--surface); border-color: var(--line-strong); }

.project-card h3 {
  max-width: 28ch;
  margin: 1.8rem 0 .75rem;
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
}

.project-card h3 a::after { content: ""; position: absolute; inset: 0; }
.project-card h3 a { text-decoration: none; }
.project-card { cursor: pointer; }
.project-card p { max-width: 48ch; margin: 0 0 1.5rem; color: var(--muted); font-size: .82rem; line-height: 1.8; }
.project-card .tags { margin-top: auto; padding-top: .5rem; }

.card-top { display: flex; justify-content: space-between; color: var(--accent); font-size: 1rem; }
.card-top .eyebrow { margin: 0; }

.tags { display: flex; flex-wrap: wrap; gap: .45rem; }

.tag {
  padding: 0;
  color: var(--muted);
  font-size: .66rem;
}

.tag::before { content: "#"; color: var(--line-strong); }
.tags { column-gap: .85rem; }

.timeline,
.video-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }

.timeline li,
.video-list li {
  display: grid;
  grid-template-columns: 185px 1fr;
  gap: 2rem;
  padding: 1.55rem 0;
  border-bottom: 1px solid var(--line);
}

.timeline time,
.video-list time,
.meta-line { color: var(--muted); font-size: .72rem; }

.timeline .eyebrow,
.video-list .eyebrow { display: block; margin-bottom: .5rem; }

.timeline h3,
.video-list h3 { margin: 0; font-size: clamp(1rem, 1.8vw, 1.2rem); line-height: 1.5; letter-spacing: -.025em; }

.timeline h3 a,
.video-list h3 a { text-decoration: none; }
.external { color: var(--accent); font-size: .8em; }

.page-intro { max-width: 800px; padding: clamp(3rem, 7vw, 5rem) 0; }
.page-intro h1 { max-width: 24ch; font-size: clamp(2rem, 4.5vw, 3.25rem); }
.project-grid-all { margin-bottom: 5rem; }

.post-list { max-width: 960px; padding-bottom: 8rem; }

.post-card {
  display: grid;
  grid-template-columns: 170px 1fr;
  column-gap: 2.5rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--line);
}

.post-card .meta-line { grid-row: 1 / 5; }
.post-card h2 { margin-bottom: .8rem; font-size: clamp(1.3rem, 3vw, 1.8rem); }
.post-card h2 a { text-decoration: none; }
.post-card > p:not(.meta-line) { max-width: 60ch; margin-top: 0; color: var(--muted); }
.empty-state { padding: 3rem 0; border-top: 1px solid var(--line); color: var(--muted); }

.article-header { max-width: 960px; padding: 4rem 0 3.5rem; border-bottom: 1px solid var(--line); }

.project-visual {
  max-width: 960px;
  height: clamp(180px, 30vw, 300px);
  margin: 3rem 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0d0b17;
}

.project-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.article-header h1 {
  max-width: 26ch;
  margin-top: 2rem;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
}

.back-link { display: inline-block; margin-bottom: 2.5rem; color: var(--muted); font-size: .78rem; font-weight: 500; }
.meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }
.article-links:empty { display: none; }
.meta-line .eyebrow { margin: 0; }
.belongs { margin: 1.4rem 0; color: var(--muted); }

.prose {
  max-width: var(--reading);
  padding: clamp(2rem, 5vw, 4rem) 0;
  color: #c8d0ca;
  font-size: .95rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.prose > :first-child { margin-top: 0; }
.prose h2,
.prose h3 { margin: 2.7em 0 .8em; color: var(--text); }
.prose h2 { font-size: 1.7rem; }
.prose h3 { font-size: 1.3rem; }
.prose a { color: var(--accent); }
.prose code { padding: .12em .35em; background: var(--surface-hover); color: var(--accent); font-size: .88em; }
.prose pre { overflow-x: auto; padding: 1.25rem; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.prose pre code { padding: 0; background: none; color: inherit; }
.prose blockquote { margin: 2rem 0; padding-left: 1.5rem; border-left: 2px solid var(--accent); color: var(--muted); }
.prose-page { padding-top: 0; }

.related { max-width: 960px; padding: 4rem 0 7rem; border-top: 1px solid var(--line); }
.related + .related { padding-top: 1rem; border-top: 0; }
.related h2 { margin-bottom: 2rem; font-size: 1.9rem; }

.not-found { padding: 9rem 0; }
.not-found h1 { max-width: 12ch; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .72rem;
}

.site-footer p { display: flex; align-items: center; gap: .7rem; margin: 0; }
.site-footer p { flex-wrap: wrap; }
.footer-mark { width: auto; }
.footer-mark::before { content: "["; color: var(--muted); }
.footer-mark::after { content: "]"; color: var(--muted); }

@media (max-width: 1000px) {
  .site-header { align-items: flex-start; flex-direction: column; gap: .75rem; padding-block: 1.5rem; }
  nav { justify-content: flex-start; }
}

@media (max-width: 760px) {
  body { font-size: 15px; }
  .site-header { align-items: flex-start; flex-direction: column; padding: 1rem 0 1.25rem; }
  nav { justify-content: flex-start; gap: .4rem 1rem; }
  .hero { grid-template-columns: 1fr; min-height: 0; padding: 3rem 0; gap: 2.5rem; }
  .hero-portrait { width: min(55%, 220px); }
  .project-grid { grid-template-columns: 1fr; }
  .project-card,
  .project-card:nth-child(2n) { min-height: 0; }
  .timeline li,
  .video-list li { grid-template-columns: 1fr; gap: .45rem; }
  .post-card { grid-template-columns: 1fr; }
  .post-card .meta-line { grid-row: auto; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .site-footer { flex-direction: column; }
  .site-footer p { align-items: baseline; }
  .hero-actions { gap: 1.25rem; }
  .post-card { padding-block: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
