.masters-profile {
    --masters-width: 62rem;
    --masters-reading-width: 46rem;
    color: var(--az-color-text);
    background: var(--az-color-canvas);
    padding-bottom: 3rem;
}

.masters-profile__hero {
    padding: 7.5rem 1.5rem 2.5rem;
    background: linear-gradient(150deg, var(--az-color-primary-soft), var(--az-color-canvas) 80%);
}

.masters-profile__hero-inner,
.masters-profile__facts,
.masters-profile__story,
.masters-profile__timeline,
.masters-profile__references,
.masters-profile__related {
    width: 100%;
    max-width: var(--masters-width);
    margin-inline: auto;
}

.masters-profile__hero-inner { display: grid; align-items: center; gap: 2rem; max-width: 52rem; }
.masters-profile a.masters-profile__back,
.masters-profile__related-heading > a {
    color: var(--az-color-primary);
    text-decoration: none;
    font-size: var(--az-text-sm);
    font-weight: 600;
}

.masters-profile__back:hover,
.masters-profile__related-heading > a:hover { text-decoration: underline; }
.masters-profile__eyebrow,
.masters-profile__section-label {
    margin: 1.25rem 0 .5rem;
    color: var(--az-color-primary);
    font-size: var(--az-text-sm);
    font-weight: 700;
}

.masters-profile__heading h1 {
    margin: 0;
    color: var(--az-color-ink);
    /* The shared design system sets heading sizes with !important. */
    font-size: clamp(1.8rem, 3vw, 2.25rem) !important;
    line-height: 1.45 !important;
}

.masters-profile__second-name {
    margin: .25rem 0 0;
    color: var(--az-color-muted);
    font-size: var(--az-text-lg);
    letter-spacing: .035em;
    text-align: right;
}

.masters-profile__lead { max-width: 54ch; margin: 1rem 0 0; font-size: var(--az-text-lg); line-height: 1.95; }
.masters-profile__sections { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.masters-profile__sections a {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem 1rem;
    border: 1px solid var(--az-color-border-strong);
    border-radius: var(--az-radius-pill);
    font-size: var(--az-text-sm);
    font-weight: 600;
    text-decoration: none;
}

.masters-profile a.masters-profile__story-link { color: var(--az-color-ink); background: var(--az-color-surface); }
.masters-profile a.masters-profile__jump { color: #fff; background: var(--az-color-primary); border-color: var(--az-color-primary); }
.masters-profile__story-link:hover { border-color: var(--az-color-primary); }
.masters-profile a.masters-profile__jump:hover { background: var(--az-color-primary-strong); }
.masters-profile a:focus-visible { outline: 2px solid var(--az-color-primary); outline-offset: 4px; }
.masters-profile__visual { position: relative; }
.masters-profile__cover {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--az-radius-lg);
    box-shadow: var(--az-shadow-card);
}

.masters-profile__portrait {
    display: block;
    width: 6rem;
    height: 6rem;
    object-fit: cover;
    border: .35rem solid var(--az-color-surface);
    border-radius: 50%;
    box-shadow: var(--az-shadow-card);
    margin: -3rem 1rem 0 auto;
    position: relative;
}

.masters-profile__visual > .masters-profile__portrait:first-child { width: 100%; height: auto; aspect-ratio: 1; margin: 0; border-width: .5rem; }
.masters-profile__facts {
    margin-top: 2rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--az-color-border);
    border-radius: var(--az-radius-lg);
    background: var(--az-color-surface);
}

.masters-profile__facts h2 { margin: 0 0 1rem; color: var(--az-color-ink); font-size: var(--az-text-sm) !important; }
.masters-profile__facts dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem; margin: 0; }
.masters-profile__facts dl > div { padding-inline-start: .85rem; border-inline-start: 2px solid var(--az-color-primary-soft); }
.masters-profile__facts dt { color: var(--az-color-muted); font-size: var(--az-text-sm); }
.masters-profile__facts dd { margin: .35rem 0 0; color: var(--az-color-ink); font-weight: 600; line-height: 1.8; }
.masters-profile__story,
.masters-profile__timeline,
.masters-profile__references {
    padding: 2.5rem 3rem;
    border: 1px solid var(--az-color-border);
    border-radius: var(--az-radius-lg);
    background: var(--az-color-surface);
    scroll-margin-top: 6rem;
}

