/* Stage P1 — rich public profile (/members/{slug}). Tokens only (global.css :root).
   Sections render as template-parts; each auto-hides when empty. Legacy .about-* rules
   kept at the foot for the render_public() degrade path. */
.member-profile{max-width:var(--container-max);margin-inline:auto;padding-inline:var(--pad-desktop);
  padding-block:var(--space-12);display:flex;flex-direction:column;gap:var(--space-16);}
@media(max-width:600px){.member-profile{padding-inline:var(--pad-mobile);}}

/* accent override (data-accent on the page root; derived from existing palette) */
.member-profile{--accent:var(--primary);--accent-soft:rgba(27,77,115,.08);}
.member-profile[data-accent="green"]{--accent:#2f6b45;--accent-soft:rgba(47,107,69,.08);}
.member-profile[data-accent="slate"]{--accent:#40484c;--accent-soft:rgba(64,72,76,.08);}
.member-profile[data-accent="amber"]{--accent:#8a5a00;--accent-soft:rgba(138,90,0,.08);}

/* section heading */
.member-profile .section__head{margin-bottom:var(--space-6);}
.member-profile .section__h{font-family:var(--font-mono);font-size:var(--text-sm);text-transform:uppercase;
  letter-spacing:.12em;color:var(--text-muted);border-bottom:1px solid var(--border-color);padding-bottom:var(--space-3);}

/* hero */
.member-profile .hero{display:grid;grid-template-columns:1fr;gap:var(--gutter);}
@media(min-width:900px){.member-profile .hero{grid-template-columns:1.4fr 1fr;align-items:start;}}
.hero__main{display:flex;gap:var(--space-6);align-items:flex-start;}
.hero__avatar,.hero__avatar-img{width:96px;height:96px;flex:none;border-radius:var(--radius-lg);border:1px solid var(--border-color);}
.hero__avatar{background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;
  font-family:var(--font-mono);font-size:var(--h-md);font-weight:500;}
.hero__avatar-img{object-fit:cover;}
.hero__id{display:flex;flex-direction:column;gap:var(--space-3);}
.hero__namerow{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-3);}
.hero__name{font-size:var(--h-lg);font-weight:600;letter-spacing:-.02em;line-height:1.1;margin:0;}
.hero__headline{font-size:var(--h-sm);color:var(--text-muted);font-weight:500;margin:0;}
.hero__meta{display:flex;gap:var(--space-2);flex-wrap:wrap;font-family:var(--font-mono);font-size:var(--label);color:var(--text-muted);margin:0;}
.hero__bio{font-size:var(--text-base);color:var(--text-main);margin:var(--space-2) 0 0;max-width:56ch;}
.hero__bio p{margin:0 0 var(--space-2);}
.hero__actions{display:flex;gap:var(--space-3);flex-wrap:wrap;margin-top:var(--space-2);}
.hero__socials{list-style:none;margin:var(--space-3) 0 0;padding:0;display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-2);}
.hero__socials a,.hero__share{display:grid;place-items:center;width:36px;height:36px;border:1px solid var(--border-color);border-radius:var(--radius);color:var(--text-muted);background:var(--surface-card);cursor:pointer;text-decoration:none;transition:color .15s,border-color .15s;}
.hero__socials a:hover,.hero__share:hover{color:var(--accent);border-color:var(--accent);}
.hero__socials svg{width:18px;height:18px;display:block;}
.hero__socials-sep{width:1px;height:20px;background:var(--border-color);margin:0 var(--space-1);}
.hero__video{margin:0;}
.hero__video iframe{width:100%;aspect-ratio:16/9;border:1px solid var(--border-color);border-radius:var(--radius-lg);}

/* owner-only sparse-profile nudge (never shown to public viewers) */
.profile-ownernote{display:flex;align-items:center;justify-content:space-between;gap:var(--space-4);flex-wrap:wrap;padding:var(--space-3) var(--space-4);background:var(--accent-soft);border:1px solid var(--accent);border-radius:var(--radius-lg);font-size:var(--text-sm);color:var(--text-main);}

.chip{font-family:var(--font-mono);font-size:var(--label);padding:var(--space-1) var(--space-2);border-radius:var(--radius);border:1px solid var(--border-color);color:var(--text-muted);}
.chip--open{color:var(--success);border-color:var(--success);}

.btn{font-family:var(--font-mono);font-size:var(--text-sm);padding:var(--space-3) var(--space-6);border-radius:var(--radius);border:1px solid transparent;cursor:pointer;display:inline-flex;align-items:center;gap:var(--space-2);text-decoration:none;}
.btn--primary{background:var(--accent);color:var(--on-primary);}
.btn--ghost{background:transparent;color:var(--accent);border-color:var(--border-color);}
.btn--accent{background:var(--accent-soft);color:var(--accent);border-color:var(--accent);}
.btn--sm{padding:var(--space-2) var(--space-4);font-size:var(--label);}

/* stats band */
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:1px;background:var(--border-color);border:1px solid var(--border-color);border-radius:var(--radius-lg);overflow:hidden;}
.stat{background:var(--surface-card);padding:var(--space-6);display:flex;flex-direction:column;gap:var(--space-1);}
.stat__num{font-size:var(--h-lg);font-weight:600;color:var(--accent);letter-spacing:-.02em;}
.stat__lbl{font-family:var(--font-mono);font-size:var(--label);text-transform:uppercase;letter-spacing:.06em;color:var(--text-muted);}

