.spr-person-page {
  --person-shell: 960px;
  --person-gutter: clamp(16px, 4vw, 32px);
  --person-line: var(--spr-stroke, #e5e5e2);
  --person-secondary: var(--spr-muted, #626260);
  --person-surface: var(--spr-surface-muted, #f5f5f3);
}

/* Keep public-profile navigation reachable while the document scrolls.
   The portfolio theme used a relative/static header on these routes. */
body.spr-person-page:not(.spr-person-article) > .spr-person-header {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  max-width: none;
  background: #fff;
  border-bottom: 1px solid var(--person-line);
}

.spr-person-page :is(main, main [id]) { scroll-margin-top: 100px; }

body.spr-person-page:not(.spr-person-profile-home) > .spr-person-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  min-height: 60px;
  padding: 8px max(var(--person-gutter), (100% - var(--person-shell)) / 2);
  border-bottom: 1px solid var(--person-line);
  background: var(--spr-surface, #fff);
  box-shadow: 0 6px 20px #26282205;
  backdrop-filter: none;
}

body.spr-person-subpage .spr-person-header .spr-wordmark img {
  width: clamp(108px, 28vw, 142px);
  height: 38px;
  margin-inline: -20px -12px;
}

body.spr-person-subpage .spr-person-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  overflow: visible;
}

body.spr-person-subpage .spr-person-header nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 10px;
  color: var(--person-secondary);
}

body.spr-person-subpage .spr-person-header nav a:not([aria-current]):hover {
  background: var(--person-surface);
  color: var(--spr-ink);
}

.spr-person-page .spr-person-about,
.spr-person-page .spr-person-collection {
  width: min(var(--person-shell), calc(100% - 2 * var(--person-gutter)));
  padding: clamp(28px, 5vw, 56px) 0 clamp(32px, 5vw, 56px);
  overflow-wrap: anywhere;
}

.spr-person-about-intro {
  margin-bottom: clamp(22px, 4vw, 36px);
}

body.spr-person-subpage :is(.spr-person-about, .spr-person-collection) .spr-kicker {
  margin: 0 0 6px;
  color: var(--person-secondary);
  font-size: .75rem;
  letter-spacing: .06em;
}

body.spr-person-subpage :is(.spr-person-about-intro, .spr-person-collection) h1 {
  max-width: 22ch;
  margin: 0;
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  font-weight: 600;
  line-height: 1.08;
  text-wrap: wrap;
}

body.spr-person-subpage .spr-person-about-intro .spr-prose {
  max-width: 64ch;
  margin-top: 14px;
  color: var(--spr-ink, #222222);
  font-size: 1rem;
  line-height: 1.62;
}

.spr-person-about-intro .spr-prose > :first-child { margin-top: 0; }
.spr-person-about-intro .spr-prose > :last-child { margin-bottom: 0; }
.spr-person-about-intro .spr-prose > p { margin: 0 0 .65em; }
.spr-person-empty-bio { margin: 14px 0 0; color: var(--person-secondary); }

.spr-person-about .spr-subsection {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(0, 2.5fr);
  align-items: start;
  gap: 10px clamp(20px, 5vw, 52px);
  margin: 0;
  padding: clamp(16px, 2.8vw, 25px) 0;
  border-color: var(--person-line);
}

body.spr-person-subpage .spr-person-about .spr-subsection > h2 {
  margin: 0;
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  font-weight: 600;
  line-height: 1.25;
  text-wrap: wrap;
}

.spr-person-about :is(.spr-detail-list, .spr-tags, .spr-identity-links) { margin: 0; }
.spr-person-about .spr-detail-list { padding-left: 1.15em; }
.spr-person-about .spr-detail-list li + li { margin-top: .3em; }
.spr-person-about .spr-tags { gap: 6px; }
.spr-person-about .spr-tags li {
  max-width: 100%;
  padding: 4px 10px;
  border-color: var(--person-line);
  background: var(--person-surface);
  color: var(--spr-ink, #222222);
  font-size: .875rem;
}

.spr-person-about .spr-list { gap: 12px; border: 0; }
.spr-person-about .spr-list article {
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  padding: 0;
  border: 0;
}
.spr-person-about .spr-list article + article { padding-top: 12px; border-top: 1px solid var(--person-line); }
.spr-person-about .spr-list article > * { grid-column: 1; }
.spr-person-about .spr-list p { margin: 0; }
body.spr-person-subpage .spr-person-about .spr-list h3 { margin: 0; font-size: 1rem; font-weight: 600; text-wrap: wrap; }

.spr-person-about .spr-identity-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 0;
  list-style: none;
}
.spr-identity-links a { display: inline-flex; min-height: 32px; align-items: center; }

.spr-person-about .spr-link-hub-grid { gap: 8px; }
.spr-person-about .spr-link-card {
  min-height: 48px;
  padding: 10px 14px;
  border-color: var(--person-line);
  border-radius: 14px;
  background: var(--spr-surface, #fff);
  box-shadow: var(--spr-elevation, 0 12px 32px #2628220e);
  font-size: .9375rem;
  font-weight: 600;
}
.spr-person-about .spr-link-card:hover {
  border-color: #c8cac5;
  background: var(--spr-surface, #fff);
  color: var(--spr-ink, #222222);
  box-shadow: var(--spr-elevation-hover, 0 14px 36px #26282216);
}

body.spr-person-subpage .spr-person-collection .spr-page-heading {
  margin: 0 0 24px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.spr-person-collection .spr-list article {
  grid-template-columns: minmax(140px, 1fr) minmax(0, 3fr);
  gap: 6px 24px;
  padding: 16px 0;
  border-color: var(--person-line);
}
.spr-person-collection .spr-list p { margin: 0; }
body.spr-person-subpage .spr-person-collection .spr-list h2 { margin: 0 0 5px; font-size: 1.25rem; font-weight: 600; }
.spr-person-collection .spr-list h2 a { text-decoration: none; }
.spr-person-collection .spr-list h2 a:hover { text-decoration: underline; }
.spr-person-collection .spr-list div > p { max-width: 60ch; color: var(--person-secondary); }

body.spr-person-subpage .spr-person-collection .spr-gallery figure,
body.spr-person-subpage .spr-person-collection .spr-empty {
  border: 1px solid var(--person-line);
  border-radius: var(--spr-radius-card, 26px);
  background: var(--spr-surface, #fff);
  box-shadow: var(--spr-elevation, 0 12px 32px #2628220e);
}
.spr-person-collection .spr-gallery figure { padding: 4px; }
.spr-person-collection .spr-gallery img { border-radius: calc(var(--spr-radius-card, 26px) - 5px); }
.spr-person-collection .spr-gallery figcaption { padding: 10px 12px; }
.spr-person-collection .spr-empty { padding: 20px; }
body.spr-person-subpage .spr-person-collection .spr-empty h2 { font-size: 1.25rem; font-weight: 600; }
.spr-person-collection .spr-empty p { margin: 0; }

body.spr-person-subpage:not(.spr-person-article) > .spr-footer {
  width: min(var(--person-shell), calc(100% - 2 * var(--person-gutter)));
  gap: 4px 12px;
  padding: 16px 0 24px;
  border-color: var(--person-line);
  color: var(--person-secondary);
}

body.spr-person-profile-home {
  --profile-width: 520px;
  --profile-gutter: 10px;
  --profile-content-width: min(calc(100% - 32px), 384px);
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  background: #fff;
}
body.spr-person-profile-home > .spr-person-header {
  width: min(calc(100% - 2 * var(--profile-gutter)), var(--profile-width));
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 66px;
  padding: 8px clamp(10px, 3vw, 18px);
}
body.spr-person-profile-home .spr-wordmark {
  width: 96px;
  height: 36px;
}
body.spr-person-profile-home .spr-wordmark img { width: 152px; }
.spr-profile-header-actions { display: flex; justify-self: end; align-items: center; gap: 8px; }
.spr-profile-header-actions .spr-profile-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 15px;
  border-radius: 999px;
  background: #171717;
  color: #fff;
  font-size: .8125rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.spr-profile-edit:focus-visible { outline: 2px solid #171717; outline-offset: 3px; }
body.spr-person-profile-home main {
  width: min(calc(100% - 2 * var(--profile-gutter)), var(--profile-width));
  margin: 0 auto;
  padding-bottom: 28px;
}
.spr-profile-footer {
  width: min(calc(100% - 2 * var(--profile-gutter)), var(--profile-width));
  margin-block-start: auto;
  margin-inline: auto;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.spr-profile-identity {
  display: grid;
  grid-template-columns: clamp(80px, 26vw, 116px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(10px, 3vw, 18px);
  margin-inline: -6px;
  padding: 17px clamp(26px, 7.4vw, 39px) 17px clamp(15px, 4.6vw, 23px);
  border: 1px solid #e5e5e5;
  border-radius: min(999px, 24vw);
  background: var(--spr-surface, #fff);
  box-shadow: 0 8px 24px -18px #292b2059;
  text-align: start;
}
.spr-profile-identity .spr-profile-avatar {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  margin: 0;
  border-width: 2px;
  box-shadow: 0 0 0 1px #dadcd4;
}
.spr-profile-identity-copy {
  order: 2;
  display: grid;
  gap: 5px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.spr-profile-identity-copy > :is(h1, p) { order: 0; }
body.spr-person-profile-home .spr-profile-identity h1 {
  margin: 0;
  font-size: clamp(1.375rem, 6.4vw, 2.125rem);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -.055em;
}
.spr-profile-headline, .spr-profile-details {
  margin: 0;
  color: var(--person-secondary);
  line-height: 1.35;
}
.spr-profile-headline { font-size: .8125rem; text-wrap: pretty; }
.spr-profile-headline a {
  color: var(--portfolio-ink);
  font-weight: 650;
  text-decoration-color: #84877e;
  text-underline-offset: 3px;
}
.spr-profile-details { font-size: .71875rem; }
.spr-profile-bio {
  width: min(100%, 440px);
  max-width: none;
  margin: 14px auto 0;
  color: var(--person-secondary);
  font-size: .84375rem;
  line-height: 1.55;
  text-align: center;
  text-wrap: pretty;
}
.spr-profile-bio a {
  margin: 0;
  font-size: inherit;
}
.spr-profile-sections {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 8px;
  width: var(--profile-content-width);
  margin: 10px auto 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #dcded5;
}
.spr-profile-section-link {
  display: inline-flex;
  min-height: 44px;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  padding: 6px clamp(9px, 2.6vw, 13px);
  border: 1px solid #a9a9a9;
  border-radius: 999px;
  background: transparent;
  color: var(--portfolio-ink);
  font-size: .8125rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-align: center;
  text-decoration: none;
}
.spr-profile-section-link:hover { border-color: currentColor; text-decoration: underline; text-underline-offset: 3px; }
.spr-profile-custom-links {
  width: min(67.3vw, 350px);
  margin: clamp(28px, 8vw, 40px) auto 0;
}
.spr-person-profile-home .spr-profile-custom-links h2 {
  margin: 0 0 8px;
  color: var(--portfolio-ink);
  font-size: 1.0625rem;
  font-weight: 650;
}
.spr-profile-custom-links .spr-profile-links {
  position: relative;
  isolation: isolate;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.spr-profile-links li { position: relative; min-width: 0; }
.spr-profile-links li + li { margin-top: -8px; }
.spr-profile-links li:focus-within { z-index: 1; }
.spr-profile-linktree .spr-profile-socials { flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.spr-profile-linktree .spr-profile-socials a { box-shadow: none; }
.spr-profile-link {
  min-height: 60px;
  gap: 10px;
  padding: 10px 13px 11px 10px;
  justify-content: flex-start;
  border-color: #303030;
  border-radius: var(--capsule-radius, 999px);
  background: linear-gradient(155deg, #232323, #141414);
  box-shadow: 0 6px 14px -10px #0007;
  color: #fff;
  text-align: start;
  backdrop-filter: none;
}
.spr-profile-links li:nth-child(even) .spr-profile-link {
  border-color: #d8d8d8;
  background: #fff;
  color: #171717;
}
.spr-profile-link:hover {
  background: linear-gradient(155deg, #303030, #202020);
  color: #fff;
  transform: none;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.spr-profile-link-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid currentColor;
  border-color: color-mix(in srgb, currentColor 23%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, currentColor 5%, transparent);
}
.spr-profile-link-icon svg { width: 16px; height: 16px; }
.spr-profile-link-copy { min-width: 0; overflow-wrap: anywhere; }
.spr-profile-link .spr-profile-link-title { color: inherit; font-size: .8125rem; font-weight: 650; line-height: 1.35; }
.spr-profile-link .spr-profile-link-description { margin-top: 2px; color: #d4d4d4; font-size: .6875rem; line-height: 1.3; }
.spr-profile-links li:nth-child(even) .spr-profile-link-description { color: #535353; }

@media (max-width: 700px) {
  body.spr-person-profile-home .spr-profile-return { display: none; }
}

@media (max-width: 620px) {
  .spr-person-about .spr-subsection,
  .spr-person-collection .spr-list article { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 360px) {
  body.spr-person-subpage .spr-person-header nav a { padding-inline: 8px; }
  .spr-profile-identity { margin-inline: -3px; }
  .spr-profile-section-link { font-size: .75rem; }
}

/* Preserve the owner's profile header width alongside the existing sticky-navigation fix. */
body.spr-person-page.spr-person-profile-home > .spr-person-header {
  width: min(calc(100% - 2 * var(--profile-gutter)), var(--profile-width));
  max-width: var(--profile-width);
  margin-inline: auto;
}

/* Keep the identity capsule clear of the sticky profile header on every screen. */
body.spr-person-page.spr-person-profile-home > main {
  margin-block-start: clamp(16px, 3vw, 24px);
}
