:root {
  --bg: #ffffff;
  --surface: #fafafa;
  --ink: #0a0a0a;
  --body: #3b3b40;
  --mute: #7a7a7e;
  --dim: #c2c2c6;
  --line: #eaeaec;
  --line-2: #dcdce0;

  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, sans-serif;

  --sidebar: 320px;
  --pad-x: clamp(24px, 4vw, 48px);
  --pad-y: clamp(32px, 4vw, 56px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--body);
  background: var(--bg);
  font-feature-settings: "ss01", "cv11", "tnum";
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--ink); color: var(--bg); }

/* ---------- Layout ---------- */

.layout {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  gap: 0;
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #fafaf8;
}
.sidebar-inner {
  position: sticky;
  top: 0;
  padding: var(--pad-y) var(--pad-x);
  max-height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar-inner::-webkit-scrollbar { display: none; }

.content {
  min-width: 0;
  padding: var(--pad-y) var(--pad-x) 96px;
}

/* ---------- Sidebar ---------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.status .status-label { color: var(--ink); font-weight: 500; }
.status .sep { color: var(--dim); margin: 0 -1px; }
.status #hero-time {
  color: var(--mute);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 10px;
}
.live-dot {
  width: 6px; height: 6px;
  background: var(--ink);
  border-radius: 50%;
  animation: pulse 2.2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .35; transform: scale(0.8); }
}

.name {
  margin: 0;
  font-family: var(--sans);
  font-size: 22px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.role {
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--mute);
  letter-spacing: -0.003em;
}
.role strong { color: var(--body); font-weight: 400; }

.tagline {
  margin: 20px 0 0;
  color: var(--body);
  font-size: 13px;
  line-height: 1.6;
  max-width: 32ch;
}

.sidenote {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--mute);
  line-height: 1.65;
  letter-spacing: 0.01em;
}

.sec-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 28px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
  padding: 2px 0;
}
.stats-grid .stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stats-grid .stat strong {
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.025em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stats-grid .stat span {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--mute);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cta {
  margin-top: 24px;
}
.cta-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 8px;
}
.cta-text {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--body);
  max-width: 34ch;
}
.cta-text a {
  color: var(--ink);
  font-weight: 500;
  border-bottom: 1px solid var(--line-2);
  transition: border-color .18s, color .18s;
}
.cta-text a:hover {
  border-bottom-color: var(--ink);
}

.prev {
  margin-top: 24px;
}
.prev-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 10px;
}
.prev-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.prev-item {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 5px;
  transition: background .18s, border-color .18s, transform .18s;
  position: relative;
  z-index: 1;
}
.prev-item:hover { z-index: 10; }

.prev-tip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 9px 12px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s cubic-bezier(.18,.9,.3,1), transform .2s cubic-bezier(.18,.9,.3,1);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 8px 24px -6px rgba(0,0,0,0.25);
}
.prev-tip strong {
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--bg);
}
.prev-tip .prev-tip-role {
  font-size: 10px;
  color: rgba(255,255,255,0.7);
}
.prev-tip .prev-tip-period {
  font-size: 9.5px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.prev-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink);
}
.prev-item:hover .prev-tip,
.prev-item:focus-visible .prev-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.prev-item:hover {
  background: var(--surface);
  border-color: var(--line-2);
  transform: translateY(-1px);
}
.prev-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.prev-item .prev-fallback {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.04em;
}

.links {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
}
.links li { display: inline-flex; }
.links a {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  color: var(--mute);
  background: var(--bg);
  transition: background .18s, color .18s, border-color .18s, transform .18s;
  flex-shrink: 0;
}
.links a:hover,
.links a:focus-visible {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  outline: none;
  transform: translateY(-1px);
}
.links a svg { display: block; }
.links a .icon-text {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
}

.sidebar-foot {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9px;
  color: var(--dim);
  letter-spacing: 0.06em;
  line-height: 1.7;
}
.sidebar-foot .foot-colo {
  color: var(--mute);
  margin-bottom: 6px;
}
.sidebar-foot .foot-kbd {
  color: var(--mute);
}
.sidebar-foot kbd {
  font-family: var(--mono);
  display: inline-block;
  padding: 1px 4px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 2px;
  margin: 0 1px;
  color: var(--body);
  background: var(--bg);
  font-size: 8.5px;
}

/* Keep old classes alive for backwards-compat */
.colophon { font-family: var(--mono); font-size: 10px; color: var(--dim); }
.kbd-hint { display: none; }

.toast {
  position: fixed;
  bottom: 20px; left: 50%;
  transform: translate(-50%, 14px);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  opacity: 0;
  transition: opacity .22s, transform .22s cubic-bezier(.2,.9,.3,1);
  z-index: 200;
  box-shadow: 0 10px 30px -6px rgba(0,0,0,0.3);
  pointer-events: none;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Content sections ---------- */

.section {
  margin-bottom: 56px;
}
.section:last-child { margin-bottom: 0; }

.sec {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 16px;
}
.sec h2 {
  margin: 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.sec-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.02em;
}

/* ---------- Projects ---------- */

.prows { border-top: 1px solid var(--line); }
.prow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 70px;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
  cursor: pointer;
  transition: background .18s, padding-left .18s, padding-right .18s;
  text-align: left;
  font: inherit;
  color: inherit;
  background: transparent;
  border-left: 0; border-right: 0; border-top: 0;
  width: 100%;
  outline: none;
}
.prow:hover {
  background: var(--surface);
}
.prow:focus-visible {
  background: var(--surface);
  box-shadow: inset 2px 0 0 var(--ink);
  outline: none;
}

.prow-num {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--mute);
  letter-spacing: 0.02em;
}

