/* =============================================
   TOKENS
   =============================================
   Courier Prime carries the "tech writer's
   desk" energy throughout the UI chrome.
   ET Book handles everything.
   ET Book handles everything display and reading.
   ============================================= */

[data-theme="dark"] {
  --bg:          #111110;
  --bg2:         #181816;
  --bg3:         #1f1f1d;
  --line:        #2b2b28;
  --line2:       #3a3a36;
  --text:        #dbd6ce;
  --text2:       #96918b;
  --text3:       #575450;
  --accent:      #c09058;
  --accent-dim:  #7a5a35;
  --link:        #7aaac6;
  --code-bg:     #161614;
  --sel:         rgba(192,144,88,.15);
  --forthcoming: #1c1c1a;
}
[data-theme="light"] {
  --bg:          #f5f2ed;
  --bg2:         #eceae4;
  --bg3:         #ffffff;
  --line:        #dbd7cf;
  --line2:       #c5c1b8;
  --text:        #1a1917;
  --text2:       #6b6760;
  --text3:       #aeaaa4;
  --accent:      #8b5530;
  --accent-dim:  #b8805a;
  --link:        #285c7a;
  --code-bg:     #e8e5e0;
  --sel:         rgba(139,85,48,.1);
  --forthcoming: #f0ede8;
}

/* =============================================
   BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
::selection { background: var(--sel); }

html {
  font-size: 20px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  font-family: 'ET Book', Georgia, serif;
  font-weight: normal;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  transition: background .25s ease, color .25s ease;
  min-height: 100vh;
  overflow-x: clip;
  max-width: 100%;
}

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

/* Courier Prime is our UI font */
.ui {
  font-family: 'Courier Prime', 'Courier New', monospace;
}

/* =============================================
   LAYOUT
   ============================================= */
.wrap {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.wrap--wide {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Article layout — wider container with TOC sidebar */
.article-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 0 3.5rem;
  align-items: start;
}
.article-layout .article-top,
.article-layout .article-body {
  grid-column: 1;
}

/* =============================================
   TOC
   ============================================= */
.toc-sidebar {
  grid-column: 2;
  grid-row: 1 / -1;
  position: sticky;
  top: 4rem;
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
  scrollbar-width: none;
  align-self: start;
  padding-top: 2.8rem;
}
/* On desktop, fix the TOC so it never scrolls away */
@media (min-width: 900px) {
  .toc-sidebar {
    position: fixed;
    top: 5rem;
    right: max(1.25rem, calc(50% - 600px));
    width: 260px;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    scrollbar-width: none;
    padding-top: 0;
    will-change: transform;
  }
  /* TOC is fixed — no padding needed, it floats over whitespace */
  .article-layout {
    padding-right: 1.25rem;
  }
}
.toc-label {
  font-family: 'Courier Prime', monospace;
  font-size: .62rem;
  letter-spacing: .04em;
  color: var(--text3);
  margin-bottom: .85rem;
}
.toc-list {
  list-style: none;
  border-left: 1px solid var(--line);
  padding-left: 0;
}
.toc-item {
  display: block;
}
.toc-link {
  display: block;
  font-family: 'Courier Prime', monospace;
  font-size: .67rem;
  font-weight: 400;
  color: var(--text3);
  text-decoration: none;
  padding: .3rem 0 .3rem .85rem;
  border-left: 2px solid transparent;
  margin-left: -1px;
  line-height: 1.5;
  transition: color .15s, border-color .15s;
}
.toc-link:hover { color: var(--text2); }
.toc-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
}
.toc-link.h3 {
  padding-left: 1.4rem;
  font-size: .63rem;
  color: var(--text3);
  opacity: .8;
}
.toc-link.h3.active { color: var(--accent); border-left-color: var(--accent); opacity: 1; }