.masters-profile__story-title,
.masters-profile__prose { max-width: var(--masters-reading-width); margin-inline: auto; }
.masters-profile__story-title { margin-block: 0 1.5rem; color: var(--az-color-ink); font-size: var(--az-text-2xl); }
.masters-profile__prose { font-size: 1.0625rem; line-height: 2.1; overflow-wrap: anywhere; }
.masters-profile__prose :is(h2, h3, h4) { color: var(--az-color-ink); margin: 2rem 0 .75rem; line-height: 1.6; }
.masters-profile__prose :is(h2, h3, h4)[id] { scroll-margin-top: 6rem; }
.masters-profile__prose p { margin: 0 0 1.25rem; }
.masters-profile__prose > :last-child { margin-bottom: 0; }
.masters-profile__prose a { color: var(--az-color-primary); text-decoration: underline; }
.masters-profile__prose img { max-width: 100%; height: auto; border-radius: var(--az-radius-md); }
.masters-profile__prose .masters-profile__figure { margin: 2rem 0; }
.masters-profile__figure img { display: block; width: auto; max-height: 30rem; margin-inline: auto; object-fit: contain; }
.masters-profile__figure figcaption { margin-top: .75rem; padding-inline: .25rem; color: var(--az-color-muted); font-size: var(--az-text-sm); line-height: 1.9; }
.masters-profile__figure-credit { display: block; margin-top: .25rem; font-size: var(--az-text-xs); }
.masters-profile__prose blockquote { margin: 1.5rem 0; padding: 1rem 1.25rem; border-inline-start: 3px solid var(--az-color-primary); background: var(--az-color-primary-soft); }
.masters-profile__prose :is(pre, table) { max-width: 100%; overflow-x: auto; }
.masters-profile__guide { margin: 1.5rem 0 2rem; padding: 1.25rem; border: 1px solid var(--az-color-border); border-radius: var(--az-radius-md); background: linear-gradient(135deg, var(--az-color-primary-soft), var(--az-color-canvas)); }
.masters-profile__guide-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.masters-profile__prose .masters-profile__guide-title { margin: 0; font-size: var(--az-text-base) !important; line-height: 1.8; }
.masters-profile__guide-count { flex-shrink: 0; color: var(--az-color-muted); font-size: var(--az-text-xs); }
.masters-profile__guide-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem 1rem; margin: 0; padding: 0; list-style: none; }
.masters-profile__prose .masters-profile__guide-list a { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr) 1rem; align-items: center; gap: .5rem; min-height: 2.75rem; padding: .55rem .35rem; border-bottom: 1px solid var(--az-color-border); border-radius: .35rem; color: var(--az-color-ink); font-size: var(--az-text-sm); line-height: 1.85; text-decoration: none; transition: background-color .15s ease, color .15s ease; }
.masters-profile__prose .masters-profile__guide-list a:hover,
.masters-profile__prose .masters-profile__guide-list a:focus-visible { color: var(--az-color-primary); background: var(--az-color-surface); }
.masters-profile__guide-number { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: .5rem; background: var(--az-color-surface); color: var(--az-color-muted); font-size: var(--az-text-xs); font-variant-numeric: tabular-nums; }
.masters-profile__guide-arrow { color: var(--az-color-primary); font-size: var(--az-text-base); text-align: center; }
.masters-profile__citation { position: static; font-size: .75em; line-height: 0; vertical-align: super; white-space: nowrap; }
.masters-profile__prose .masters-profile__citation a { padding: .15rem .1rem; font-weight: 600; text-decoration: none; scroll-margin-top: 6rem; }
.masters-profile__references { margin-top: 2rem; padding: 1.25rem 1rem; border: 0; border-top: 1px solid var(--az-color-border); border-radius: 0; background: transparent; }
.masters-profile__references .masters-profile__prose { max-width: none; font-size: .8125rem; line-height: 1.75; }
.masters-profile__references-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.masters-profile__references .masters-profile__references-heading h2 { margin: 0; font-size: var(--az-text-sm) !important; line-height: 1.8 !important; }
.masters-profile__references-count { color: var(--az-color-muted); font-size: var(--az-text-xs); white-space: nowrap; }
.masters-profile__reference-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.75rem; padding: 0; margin: .65rem 0 0; list-style: none; }
.masters-profile__reference-list > li { display: grid; grid-template-columns: 2rem minmax(0, 1fr); align-items: start; gap: .35rem; padding: .4rem 0; border-top: 1px solid var(--az-color-border); scroll-margin-top: 6rem; }
.masters-profile__reference-list > li:target { background: var(--az-color-primary-soft); }
.masters-profile__reference-number { color: var(--az-color-muted); font-size: var(--az-text-xs); line-height: 2; font-variant-numeric: tabular-nums; }
.masters-profile__reference-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: .35rem; min-width: 0; }
.masters-profile__references .masters-profile__reference-source { color: var(--az-color-ink); text-decoration: none; }
.masters-profile__references .masters-profile__reference-source:hover { color: var(--az-color-primary); text-decoration: underline; text-underline-offset: .2em; }
.masters-profile__reference-backlinks { display: inline-flex; flex-wrap: wrap; gap: .15rem; }
.masters-profile__reference-return { position: relative; }
.masters-profile__reference-return summary,
.masters-profile__prose .masters-profile__reference-backlinks a { display: inline-flex; align-items: center; justify-content: center; gap: .2rem; min-width: 1.5rem; min-height: 1.5rem; padding: 0 .2rem; border-radius: .25rem; color: var(--az-color-muted); font-size: var(--az-text-xs); line-height: 1; text-decoration: none; }
.masters-profile__reference-return summary { list-style: none; cursor: pointer; }
.masters-profile__reference-return summary::-webkit-details-marker { display: none; }
.masters-profile__reference-return summary:hover,
.masters-profile__reference-return[open] summary,
.masters-profile__prose .masters-profile__reference-backlinks a:hover { color: var(--az-color-primary); background: var(--az-color-primary-soft); }
.masters-profile__reference-return summary:focus-visible { outline: 2px solid var(--az-color-primary); outline-offset: 2px; }
.masters-profile__reference-return[open] .masters-profile__reference-backlinks { position: absolute; z-index: 2; top: calc(100% + .25rem); inset-inline-end: 0; width: max-content; max-width: min(14rem, calc(100vw - 5rem)); padding: .4rem; border: 1px solid var(--az-color-border); border-radius: var(--az-radius-md); background: var(--az-color-surface); box-shadow: var(--az-shadow-card); }
.masters-profile__reference-backlinks span { font-size: .85em; }
.masters-profile__timeline { margin-top: 1.5rem; padding-bottom: 1rem; }
.masters-profile__section-heading { margin-bottom: 2rem; }
.masters-profile__section-heading .masters-profile__section-label { margin-top: 0; }
.masters-profile__section-heading h2,
.masters-profile__related-heading h2 { margin: 0; color: var(--az-color-ink); font-size: var(--az-text-2xl); }
.masters-profile__section-heading > p:last-child { margin: .5rem 0 0; color: var(--az-color-muted); }
.masters-profile__timeline-row {
    --masters-line-top: 2.75rem;
    position: relative;
    display: flex;
    padding: 0 1.5rem 2.5rem;
    margin: 0;
    list-style: none;
}

