/* The GPU owns the closed panels; CSS owns a profile's reading state. */
.p-panel__open { position: absolute; inset: 0; display: block; color: inherit; }
.p-panel__open:focus-visible { outline: 2px solid var(--ink); outline-offset: -6px; z-index: 3; }
.p-panel:has(.p-panel__open:focus-visible)::after { transform: scaleX(1); }
.p-panel:has(.p-panel__open:focus-visible) .p-panel__detail { opacity: 1; transform: none; }
.p-panel__profile-slot[hidden], .p-profile-source[hidden], .p-profile__close[hidden] { display: none; }
.p-panels[data-profile-open] .p-panels__canvas { visibility: hidden !important; }
.p-panels[data-profile-open] .p-panel { background: var(--panel-surface); will-change: auto; transition: left .42s cubic-bezier(.22,.7,.2,1), width .42s cubic-bezier(.22,.7,.2,1); }
.p-panels[data-profile-open] .p-panel__art,
.p-panels[data-profile-open] .p-panel__index,
.p-panels[data-profile-open] .p-panel__label { opacity: 1; }
.p-panels[data-profile-open] .p-panel__art { transition: width .42s, opacity .3s, transform .42s; }
.p-panel__profile-slot { position: absolute; inset: 0 0 0 37%; padding: clamp(20px, 2.7vw, 40px); padding-left: 0; }
.p-profile { min-width: 0; color: var(--ink); font-family: var(--sans); }
.p-profile { position: relative; }
.p-profile-motion { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; visibility: hidden; }
.p-profile-motion canvas { display: block; width: 100%; height: 100%; }
.p-profile[data-profile-motion] .p-profile__name,
.p-profile[data-profile-motion] .p-profile__bio,
.p-profile[data-profile-motion] .p-profile__links { animation: none; }
.p-profile__name[data-name-render="webgl"],
.p-profile__portrait[data-profile-art="webgl"],
.p-panels[data-profile-open] .p-panel__art[data-profile-art="webgl"] { opacity: 0; }
.p-panels[data-profile-open] .p-panel__art[data-profile-art="webgl"] { transition: width .42s, transform .42s; }
.p-profile[data-profile-motion="webgl"] .p-profile__bio { opacity: var(--profile-copy, 1); transform: translateX(calc((1 - var(--profile-copy, 1)) * 12px)); }
.p-profile[data-profile-motion="webgl"] .p-profile__links { opacity: var(--profile-links, 1); transform: translateX(calc((1 - var(--profile-links, 1)) * 8px)); }
.p-profile-source { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; }
.p-profile-source .p-profile { padding: 24px; border-top: 3px solid var(--member-color); }
.p-profile__header { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding-bottom: 20px; border-bottom: 1px solid #252c2d26; }
.p-profile__number { font: .75rem/1.6 var(--mono); letter-spacing: .06em; color: var(--muted); }
.p-profile__number span { margin-left: 12px; }
.p-profile__name { font: 500 clamp(2rem, calc(1.25rem + 2vw), 3.25rem)/1.45 var(--serif); letter-spacing: .1em; margin: 7px 0 0; }
.p-profile__close { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; min-width: 48px; min-height: 44px; padding: 0 4px; background: transparent; border: 0; color: inherit; font: .875rem/1.4 var(--sans); cursor: pointer; }
.p-profile__close > :first-child { font: 300 1.7rem/1 var(--sans); transition: transform var(--motion-hover) var(--ease-out); }
.p-profile__close:is(:hover, :focus-visible) > :first-child { transform: scale(1.08); }
.p-profile__close:active > :first-child { transform: scale(.94); }
.p-profile__body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #252c2d50 transparent; padding: 20px 12px 20px 0; }
.p-profile__body:focus-visible { outline-offset: -2px; }
.p-profile__portrait { width: min(160px, 45%); margin: 0 auto 24px; }
.p-profile__portrait::before { display: none; }
.p-profile__catch { font-size: clamp(1.25rem, 1.7vw, 1.5rem); font-weight: 500; line-height: 1.65; letter-spacing: .025em; margin-bottom: 24px; }
.p-profile__facts { display: grid; gap: 15px; margin: 0; font-size: 1rem; }
.p-profile__facts > div { display: grid; grid-template-columns: 4.4em minmax(0, 1fr); gap: 12px; }
.p-profile__facts dt { color: var(--muted); font-size: .875rem; line-height: 2; }
.p-profile__facts dd { margin: 0; line-height: 1.85; overflow-wrap: anywhere; }
.p-profile__message { font-size: 1.125rem; line-height: 1.9; margin-top: 26px; padding: 0 0 0 16px; border-left: 2px solid var(--member-color); }
.p-profile__links { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; border-top: 1px solid #252c2d26; }
.p-profile__links a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; font-size: .875rem; position: relative; }
.p-profile__links a::after { position: absolute; content: ''; bottom: 2px; inset-inline: 0; height: 2px; background: var(--member-color); transform: scaleX(0); transform-origin: left; transition: transform .3s; }
.p-profile__links a:is(:hover, :focus-visible)::after { transform: scaleX(1); }
.p-profile__links a > :last-child { transition: transform .25s; }
.p-profile__links a:hover > :last-child { transform: translate(2px, -2px); }
.p-panel__profile-slot .p-profile { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
.p-panel__profile-slot .p-profile__portrait { display: none; }
.p-panel__profile-slot .p-profile:not(.is-profile-visible) { opacity: 0; transition: opacity .15s; }
.is-profile-visible .p-profile__name { animation: profile-name .5s cubic-bezier(.2,.7,.2,1) both; }
.is-profile-visible .p-profile__bio { animation: profile-copy .42s .13s both; }
.is-profile-visible .p-profile__links { animation: profile-copy .42s .22s both; }
@keyframes profile-name { from { opacity: 0; letter-spacing: -.03em; transform: translateY(8px); } to { opacity: 1; letter-spacing: .1em; transform: none; } }
@keyframes profile-copy { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.p-profile-sheet { --sheet-paper: #f5f6f3; position: fixed; inset: auto 0 0; width: 100%; max-width: 100%; height: min(840px, 92svh); max-height: 92svh; margin: 0; border: 0; padding: 0; border-radius: 20px 20px 0 0; background: var(--sheet-paper); color: var(--ink); overflow: hidden; box-shadow: 0 -12px 70px #252c2d20; transform: translateY(100%); opacity: 0; transition: transform .36s cubic-bezier(.2,.7,.2,1), opacity .24s; }
.p-profile-sheet::backdrop { background: rgb(37 44 45 / var(--sheet-backdrop-opacity, .4)); }
.p-profile-sheet[data-state="open"] { transform: translate3d(0, var(--sheet-drag, 0px), 0); opacity: 1; }
.p-profile-sheet[data-dragging="true"] { transition: none; user-select: none; -webkit-user-select: none; }
.p-profile-sheet[data-state="closing"] { transform: translateY(100%); opacity: 0; transition-duration: .24s; }
.p-profile-sheet__inner { display: grid; grid-template-rows: auto auto minmax(0, 1fr); height: 100%; padding: 10px max(20px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
.p-profile-sheet__handle { display: grid; place-items: center; width: 64px; height: 24px; margin: 0 auto 4px; touch-action: none; }
.p-profile-sheet__handle::before { content: ""; width: 32px; height: 3px; border-radius: 3px; background: #252c2d40; }
.p-profile-sheet__members { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); padding-bottom: 12px; gap: 6px; }
.p-profile-switch { min-height: 44px; padding: 8px 2px; background: transparent; color: var(--muted); border: 0; border-bottom: 2px solid transparent; font: 500 .875rem/1.6 var(--sans); cursor: pointer; }
.p-profile-switch[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--member-color); }
.p-profile-sheet__slot { min-height: 0; }
.p-profile-sheet .p-profile { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; padding-top: 20px; }
.p-profile-sheet .p-profile__header { padding-bottom: 16px; }
.p-profile-sheet .p-profile__name { font-size: 2rem; }
.p-profile-sheet .p-profile__body { padding: 20px 4px; }
.p-profile-sheet .p-profile__portrait { width: min(112px, 32%); margin-bottom: 20px; }
.p-profile-sheet .p-profile__catch { font-size: 1.25rem; }
.p-profile-sheet .p-profile__links a { min-height: 56px; }

@media (min-width: 801px) {
  .p-panels[data-profile-open]:not([data-profile-closing]) .p-panel.is-profile-selected .p-panel__open { width: 36%; }
  .p-panels[data-profile-open]:not([data-profile-closing]) .is-profile-selected .p-panel__art-window { inset: 4rem 0; }
  .p-panels[data-profile-open]:not([data-profile-closing]) .is-profile-selected .p-panel__art { width: min(33cqw, calc((var(--panel-height) - 7rem) / var(--ratio))); transform: translate(-50%, -50%); }
  .p-panels[data-profile-open]:not([data-profile-closing]) .is-profile-selected .p-panel__label,
  .p-panels[data-profile-open]:not([data-profile-closing]) .is-profile-selected .p-panel__index { opacity: 0; pointer-events: none; }
  .p-panels[data-profile-open]:not([data-profile-closing]) .p-panel:not(.is-profile-selected) .p-panel__index { left: 0; right: 0; justify-content: center; }
  .p-panels[data-profile-open]:not([data-profile-closing]) .p-panel:not(.is-profile-selected) .p-panel__index > span,
  .p-panels[data-profile-open]:not([data-profile-closing]) .p-panel:not(.is-profile-selected) .p-panel__expand,
  .p-panels[data-profile-open]:not([data-profile-closing]) .p-panel:not(.is-profile-selected) .p-panel__detail { display: none; }
  .p-panels[data-profile-open]:not([data-profile-closing]) .p-panel:not(.is-profile-selected) .p-panel__label { display: flex; left: 0; right: 0; justify-content: center; border: 0; }
  .p-panels[data-profile-open]:not([data-profile-closing]) .p-panel:not(.is-profile-selected) .p-panel__name { writing-mode: vertical-rl; font-size: 1rem; letter-spacing: .18em; }
  .p-panels[data-profile-open]:not([data-profile-closing]) .p-panel:not(.is-profile-selected) .p-panel__art { opacity: .36; width: 150cqw; }
  .p-panels[data-profile-open]:not([data-profile-closing]) .p-panel:not(.is-profile-selected):is(:hover, :focus-within) .p-panel__art { opacity: .85; }
  .p-panels[data-profile-open] .is-profile-selected::after { transform: scaleX(1); }
}
@media (min-width: 801px) and (max-width: 1050px) {
  .p-panel__profile-slot { left: 31%; padding: 20px 24px 20px 0; }
  .p-panels[data-profile-open]:not([data-profile-closing]) .p-panel.is-profile-selected .p-panel__open { width: 30%; }
  .p-panels[data-profile-open]:not([data-profile-closing]) .is-profile-selected .p-panel__art { width: 28cqw; }
  .p-profile__facts > div { grid-template-columns: 3.8em minmax(0, 1fr); gap: 8px; }
}
@media (max-width: 800px) {
  .p-profile-source { grid-template-columns: 1fr; }
  .p-panels[data-profile-open] .p-panel { transition: none; }
  .p-profile__facts { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .p-panels[data-profile-open] .p-panel, .p-panels[data-profile-open] .p-panel__art,
  .p-profile-sheet, .p-profile__close > span, .p-profile__links a::after { transition: none; }
  .is-profile-visible .p-profile__name, .is-profile-visible .p-profile__bio, .is-profile-visible .p-profile__links { animation: none; }
}
@media print {
  .p-profile-source[hidden] { display: grid !important; }
  .p-profile__close, .p-profile-sheet__members { display: none !important; }
  .p-profile__body { overflow: visible; }
}