/* Mobile TOC — collapsible drawer, sits after intro paragraph */
.toc-mobile {
  display: none;
  margin-top: 1.4rem;
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.toc-mobile-toggle {
  width: 100%;
  background: var(--bg2);
  border: none;
  padding: .7rem 1rem;
  font-family: 'Courier Prime', monospace;
  font-size: .68rem;
  color: var(--text2);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  letter-spacing: .04em;
}
.toc-mobile-toggle .toc-chevron {
  transition: transform .2s;
  font-size: .8rem;
}
.toc-mobile-toggle.open .toc-chevron { transform: rotate(180deg); }
.toc-mobile-body {
  display: none;
  padding: .5rem 0;
  background: var(--bg);
}
.toc-mobile-body.open { display: block; }
.toc-mobile-body .toc-link {
  font-size: .7rem;
  padding: .35rem 1rem;
  border-left: none;
  color: var(--text3);
  text-decoration: none;
  display: block;
}
.toc-mobile-body .toc-link:hover { color: var(--text2); }
.toc-mobile-body .toc-link.h3 { padding-left: 1.75rem; }
.toc-mobile-body .toc-link.active { color: var(--accent); }

/* =============================================
   LINK PREVIEW CARD
   ============================================= */
.link-preview {
  position: fixed;
  z-index: 400;
  width: 280px;
  background: var(--bg);
  border: 1px solid var(--line2);
  border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0,0,0,.28);
  padding: .9rem 1rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  display: none;
}
.link-preview.visible {
  display: block;
  opacity: 1;
  pointer-events: all;
}
.link-preview-domain {
  font-family: 'Courier Prime', monospace;
  font-size: .62rem;
  color: var(--text3);
  margin-bottom: .35rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.link-preview-domain img {
  width: 13px;
  height: 13px;
  border-radius: 2px;
}
.link-preview-title {
  font-family: 'ET Book', Georgia, serif;
  font-size: .92rem;
  font-weight: normal;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: .55rem;
}
.link-preview-desc {
  font-family: 'Courier Prime', monospace;
  font-size: .63rem;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: .65rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.link-preview-visit {
  font-family: 'Courier Prime', monospace;
  font-size: .63rem;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.link-preview-visit:hover { text-decoration: underline; }
.link-preview-loading {
  font-family: 'Courier Prime', monospace;
  font-size: .65rem;
  color: var(--text3);
  padding: .3rem 0;
}

/* Responsive: hide sidebar TOC, show mobile TOC */
@media (max-width: 860px) {
  .article-layout {
    grid-template-columns: 1fr;
    max-width: 720px;
  }
  .toc-sidebar { display: none; }
  .toc-mobile { display: block; }
  .article-layout .article-top,
  .article-layout .article-body { grid-column: 1; }
}

/* =============================================
   HEADER
   ============================================= */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background .25s, border-color .25s, transform .25s ease;
}

@media (max-width: 500px) {
  .site-header.header-hidden {
    transform: translateY(-100%);
  }
}

/* Reading progress bar — horizontal, very top of screen */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: none;
}
.progress-bar.visible { opacity: 1; }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  gap: .5rem;
  min-width: 0;
}

/* Site name: ET Book */
.site-name {
  font-family: 'ET Book', Georgia, serif;
  font-weight: normal;
  font-size: 1.05rem;
  letter-spacing: -.01em;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.site-name span { color: var(--accent); }

/* Nav: Courier Prime */
.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  flex-shrink: 0;
  gap: 0;
}
.nav-links a {
  font-family: 'Courier Prime', monospace;
  font-size: .72rem;
  color: var(--text2);
  padding: .25rem .5rem;
  white-space: nowrap;
  transition: color .15s;
  border-radius: 3px;
  letter-spacing: .01em;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }

@media (max-width: 420px) {
  .site-name { font-size: .9rem; }
  .nav-links a { padding: .25rem .35rem; font-size: .68rem; }
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }

/* ── Hamburger (mobile nav) ── */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text2);
  flex-shrink: 0;
  transition: color .15s;
}
.hamburger:hover { color: var(--text); }
.hamburger .icon-close { display: none; }
.site-header.nav-open .hamburger .icon-menu { display: none; }
.site-header.nav-open .hamburger .icon-close { display: flex; }

@media (max-width: 500px) {
  .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .nav-links { display: none !important; }
  .site-header.nav-open .nav-links {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    max-height: calc(100vh - 52px);
    overflow-y: auto;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: .5rem 1.25rem .75rem;
    z-index: 49;
    gap: 0;
  }
  .site-header.nav-open .nav-links a {
    display: block;
    padding: .5rem 0;
    font-size: .8rem;
    border-bottom: 1px solid var(--line);
    text-align: right;
  }
  .site-header.nav-open .nav-links li:last-child a { border-bottom: none; }
}

/* Theme toggle: Courier Prime */
.theme-btn {
  background: none;
  border: 1px solid var(--line2);
  border-radius: 4px;
  height: 30px;
  padding: 0 .6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .35rem;
  font-family: 'Courier Prime', monospace;
  font-size: .68rem;
  color: var(--text2);
  flex-shrink: 0;
  white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.theme-btn:hover { border-color: var(--accent-dim); color: var(--text); }
.theme-btn .icon { font-size: .85rem; }

/* =============================================
   INTRO
   ============================================= */
.intro {
  padding: 3.2rem 0 2.4rem;
  border-bottom: 1px solid var(--line);
}
.intro-name {
  font-family: 'ET Book', Georgia, serif;
  font-size: clamp(1.65rem, 5vw, 2.3rem);
  font-weight: normal;
  letter-spacing: -.01em;
  line-height: 1.22;
  margin-bottom: .85rem;
}
.intro-name em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}
.intro-desc {
  font-size: .96rem;
  color: var(--text2);
  line-height: 1.85;
  max-width: 54ch;
}
.intro-desc a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: color-mix(in srgb, var(--link) 30%, transparent);
  transition: text-decoration-color .15s;
}
.intro-desc a:hover { text-decoration-color: var(--link); }

/* =============================================
   CATEGORY NAV
   ============================================= */
.category-nav {
  display: flex;
  align-items: flex-end;
  gap: 0;
  padding: 1.5rem 0 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}
.category-nav::-webkit-scrollbar { display: none; }

/* Categories in italic ET Book, active goes roman */
.cat-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  font-family: 'ET Book', serif;
  font-size: .88rem;
  font-style: italic;
  font-weight: 300;
  color: var(--text3);
  padding: .45rem .75rem;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.cat-btn:hover { color: var(--text2); }
.cat-btn.active {
  color: var(--text);
  font-style: normal;
  font-weight: 400;
  border-bottom-color: var(--accent);
}

/* =============================================
   WRITING LIST
   ============================================= */
.writing-list { list-style: none; }