.prow-body {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
  overflow: hidden;
}
.prow-name {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.25;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.01em;
  word-break: break-word;
  display: inline-flex; align-items: baseline; gap: 8px;
}
.prow.is-flag .prow-name {
  font-weight: 600;
}
.prow-sum {
  font-size: 13px;
  line-height: 1.5;
  color: var(--body);
  max-width: 620px;
}
.prow-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  align-self: baseline;
  padding-top: 4px;
}

.prow-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  font-weight: 500;
  text-align: right;
  line-height: 1.5;
  white-space: nowrap;
  padding-top: 4px;
}
.prow-meta.dim { color: var(--mute); font-weight: 400; }

/* ---------- Writing ---------- */

.erows { border-top: 1px solid var(--line); }
.erow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 16px;
  font: inherit;
  text-align: left;
  background: transparent;
  border-left: 0; border-right: 0; border-top: 0;
  width: 100%;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
  cursor: pointer;
  transition: background .18s, padding-left .18s, padding-right .18s;
  color: var(--body);
}
.erow:hover {
  background: var(--surface);
}
.erow:focus-visible {
  background: var(--surface);
  box-shadow: inset 2px 0 0 var(--ink);
  outline: none;
}
.erow .eid {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--mute);
  letter-spacing: 0.02em;
}
.erow-body { min-width: 0; overflow: hidden; }
.erow-body .etitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.erow-body .edesc { line-height: 1.5; }
.erow .etitle {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.005em;
}
.erow .edesc {
  display: block;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--mute);
  margin-top: 2px;
  line-height: 1.5;
}
.erow .ekind {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--mute);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  align-self: baseline;
  padding-top: 2px;
}

/* Metrics column on .erow (for Experiments section) */
.ekind.emetrics {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
  align-self: flex-start;
  padding-top: 2px;
}
.ekind.emetrics span {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ekind.emetrics span:not(:first-child) {
  color: var(--mute);
  font-weight: 400;
}

/* ---------- Modal ---------- */

.pmodal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 60px 20px 40px;
  overflow-y: auto;
}
.pmodal[hidden] { display: none !important; }
.pmodal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 10, 10, 0.36);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  animation: fade-in .22s ease;
}
.pmodal-card {
  position: relative;
  z-index: 1;
  background: var(--bg);
  border: 1px solid var(--ink);
  max-width: 680px;
  width: 100%;
  margin: auto;
  animation: slide-up .28s cubic-bezier(.18,.9,.3,1);
  box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.22);
}
.pmodal-close {
  position: absolute; top: 12px; right: 12px;
  background: transparent;
  border: 1px solid var(--line-2);
  width: 30px; height: 30px;
  cursor: pointer;
  font-size: 12px;
  color: var(--mute);
  transition: all .18s ease;
  z-index: 2;
  font-family: var(--mono);
}
.pmodal-close:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pmodal-content { padding: 32px 32px 28px; }

