@font-face {
  font-family: "IA Writer Mono";
  src: url("assets/fonts/ia-writer-mono-regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IA Writer Mono";
  src: url("assets/fonts/ia-writer-mono-bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #111;
  --text: #666;
  --muted: #929292;
  --faint: #b5b5b5;
  --line: #e5e5e5;
  --soft: #f7f7f5;
  --page: #fff;
  --accent: #111;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --mono: "IA Writer Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --title-size: 24px;
  --heading-size: 20px;
  --content-width: 760px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--page); }

body {
  margin: 0;
  color: var(--text);
  background: var(--page);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.42;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover { color: var(--accent); }

/* Pointer clicks stay quiet; keyboard navigation keeps a visible indicator. */
:focus:not(:focus-visible) { outline: none; }
a:focus-visible, summary:focus-visible {
  outline: none;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-shell {
  width: min(var(--content-width), calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 64px 0 48px;
}

.site-shell.home {
  display: flex;
  flex-direction: column;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 34px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.3;
}

.site-brand,
.site-nav a {
  text-decoration: none;
}

.site-brand {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.site-brand.is-active,
.site-nav .is-active {
  color: var(--accent);
  text-decoration: underline;
}

h1,
h2 {
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 {
  margin: 0 0 18px;
  font-size: var(--title-size);
  line-height: 1.3;
}

.eyebrow,
.section-number,
.project-number,
.project-kicker,
.investment-meta,
.writing-number,
.book-genres,
.backlog-badge {
  font-family: var(--mono);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-intro { display: block; }

.mentoring-section p { margin: 0 0 28px; }

.mentoring-link {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  color: var(--ink);
  text-decoration: none;
}

.mentoring-link img { display: block; width: 136px; height: auto; }
.mentoring-link span { font-size: 26px; line-height: 1; }
.mentoring-link:hover { opacity: 0.7; }

.bio p {
  margin: 0 0 18px;
}

.home-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: fit-content;
  margin-top: 24px;
}

.social-icon-link {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--ink);
  opacity: 0.76;
  transition: opacity 120ms ease, transform 120ms ease;
}

.social-icon-link:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.social-icon-link img {
  display: block;
  width: 15px;
  height: 15px;
}

.social-icon-link[aria-label="X"] img {
  width: 13px;
  height: 13px;
}

.site-credit {
  margin-top: auto;
  padding-top: 48px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0;
}

.site-credit--subpage {
  margin-top: 72px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.projects-intro,
.writing-intro,
.investing-intro,
.bookshelf-intro {
  margin: 0 0 42px;
}

/* Work */
.resume-section {
  display: block;
  margin-bottom: 60px;
  padding: 10px 0 18px;
}

.resume-overview {
  display: flex;
  gap: 28px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
}

.resume-section h2,
.github-section > h2 {
  margin: 0 0 8px;
  font-size: var(--heading-size);
  line-height: 1.3;
}

.resume-section p:not(.section-number),
.github-intro {
  margin: 0;
}

.section-number,
.project-number,
.project-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.resume-actions {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 7px;
}

.resume-actions a {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  width: fit-content;
  color: var(--ink);
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}

.resume-actions a::after {
  content: "↗";
  font-size: 14px;
  line-height: 1;
  transition: transform 120ms ease;
}

.resume-actions a:hover::after { transform: translate(2px, -2px); }

/* An in-page resume, using the site's quiet editorial typography. */
.resume-reader {
  border-top: 1px solid var(--line);
}

.resume-section p.resume-hint {
  margin: 18px 0 24px;
  font-size: 13px;
  color: var(--muted);
}

.resume-content {
  font-size: 16px;
  line-height: 1.55;
}

.resume-chapter + .resume-chapter { margin-top: 38px; }
.resume-chapter h3 {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-size: var(--heading-size);
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.resume-chapter h4 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 400;
}
.resume-chapter p { margin: 0; }
.resume-job + .resume-job { margin-top: 30px; }
.resume-chapter .resume-location { margin: 2px 0 12px; font-size: 13px; color: var(--muted); }
.resume-role + .resume-role { margin-top: 10px; }
.resume-chapter .resume-date { font-size: 12px; color: var(--muted); }
.resume-chapter .resume-job-intro { margin-top: 16px; }
.resume-disclosure { margin-top: 12px; }
.resume-disclosure summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  cursor: pointer;
  color: var(--ink);
  padding: 10px 0;
  list-style: none;
}
.resume-disclosure summary::-webkit-details-marker { display: none; }
.resume-disclosure summary::after {
  content: "+";
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 400;
  color: var(--muted);
}
.resume-disclosure[open] > summary::after { content: "−"; }
.resume-disclosure summary h3 { margin: 0; }
.resume-disclosure summary:hover { color: var(--text); }
.resume-disclosure[open] > summary { margin-bottom: 10px; }
.resume-disclosure ul { margin: 10px 0 0; padding-left: 20px; }
.resume-disclosure li + li { margin-top: 10px; }
.resume-degree + .resume-degree, .resume-skill + .resume-skill { margin-top: 22px; }
.resume-degree h4, .resume-skill h4 { margin-bottom: 5px; }
.resume-degree p { font-size: 14px; }

@media (max-width: 640px) {
  .resume-overview { align-items: flex-start; flex-direction: column; gap: 18px; }
  .resume-overview .resume-actions { flex-direction: row; flex-wrap: wrap; gap: 20px; }
}

@media print {
  .resume-hint { display: none; }
}

.github-intro { margin-bottom: 32px; }

.project-list {
  display: grid;
  gap: 48px;
}

.project-entry {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 24px;
  align-items: center;
  padding-bottom: 34px;
}

.project-entry:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.project-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--soft);
}

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

.project-media--pulse img {
  width: 160%;
  max-width: none;
  transform: translateX(-37.5%);
}

.project-number { margin-bottom: 13px; }

.project-copy h2 {
  margin: 0 0 5px;
  font-size: var(--heading-size);
  line-height: 1.3;
}

.project-kicker {
  margin-bottom: 14px;
  line-height: 1.5;
}

.project-description { margin: 0; }

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 11px;
}

.github-profile-link {
  display: inline-block;
  margin-top: 38px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

/* Investing */
.investing-intro a,
.investment-copy a { text-underline-offset: 3px; }

.investment-timeline {
  display: grid;
  border-top: 1px solid var(--line);
}

.investment-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 22px;
  align-items: start;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.investment-mark {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--page);
}

.investment-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.investment-mark--nebius img { object-fit: contain; }

.investment-meta {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.investment-copy h2 {
  margin: 0 0 8px;
  font-size: var(--heading-size);
  line-height: 1.3;
}

.investment-copy h2 a { text-decoration: none; }
.investment-copy h2 a:hover { text-decoration: underline; }
.investment-copy p { margin: 0; }

.investment-founders {
  margin-top: 10px !important;
  color: var(--muted) !important;
  font-family: var(--mono);
  font-size: 10px !important;
}

/* Writing */
.writing-list {
  display: grid;
}

.writing-entry {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 0 12px;
  padding: 22px 0 28px;
}

.writing-entry + .writing-entry { border-top: 1px solid var(--line); }

.writing-number {
  grid-row: 1 / span 2;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.writing-entry h2 {
  margin: 0 0 8px;
  font-size: 19px;
  line-height: 1.3;
}

.writing-entry h2 a { text-decoration: none; }
.writing-entry h2 a:hover { text-decoration: underline; }
.writing-entry > p:last-child { margin: 0; }
.linked-ending { white-space: nowrap; }

/* Bookshelf (kept ready behind the feature flag) */

.bookshelf-toolbar {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.book-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 15px;
}

.book-filter {
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.book-filter span {
  margin-left: 4px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
}

.book-filter:hover,
.book-filter.is-active {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.book-search-wrap { flex: 0 0 220px; }

.book-search-wrap input {
  width: 100%;
  height: 34px;
  padding: 0 0 6px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: 11px var(--mono);
}

.book-search-wrap input:focus { border-bottom-color: var(--accent); }

.book-results {
  margin: 0 0 22px;
  color: var(--muted);
  font: 10px var(--mono);
}

.bookshelf-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 38px 24px;
}

.book-card { min-width: 0; }

.book-cover-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  background: var(--soft);
}

.book-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.backlog-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 6px;
  color: #fff;
  background: rgba(17, 17, 17, 0.78);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.book-genres {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.book-meta h2 {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.25;
}

.book-subtitle,
.book-author,
.book-summary { margin: 0; }
.book-subtitle { font-size: 13px; }
.book-author { margin-top: 5px; color: var(--muted); font-size: 13px; }
.book-summary { margin-top: 9px; font-size: 15px; }
.bookshelf-empty { margin-top: 30px; color: var(--muted); }

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

@media (max-width: 640px) {
  body { font-size: 16px; line-height: 1.45; }

  .site-shell,
  .bookshelf-shell {
    width: calc(100% - 32px);
    padding: 48px 0 34px;
  }

  .site-header {
    gap: 8px 18px;
    margin-bottom: 30px;
    font-size: 16px;
  }

  .site-nav { gap: 5px 12px; }
  :root { --title-size: 22px; --heading-size: 19px; }

  .site-credit {
    padding-top: 38px;
  }

  .site-credit--subpage { margin-top: 56px; padding-top: 18px; }

  .projects-intro,
  .writing-intro,
  .investing-intro,
  .bookshelf-intro { margin-bottom: 34px; }

  .resume-section {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 48px;
  }

  .project-list { gap: 40px; }

  .project-entry {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-bottom: 40px;
  }

  .investment-card {
    grid-template-columns: 52px 1fr;
    gap: 16px;
    padding: 23px 0;
  }

  .investment-mark { width: 52px; height: 52px; }

  .writing-entry {
    grid-template-columns: 28px 1fr;
    gap: 0 8px;
    padding: 21px 0;
  }

  .writing-entry h2 { font-size: 18px; }

  .bookshelf-toolbar { flex-direction: column; }
  .book-search-wrap { flex-basis: auto; width: 100%; max-width: 320px; }
  .bookshelf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px 16px; }
}

@media (max-width: 390px) {
  .site-header { display: block; }
  .site-nav { margin-top: 8px; }
  .bookshelf-grid { grid-template-columns: 1fr; }
}

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