.post-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .5rem .75rem;
  align-items: start;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .12s;
}
.post-item:first-child { border-top: 1px solid var(--line); }
.post-item:hover .post-title { color: var(--accent); }
/* Forthcoming items don't need a right column */
.post-item.forthcoming {
  grid-template-columns: 1fr;
}

.post-title {
  font-family: 'ET Book', Georgia, serif;
  font-weight: normal;
  font-size: 1.08rem;
  line-height: 1.42;
  letter-spacing: -.01em;
  margin-bottom: .3rem;
  transition: color .15s;
}
.post-blurb {
  font-family: 'ET Book', Georgia, serif;
  font-size: .92rem;
  font-weight: normal;
  font-style: italic;
  color: var(--text2);
  line-height: 1.7;
  margin-bottom: .45rem;
}

/* Post footer: Courier Prime for all metadata */
.post-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}
.post-date {
  font-family: 'Courier Prime', monospace;
  font-size: .68rem;
  color: var(--text3);
}
.post-category {
  font-family: 'Courier Prime', monospace;
  font-size: .66rem;
  color: var(--accent-dim);
}
.post-category::before {
  content: '/';
  margin-right: .4rem;
  color: var(--text3);
}
.forthcoming-badge {
  font-family: 'Courier Prime', monospace;
  font-size: .64rem;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  border-radius: 3px;
  padding: .08rem .38rem;
}

/* Right column */
.post-right {
  font-family: 'Courier Prime', monospace;
  font-size: .66rem;
  color: var(--text3);
  white-space: nowrap;
  text-align: right;
  line-height: 2;
  padding-top: .1rem;
}
.post-right .arr {
  color: var(--accent-dim);
  font-size: .9rem;
  display: block;
}

/* Forthcoming rows */
.post-item.forthcoming {
  grid-template-columns: 1fr;
  opacity: .55;
  cursor: default;
  background: none;
}
.post-item.forthcoming:hover .post-title { color: inherit; }

/* =============================================
   ARTICLE VIEW
   ============================================= */
.article-view { display: none; }
.article-view.on { display: block; }
.home-view.off { display: none; }

.article-top {
  padding: 2.8rem 0 2rem;
  border-bottom: 1px solid var(--line);
}

/* Back button: Courier Prime */
.back-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Courier Prime', monospace;
  font-size: .7rem;
  color: var(--text3);
  margin-bottom: 1.6rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  transition: color .15s;
  padding: .5rem 0;
  letter-spacing: .01em;
}
.back-btn:hover { color: var(--accent); }

/* Article category: Courier Prime */
.article-cat {
  font-family: 'Courier Prime', monospace;
  font-size: .7rem;
  color: var(--accent);
  margin-bottom: .9rem;
  letter-spacing: .02em;
}