.masters-profile__timeline-row::before {
    content: '';
    position: absolute;
    top: var(--masters-line-top);
    right: 1.5rem;
    left: 1.5rem;
    height: 2px;
    background: var(--az-color-primary);
    opacity: .3;
}

.masters-profile__timeline-row:not(:last-child)::after {
    content: '';
    position: absolute;
    top: var(--masters-line-top);
    left: -1.5rem;
    width: 3rem;
    height: calc(100% + 2px);
    border: 2px solid var(--az-color-primary);
    border-right: 0;
    border-radius: 4rem 0 0 4rem;
    opacity: .3;
}

.masters-profile__timeline-row:nth-child(even):not(:last-child)::after {
    left: auto;
    right: -1.5rem;
    border: 2px solid var(--az-color-primary);
    border-left: 0;
    border-radius: 0 4rem 4rem 0;
}

.masters-profile__timeline-row:nth-child(even) { flex-direction: row-reverse; }
.masters-profile__event { position: relative; flex: 1 1 0; min-width: 0; padding: 0 .75rem; text-align: center; }
.masters-profile__event-date { display: block; min-height: 2.25rem; color: var(--az-color-primary); font-weight: 700; }
.masters-profile__event-dot {
    display: block;
    width: 1rem;
    height: 1rem;
    margin: 0 auto 1rem;
    border: 3px solid var(--az-color-surface);
    border-radius: 50%;
    background: var(--az-color-primary);
    box-shadow: 0 0 0 2px var(--az-color-primary);
}