.d-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px; margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.d-name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
  word-break: break-word;
}
.d-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  color: var(--mute);
  text-align: right;
  white-space: nowrap;
  line-height: 1.6;
}
.d-meta .stars {
  display: block;
  font-size: 12px;
  color: var(--ink);
  font-weight: 500;
}

.d-paragraphs p {
  color: var(--body);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 10px;
}
.d-paragraphs p:last-child { margin-bottom: 0; }

.d-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 16px 0 4px;
}
.d-images img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border: 1px solid var(--line-2);
  transition: transform .25s ease;
}
.d-images a:hover img { transform: scale(1.02); }

.d-tweets {
  display: flex; flex-direction: column; gap: 12px;
  margin: 16px 0 4px;
}
.d-tweet {
  border-left: 2px solid var(--ink);
  padding: 4px 0 4px 12px;
}
.d-tweet .t-text {
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.d-tweet footer {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--mute);
  letter-spacing: 0.03em;
}

.d-links {
  display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap;
}
.d-link {
  display: inline-block;
  border: 1px solid var(--ink);
  padding: 7px 13px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink);
  letter-spacing: 0.04em;
  transition: all .18s ease;
}
.d-link:hover { background: var(--ink); color: var(--bg); }
.d-link.primary { background: var(--ink); color: var(--bg); }
.d-link.primary:hover { background: transparent; color: var(--ink); }

/* ---------- Venture detail (inside pmodal) ---------- */

.venture-detail .vd-head {
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.venture-detail .vd-id {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 8px;
}
.venture-detail .vd-name {
  margin: 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--ink);
}
.venture-detail .vd-summary {
  margin: 10px 0 0;
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--body);
  max-width: 52ch;
}
.venture-detail .vd-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 22px;
}
.venture-detail .vd-metric {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--ink);
  border: 1px solid var(--line-2);
  padding: 5px 10px;
}
.venture-detail .vd-paras p {
  color: var(--body);
  font-size: 14.5px;
  line-height: 1.65;
  margin: 0 0 12px;
}
.venture-detail .vd-paras p:last-child { margin-bottom: 0; }
.venture-detail .vd-section {
  margin-top: 20px;
}
.venture-detail .vd-section-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 10px;
}
.venture-detail .vd-highlights {
  list-style: none;
  padding: 0;
  margin: 0;
}
.venture-detail .vd-highlights li {
  position: relative;
  padding: 6px 0 6px 18px;
  color: var(--body);
  font-size: 14px;
  line-height: 1.5;
  border-bottom: 1px solid var(--line);
}
.venture-detail .vd-highlights li:last-child { border-bottom: 0; }
.venture-detail .vd-highlights li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--mute);
}

/* ---------- Essay reader (modal) ---------- */

.reader {
  position: fixed; inset: 0;
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  animation: fade-in .22s ease;
}
.reader[hidden] { display: none !important; }
.reader-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 10, 10, 0.45);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  z-index: 0;
}
.reader-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 820px;
  max-height: calc(100vh - 80px);
  background: var(--bg);
  border: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  animation: slide-up .32s cubic-bezier(.18,.9,.3,1);
  box-shadow: 0 40px 100px -30px rgba(0,0,0,0.35);
}

.reader-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  flex-shrink: 0;
}
.reader-close {
  justify-self: start;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--body);
  cursor: pointer;
  padding: 6px 12px;
  transition: all .18s;
  border-radius: 2px;
}
.reader-close:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.reader-progress {
  justify-self: center;
  height: 2px;
  width: 200px;
  background: var(--line);
  position: relative;
}
.reader-progress-bar {
  height: 100%;
  background: var(--ink);
  width: 0%;
  transition: width .1s linear;
}

.reader-title {
  justify-self: end;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--mute);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 400px;
}
.reader-title strong {
  color: var(--ink);
  font-weight: 500;
}

.reader-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  min-height: 0;
}
.reader-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 56px 48px 40px;
}

