/* ============================================================
   Adam Young — design tokens
   ============================================================ */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --surface-hover: #e7ebf1;
  --ink: #0d1117;
  --ink-strong: #050810;
  --muted: #5b6573;
  --muted-strong: #2d3748;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.16);
  --accent: #0a84ff;
  --accent-2: #5e5ce6;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --code-bg: rgba(15, 23, 42, 0.05);
  --selection: rgba(10, 132, 255, 0.20);
  --rail-w: 240px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --surface: #141414;
    --surface-2: #1c1c1c;
    --surface-hover: #242424;
    --ink: #f5f5f5;
    --ink-strong: #ffffff;
    --muted: #8b95a0;
    --muted-strong: #c5cdd6;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.18);
    --accent: #0a84ff;
    --accent-2: #5e5ce6;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 30px rgba(0, 0, 0, 0.4);
    --code-bg: rgba(255, 255, 255, 0.06);
    --selection: rgba(10, 132, 255, 0.30);
  }
}

/* ============================================================
   Base
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

html, body {
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

body {
  font-family: "SF Pro Text", "SF Pro Icons", -apple-system, BlinkMacSystemFont,
               "Helvetica Neue", "Helvetica", "Arial", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
}

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

a { color: inherit; text-decoration: none; }

img, svg { display: block; max-width: 100%; }

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

input { font: inherit; color: inherit; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 12px;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 8px;
  font-size: 13px;
  z-index: 100;
}
.skip-link:focus { top: 12px; }

.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   Shell layout
   ============================================================ */
.shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100vh;
}

.main-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px 36px 64px;
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   Sidebar rail
   ============================================================ */
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 22px 14px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
}
.rail::-webkit-scrollbar { width: 6px; }
.rail::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.rail-brand {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: center;
  padding: 4px 8px 22px;
  margin-bottom: 4px;
}
.rail-brand-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  display: block;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.rail-brand:hover .rail-brand-avatar {
  transform: scale(1.04);
  border-color: var(--border-strong);
}
.brand-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brand-name {
  font-weight: 600; font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-pill {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.005em;
}

.rail-nav { display: flex; flex-direction: column; gap: 2px; }

.rail-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.rail-link:hover { background: var(--surface-2); color: var(--ink); }
.rail-link.active {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.rail-link-icon {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  flex-shrink: 0;
  color: currentColor;
}
.rail-link-icon svg { width: 18px; height: 18px; }
.rail-link-label { flex: 1; min-width: 0; }

.rail-divider {
  height: 1px;
  background: var(--border-strong);
  margin: 12px 4px;
}

/* ============================================================
   Top bar
   ============================================================ */
.topbar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 0 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.search {
  width: 100%;
  max-width: 580px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 999px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.search:hover { background: var(--surface-hover); }
.search:focus-within { background: var(--surface); border-color: var(--border-strong); }
.search-icon { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.search-icon svg { width: 100%; height: 100%; }
.search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--ink);
  min-width: 0;
}
.search input::placeholder { color: var(--muted); }

/* ============================================================
   Page header
   ============================================================ */
.page-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 40px;
  margin-bottom: 20px;
}
.page-header h1 {
  font-size: clamp(40px, 6.5vw, 72px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.page-subtitle {
  font-size: 15px;
  color: var(--muted);
  max-width: 640px;
}

/* ============================================================
   Hero (home) — text-forward, editorial
   ============================================================ */
.hero {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 40px;
  margin-bottom: 56px;
}

.hero-availability {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 6px 14px 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-strong);
  letter-spacing: 0.005em;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.hero-availability:hover {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--ink);
  transform: translateY(-1px);
}
.hero-availability-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  flex-shrink: 0;
}

.hero-title {
  font-size: clamp(40px, 6.5vw, 72px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--ink);
  max-width: 14ch;
}
.hero-name {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-tagline {
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
  letter-spacing: -0.012em;
  max-width: 36ch;
  margin-top: -4px;
}
.hero-sub {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 56ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--ink);
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn-primary:hover { transform: translateY(-1px); opacity: 0.92; }

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 4px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  border: none;
  transition: gap 0.15s ease, color 0.15s ease;
}
.btn-link:hover { gap: 10px; color: var(--accent); }

.btn-arrow {
  width: 16px; height: 16px;
  display: grid; place-items: center;
}
.btn-arrow svg { width: 100%; height: 100%; }

/* ============================================================
   Sections
   ============================================================ */
.section { margin-bottom: 56px; }
.section:last-child { margin-bottom: 32px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.section-head h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.section-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.section-link:hover {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--ink);
}
.section-link-arrow {
  width: 14px; height: 14px;
  display: grid; place-items: center;
}
.section-link-arrow svg { width: 100%; height: 100%; }

/* ============================================================
   Post grid (home)
   ============================================================ */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.2s ease;
}
.post-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}
.post-card-media {
  aspect-ratio: 1200/630;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.post-card-fallback {
  font-size: 48px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: -0.04em;
}
.post-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.post-card-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 4px;
  align-items: center;
}
.post-card h3 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.post-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
  padding-top: 14px;
}