.article-h1 {
  font-family: 'ET Book', Georgia, serif;
  font-weight: normal;
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  line-height: 1.2;
  letter-spacing: -.01em;
  margin-bottom: .8rem;
}
.article-deck {
  font-family: 'ET Book', Georgia, serif;
  font-size: 1.2rem;
  font-style: normal;
  font-weight: normal;
  color: var(--text2);
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* Byline: Courier Prime */
.article-byline {
  font-family: 'Courier Prime', monospace;
  font-size: .68rem;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
}
.byline-sep {
  color: var(--text3);
  opacity: .5;
  font-size: .6rem;
}
/* Desktop: show long date, hide short */
.byline-date-short { display: none; white-space: nowrap; }
.byline-date-long  { display: inline; white-space: nowrap; }
/* Mobile: show short date, hide long */
@media (max-width: 520px) {
  .byline-date-short { display: inline; }
  .byline-date-long  { display: none; }
}

/* Share button */
.share-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: 'Courier Prime', monospace;
  font-size: .66rem;
  color: var(--text3);
  padding: .22rem .55rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  transition: border-color .15s, color .15s;
}
.share-btn:hover { border-color: var(--line2); color: var(--text2); }
.share-btn svg {
  width: .75rem;
  height: .75rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Share dropdown — permanent element, positioned via JS */
.share-menu {
  position: fixed;
  background: var(--bg);
  border: 1px solid var(--line2);
  border-radius: 4px;
  padding: .3rem 0;
  min-width: 6rem;
  max-width: 8rem;
  z-index: 200;
  display: none;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}
.share-menu.open { display: block; }
.share-menu a {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .38rem .6rem;
  font-family: 'Courier Prime', monospace;
  font-size: .63rem;
  color: var(--text2);
  text-decoration: none;
  transition: background .12s, color .12s;
}
.share-menu a:hover { background: var(--bg2); color: var(--text); }
.share-menu .divider {
  height: 1px;
  background: var(--line);
  margin: .3rem 0;
}

/* =============================================
   ARTICLE BODY
   ============================================= */
.article-body {
  padding: 2.8rem 0 4.5rem;
}
.article-body > * + * { margin-top: 1.55em; }
.article-body h2 + p,
.article-body h3 + p,
.article-body h4 + p { margin-top: .75em; }

.article-body p {
  font-size: .98rem;
  line-height: 1.9;
  font-weight: 400;
}
.article-body h2 {
  font-family: 'ET Book', Georgia, serif;
  font-weight: bold;
  font-size: 1.55rem;
  line-height: 1.3;
  margin-top: 2.2em;
  margin-bottom: .5em;
  letter-spacing: -.01em;
  padding-top: .85em;
  border-top: none;
  position: relative;
  display: block;
}
/* Short rule above H2 */
.article-body h2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 2rem;
  height: 1px;
  background: var(--accent-dim);
}
.article-body h3 {
  font-family: 'ET Book', Georgia, serif;
  font-size: 1.15rem;
  font-weight: normal;
  font-style: italic;
  color: var(--text);
  margin-top: 2.2em;
  margin-bottom: .1em;
  display: block;
}
.article-body h4 {
  font-family: 'Courier Prime', monospace;
  font-size: .78rem;
  font-weight: 400;
  font-style: normal;
  letter-spacing: .08em;
  color: var(--text2);
  margin-top: 1.8em;
  margin-bottom: .1em;
  text-transform: uppercase;
}
.heading-anchor {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  flex-shrink: 0;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  margin-left: .4em;
  color: var(--text3);
  opacity: 0;
  transition: opacity .15s, color .15s;
  user-select: none;
  line-height: 1;
  position: relative;
  top: -.05em;
}
.heading-anchor svg {
  width: .95em;
  height: .95em;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Desktop: show anchor on heading hover */
@media (hover: hover) {
  .article-body h2:hover .heading-anchor,
  .article-body h3:hover .heading-anchor {
    opacity: 1;
  }
  .heading-anchor:hover {
    color: var(--accent);
    opacity: 1;
  }
}
/* Mobile: always visible */
@media (hover: none) {
  .heading-anchor {
    opacity: 1;
  }
}

/* ---- Toast ---- */
.copy-toast {
  position: fixed;
  background: #333;
  color: #fff;
  font-family: system-ui, sans-serif;
  font-size: .72rem;
  padding: .2rem .5rem;
  border-radius: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.copy-toast.show { opacity: 1; }

/* ---- Selection tooltip (desktop only) ---- */
.selection-tooltip {
  position: fixed;
  background: var(--bg3);
  border: 1px solid var(--line2);
  border-radius: 5px;
  padding: .28rem .2rem;
  display: none;
  align-items: center;
  gap: .1rem;
  z-index: 300;
  box-shadow: 0 4px 18px rgba(0,0,0,.22);
  pointer-events: all;
  transform: translateX(-50%);
  transition: top .1s;
}
.selection-tooltip.visible { display: flex; }
.selection-tooltip::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 5px;
  background: var(--bg3);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
/* Main state vs share-expanded state */
.sel-main { display: flex; align-items: center; gap: .1rem; }
.sel-expanded { display: none; align-items: center; gap: .1rem; }
.selection-tooltip.expanded .sel-main { display: none; }
.selection-tooltip.expanded .sel-expanded { display: flex; }

.sel-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Courier Prime', monospace;
  font-size: .66rem;
  color: var(--text2);
  padding: .25rem .55rem;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: .3rem;
  white-space: nowrap;
  transition: background .12s, color .12s;
  line-height: 1;
}
.sel-btn:hover { background: var(--bg2); color: var(--text); }
.sel-btn svg {
  width: .78rem;
  height: .78rem;
  flex-shrink: 0;
}
.sel-back {
  color: var(--text3);
  padding-right: .4rem;
}
.sel-divider {
  width: 1px;
  height: 1.1rem;
  background: var(--line2);
  flex-shrink: 0;
}
.article-body blockquote {
  border-left: 2px solid var(--accent-dim);
  padding: .35em 0 .35em 1.35em;
  color: var(--text2);
  font-style: italic;
  font-size: .95rem;
}
.article-body a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: color-mix(in srgb, var(--link) 30%, transparent);
  transition: text-decoration-color .15s;
}
.article-body a:hover { text-decoration-color: var(--link); }

/* Code: Courier Prime naturally */
.article-body code {
  font-family: 'Courier Prime', monospace;
  font-size: .85em;
  background: var(--code-bg);
  color: var(--accent);
  padding: .12em .36em;
  border-radius: 3px;
}
.article-body pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.2rem 1.1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.article-body pre code {
  background: none;
  padding: 0;
  font-size: .82rem;
  color: var(--text);
}

sup {
  font-family: 'Courier Prime', monospace;
  font-size: .62em;
  color: var(--accent);
}

/* Footnotes */
.footnotes {
  margin-top: 3.2rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  font-size: .81rem;
  color: var(--text2);
  line-height: 1.75;
}
.footnotes-label {
  font-family: 'ET Book', serif;
  font-size: .85rem;
  font-style: italic;
  color: var(--text3);
  margin-bottom: .75rem;
}
.footnotes ol { padding-left: 1.2rem; }
.footnotes li { margin-bottom: .5em; }

