:root {
  --accent: #3d5366;
  --text: #292929;
  --muted: #6b6b6b;
  --line: #d8d8d6;
  --soft: #eeeeec;
  --background: #fafaf9;
  --quote-text: #454545;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --max-width: 1180px;
  --sidebar-width: 230px;
  --content-width: 700px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --accent: #a7bfd3;
  --text: #e8eaec;
  --muted: #a9afb5;
  --line: #3a4249;
  --soft: #262d33;
  --background: #171c21;
  --quote-text: #c8cdd1;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: color 180ms ease, background-color 180ms ease;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
  transition: opacity 150ms ease, text-decoration-color 150ms ease;
}

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

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

::selection {
  color: var(--text);
  background: var(--soft);
}

.masthead {
  border-bottom: 1px solid var(--line);
}

.masthead-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.nav {
  min-height: 98px;
  display: flex;
  align-items: center;
  gap: 2.15rem;
  white-space: nowrap;
}

.nav-link {
  padding: .7rem 0 .55rem;
  border-bottom: 1px solid transparent;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 500;
  letter-spacing: .015em;
}

.nav-link:first-child {
  margin-right: auto;
  border-bottom: 0;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -.015em;
}

.nav-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-link.active:not(:first-child) {
  border-bottom-color: var(--accent);
  color: var(--text);
}

.theme-toggle {
  width: 2.15rem;
  height: 2.15rem;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--soft);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.theme-icon {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

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

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

.site-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4.75rem 2rem 5.5rem;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, var(--content-width));
  gap: 5.5rem;
}

.sidebar {
  min-width: 0;
}

.profile-card {
  position: sticky;
  top: 2.5rem;
}

.avatar {
  position: relative;
  width: 168px;
  height: 168px;
  display: block;
  perspective: 800px;
  padding: 0;
  border: 0;
  background: transparent;
  touch-action: manipulation;
  cursor: default;
  margin-bottom: 1.65rem;
  border-radius: 50%;
}

.avatar:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.avatar-coin {
  display: block;
  pointer-events: none;
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
}

.avatar.is-interactive .avatar-coin {
  transition: transform 650ms cubic-bezier(.22, .68, .2, 1);
}

:root[data-avatar-flipped="true"] .avatar-coin {
  transform: rotateY(180deg);
}

.avatar-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--background);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.avatar-back {
  transform: rotateY(180deg);
}

.avatar-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-nala {
  object-position: 50% 27%;
  transform: scale(1.02);
  transform-origin: 60% 50%;
}

.profile-name {
  margin: 0 0 .35rem;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.42rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.pronouns {
  margin-bottom: .75rem;
  color: var(--muted);
  font-size: .88rem;
}

.role,
.affiliation {
  margin: .38rem 0;
  line-height: 1.48;
}

.role {
  max-width: 13rem;
  color: var(--text);
  font-size: .96rem;
}

.affiliations {
  margin-top: .9rem;
}

.affiliation {
  color: var(--muted);
  font-size: .9rem;
}

.profile-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .48rem;
  margin-top: 1.55rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: .88rem;
}

.profile-links span {
  color: var(--muted);
}

.profile-link-with-icon {
  display: inline-flex;
  align-items: center;
  gap: .46rem;
}

.profile-link-icon {
  width: .9rem;
  height: .9rem;
  flex: 0 0 auto;
  fill: currentColor;
}

.profile-link-icon .icon-cutout {
  fill: var(--background);
}

.page-content {
  width: 100%;
  max-width: var(--content-width);
  min-width: 0;
}

.page > h1,
.prose h2 {
  display: flex;
  align-items: center;
  color: var(--accent);
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -.018em;
}

.page > h1::before,
.prose h2::before {
  content: "";
  width: 2.15rem;
  height: 1px;
  flex: 0 0 auto;
  margin-right: .8rem;
  background: var(--accent);
}

.page > h1 {
  margin: 0 0 2.25rem;
  font-size: clamp(2rem, 4vw, 2.45rem);
  line-height: 1.16;
}

.prose h2 {
  margin: 3rem 0 1rem;
  font-size: 1.55rem;
  line-height: 1.3;
}