.reader .essay .e-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 22px;
}
.reader .essay .e-meta .e-dot { color: var(--dim); }
.reader .essay .e-title {
  margin: 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(32px, 4.4vw, 46px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.reader .essay .e-subtitle {
  margin: 12px 0 0;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 17.5px;
  line-height: 1.45;
  color: var(--mute);
  max-width: 50ch;
  letter-spacing: -0.005em;
}
.reader .essay .e-body {
  margin-top: 44px;
  color: var(--body);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.72;
  letter-spacing: -0.002em;
}
.reader .essay .e-body > :first-child { margin-top: 0; }
.reader .essay .e-body p { margin: 0 0 16px; }
.reader .essay .e-body h2 {
  margin: 40px 0 14px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.reader .essay .e-body h3 {
  margin: 26px 0 8px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}
.reader .essay .e-body ul {
  margin: 0 0 18px;
  padding-left: 0;
  list-style: none;
}
.reader .essay .e-body ul li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 4px;
}
.reader .essay .e-body ul li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--mute);
}

/* Prev / next nav */
.reader-pn {
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pn-btn {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: background .18s, border-color .18s;
}
.pn-btn.pn-next {
  align-items: flex-end;
  text-align: right;
}
.pn-btn:hover:not(:disabled) {
  background: var(--surface);
  border-color: var(--line-2);
}
.pn-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.pn-dir {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
}
.pn-title {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.pn-title.muted {
  color: var(--dim);
  font-weight: 400;
}

.reader-kbd {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
  gap: 20px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--mute);
  letter-spacing: 0.04em;
}
.reader-kbd kbd {
  font-family: var(--mono);
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 3px;
  color: var(--body);
  background: var(--bg);
  font-size: 10px;
  margin-right: 4px;
}

@media (max-width: 720px) {
  .reader { padding: 0; }
  .reader-card { max-height: 100vh; height: 100vh; border: 0; }
  .reader-bar { grid-template-columns: auto 1fr; padding: 12px 16px; gap: 14px; }
  .reader-progress { display: none; }
  .reader-title { font-size: 10.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .reader-inner { padding: 32px 18px 28px; }
  .reader .essay .e-meta { font-size: 10px; }
  .reader .essay .e-title { font-size: 24px; }
  .reader .essay .e-subtitle { font-size: 14.5px; }
  .reader .essay .e-body { font-size: 15px; line-height: 1.65; }
  .reader .essay .e-body h2 { font-size: 18px; margin: 28px 0 10px; }
  .reader .essay .e-body h3 { font-size: 10.5px; }
  .reader-pn { grid-template-columns: 1fr; gap: 8px; }
  .pn-btn { padding: 14px 16px; }
  .pn-btn.pn-next { align-items: flex-start; text-align: left; }
  .pn-title { font-size: 14px; }
  .reader-kbd { display: none; }
  .reader-close { padding: 5px 10px; font-size: 11px; }
}

/* ---------- Legacy essay-modal (unused but kept harmless) ---------- */

.pmodal-card.is-essay {
  max-width: 780px;
}
.pmodal-card.is-essay .pmodal-content {
  padding: 56px 52px 48px;
}
.essay .e-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 20px;
}
.essay .e-meta .e-dot { color: var(--dim); }
.essay .e-title {
  margin: 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.essay .e-subtitle {
  margin: 10px 0 0;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.45;
  color: var(--mute);
  max-width: 56ch;
}
.essay .e-body {
  margin-top: 36px;
  color: var(--body);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.7;
  letter-spacing: -0.001em;
}
.essay .e-body > :first-child { margin-top: 0; }
.essay .e-body p {
  margin: 0 0 14px;
}
.essay .e-body h2 {
  margin: 32px 0 10px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.essay .e-body h3 {
  margin: 22px 0 8px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.essay .e-body ul {
  margin: 0 0 16px;
  padding-left: 0;
  list-style: none;
}
.essay .e-body ul li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 4px;
}
.essay .e-body ul li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--mute);
}

@media (max-width: 720px) {
  .pmodal-card.is-essay .pmodal-content { padding: 36px 24px 28px; }
  .essay .e-body { font-size: 15px; }
}

@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }
@keyframes slide-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive ---------- */