/* Related */
.related {
  margin-top: 3rem;
  padding: 1.4rem;
  background: var(--bg2);
  border-radius: 4px;
  border: 1px solid var(--line);
}
.related-label {
  font-family: 'ET Book', serif;
  font-size: .85rem;
  font-style: italic;
  color: var(--text3);
  margin-bottom: .9rem;
}
.related-links { list-style: none; }
.related-links li {
  padding: .45rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .9rem;
}
.related-links li:last-child { border-bottom: none; }
.related-links a { color: var(--text); transition: color .15s; }
.related-links a:hover { color: var(--accent); }

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.8rem 0;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "copy copy"
    "links toggle";
  gap: .5rem 1.5rem;
  align-items: center;
}
.footer-copy {
  grid-area: copy;
  font-family: 'Courier Prime', monospace;
  font-size: .68rem;
  color: var(--text3);
}
.footer-links {
  grid-area: links;
  display: flex;
  gap: 1.25rem;
  flex-wrap: nowrap;
}
.footer-links a {
  font-family: 'Courier Prime', monospace;
  font-size: .68rem;
  white-space: nowrap;
  color: var(--text3);
  transition: color .15s;
}
.footer-links a:hover { color: var(--accent); }
.theme-btn {
  grid-area: toggle;
  align-self: center;
}
.site-footer .theme-btn {
  border: none;
  height: auto;
  padding: 0;
  color: var(--accent);
  background: none;
  display: flex;
  align-items: center;
}
#theme-icon { display: flex; align-items: center; color: var(--accent); }
.site-footer .theme-btn:hover { color: var(--accent); }

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes up {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}
.fade { animation: up .38s ease both; }
.post-item { animation: up .32s ease both; }
.post-item:nth-child(1) { animation-delay: .03s; }
.post-item:nth-child(2) { animation-delay: .07s; }
.post-item:nth-child(3) { animation-delay: .11s; }
.post-item:nth-child(4) { animation-delay: .15s; }
.post-item:nth-child(5) { animation-delay: .19s; }
.post-item:nth-child(6) { animation-delay: .23s; }
.post-item:nth-child(7) { animation-delay: .27s; }
.post-item:nth-child(8) { animation-delay: .31s; }
.post-item:nth-child(9) { animation-delay: .35s; }
.post-item:nth-child(10) { animation-delay: .38s; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 500px) {
  html { font-size: 17px; }
  .post-right { font-size: .58rem; }
  .intro { padding: 2rem 0 1.8rem; }
  .article-top { padding: 1.8rem 0 1.6rem; }
}

/* Drop cap — first paragraph, desktop only */
@media (min-width: 700px) {
  .article-body > p:first-of-type::first-letter {
    font-family: 'ET Book', Georgia, serif;
    font-size: 4.2em;
    font-weight: normal;
    float: left;
    line-height: .82;
    margin: .06em .08em 0 0;
    color: var(--text);
  }
}

/* =============================================
   ARTICLE LEFT SIDEBAR (desktop only)
   ============================================= */
.article-sidebar {
  display: none;
}
@media (min-width: 900px) {
  .article-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.4rem;
    position: fixed;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    will-change: transform;
  }
}
.article-sidebar-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  padding: .28rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color .15s, background .12s;
  position: relative;
}
.article-sidebar-btn:hover { color: var(--text2); background: var(--bg2); }
.article-sidebar-btn.active { color: var(--accent); }
.article-sidebar-btn svg {
  width: .95rem; height: .95rem;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.article-sidebar-btn::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + .65rem);
  top: 50%;
  transform: translateY(-50%);
  background: var(--text);
  color: var(--bg);
  font-family: 'Courier Prime', monospace;
  font-size: .6rem;
  padding: .2rem .45rem;
  border-radius: 3px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
  z-index: 10;
}
.article-sidebar-btn:hover::after { opacity: 1; }

/* Vertical progress bar — percentage at top, fills downward */
.article-sidebar-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
}
.article-sidebar-pct {
  font-family: 'Courier Prime', monospace;
  font-size: .55rem;
  color: var(--text3);
  letter-spacing: .04em;
  line-height: 1;
}
.article-sidebar-track {
  width: 2px;
  height: 120px;
  background: var(--line);
  border-radius: 2px;
  position: relative;
}
.article-sidebar-fill {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: height .8s ease-out;
}

/* =============================================
   SIMPLE VIEWS (About, Now)
   ============================================= */
.simple-view { display: none; }
.simple-view.on { display: block; }

