/* Plain, on purpose. One typeface, one size, one accent. Every line sits on a 24px grid. */
:root {
  --bg: #f6f5f1;
  --ink: #171716;
  --mute: #8b8a84;
  --faint: #c9c7bf;
  --rule: #e4e2db;
  --hover: #eeece5;
  --accent: #ec5b35;            /* the orange middle key of the Hotkey Labs mark */
  --lh: 24px;
  --fs: 15px;
  --mono: "Paper Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --left: clamp(20px, 15vw, 248px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--mono);
  font-size: var(--fs);
  line-height: var(--lh);
  font-weight: 400;
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
}
em, i, cite, address, dfn, var, q, blockquote { font-style: normal; }
h1, h2, p, ul, ol, li, dl, dd { margin: 0; padding: 0; font-size: inherit; font-weight: inherit; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
img, video { display: block; }
::selection { background: rgba(236, 91, 53, 0.22); }
:focus { outline: none; }
:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.sheet {
  width: 100%;
  max-width: calc(var(--left) + 84ch + 40px);
  padding: calc(var(--lh) * 4) 20px calc(var(--lh) * 5) var(--left);
}

/* one row = label, text, number, mark. Labels hang in a 14ch column and may wrap down past
   the empty label cells of the rows below them, so a long label never pushes a row down. */
.row {
  position: relative;
  display: grid;
  grid-template-columns: 14ch minmax(0, 1fr);
  align-items: start;
}
.row > .k { color: var(--mute); position: absolute; left: 0; top: 0; width: 12ch; }
.row > .k .th { display: none; }
.row > .v, .row > a.v {
  grid-column: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 4ch;
  column-gap: 2ch;
}
.row > .k:only-child { grid-column: 1 / -1; position: static; width: auto; }

/* a row with two inline links: each one lights up on its own, the row's arrow answers either */
.inl { border-radius: 3px; margin: 0 -2px; padding: 0 2px; box-shadow: inset 0 -1px 0 var(--faint); transition: background-color 0.12s ease, box-shadow 0.12s ease; }
.inl:hover { background: var(--hover); box-shadow: inset 0 -1px 0 var(--accent); }
.multi:has(.inl:hover) .m b { color: var(--accent); transform: translate(1px, -1px); }

/* the streak: one square per day since the first post */
.strip-row { display: flex !important; flex-wrap: wrap; align-items: center; column-gap: 2ch; }
.strip { display: flex; flex-wrap: wrap; }
.sq { position: relative; display: block; width: 14px; height: var(--lh); cursor: default; }
.sq::before {
  content: ""; position: absolute; left: 2px; top: 7px; width: 10px; height: 10px; border-radius: 2.5px;
  background: var(--rule); transition: transform 0.15s ease, background-color 0.15s ease;
}
.sq.is-on::before { background: var(--accent); }
.sq.is-next::before { background: transparent; box-shadow: inset 0 0 0 1px var(--faint); }
.sq.is-today:not(.is-on)::before { background: transparent; box-shadow: inset 0 0 0 1px var(--accent); }
.sq.is-today::after {
  content: ""; position: absolute; left: 2px; top: 7px; width: 10px; height: 10px; border-radius: 2.5px;
  box-shadow: 0 0 0 1px var(--accent); opacity: 0; animation: sqpulse 2.4s ease-out infinite;
}
@keyframes sqpulse { 0% { opacity: 0.55; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.9); } }
.sq[data-peek]:hover::before, .sq.is-peek::before { transform: scale(1.3); }
.sq:focus-visible { outline: none; }
.sq:focus-visible::before { box-shadow: 0 0 0 1.5px var(--bg), 0 0 0 3px var(--accent); }
.strip-info { color: var(--mute); white-space: nowrap; }
.strip-info.is-on { color: var(--ink); }

