:root {
  color-scheme: light;
  --bg: #fff;
  --text: #111;
  --muted: #9b9b9b;
  --soft: #c9c9c9;
  --body: #565656;
  --rule: #ededed;
  --menu-link: #404040;
  --menu-label-color: rgba(17, 17, 17, 0.4);
  --social-icon: #a8a8a8;
  --hover-bg: rgba(0, 0, 0, 0.06);
  --hover-bg-subtle: rgba(0, 0, 0, 0.04);
  --topbar-bg: rgba(255, 255, 255, 0.85);
  --topbar-shadow: rgba(0, 0, 0, 0.06);
  --menu-bg: #fff;
  --menu-divider: rgba(0, 0, 0, 0.06);
  --menu-width: 400px;
  --content: 640px;
  --narrow-content: 560px;
  --max-content: 720px;
  font-family: "Geist", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0a;
  --text: #ededed;
  --muted: #6b6b6b;
  --soft: #4a4a4a;
  --body: #a3a3a3;
  --rule: #222;
  --menu-link: #b0b0b0;
  --menu-label-color: rgba(237, 237, 237, 0.4);
  --social-icon: #555;
  --hover-bg: rgba(255, 255, 255, 0.08);
  --hover-bg-subtle: rgba(255, 255, 255, 0.06);
  --topbar-bg: rgba(10, 10, 10, 0.85);
  --topbar-shadow: rgba(0, 0, 0, 0.3);
  --menu-bg: #0a0a0a;
  --menu-divider: rgba(255, 255, 255, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
    --bg: #0a0a0a;
    --text: #ededed;
    --muted: #6b6b6b;
    --soft: #4a4a4a;
    --body: #a3a3a3;
    --rule: #222;
    --menu-link: #b0b0b0;
    --menu-label-color: rgba(237, 237, 237, 0.4);
    --social-icon: #555;
    --hover-bg: rgba(255, 255, 255, 0.08);
    --hover-bg-subtle: rgba(255, 255, 255, 0.06);
    --topbar-bg: rgba(10, 10, 10, 0.85);
    --topbar-shadow: rgba(0, 0, 0, 0.3);
    --menu-bg: #0a0a0a;
    --menu-divider: rgba(255, 255, 255, 0.08);
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 140ms ease, text-decoration-color 140ms ease;
}

button {
  font: inherit;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  background: rgba(255, 255, 255, 0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0);
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  transition: background 160ms ease, box-shadow 160ms ease, backdrop-filter 160ms ease, -webkit-backdrop-filter 160ms ease;
  pointer-events: none;
}

.topbar > * {
  pointer-events: auto;
}

.topbar.is-scrolled {
  background: var(--topbar-bg);
  box-shadow: 0 1px 3px var(--topbar-shadow);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.menu-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color 140ms ease, transform 140ms ease;
}

.menu-button:hover {
  background-color: var(--hover-bg);
}

.menu-button:active {
  transform: scale(0.96);
}

.menu-button svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.4;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color 140ms ease, transform 140ms ease;
}

.theme-toggle:hover {
  background-color: var(--hover-bg);
}

.theme-toggle:active {
  transform: scale(0.96);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle .icon-moon {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: block;
  }

  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: none;
  }
}

.icon-close {
  display: none;
}

.menu-open .icon-open {
  display: none;
}

.menu-open .icon-close {
  display: block;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
}

.crumbs a {
  color: inherit;
}

.crumbs svg {
  width: 12px;
  height: 12px;
  color: var(--soft);
  flex: none;
}

.crumbs span {
  color: var(--soft);
  font-weight: 400;
}