/* ============================================================
   Project cards
   ============================================================ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.project-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.2s ease;
}
.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}
.project-art {
  aspect-ratio: 16/9;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.project-art.has-image { display: block; }
.project-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.project-card.tmdb .project-art:not(.has-image) { background: linear-gradient(135deg, #ff7139, #f05138); }
.project-card.popcorn .project-art:not(.has-image) { background: linear-gradient(135deg, #ffe89a, #ffb347); }
.project-icon {
  width: 56px; height: 56px;
  color: white;
  display: grid;
  place-items: center;
}
.project-icon svg { width: 100%; height: 100%; }
.project-card.popcorn .project-icon { color: inherit; }
.project-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.project-body h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 6px;
}
.project-body p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}
.project-link {
  font-size: 13px;
  color: var(--muted);
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.project-card:hover .project-link,
.project-row:hover .project-link { color: var(--accent); }

/* Full-width project rows on /projects/ */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.project-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.2s ease;
}
.project-row:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}
.project-row .project-art {
  aspect-ratio: auto;
  min-height: 240px;
}
.project-row.tmdb .project-art:not(.has-image) { background: linear-gradient(135deg, #ff7139, #f05138); }
.project-row.popcorn .project-art:not(.has-image) { background: linear-gradient(135deg, #ffe89a, #ffb347); }
.project-row .project-icon { width: 72px; height: 72px; color: white; }
.project-row.popcorn .project-icon { color: inherit; }
.project-row .project-body {
  padding: 28px 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.project-row .project-body h3 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.project-row .project-body p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}
.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.project-tech .chip {
  font-size: 12px;
  padding: 4px 10px;
}
.project-card .project-tech {
  margin-top: 12px;
  margin-bottom: 4px;
}
.project-row .project-link {
  margin-top: auto;
  font-size: 13px;
}
.project-row .section-link-arrow { width: 14px; height: 14px; }

@media (max-width: 760px) {
  .project-row {
    grid-template-columns: 1fr;
  }
  .project-row .project-art {
    aspect-ratio: 16/9;
    min-height: 0;
  }
  .project-row .project-body { padding: 22px; }
}

/* ============================================================
   Stack chips
   ============================================================ */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}

/* ============================================================
   Blog list (Apple News–style mosaic)
   ============================================================ */
.blog-mosaic {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.2s ease;
}
.blog-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}

/* Lead — up to two large feature cards */
.blog-lead {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 24px;
}
.blog-feature {
  display: flex;
  flex-direction: column;
}
.blog-feature-media {
  aspect-ratio: 1200/630;
  background: var(--bg);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.blog-feature-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.blog-feature-body {
  padding: 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.blog-feature-body h3 {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.blog-feature-body p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-feature-body .post-card-tags { margin-top: auto; padding-top: 14px; }

/* Tiles — compact cards: text left, thumbnail right */
.blog-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.blog-tile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 16px;
  padding: 16px;
  align-items: start;
}
.blog-tile-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.blog-tile-text h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-tile-text p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-tile-media {
  width: 92px;
  aspect-ratio: 1;
  background: var(--bg);
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.blog-tile-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.blog-tile-media .post-card-fallback { font-size: 24px; }
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
}

/* ============================================================
   Single post
   ============================================================ */
.post {
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  padding: 0 0 64px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
  transition: color 0.2s ease;
}
.back-link:hover { color: var(--ink); }
.post-header { margin-bottom: 28px; }
.post-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 12px;
  color: var(--ink);
}
.post-meta {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.005em;
}
.tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.post-meta .tag { margin-left: 4px; }

/* ============================================================
   Post body (rich text) — preserved & lightly tuned
   ============================================================ */
.post-body, .page-body {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
}
.post-body > * + *, .page-body > * + * { margin-top: 1.1em; }
.post-body h2, .page-body h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.018em;
  margin-top: 1.6em;
  color: var(--ink);
}
.post-body h3, .page-body h3 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin-top: 1.4em;
  color: var(--ink);
}
.post-body p, .page-body p { color: var(--ink); }
.post-body a, .page-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.post-body a:hover, .page-body a:hover { text-decoration-thickness: 2px; }
.post-body ul, .post-body ol, .page-body ul, .page-body ol { padding-left: 1.4em; }
.post-body li + li, .page-body li + li { margin-top: 0.4em; }
.post-body blockquote, .page-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 20px;
  color: var(--muted);
  font-style: italic;
}
.post-body code, .page-body code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
}
.post-body pre, .page-body pre {
  background: var(--code-bg);
  padding: 18px 20px;
  border-radius: 12px;
  overflow-x: auto;
  border: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.55;
  max-width: 100%;
  box-sizing: border-box;
}
.post-body pre code, .page-body pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}
.post-body img, .page-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.post-body hr, .page-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