/* ---------- Tablet (≤860px) ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
  }
  .sidebar-inner {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 24px 20px 28px;
  }
  .content { padding: 32px 20px 64px; }

  /* sidebar elements */
  .name { font-size: 20px; }
  .role { font-size: 11.5px; }
  .tagline { font-size: 12.5px; max-width: 100%; }
  .prev { margin-top: 20px; }
  .cta { margin-top: 18px; }
  .cta-text { font-size: 12px; max-width: 100%; }
  .links { margin-top: 20px; }
  .sidebar-foot { margin-top: 22px; padding-top: 14px; }

  /* sections */
  .section { padding: 48px 0; }
  .sec h2 { font-size: 13px; }

  /* rows */
  .prow { grid-template-columns: minmax(0, 1fr) 70px; gap: 10px; padding: 14px 0; }
  .prow-tag { display: none; }
  .prow-name { font-size: 14.5px; }
  .prow-sum { font-size: 12.5px; }
  .prow-meta { font-size: 10.5px; }

  .erow { grid-template-columns: minmax(0, 1fr) 100px; gap: 10px; padding: 12px 0; }
  .erow .edesc { display: none; }
  .erow .etitle { font-size: 13.5px; }
  .erow .ekind { font-size: 10px; }
  .ekind.emetrics span { font-size: 9px; }

  /* modals */
  .pmodal { padding: 20px 12px; }
  .pmodal-card { max-width: 100%; border: 0; }
  .pmodal-content { padding: 24px 20px 20px; }
  .d-head { flex-direction: column; gap: 8px; }
  .d-meta { text-align: left; }
  .d-name { font-size: 20px; }
  .d-images { grid-template-columns: repeat(2, 1fr); }

  /* venture detail */
  .venture-detail .vd-name { font-size: 22px; }
  .venture-detail .vd-metrics { gap: 4px; }
  .venture-detail .vd-metric { font-size: 9.5px; padding: 4px 8px; }
  .venture-detail .vd-highlights li { font-size: 13px; padding: 5px 0 5px 14px; }
}

/* ---------- Phone (≤480px) ---------- */
@media (max-width: 480px) {
  .sidebar-inner { padding: 20px 16px 24px; }
  .content { padding: 24px 16px 48px; }

  .status { font-size: 9px; gap: 6px; }
  .name { font-size: 18px; letter-spacing: -0.025em; }
  .tagline { font-size: 11.5px; line-height: 1.55; }
  .cta-text { font-size: 11.5px; }

  .prev-item { width: 26px; height: 26px; padding: 4px; }
  .prev-tip { display: none; }

  .section { padding: 40px 0; }
  .sec h2 { font-size: 12.5px; }
  .sec-count { font-size: 9.5px; }

  .prow { grid-template-columns: minmax(0, 1fr) 60px; gap: 8px; padding: 12px 0; }
  .prow-name { font-size: 13.5px; }
  .prow-sum { font-size: 12px; line-height: 1.45; }
  .prow-meta { font-size: 10px; }
  .prow-meta .stars { font-size: 10px; }

  .erow { grid-template-columns: minmax(0, 1fr) 80px; gap: 8px; padding: 10px 0; }
  .erow .etitle { font-size: 13px; }
  .erow .ekind { font-size: 9px; }
  .ekind.emetrics span { font-size: 8.5px; }

  .pmodal { padding: 0; }
  .pmodal-backdrop { background: rgba(10,10,10,0.5); }
  .pmodal-card { height: 100vh; max-height: 100vh; border: 0; border-radius: 0; }
  .pmodal-content { padding: 20px 16px 16px; }
  .d-name { font-size: 18px; }
  .d-paragraphs p { font-size: 13.5px; }
  .d-links { gap: 6px; }
  .d-link { padding: 7px 11px; font-size: 10px; }

  .venture-detail .vd-name { font-size: 18px; }
  .venture-detail .vd-summary { font-size: 13px; }
  .venture-detail .vd-metric { font-size: 9px; padding: 3px 6px; }
  .venture-detail .vd-highlights li { font-size: 12.5px; }

  .contact a { grid-template-columns: 60px 1fr auto; gap: 10px; padding: 12px 0; }
}