.simple-view-inner {
  max-width: 580px;
  padding: 3.5rem 0 5rem;
}
.simple-view-title {
  font-family: 'ET Book', Georgia, serif;
  font-weight: normal;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  color: var(--text);
  margin: 0 0 1.8rem;
  line-height: 1.2;
}
.simple-view-date {
  font-family: 'Courier Prime', monospace;
  font-size: .65rem;
  color: var(--text3);
  letter-spacing: .06em;
  margin: -1.2rem 0 1.8rem;
}
.simple-view-body p {
  font-family: 'ET Book', Georgia, serif;
  font-size: .98rem;
  line-height: 1.9;
  color: var(--text);
  margin-bottom: 1.3em;
}
.simple-view-body p:last-child { margin-bottom: 0; }
.simple-view-body em { font-style: italic; }
.simple-view-links {
  display: flex;
  gap: 1.2rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.simple-view-links a {
  font-family: 'Courier Prime', monospace;
  font-size: .65rem;
  color: var(--accent);
  letter-spacing: .04em;
  text-decoration: none;
  transition: opacity .15s;
}
.simple-view-links a:hover { opacity: .7; }
.simple-view-note {
  font-family: 'Courier Prime', monospace;
  font-size: .62rem;
  color: var(--text3);
  margin-top: 2.5rem;
  line-height: 1.6;
}
.simple-view-note a {
  color: var(--text3);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Utility bar — three row layout */
.util-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 700;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 8px rgba(0,0,0,.08);
  transform: translateY(-100%);
  transition: transform .2s ease, background .25s, border-color .25s;
  display: none;
  padding: .55rem 1.25rem .45rem;
  gap: .3rem;
  flex-direction: column;
}
.util-bar.visible { transform: translateY(0); }
body.in-article .util-bar { display: flex; }
/* Hide utility bar on desktop — sidebar handles it there */
@media (min-width: 900px) {
  body.in-article .util-bar { display: none !important; }
}

/* Row 1: title */
.util-bar-title {
  font-family: 'Courier Prime', monospace;
  font-size: .7rem;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: .02em;
}

/* Row 2: progress bar + percentage */
.util-bar-progress-row {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.util-bar-track {
  flex: 1;
  height: 3px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.util-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .8s ease-out;
}
.util-bar-pct {
  font-family: 'Courier Prime', monospace;
  font-size: .62rem;
  color: var(--text3);
  letter-spacing: .04em;
  flex-shrink: 0;
  min-width: 2.2rem;
  text-align: right;
}

/* Row 3: actions */
.util-bar-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.util-bar-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Courier Prime', monospace;
  font-size: .65rem;
  color: var(--text3);
  padding: 0;
  display: flex;
  align-items: center;
  gap: .28rem;
  transition: color .15s;
  flex-shrink: 0;
}
.util-bar-btn:hover { color: var(--text2); }
.util-bar-btn.active { color: var(--accent); }
.util-bar-btn svg {
  width: .75rem; height: .75rem;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.util-bar-sep {
  color: var(--text3);
  opacity: .4;
  font-family: 'Courier Prime', monospace;
  font-size: .6rem;
}

/* Read toggle pill */
.util-read-toggle {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  cursor: pointer;
  background: none;
  border: none;
  font-family: 'Courier Prime', monospace;
  font-size: .65rem;
  color: var(--text3);
  padding: 0;
  transition: color .15s;
}
.util-read-toggle:hover { color: var(--text2); }
.util-read-toggle .toggle-track {
  width: 1.6rem;
  height: .85rem;
  border-radius: 1rem;
  background: var(--line2);
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}
.util-read-toggle .toggle-thumb {
  position: absolute;
  top: .1rem;
  left: .1rem;
  width: .65rem;
  height: .65rem;
  border-radius: 50%;
  background: var(--bg);
  transition: transform .2s, background .2s;
}
.util-read-toggle.on .toggle-track { background: var(--accent); }
.util-read-toggle.on .toggle-thumb { transform: translateX(.75rem); }
.util-read-toggle.on { color: var(--accent); }

/* Settings button only visible in reader mode */
.util-settings-btn { display: none; }
body.reading-mode .util-settings-btn { display: inline-flex; }
body.in-article.util-bar-showing .article-layout {
  padding-top: calc(3rem + 72px);
}

/* Reading mode layout */
body.reading-mode .article-layout {
  display: block;
  max-width: 1280px;
  padding: 0 1.25rem;
}
body.reading-mode .article-top,
body.reading-mode .article-body {
  max-width: var(--rm-width, 720px);
  padding: 3rem 0 6rem;
}

[data-reading-theme="paper"] {
  --bg:         #f2e8d5;
  --bg2:        #e8dcc4;
  --bg3:        #f7f0e2;
  --line:       #c8b898;
  --line2:      #6b4c2a;
  --text:       #1a1208;
  --text2:      #4a3820;
  --text3:      #8a7458;
  --accent:     #8b4513;
  --accent-dim: #8b4513;
  --link:       #3a5a1a;
  --code-bg:    #e8dcc4;
  --sel:        rgba(139,69,19,.15);
}

body.reading-mode .site-header,
body.reading-mode .site-footer,
body.reading-mode .toc-sidebar,
body.reading-mode .toc-mobile,
body.reading-mode .share-btn,
body.reading-mode .read-mode-btn,
body.reading-mode .progress-bar,
body.reading-mode .back-btn { display: none !important; }

body.reading-mode .article-layout {
  display: block;
  max-width: 1280px;
  padding: 0 1.25rem;
}
body.reading-mode .article-top,
body.reading-mode .article-body {
  max-width: var(--rm-width, 720px);
  padding: 3rem 0 6rem;
}
body.reading-mode .article-top { padding-top: 0; }
body.reading-mode .article-body p,
body.reading-mode .article-body li {
  font-size: var(--rm-fontsize, 1.05rem);
  line-height: 1.95;
}
body.reading-mode .article-h1,
body.reading-mode .article-body h2,
body.reading-mode .article-body h3,
body.reading-mode .article-body p,
body.reading-mode .article-body li,
body.reading-mode .article-deck { font-family: 'ET Book', Georgia, serif !important; }

/* Font overrides via data attribute */
body.reading-mode[data-rm-font="georgia"] .article-h1,
body.reading-mode[data-rm-font="georgia"] .article-body h2,
body.reading-mode[data-rm-font="georgia"] .article-body h3,
body.reading-mode[data-rm-font="georgia"] .article-body p,
body.reading-mode[data-rm-font="georgia"] .article-body li,
body.reading-mode[data-rm-font="georgia"] .article-deck { font-family: Georgia, serif !important; }

body.reading-mode[data-rm-font="times"] .article-h1,
body.reading-mode[data-rm-font="times"] .article-body h2,
body.reading-mode[data-rm-font="times"] .article-body h3,
body.reading-mode[data-rm-font="times"] .article-body p,
body.reading-mode[data-rm-font="times"] .article-body li,
body.reading-mode[data-rm-font="times"] .article-deck { font-family: 'Times New Roman', Times, serif !important; }

body.reading-mode .article-h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }

/* Reading mode active indicator in byline — clickable to exit */
.rm-active-indicator {
  display: none;
  align-items: center;
  gap: .3rem;
  font-family: 'Courier Prime', monospace;
  font-size: .63rem;
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: opacity .15s;
}
.rm-active-indicator:hover { opacity: .75; }
.rm-active-indicator svg {
  width: .75rem; height: .75rem;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
body.reading-mode .rm-active-indicator { display: inline-flex; }
body.reading-mode .share-btn,
body.reading-mode .read-mode-btn { display: none !important; }

/* Read mode button — borderless, quiet */
.read-mode-btn {
  background: none;
  border: none;
  font-family: 'Courier Prime', monospace;
  font-size: .68rem;
  color: var(--text3);
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  transition: color .15s;
}
.read-mode-btn:hover { color: var(--text2); }
.read-mode-btn svg {
  width: .75rem; height: .75rem;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---- Toolbar wrapper ---- */
.rm-toolbar {
  position: fixed;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}
.rm-toolbar.visible { display: flex; }

/* ---- Expanded panel ---- */
.rm-panel {
  background: var(--bg);
  border: 1px solid var(--line2);
  border-radius: 8px;
  padding: .85rem 1rem;
  box-shadow: 0 4px 24px rgba(0,0,0,.22);
  display: none;
  flex-direction: column;
  gap: .65rem;
  min-width: 252px;
  transition: background .25s;
}
.rm-panel.open { display: flex; }
.rm-panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}
.rm-panel-label {
  font-family: 'Courier Prime', monospace;
  font-size: .62rem;
  color: var(--text3);
  letter-spacing: .05em;
  flex-shrink: 0;
  width: 2.6rem;
}
.rm-panel-btns { display: flex; gap: .28rem; }
.rm-panel-btn {
  background: none;
  border: 1px solid var(--line2);
  border-radius: 3px;
  font-family: 'Courier Prime', monospace;
  font-size: .62rem;
  color: var(--text2);
  padding: .18rem .42rem;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  white-space: nowrap;
}
.rm-panel-btn:hover { background: var(--bg2); }
.rm-panel-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.rm-panel-divider { height: 1px; background: var(--line); }

/* ---- Pill bar ---- */
.rm-pill {
  background: var(--bg);
  border: 1px solid var(--line2);
  border-radius: 100px;
  padding: .32rem .45rem;
  display: flex;
  align-items: center;
  gap: .05rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
  transition: background .25s;
  overflow: visible;
}
.rm-pill-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Courier Prime', monospace;
  font-size: .7rem;
  color: var(--text2);
  padding: .22rem .4rem;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, color .12s;
  position: relative;
  line-height: 1;
}
.rm-pill-btn:hover { background: var(--bg2); color: var(--text); }
.rm-pill-btn svg {
  width: .8rem; height: .8rem;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
/* No custom tooltip - use native title attribute */
.rm-pill-sep {
  width: 1px; height: 1rem;
  background: var(--line2);
  margin: 0 .08rem;
  flex-shrink: 0;
}
/* =============================================
   PROJECTS PAGE
   ============================================= */
.projects-view { display: none; }
.projects-view.on { display: block; }
.project-view { display: none; }
.project-view.on { display: block; }

.projects-intro {
  padding: 3rem 0 2.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.5rem;
}
.projects-intro h1 {
  font-family: 'ET Book', Georgia, serif;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: normal;
  color: var(--text);
  margin: 0 0 1rem;
  line-height: 1.25;
}
.projects-intro p {
  font-family: 'ET Book', Georgia, serif;
  font-size: 1rem;
  color: var(--text2);
  line-height: 1.7;
  max-width: 560px;
  margin: 0;
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-bottom: 3rem;
}

.project-card {
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .12s;
  display: block;
}
.project-card:first-child { border-top: 1px solid var(--line); }
.project-card:hover .project-name { color: var(--accent); }

.project-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .3rem;
}
.project-name {
  font-family: 'ET Book', Georgia, serif;
  font-size: 1.15rem;
  font-weight: normal;
  color: var(--text);
  line-height: 1.3;
  transition: color .15s;
}
.project-status {
  font-family: 'Courier Prime', monospace;
  font-size: .6rem;
  letter-spacing: .04em;
  color: var(--text3);
  white-space: nowrap;
  flex-shrink: 0;
}
.project-status.live { color: var(--accent); }

.project-tagline {
  font-family: 'ET Book', Georgia, serif;
  font-style: italic;
  font-size: .9rem;
  color: var(--text2);
  margin: 0 0 .7rem;
  line-height: 1.5;
}
.project-footer {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}
.project-tag {
  font-family: 'Courier Prime', monospace;
  font-size: .6rem;
  color: var(--text3);
  letter-spacing: .02em;
}
.project-tag + .project-tag::before {
  content: '·';
  margin-right: .4rem;
  opacity: .4;
}
.project-card-read-more {
  font-family: 'Courier Prime', monospace;
  font-size: .6rem;
  color: var(--text3);
  opacity: 0;
  transition: opacity .15s;
  margin-left: auto;
  white-space: nowrap;
}
.project-card:hover .project-card-read-more { opacity: 1; }

/* =============================================
   WORK VIEW
   ============================================= */
.work-list {
  border-top: 1px solid var(--line);
  margin: 1.8rem 0 3.5rem;
}
.work-toc {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: 1.6rem 0 1.4rem;
  padding: .75rem 0;
}
.work-filter-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text2);
  cursor: pointer;
  font-family: 'Courier Prime', monospace;
  font-size: .66rem;
  padding: .32rem .58rem .28rem;
  transition: border-color .15s, color .15s, background .15s;
}
.work-filter-btn:hover,
.work-filter-btn.active {
  background: var(--bg2);
  border-color: var(--accent);
  color: var(--accent);
}
.work-client {
  border-bottom: 1px solid var(--line);
  padding: 1.7rem 0 1.8rem;
}
.work-client.hidden {
  display: none;
}
.work-client h2 {
  font-family: 'ET Book', Georgia, serif;
  font-weight: normal;
  font-size: 1.45rem;
  line-height: 1.25;
  letter-spacing: -.01em;
  margin-bottom: .65rem;
}
.work-client-note {
  font-family: 'Courier Prime', monospace;
  font-size: .62rem;
  color: var(--accent);
  margin-left: .35rem;
  vertical-align: middle;
}
.work-client-desc {
  font-family: 'ET Book', Georgia, serif;
  font-size: .95rem;
  line-height: 1.75;
  color: var(--text2);
  margin-bottom: .9rem;
}
.work-client-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .42rem;
  margin: 0 0 1.15rem;
}
.work-client-tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text3);
  font-family: 'Courier Prime', monospace;
  font-size: .62rem;
  padding: .26rem .48rem .22rem;
}
.work-subhead {
  font-family: 'Courier Prime', monospace;
  font-size: .72rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text3);
  margin: 1.15rem 0 .35rem;
}
.work-links {
  padding-left: 1.4rem;
  margin: 0;
}
.work-links li {
  border-top: 1px solid var(--line);
  font-family: 'ET Book', Georgia, serif;
  font-size: .92rem;
  line-height: 1.55;
  color: var(--text2);
  padding: .7rem 0 .78rem;
}
.work-links li:last-child {
  border-bottom: 1px solid var(--line);
}
.work-link-title {
  color: var(--text);
  text-decoration: underline dotted var(--text3);
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}
.work-link-summary {
  color: var(--text3);
  display: block;
  font-size: .82rem;
  line-height: 1.45;
  margin-top: .12rem;
}
.work-link-icon {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  display: inline-flex;
  font-family: 'Courier Prime', monospace;
  font-size: 0;
  height: 1.05rem;
  justify-content: center;
  margin-left: .35rem;
  text-decoration: none;
  transform: translateY(-.05rem);
  transition: border-color .15s, color .15s, background .15s;
  width: 1.05rem;
}
.work-link-icon::before {
  content: "\2197";
  font-size: .72rem;
  line-height: 1;
}
.work-link-icon:hover {
  background: var(--bg2);
  border-color: var(--accent);
  color: var(--accent);
}