/* ============================================================
   Post navigation (prev / next)
   ============================================================ */
.post-nav {
  display: flex;
  gap: 16px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.post-nav-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  flex: 0 1 calc(50% - 8px);
  min-width: 0;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.post-nav-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}
.post-nav-card.next {
  flex-direction: row-reverse;
  text-align: right;
  margin-left: auto;
}
.post-nav-media {
  flex-shrink: 0;
  width: 88px;
  aspect-ratio: 16/10;
  background: var(--bg);
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.post-nav-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.post-nav-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.post-nav-direction {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.post-nav-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-nav-date {
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .post-nav { flex-direction: column; }
  .post-nav-card,
  .post-nav-card.next {
    flex: 1;
    flex-direction: row;
    text-align: left;
    margin-left: 0;
  }
  .post-nav-media { width: 72px; }
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  margin-top: auto;
  padding: 32px 0 8px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  justify-content: center;
  text-align: center;
}

/* ============================================================
   Desktop: hide mobile-only elements
   ============================================================ */
@media (min-width: 1101px) {
  .mobile-header,
  .nav-overlay,
  .rail-mobile-head { display: none !important; }
}

/* ============================================================
   Print: hide navigation chrome
   ============================================================ */
@media print {
  .mobile-header, .nav-overlay, .rail { display: none !important; }
  .shell { grid-template-columns: 1fr !important; }
}

/* ============================================================
   Responsive — tablet & mobile (≤1100px)
   ============================================================ */
@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }

  /* Sticky top bar */
  .mobile-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    min-height: 56px;
    padding: 8px 18px;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }
  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .mobile-brand-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border);
    object-fit: cover;
    display: block;
  }
  .mobile-brand-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
  }

  /* Hamburger button */
  .nav-toggle-btn {
    display: grid;
    place-items: center;
    width: 44px; height: 44px;
    border-radius: 10px;
    color: var(--ink);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease;
  }
  .nav-toggle-btn:hover { background: var(--surface-2); }
  .nav-toggle-btn svg { width: 22px; height: 22px; }

  /* Backdrop overlay */
  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    cursor: default;
  }

  /* Slide-in drawer */
  .rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, 86vw);
    z-index: 200;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--bg);
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    padding: max(16px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    display: flex;
    flex-direction: column;
    gap: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
  }
  .rail::-webkit-scrollbar { width: 4px; }
  .rail::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

  /* Drawer header row: close button */
  .rail-mobile-head {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
  }
  .nav-close-btn {
    display: grid;
    place-items: center;
    width: 36px; height: 36px;
    border-radius: 8px;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
  }
  .nav-close-btn:hover { background: var(--surface-2); color: var(--ink); }
  .nav-close-btn svg { width: 20px; height: 20px; }

  /* Open state — driven by JS toggling [data-nav-open] on <html> */
  html[data-nav-open] .rail { transform: translateX(0); }
  html[data-nav-open] .nav-overlay { opacity: 1; pointer-events: auto; }
  html[data-nav-open] { overflow: hidden; }

  /* Rail internals in drawer: show everything vertically */
  .rail-divider { display: block; }
  .rail-nav-secondary { display: flex; }
  .rail-nav { flex-direction: column; gap: 2px; }
  .rail-link { padding: 9px 12px; }

  .main-area { padding: 16px 24px 64px; }
}

/* ============================================================
   Responsive — mobile (≤720px)
   ============================================================ */