.prose h2::before {
  width: 1.45rem;
  margin-right: .65rem;
}

.prose h3 {
  margin: 2.1rem 0 .55rem;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.35;
}

.prose h3 a {
  color: inherit;
}

.prose p > strong:only-child {
  display: block;
  margin-top: 2.1rem;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.35;
}

.prose > p:first-child > strong:only-child {
  margin-top: 0;
}

.prose p {
  margin: 0 0 1.25rem;
}

.prose ul,
.prose ol {
  margin: .75rem 0 1.4rem;
  padding-left: 1.35rem;
}

.prose li {
  margin-bottom: .38rem;
  padding-left: .18rem;
}

.prose blockquote {
  margin: 2rem 0;
  padding: .15rem 0 .15rem 1.2rem;
  border-left: 1px solid var(--accent);
  color: var(--muted);
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .9em;
}

.homepage-quote {
  max-width: 36rem;
  margin: 5.75rem 0 1rem;
  padding: .2rem 0 .2rem .9rem;
  border-left: 1px solid var(--accent);
}

.homepage-quote blockquote {
  margin: 0;
}

.homepage-quote p {
  margin: 0;
  color: var(--quote-text);
  font-family: var(--font-serif);
  font-size: 1.16rem;
  font-style: italic;
  line-height: 1.62;
}

.homepage-quote figcaption {
  margin-top: .65rem;
  color: var(--muted);
  font-size: .82rem;
  letter-spacing: .035em;
}

.entries {
  margin-top: 2.75rem;
}

.entry {
  margin: 0 0 2.5rem;
}

.entry h2 {
  margin-bottom: .45rem;
  font-family: var(--font-serif);
  font-size: 1.28rem;
  font-weight: 600;
}

.entry-meta {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}

.footer {
  color: var(--muted);
  font-size: .78rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.25rem 2rem 3rem calc(2rem + var(--sidebar-width) + 5.5rem);
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .masthead-inner {
    padding: 0 1.5rem;
  }

  .site-shell {
    padding: 3.5rem 1.5rem 4.5rem;
    grid-template-columns: minmax(0, 1fr);
    gap: 3.75rem;
  }

  .profile-card {
    position: static;
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    column-gap: 1.6rem;
    align-items: start;
  }

  .avatar {
    width: 132px;
    height: 132px;
    grid-row: 1 / span 7;
    margin-bottom: 0;
  }

  .profile-links {
    margin-top: .9rem;
    padding-top: .9rem;
  }

  .footer-inner {
    margin: 0 1.5rem;
    padding: 2rem 0 2.5rem;
  }
}

@media (max-width: 640px) {
  .masthead-inner {
    padding: 0 1.2rem;
  }

  .nav {
    min-height: 0;
    padding: 1.25rem 0 1.15rem;
    flex-wrap: wrap;
    column-gap: 1.25rem;
    row-gap: .65rem;
  }

  .nav-link {
    padding: .15rem 0 .3rem;
    font-size: .84rem;
  }

  .nav-link:first-child {
    flex: 0 0 100%;
    margin-right: 0;
    padding: 0;
    font-size: 1.4rem;
  }

  .site-shell {
    padding: 2.75rem 1.2rem 3.75rem;
    gap: 3.25rem;
  }

  .profile-card {
    display: block;
  }

  .avatar {
    width: 128px;
    height: 128px;
    margin-bottom: 1.4rem;
  }

  .role {
    max-width: none;
  }

  .page > h1 {
    margin-bottom: 1.8rem;
    font-size: 2rem;
  }

  .page > h1::before {
    width: 1.65rem;
    margin-right: .65rem;
  }

  .prose h2 {
    margin-top: 2.5rem;
    font-size: 1.4rem;
  }

  .homepage-quote {
    margin-top: 4.25rem;
    padding-left: .8rem;
  }

  .homepage-quote p {
    font-size: 1.08rem;
  }

  .footer-inner {
    margin: 0 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body,
  a,
  .avatar.is-interactive .avatar-coin,
  .theme-toggle {
    transition: none;
  }
}