.side-menu {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: 56px 16px 24px;
  flex-direction: column;
  overflow-y: auto;
  background: var(--menu-bg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
  -webkit-overflow-scrolling: touch;
}

.menu-open .side-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.primary-menu,
.project-menu {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1px;
}

.primary-menu a,
.project-menu a {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 6px 8px;
  color: var(--menu-link);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: -0.005em;
  border-radius: 6px;
  transition: color 140ms ease, background-color 140ms ease;
}

.primary-menu a:hover,
.primary-menu a:focus-visible,
.project-menu a:hover,
.project-menu a:focus-visible {
  color: var(--text);
  background-color: var(--hover-bg-subtle);
}

.primary-menu a[aria-current="page"],
.project-menu a[aria-current="page"] {
  color: var(--text);
  font-weight: 400;
}

.menu-section {
  margin-top: 20px;
}

.menu-label {
  margin: 0 0 4px;
  padding: 0 8px;
  color: var(--menu-label-color);
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
  letter-spacing: 0;
}

.menu-socials {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  margin-top: auto;
  padding-top: 32px;
}

.site-shell {
  min-height: 100vh;
}

.page-column {
  width: min(var(--content), var(--max-content), calc(100vw - 48px));
  margin: 0 auto;
  max-width: 100%;
}

.home-page {
  padding: 128px 0 110px;
}

.sub-page {
  width: min(var(--narrow-content), calc(100vw - 48px));
  padding: 96px 0 110px;
}

.about-page {
  padding-top: 128px;
}

.avatar {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

.home-page .avatar,
.about-page .avatar {
  margin-bottom: 32px;
}

.home-title {
  margin: 0 0 16px;
  font-size: 22px;
  line-height: 30px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.lead {
  margin: 0;
  color: var(--body);
  font-size: 22px;
  line-height: 30px;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.intro-copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0;
}

.intro-copy p {
  margin: 0;
  color: var(--body);
  font-size: 16px;
  line-height: 26px;
  font-weight: 400;
  letter-spacing: -0.005em;
}

.intro-copy p:first-child {
  font-size: 22px;
  line-height: 30px;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.intro-copy a {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.social-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 40px 0 56px;
}

.about-page .social-row {
  margin: 40px 0 56px;
}

.social-row a,
.menu-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--social-icon);
  border-radius: 6px;
  transition: color 140ms ease, transform 140ms ease;
}

.social-row a svg,
.menu-socials a svg {
  width: 20px;
  height: 20px;
  display: block;
}

.social-row a:hover,
.menu-socials a:hover {
  /* No background on hover for clean blend */
}

.social-row a:active,
.menu-socials a:active {
  transform: scale(0.94);
}

.social-row a:focus-visible,
.menu-socials a:focus-visible {
  color: var(--text);
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* Brand colors on hover */
.social-row a[aria-label="LinkedIn"]:hover,
.menu-socials a[aria-label="LinkedIn"]:hover {
  color: #0A66C2;
}

.social-row a[aria-label="X"]:hover,
.menu-socials a[aria-label="X"]:hover {
  color: #000000;
}

.social-row a[aria-label="GitHub"]:hover,
.menu-socials a[aria-label="GitHub"]:hover {
  color: #181717;
}

.social-row a[aria-label="Substack"]:hover,
.menu-socials a[aria-label="Substack"]:hover {
  color: #FF6719;
}

.social-row a[aria-label="Instagram"]:hover,
.menu-socials a[aria-label="Instagram"]:hover {
  color: #E4405F;
}

.menu-socials a {
  width: 28px;
  height: 28px;
}

.menu-socials a svg {
  width: 16px;
  height: 16px;
}

.section-block {
  margin-top: 0;
}

.section-block + .section-block {
  margin-top: 64px;
}

.section-heading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 22px;
  letter-spacing: -0.005em;
}

.section-heading svg {
  width: 12px;
  height: 12px;
  flex: none;
  transition: transform 140ms ease;
}

a.section-heading:hover svg {
  transform: translateX(2px);
}

a.section-heading:hover {
  color: var(--text);
}

.link-list,
.project-list,
.plain-list,
.work-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-list a,
.project-row strong,
.plain-row strong,
.work-row strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 400;
  line-height: 26px;
  letter-spacing: -0.005em;
  display: inline-block;
}

/* Hover-underline tokens used by every content list link.
   Underline color animates from transparent to text on hover. */
.link-list a,
.entry-link strong {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: text-decoration-color 140ms ease;
}

.link-list a:hover,
.link-list a:focus-visible,
.entry-link:hover strong,
.entry-link:focus-visible strong {
  text-decoration-color: currentColor;
}

/* Reusable two-part row: bold title + muted description.
   Hover underline (above) applies only to the bold title. */
.entry-link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 8px;
  row-gap: 0;
  color: inherit;
}

.entry-link:focus-visible {
  outline: none;
}

.work-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: baseline;
}

.project-row,
.plain-row {
  display: block;
}

.dated-list .entry-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 16px;
  align-items: baseline;
}

.dated-list .entry-link span {
  text-align: right;
}

.project-row span,
.plain-row span,
.work-row span {
  color: var(--muted);
  font-size: 16px;
  font-weight: 400;
  line-height: 26px;
  letter-spacing: -0.005em;
}