/* Ben's face beside his name: in the margin on wide screens, inline on phones */
.top .name { position: relative; }
.face {
  position: absolute; right: calc(100% + 1.5ch); top: 0; width: 48px; height: 48px;
  border-radius: 12px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

/* the branches the ape lives in: drawn behind the page, never through text */
body { overflow-x: clip; }
.sheet { position: relative; z-index: 1; }
.branch-world { position: absolute; left: 0; top: 0; width: 100%; overflow: hidden; pointer-events: none; z-index: 0; }
.branch-world svg { display: block; }

/* top concepts as phone cards */
.cards {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0 24px;
  margin: 8px 0 var(--lh); row-gap: 22px;
}
.card { display: block; min-width: 0; }
.card-m {
  position: relative; display: block; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden;
  background: #e7e4dc; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.07), 0 10px 24px -14px rgba(30, 24, 12, 0.35);
  transition: transform 0.25s cubic-bezier(.2, .8, .2, 1), box-shadow 0.25s ease;
}
.card-m img, .card-m video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-m video { opacity: 0; transition: opacity 0.3s ease; }
.card-m video.is-playing { opacity: 1; }
.card:hover .card-m { transform: translateY(-3px); box-shadow: 0 0 0 1px rgba(236, 91, 53, 0.45), 0 14px 28px -14px rgba(30, 24, 12, 0.4); }
.card-t {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 8px; height: 32px; font-size: 12px; line-height: 16px; color: var(--ink); text-wrap: pretty;
}
.card-v { display: block; font-size: 12px; line-height: 16px; margin-top: 2px; color: var(--mute); }
.card:hover .card-t { color: var(--accent); }

/* mini apps as a small home-screen row */
.apps { display: flex !important; gap: 2ch; align-items: flex-start; }
.app { width: 11ch; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding-top: 2px; }
.app img { width: 56px; height: 56px; border-radius: 13px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 6px 14px -8px rgba(30, 24, 12, 0.4); transition: transform 0.2s cubic-bezier(.2, .8, .2, 1); }
.app span { line-height: 18px; }
.app:hover img, .app:focus-visible img { transform: translateY(-2px) scale(1.04); }
.app:hover span { color: var(--accent); }
.apps-row { margin-bottom: 0; }

/* small app icons inline (about) */
.t .ico { display: inline-block; width: 20px; height: 20px; border-radius: 5px; vertical-align: -5px; margin-right: 1.2ch; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); }

/* work list thumbnails */
.item .t img {
  display: inline-block; width: 16px; height: 20px; border-radius: 3px; object-fit: cover; vertical-align: -5px;
  margin-right: 1.2ch; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); background: #e7e4dc;
}

/* the ape: lives on the page in document coordinates; ropes are drawn in their own layer */
.ape-world { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 15; pointer-events: none; }
.ape-ropes { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.ape-body { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ape-body:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.v .t { min-width: 0; text-wrap: pretty; }
.sheet > p { text-wrap: balance; }
.v .n { color: var(--mute); text-align: right; white-space: nowrap; }
.v .m { color: var(--faint); text-align: right; white-space: nowrap; }
.v .m b { font-weight: 400; color: var(--ink); display: inline-block; transition: transform 0.18s ease, color 0.18s ease; }
a.v { border-radius: 3px; margin: 0 -6px; padding: 0 6px; transition: background-color 0.12s ease; }
a.v:hover, a.v.is-peek { background: var(--hover); }
a.v:hover .m b, a.v.is-peek .m b { color: var(--accent); transform: translate(1px, -1px); }
a.v[data-int]:hover .m b { transform: translateX(2px); }
.gap { height: var(--lh); }
.gap2 { height: calc(var(--lh) * 2); }

.top { display: flex; justify-content: space-between; gap: 2ch; margin-bottom: var(--lh); }   /* a full grid step under the name and photo */
.top nav { display: flex; gap: 2ch; color: var(--mute); }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--ink); }
.top nav a[aria-current="page"]::before { content: "\2022\00a0"; color: var(--accent); }
.name { font-weight: 500; }
.mute { color: var(--mute); }
.live { white-space: nowrap; }
.live::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); margin: 0 1ch 2px 0; vertical-align: middle;
}
.hint { color: var(--mute); }
.hint .touch { display: none; }
@media (hover: none) {
  .hint .mouse { display: none; }
  .hint .touch { display: inline; }
}

/* the peek: a small card that follows the cursor */
.peek {
  position: fixed; left: 0; top: 0; z-index: 20;
  width: 168px; height: 210px;
  border-radius: 12px; overflow: hidden;
  background: #e9e7e0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 14px 34px rgba(30, 24, 12, 0.18), 0 2px 6px rgba(30, 24, 12, 0.08);
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
  transition: opacity 0.14s ease;
}
.peek.on { opacity: 1; }
.peek img, .peek video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.peek video { opacity: 0; transition: opacity 0.25s ease; }
.peek video.is-playing { opacity: 1; }
.peek-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 9px 7px;
  font-size: 12px; line-height: 15px; color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
  opacity: 0;
}
.peek.flip .peek-cap { opacity: 1; }
[data-peek] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* ---------- work list ---------- */
.tools { display: flex; flex-wrap: wrap; gap: 0 3ch; color: var(--mute); }
.tools button { background: none; border: 0; padding: 0; cursor: pointer; color: var(--mute); }
.tools button[aria-pressed="true"] { color: var(--ink); }
.tools button:hover { color: var(--ink); }
.filter { display: inline-flex; gap: 1ch; }
.filter input {
  width: 22ch; border: 0; border-bottom: 1px solid var(--rule); background: transparent; padding: 0; height: var(--lh);
  border-radius: 0; outline: none; color: var(--ink);
}
.filter input:focus { border-bottom-color: var(--accent); }
.filter input::placeholder { color: var(--faint); }
.day { display: grid; grid-template-columns: 11ch minmax(0, 1fr) auto; column-gap: 0; margin-top: var(--lh); }
.day .c { padding-left: 2ch; padding-right: calc(4ch + 2ch); }
.day b { font-weight: 500; }
.day span { color: var(--mute); }
.day .c { text-align: right; }
.item { display: grid; grid-template-columns: 11ch minmax(0, 1fr); }
.item .k { color: var(--mute); text-align: right; padding-right: 3ch; }
.item .v {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 4ch; column-gap: 2ch;
  border-radius: 3px; margin: 0 -6px; padding: 0 6px; transition: background-color 0.12s ease;
}
.item a.v:hover .m b, .item a.v.is-peek .m b { color: var(--accent); transform: translate(1px, -1px); }
.item .v:hover, .item .v.is-peek { background: var(--hover); }
.item.is-target a.v { background: rgba(236, 91, 53, 0.1); }
.empty { color: var(--mute); }