.masters-profile__event strong { display: block; color: var(--az-color-ink); font-size: var(--az-text-base); }
.masters-profile__event p { max-width: 24ch; margin: .5rem auto 0; font-size: var(--az-text-sm); line-height: 1.85; }
.masters-profile__related { padding: 2.5rem 0 0; }
.masters-profile__related-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.masters-profile__related-heading .masters-profile__section-label { margin-top: 0; }
.masters-profile__related-heading > a { flex-shrink: 0; }
.masters-profile__related-grid { display: grid; gap: 1rem; }
.masters-profile a.masters-profile__related-card {
    display: flex;
    flex-direction: column;
    gap: .85rem;
    padding: .75rem .75rem 1.25rem;
    border: 1px solid var(--az-color-border);
    border-radius: var(--az-radius-lg);
    background: var(--az-color-surface);
    color: var(--az-color-ink);
    text-align: center;
    text-decoration: none;
    transition: transform .2s ease, border-color .2s ease;
}

.masters-profile a.masters-profile__related-card:hover { transform: translateY(-3px); border-color: var(--az-color-primary); }
.masters-profile__related-image { display: grid; place-items: center; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--az-radius-md); background: linear-gradient(140deg, var(--az-color-primary-soft), var(--az-color-canvas)); }
.masters-profile__related-image img { width: 7rem; height: 7rem; object-fit: cover; border: 4px solid var(--az-color-surface); border-radius: 50%; }
.masters-profile__related-card strong { padding-inline: .5rem; font-size: var(--az-text-base); line-height: 1.8; }
.masters-profile__related-name { display: block; color: var(--az-color-muted); font-size: var(--az-text-sm); font-weight: 400; }
.masters-profile__related-action { margin-top: auto; color: var(--az-color-primary); font-size: var(--az-text-sm); }
.masters-profile__empty { margin: 0; padding: 10rem 1.5rem; text-align: center; }

@media (min-width: 701px) {
    .masters-profile__hero-inner--with-visual { grid-template-columns: minmax(0, 1fr) 12rem; gap: 2rem; }
    .masters-profile__related-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1050px) {
    .masters-profile__story,
    .masters-profile__timeline,
    .masters-profile__references,
    .masters-profile__related { width: calc(100% - 3rem); }
}