.work-row .company {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
}

.mark {
  display: inline-grid;
  flex: 0 0 16px;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  color: #fff;
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
}

.mark.green {
  background: #5f7f62;
}

.mark.blue {
  background: #527899;
}

.mark.black {
  background: #151515;
}

.mark.gray {
  background: #777;
}

.year-page h1,
.timeline-page h1 {
  margin: 0 0 48px;
  color: var(--text);
  font-size: 32px;
  line-height: 40px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.empty-state {
  color: var(--muted);
  font-size: 16px;
  line-height: 26px;
  font-weight: 400;
}.timeline-page {
  width: min(736px, calc(100vw - 48px));
  margin: 0 auto;
  padding-top: 110px;
}

.timeline-page h1 {
  margin-left: 204px;
}

.resume-list {
  display: flex;
  flex-direction: column;
  gap: 58px;
}

.resume-entry {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.resume-date {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  text-align: right;
}

.resume-body {
  max-width: var(--content);
}

.resume-body h2 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 20px;
  line-height: 28px;
  font-weight: 500;
}

.resume-body p {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 26px;
  font-weight: 400;
}

.resume-body p + p,
.resume-body ul {
  margin-top: 14px;
}

.resume-body ul {
  padding-left: 19px;
}

.resume-body li {
  margin: 6px 0;
  color: var(--text);
  font-size: 16px;
  line-height: 25px;
}

.entry-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  padding: 5px 12px 6px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.entry-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--soft);
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 10px;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-140%);
}

.skip-link:focus {
  transform: translateY(0);
}

@media (max-width: 700px) {
  .topbar {
    min-height: 48px;
    gap: 10px;
    padding: 6px 12px;
    font-size: 14px;
  }

  .crumbs {
    gap: 8px;
    font-size: 13px;
  }

  .side-menu {
    padding: 56px 12px 24px;
  }

  .primary-menu a,
  .project-menu a {
    /* Slightly larger tap targets on mobile while keeping compact look */
    padding: 8px;
  }

  .page-column,
  .timeline-page {
    width: calc(100vw - 32px);
  }

  .home-page {
    padding-top: 96px;
  }

  .sub-page,
  .timeline-page {
    padding-top: 96px;
  }

  .about-page {
    padding-top: 96px;
  }

  .home-page .avatar,
  .about-page .avatar {
    margin-bottom: 28px;
  }

  .home-title {
    margin-bottom: 12px;
    font-size: 22px;
    line-height: 30px;
  }

  .lead,
  .intro-copy p {
    font-size: 22px;
    line-height: 30px;
  }

  .social-row {
    gap: 12px;
    margin: 32px 0 48px;
  }

  .section-heading {
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 22px;
  }  .project-row,
  .plain-row,
  .work-row {
    display: flex;
    flex-wrap: wrap;
    column-gap: 8px;
    row-gap: 0;
  }

  .project-row span,
  .plain-row span,
  .work-row span {
    font-size: 16px;
    line-height: 24px;
  }

  .year-page h1,
  .timeline-page h1 {
    margin-bottom: 40px;
    font-size: 28px;
    line-height: 36px;
  }  .timeline-page h1 {
    margin-left: 0;
  }

  .resume-list {
    gap: 48px;
  }

  .resume-entry {
    display: block;
  }

  .resume-date {
    margin-bottom: 8px;
    text-align: left;
    font-size: 13px;
    line-height: 20px;
  }

  .resume-body h2 {
    font-size: 18px;
    line-height: 26px;
  }

  .resume-body p,
  .resume-body li {
    font-size: 15px;
    line-height: 24px;
  }  .social-row a,
  .menu-socials a {
    width: 40px;
    height: 40px;
  }

  .menu-button {
    width: 40px;
    height: 40px;
  }

  .theme-toggle {
    width: 40px;
    height: 40px;
  }
}

/* Ultrawide monitor support */
@media (min-width: 1920px) {
  .page-column {
    width: min(var(--max-content), calc(100vw - 64px));
  }

  .timeline-page {
    width: min(800px, calc(100vw - 64px));
  }
}

/* iPad and tablet optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
  .page-column {
    width: min(var(--content), calc(100vw - 56px));
  }

  .sub-page {
    width: min(var(--narrow-content), calc(100vw - 56px));
  }

  .side-menu {
    width: 320px;
  }
}