@media (max-width: 720px) {
  .topbar {
    padding-bottom: 18px;
    margin-bottom: 24px;
  }
  .hero {
    margin-bottom: 40px;
    gap: 16px;
  }
  .hero-title { max-width: none; }
  .hero-tagline { max-width: none; font-size: 17px; }
  .hero-sub { font-size: 15px; }
  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }
  .blog-tile {
    grid-template-columns: minmax(0, 1fr) 76px;
    gap: 14px;
  }
  .blog-tile-media { width: 76px; }
  .main-area { padding: 12px 18px 48px; }
  .section { margin-bottom: 44px; }
  .post-body pre, .page-body pre {
    margin-left: -18px;
    margin-right: -18px;
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: 14px 18px;
  }
}

/* ============================================================
   About page
   ============================================================ */

/* Hero card — the "Hi, I'm Adam" intro */
.about-hero {
  margin-top: 40px;
  margin-bottom: 48px;
}

.about-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 14px;
}
.eyebrow-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.about-hero-lead {
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
  letter-spacing: -0.012em;
  margin-bottom: 14px;
  max-width: 36ch;
}
.about-hero-highlight {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 600;
}
.about-hero p:not(.about-hero-lead) {
  font-size: 16px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 68ch;
}
.about-hero-chips {
  margin-top: 22px;
}

/* Section headings with subtle gradient accent */
.about-section { margin-bottom: 48px; }
.about-section:last-child { margin-bottom: 16px; }
.about-section h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin-bottom: 8px;
  padding-bottom: 14px;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.about-section h2::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 56px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.career-list, .education-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.career-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}
.career-row:last-child { border-bottom: none; padding-bottom: 4px; }

.education-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}
.education-row:last-child { border-bottom: none; padding-bottom: 4px; }
@media (max-width: 720px) {
  .education-row {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 14px;
    padding: 18px 0;
  }
}

.company-logo {
  width: 72px;
  height: 72px;
  background: #ffffff;
  border-radius: 10px;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  align-self: start;
  overflow: hidden;
}
.company-logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.career-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding-top: 2px;
}
.primary-line {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.005em;
}
.company-description {
  font-size: 13px;
  color: var(--muted);
  margin: 2px 0 6px;
  line-height: 1.45;
}
.secondary-line {
  font-size: 14px;
  color: var(--ink);
}
.date-line, .location-line {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Multi-role timeline */
.sub-role-list {
  list-style: none;
  margin: 16px 0 0 0;
  padding: 0 0 0 22px;
  position: relative;
}
.sub-role-list.multi::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 8px;
  width: 1px;
  background: var(--border-strong);
}
.sub-role {
  position: relative;
  padding-bottom: 14px;
}
.sub-role:last-child { padding-bottom: 0; }
.sub-role::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  outline: 3px solid var(--bg);
}
.sub-role-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sub-role .primary-line { font-size: 15px; }

@media (max-width: 720px) {
  .career-row {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 14px;
    padding: 18px 0;
  }
  .company-logo {
    width: 56px;
    height: 56px;
    padding: 6px;
  }
  .primary-line { font-size: 15px; }
  .secondary-line { font-size: 13px; }
  .sub-role-list { padding-left: 18px; }
  .sub-role::before { left: -18px; }
}

/* ============================================================
   Books page
   ============================================================ */
.book-groups {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.book-group-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 18px;
  padding-bottom: 14px;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.book-group-title::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 56px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
}

.book-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.book-cover {
  aspect-ratio: 3 / 4;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.book-body {
  padding: 16px 18px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.book-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--ink);
}
.book-subtitle {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 2px;
  flex: 1;
}
.book-authors {
  font-size: 13px;
  color: var(--muted-strong);
  margin-top: 6px;
}

/* ============================================================
   Code syntax highlighting (Splash) — preserved
   ============================================================ */
pre code,
pre.splash code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #24292f;
}
pre code .keyword,
pre code .preprocessing { color: #cf222e; }
pre code .string { color: #0a3069; }
pre code .type { color: #953800; }
pre code .call,
pre code .dotAccess { color: #8250df; }
pre code .number,
pre code .property { color: #0550ae; }
pre code .comment { color: #6e7781; font-style: italic; }

@media (prefers-color-scheme: dark) {
  pre code,
  pre.splash code { color: #c9d1d9; }
  pre code .keyword,
  pre code .preprocessing { color: #ff7b72; }
  pre code .string { color: #a5d6ff; }
  pre code .type { color: #ffa657; }
  pre code .call,
  pre code .dotAccess { color: #d2a8ff; }
  pre code .number,
  pre code .property { color: #79c0ff; }
  pre code .comment { color: #8b949e; }
}