@media (max-width: 700px) {
    .masters-profile__hero { padding: 6.5rem 1.25rem 1.5rem; }
    .masters-profile__hero-inner--with-visual { grid-template-columns: minmax(0, 1fr) 6rem; gap: .75rem; align-items: start; }
    .masters-profile__heading { display: contents; }
    .masters-profile__back { grid-column: 1 / -1; }
    .masters-profile__eyebrow { grid-column: 1; margin: .75rem 0 0; }
    .masters-profile__heading h1 { grid-column: 1; font-size: 1.65rem !important; }
    .masters-profile__second-name { grid-column: 1; font-size: var(--az-text-sm); margin: 0; }
    .masters-profile__lead,
    .masters-profile__sections { grid-column: 1 / -1; }
    .masters-profile__lead { margin-top: .25rem; font-size: var(--az-text-base); line-height: 1.95; }
    .masters-profile__sections { margin-top: .25rem; }
    .masters-profile__visual { grid-column: 2; grid-row: 2 / 5; align-self: center; }
    .masters-profile__portrait { width: 3rem; height: 3rem; margin: -1.5rem .25rem 0 auto; border-width: 3px; }
    .masters-profile__visual > .masters-profile__portrait:first-child { border-width: 4px; }
    .masters-profile__facts { margin-top: 1.25rem; padding: 1rem; }
    .masters-profile__facts h2 { margin-bottom: .75rem; }
    .masters-profile__facts dl { grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 1rem .5rem; }
    .masters-profile__facts dl > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .masters-profile__facts dd { font-size: var(--az-text-sm); }
    .masters-profile__story,
    .masters-profile__timeline,
    .masters-profile__references { width: calc(100% - 2.5rem); padding: 1.5rem 1.25rem; }
    .masters-profile__references { padding: 1rem .25rem; }
    .masters-profile__reference-list { grid-template-columns: minmax(0, 1fr); }
    .masters-profile__story-title { font-size: var(--az-text-xl) !important; margin-bottom: 1rem; }
    .masters-profile__prose { font-size: var(--az-text-base); line-height: 2.05; }
    .masters-profile__guide { padding: .875rem; margin-block: 1.25rem 1.5rem; }
    .masters-profile__guide-list { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
    .masters-profile__prose .masters-profile__guide-list a { grid-template-columns: 1.5rem minmax(0, 1fr) .875rem; padding-inline: .15rem; }
    .masters-profile__guide-number { width: 1.5rem; height: 1.5rem; }
    .masters-profile__timeline { padding-bottom: .25rem; }
    .masters-profile__section-heading { margin-bottom: 1.5rem; }
    .masters-profile__timeline-rows { border-inline-start: 2px solid var(--az-color-border-strong); margin-inline-start: .5rem; }
    .masters-profile__timeline-row,
    .masters-profile__timeline-row:nth-child(even) { display: block; padding: 0; }
    .masters-profile__timeline-row::before,
    .masters-profile__timeline-row::after { display: none; }
    .masters-profile__event { padding: 0 1.5rem 1.75rem 0; text-align: right; }
    .masters-profile__event-dot { position: absolute; top: .4rem; right: -.55rem; margin: 0; }
    .masters-profile__event-date { min-height: 0; margin-bottom: .35rem; }
    .masters-profile__event p { max-width: none; margin-right: 0; }
    .masters-profile__related { width: calc(100% - 2.5rem); padding-top: 2rem; }
    .masters-profile__related-heading { align-items: center; }
    .masters-profile__related-heading h2 { font-size: var(--az-text-xl) !important; }
    .masters-profile a.masters-profile__related-card { display: grid; grid-template-columns: 5rem minmax(0, 1fr); padding: .75rem; gap: .25rem 1rem; text-align: right; align-items: center; }
    .masters-profile__related-image { grid-row: 1 / 3; aspect-ratio: 1; }
    .masters-profile__related-image img { width: 4rem; height: 4rem; border-width: 2px; }
    .masters-profile__related-card strong { padding: 0; font-size: var(--az-text-sm); }
    .masters-profile__related-action { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .masters-profile__prose .masters-profile__guide-list a,
    .masters-profile__related-card { transition: none; }
}