/* projects grid */
.proj-grid{display:grid;grid-template-columns:1fr;gap:var(--gutter);}
@media(min-width:640px){.proj-grid{grid-template-columns:repeat(2,1fr);}}
@media(min-width:980px){.proj-grid{grid-template-columns:repeat(3,1fr);}}
.proj{display:flex;flex-direction:column;background:var(--surface-card);border:1px solid var(--border-color);border-radius:var(--radius-lg);overflow:hidden;transition:border-color .15s,transform .15s,box-shadow .15s;text-decoration:none;}
.proj:hover{border-color:var(--accent);transform:translateY(-2px);box-shadow:var(--shadow-sm);}
.proj__cover{position:relative;aspect-ratio:16/9;display:block;background-size:cover;background-position:center;}
.proj__cover--a{background:linear-gradient(135deg,var(--accent),#5b86a8);}
.proj__cover--b{background:linear-gradient(135deg,#2f6b45,#3f8a5c 60%,#6aa884);}
.proj__cover--c{background:linear-gradient(135deg,#40484c,#5a646a 60%,#828c93);}
.proj__tag{position:absolute;top:var(--space-3);left:var(--space-3);font-family:var(--font-mono);font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#fff;background:rgba(0,0,0,.35);padding:var(--space-1) var(--space-2);border-radius:var(--radius);}
.proj__body{display:flex;flex-direction:column;gap:var(--space-2);padding:var(--space-6);flex-grow:1;}
.proj__h{font-size:var(--h-sm);font-weight:600;color:var(--text-main);}
.proj__sub{font-size:var(--text-sm);color:var(--text-muted);flex-grow:1;}
.proj__foot{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);margin-top:var(--space-2);}
.proj__stack{font-family:var(--font-mono);font-size:var(--label);color:var(--text-muted);}
.proj__go{font-family:var(--font-mono);font-size:var(--label);color:var(--accent);opacity:0;transform:translateX(-4px);transition:opacity .15s,transform .15s;}
.proj:hover .proj__go{opacity:1;transform:none;}

/* timeline (experience + education) */
.timeline{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;}
.tl{display:grid;grid-template-columns:1fr;gap:var(--space-2);padding:var(--space-6) 0;border-bottom:1px solid var(--surface-low);}
.tl:last-child{border-bottom:0;}
@media(min-width:768px){.tl{grid-template-columns:160px 1fr;gap:var(--space-6);}}
.tl__when{font-family:var(--font-mono);font-size:var(--label);color:var(--text-muted);padding-top:2px;}
.tl__role{font-size:var(--text-base);font-weight:600;margin:0;}
.tl__at{font-weight:400;color:var(--text-muted);}
.tl__bullets{margin:var(--space-3) 0 0;padding-left:var(--space-4);display:flex;flex-direction:column;gap:var(--space-2);color:var(--text-muted);font-size:var(--text-sm);}

/* tech stack */
.stack{display:grid;grid-template-columns:1fr;gap:var(--space-8);}
@media(min-width:768px){.stack{grid-template-columns:repeat(3,1fr);}}
.stack-grp{display:flex;flex-direction:column;gap:var(--space-4);}
.stack-grp__h{font-size:var(--text-base);font-weight:600;border-bottom:1px solid var(--border-color);padding-bottom:var(--space-2);margin:0;}
.techgrid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(3,1fr);gap:var(--space-3);}
.tech__icon{transition:border-color .15s,color .15s,transform .15s,background .15s;}
.tech:hover .tech__icon{border-color:var(--accent);background:var(--accent-soft);transform:translateY(-2px);}
.tech{display:flex;flex-direction:column;align-items:center;gap:var(--space-2);text-align:center;}
.tech__icon{width:48px;height:48px;display:grid;place-items:center;border:1px solid var(--border-color);border-radius:var(--radius-lg);background:var(--surface-card);font-family:var(--font-mono);font-size:var(--text-sm);font-weight:500;color:var(--accent);}
.tech__name{font-family:var(--font-mono);font-size:var(--label);color:var(--text-muted);}

/* badges */
.badges{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:var(--space-3);}
.badge{display:flex;flex-direction:column;gap:2px;padding:var(--space-3) var(--space-4);background:var(--surface-card);border:1px solid var(--border-color);border-radius:var(--radius-lg);}
.badge__t{font-weight:600;font-size:var(--text-sm);}
.badge__m{font-family:var(--font-mono);font-size:var(--label);color:var(--text-muted);}

/* taglist (interests) */
.taglist{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:var(--space-2);}
.taglist li{font-family:var(--font-mono);font-size:var(--label);padding:var(--space-1) var(--space-3);background:var(--surface-low);border:1px solid var(--border-color);border-radius:var(--radius);color:var(--text-muted);}
.taglist--lg li{font-size:var(--text-sm);padding:var(--space-2) var(--space-4);}

/* testimonials */
.quotes{display:grid;grid-template-columns:1fr;gap:var(--gutter);}
@media(min-width:768px){.quotes{grid-template-columns:repeat(2,1fr);}}
.quote{margin:0;padding:var(--space-6);background:var(--surface-card);border:1px solid var(--border-color);border-left:3px solid var(--accent);border-radius:var(--radius-lg);}
.quote p{margin:0 0 var(--space-4);font-size:var(--text-base);}
.quote footer{display:flex;flex-direction:column;font-family:var(--font-mono);font-size:var(--label);}
.quote__name{color:var(--text-main);font-weight:500;}
.quote__role{color:var(--text-muted);}

/* linklist (publications, awards) */
.linklist{list-style:none;margin:0;padding:0;border:1px solid var(--border-color);border-radius:var(--radius-lg);background:var(--surface-card);overflow:hidden;}
.linklist li{display:flex;align-items:center;justify-content:space-between;gap:var(--space-4);padding:var(--space-3) var(--space-4);border-bottom:1px solid var(--surface-low);}
.linklist li:last-child{border-bottom:0;}
.linklist__d{font-family:var(--font-mono);font-size:var(--label);color:var(--text-muted);flex:none;}

/* ── legacy degrade (render_public ID card; parts-less theme only) ───────── */
.about-grid{display:grid;grid-template-columns:1fr;gap:var(--gutter);align-items:start;}
@media(min-width:768px){.about-grid{grid-template-columns:1fr 2fr;}}
.about-id{overflow:hidden;}
.about-id__top{display:flex;flex-direction:column;align-items:center;gap:var(--space-3);padding:var(--space-6);border-bottom:1px solid var(--border-color);background:var(--surface-low);}
.about-detail{display:flex;flex-direction:column;gap:var(--space-12);}
.about-phil{margin-top:var(--space-4);}
.arsenal{display:grid;grid-template-columns:1fr;gap:var(--space-4);margin-top:var(--space-4);}
@media(min-width:640px){.arsenal{grid-template-columns:1fr 1fr;}}
.member-projects{margin-top:var(--space-12);}
.member-projects__h{border-bottom:1px solid var(--border-color);padding-bottom:var(--space-2);margin-bottom:var(--space-4);}
.member-projects .ts-project-list{list-style:none;margin:0;padding:0;border:1px solid var(--border-color);border-radius:var(--radius-lg);background:var(--surface-card);overflow:hidden;}
.member-projects .ts-project-list__row{display:flex;align-items:center;gap:var(--space-4);padding:var(--space-3) var(--space-4);border-bottom:1px solid var(--surface-low);}
.member-projects .ts-project-list__row:last-child{border-bottom:0;}
.member-projects .ts-project-list__title{font-weight:500;}

/* ── Phase: mockup parity — scrollspy, section head row, toast, mobilebar, print ── */
.spy{position:sticky;top:var(--nav-height);z-index:40;display:flex;gap:var(--space-1);overflow-x:auto;padding:var(--space-2) 0;margin:0 0 var(--space-4);border-bottom:1px solid var(--border-color);background:var(--surface-bg);scrollbar-width:none;}
.spy::-webkit-scrollbar{display:none;}
.spy a{font-family:var(--font-mono);font-size:var(--label);text-transform:uppercase;letter-spacing:.04em;color:var(--text-muted);white-space:nowrap;text-decoration:none;padding:var(--space-2) var(--space-3);border-radius:var(--radius);}
.spy a:hover{color:var(--accent);background:var(--surface-low);}
.spy a.is-active{color:var(--accent);background:var(--accent-soft);}

.section__head--row{display:flex;align-items:baseline;justify-content:space-between;gap:var(--space-4);}
.section__more{font-family:var(--font-mono);font-size:var(--label);color:var(--accent);flex:none;}

.toast{position:fixed;bottom:var(--space-6);left:50%;transform:translateX(-50%);background:var(--text-main);color:var(--surface-bg);font-family:var(--font-mono);font-size:var(--label);padding:var(--space-3) var(--space-4);border-radius:var(--radius);z-index:60;}
.toast[hidden]{display:none;}

.mobilebar{display:none;}
@media(max-width:640px){.mobilebar{display:flex;gap:var(--space-3);position:fixed;left:0;right:0;bottom:0;padding:var(--space-3) var(--space-4);background:var(--surface-card);border-top:1px solid var(--border-color);z-index:50;}.mobilebar .btn{flex:1;justify-content:center;}}

/* ─────────────────────────────────────────────────────────────────────────
   V4 member layout — two-column shell + sticky identity rail + slim action bar
   + at-a-glance + intro-video modal. Tokens only; reuses .spy/.chip/.section.
   ───────────────────────────────────────────────────────────────────────── */
.mp-shell{display:grid;grid-template-columns:1fr;gap:var(--gutter);}
@media(min-width:900px){.mp-shell{grid-template-columns:320px 1fr;align-items:start;}}
.mp-main{min-width:0;display:flex;flex-direction:column;gap:var(--space-12);}

.mp-rail{display:flex;flex-direction:column;gap:var(--space-4);}
@media(min-width:900px){.mp-rail{position:sticky;top:calc(var(--nav-height) + var(--space-4));}}

.mp-idcard{background:var(--surface-card);border:1px solid var(--border-color);border-radius:var(--radius-lg);padding:var(--space-6);box-shadow:var(--shadow-sm);}
.mp-idcard__avwrap{position:relative;width:100px;height:100px;}
.mp-idcard__av{width:100px;height:100px;border-radius:var(--radius-xl);border:1px solid var(--border-color);object-fit:cover;}
.mp-idcard__av--initials{background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;font-family:var(--font-mono);font-weight:600;font-size:var(--h-lg);}
.mp-idcard__play{position:absolute;right:-6px;bottom:-6px;width:32px;height:32px;border-radius:50%;background:var(--accent);color:#fff;border:2px solid var(--surface-card);display:grid;place-items:center;cursor:pointer;box-shadow:var(--shadow-sm);}
.mp-idcard__name{font-size:var(--h-md);font-weight:600;letter-spacing:-.02em;line-height:1.15;margin:var(--space-3) 0 0;}
.mp-idcard__role{color:var(--text-muted);font-weight:500;margin:2px 0 0;}
.mp-idcard__avail{margin-top:var(--space-3);}
.mp-idcard__meta{list-style:none;margin:var(--space-4) 0 0;padding:0;display:flex;flex-direction:column;gap:var(--space-2);font-size:var(--text-sm);color:var(--text-muted);}
.mp-idcard__meta li{display:flex;align-items:center;gap:var(--space-2);}
.mp-idcard__cta{display:flex;flex-direction:column;gap:var(--space-2);margin-top:var(--space-6);}
.mp-idcard__cta .btn{width:100%;justify-content:center;}
.mp-idcard__socials{list-style:none;margin:var(--space-4) 0 0;padding:0;display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-2);}
.mp-idcard__socials a,.mp-idcard__share{display:grid;place-items:center;width:36px;height:36px;border:1px solid var(--border-color);border-radius:var(--radius);color:var(--text-muted);background:var(--surface-card);cursor:pointer;text-decoration:none;transition:color .15s,border-color .15s;}
.mp-idcard__socials a:hover,.mp-idcard__share:hover{color:var(--accent);border-color:var(--accent);}
.mp-idcard__socials svg{width:18px;height:18px;display:block;}
.mp-idcard__share-li{margin-left:auto;}

.mp-glance{background:var(--surface-card);border:1px solid var(--border-color);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);padding:var(--space-4) var(--space-6);display:grid;grid-template-columns:1fr 1fr;gap:var(--space-4);}
.mp-glance__cell{display:flex;flex-direction:column;}
.mp-glance__n{font-family:var(--font-mono);font-size:var(--h-md);font-weight:600;color:var(--text-main);}
.mp-glance__k{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--text-muted);}

/* scroll-spy inside the rail — vertical TOC on desktop (reuses .spy active contract) */
.mp-toc{position:static;border-bottom:0;background:var(--surface-card);border:1px solid var(--border-color);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);flex-direction:column;gap:0;padding:var(--space-2);overflow:visible;}
.mp-toc a{padding:var(--space-2) var(--space-3);}
@media(max-width:899px){.mp-rail{position:static;}.mp-toc{display:none;}}

/* slim sticky action bar — slides in on scroll (JS toggles .show); hidden+inert until then */
.mp-actionbar{position:fixed;top:0;left:0;right:0;z-index:60;background:var(--surface-card);border-bottom:1px solid var(--border-color);box-shadow:var(--shadow-sm);transform:translateY(-100%);transition:transform .22s ease;}
.mp-actionbar.show{transform:translateY(0);}
/* mobile uses the bottom .mobilebar instead — avoid two action surfaces */
@media(max-width:640px){.mp-actionbar{display:none;}}
.mp-actionbar__in{max-width:var(--container-max);margin-inline:auto;padding:var(--space-2) var(--pad-desktop);display:flex;align-items:center;gap:var(--space-3);min-height:var(--nav-height);}
@media(max-width:600px){.mp-actionbar__in{padding-inline:var(--pad-mobile);}}
.mp-actionbar__name{font-weight:600;white-space:nowrap;}
.mp-actionbar__sp{flex:1 1 auto;}

/* intro-video modal */
.mp-vmodal{position:fixed;inset:0;z-index:90;background:rgba(0,0,0,.6);display:grid;place-items:center;padding:var(--space-6);}
.mp-vmodal[hidden]{display:none;}
.mp-vmodal__box{position:relative;width:100%;max-width:800px;}
.mp-vmodal__embed{aspect-ratio:16/9;background:#000;border-radius:var(--radius-lg);overflow:hidden;}
.mp-vmodal__embed iframe{width:100%;height:100%;border:0;}
.mp-vmodal__x{position:absolute;top:calc(-1*var(--space-8));right:0;background:none;border:0;color:#fff;font-size:28px;line-height:1;cursor:pointer;}

.about-bio{font-size:var(--text-base);color:var(--text-main);max-width:64ch;line-height:1.7;}
.about-bio p{margin:0 0 var(--space-4);}

@media print{
  .spy,.mp-toc,.mobilebar,.mp-actionbar,.toast,.mp-vmodal,.hero__video,.profile-ownernote,.hero__actions,.hero__socials,.mp-idcard__cta,.mp-idcard__socials,.mp-idcard__play{display:none!important;}
  .js [data-reveal]{opacity:1!important;transform:none!important;}
  .member-profile{padding:0;gap:var(--space-8);}
  .mp-shell{grid-template-columns:1fr;gap:var(--space-6);}
  .mp-rail{position:static;}
}