/* ---------- about ---------- */
.prose { max-width: 62ch; }
.prose p + p { margin-top: var(--lh); }
.prose a { border-bottom: 1px solid var(--faint); transition: border-color 0.15s ease; }
.prose a:hover { border-bottom-color: var(--accent); }
.me { width: 144px; height: 144px; border-radius: 22px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 18px 40px -22px rgba(30, 24, 12, 0.45); }

@media (max-width: 640px) {
  :root { --fs: 15px; --lh: 24px; }
  .sheet { padding: calc(var(--lh) * 2) 20px calc(var(--lh) * 3); }
  .row { grid-template-columns: minmax(0, 1fr); }
  .row > .k { grid-column: 1; position: static; width: auto; }
  .face { position: relative; right: auto; display: inline-block; width: 30px; height: 30px; border-radius: 8px; vertical-align: top; margin: -3px 1ch -3px 0; }
  .cards { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 20px; margin: 8px -20px calc(var(--lh) - 8px); padding: 0 20px; scrollbar-width: none; }
  .cards::-webkit-scrollbar { display: none; }
  .card { flex: 0 0 148px; scroll-snap-align: start; }
  .card-t { font-size: 15px; line-height: 20px; height: 40px; }
  .card-v { font-size: 15px; line-height: 20px; }
  .apps { gap: 0; justify-content: space-between; }
  .app { width: 25%; }
  .app-info-row { display: none !important; }
  .row.ape-home > .k { margin-bottom: var(--lh); }
  .strip-row { column-gap: 1.5ch; }
  .row > .v, .row > a.v { grid-column: 1; grid-template-columns: minmax(0, 1fr) auto 3ch; column-gap: 1ch; }
  .row + .row > .k:not(:empty) { margin-top: 10px; }
  .row > .k:empty { display: none; }
  a.v { margin: 0 -4px; padding: 0 4px; }
  .item { grid-template-columns: 5ch minmax(0, 1fr); }
  .item .k { padding-right: 1.5ch; }
  .item .v { grid-template-columns: minmax(0, 1fr) auto; column-gap: 1.5ch; margin: 0 -4px; padding: 0 4px; }
  .item .v .m { display: none; }
  .tools { gap: 0 2ch; }
  .day { grid-template-columns: 5ch minmax(0, 1fr) auto; }
  .day b { grid-column: 1 / 3; }
  .day .d { display: none; }
  .day .c { padding-right: 0; }
  .since { display: none; }
  .filter input { width: 16ch; }
  .peek { width: 144px; height: 180px; }
  .peek.flip .peek-cap { display: none; }
}

@media (hover: none) {
  .row > .k .th { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}

[hidden] { display: none !important; }
.sheet > h1 { font-weight: 500; }
.prose h1 { font-weight: 500; margin-bottom: var(--lh); text-wrap: balance; }
.block { display: block; }

/* Ben 11/22: everything lowercase; YC and Alliance stay as written */
body { text-transform: lowercase; }
.keep, input, textarea { text-transform: none; }

/* Ben 11/22: mini apps spacing */
.apps { gap: 2.5ch; margin-top: 4px; }
.app span { text-wrap: balance; }
@media (max-width: 640px) {
  .apps { gap: 10px; justify-content: flex-start; margin-top: 14px; }
  .app { width: 80px; flex: none; }
  .app span { font-size: 12px; line-height: 16px; }
}

/* a label that runs the full row (e.g. "top performing concepts i've posted to x") */
.row .k.k-wide { width: auto; max-width: none; white-space: normal; }

.row .k.k-nowrap { white-space: nowrap; }