/* Project embed iframe */
.project-embed-wrap {
  width: min(100%, 1040px);
  margin: 1.4rem auto 2.2rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg2);
}
.project-embed {
  width: 100%;
  height: 760px;
  border: none;
  display: block;
}
.project-embed-link {
  display: block;
  font-family: 'Courier Prime', monospace;
  font-size: .62rem;
  color: var(--text3);
  padding: .5rem .75rem;
  border-top: 1px solid var(--line);
  text-decoration: none;
  transition: color .15s;
}
.project-embed-link:hover { color: var(--accent); }
@media (max-width: 520px) {
  .project-embed { height: 620px; }
}

/* Fix detail page — status inline with label */
.project-detail-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1.5rem;
}
.project-detail-label {
  font-family: 'Courier Prime', monospace;
  font-size: .63rem;
  color: var(--text3);
  letter-spacing: .03em;
}
.project-detail-status {
  font-family: 'Courier Prime', monospace;
  font-size: .63rem;
  color: var(--accent);
  letter-spacing: .03em;
}
.project-detail {
  max-width: 100%;
  padding: 2.5rem 0 5rem;
}
.project-wrap {
  max-width: 1120px;
}
.project-detail-name,
.project-detail-tagline,
.project-detail-divider,
.project-detail-body > p,
.project-detail-body > h3,
.project-detail-body > ul,
.project-detail-footer {
  max-width: 760px;
}
.project-detail-name {
  font-family: 'ET Book', Georgia, serif;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: normal;
  color: var(--text);
  line-height: 1.2;
  margin: 0 0 .6rem;
}
.project-detail-tagline {
  font-family: 'ET Book', Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text2);
  margin: 0 0 1.8rem;
  line-height: 1.55;
}
.project-detail-divider {
  height: 1px;
  background: var(--line);
  margin-bottom: 2rem;
}
.project-detail-body p {
  font-family: 'ET Book', Georgia, serif;
  font-size: .98rem;
  line-height: 1.9;
  color: var(--text);
  margin: 0 0 1.3em;
}
.project-detail-body p:last-child { margin-bottom: 0; }
.project-detail-body h3 {
  font-family: 'Courier Prime', monospace;
